Page 1 of 1

Customizable color for roboport radius

Posted: Fri May 12, 2017 4:39 pm
by 321freddy
I want to be able to change the color of logistic and construction radius visualization of roboports however not globally using the utility-sprites but rather in one of these ways:

Option A: Each force has individual modifiable color definitions for the radius visualizations (since forces always have seperate logistic networks).

Option B: Each roboport entity prototype has it's own modifiable radius visualization sprites like it is already the case with power poles and beacons.

Thanks in advance :)

Re: Customizable color for roboport radius

Posted: Fri May 12, 2017 5:40 pm
by bobingabout
Option B:

Code: Select all

    radius_visualisation_picture =
    {
      filename = "__boblogistics__/graphics/entity/roboport/roboport-radius-visualization.png",
      width = 12,
      height = 12
    },
    construction_radius_visualisation_picture =
    {
      filename = "__boblogistics__/graphics/entity/roboport/roboport-construction-radius-visualization.png",
      width = 12,
      height = 12
    },
This is part of the entity definition, which means in theory, you can use any picture you like for it.

If you're modding though, you can probably use a white square, then add a tint line. Unfortunately you probably can't use a runtime tint, but you can still use code to specify the colour using this method.

Re: Customizable color for roboport radius

Posted: Fri May 12, 2017 6:07 pm
by Rseding91
bobingabout wrote:Option B:

Code: Select all

    radius_visualisation_picture =
    {
      filename = "__boblogistics__/graphics/entity/roboport/roboport-radius-visualization.png",
      width = 12,
      height = 12
    },
    construction_radius_visualisation_picture =
    {
      filename = "__boblogistics__/graphics/entity/roboport/roboport-construction-radius-visualization.png",
      width = 12,
      height = 12
    },
This is part of the entity definition, which means in theory, you can use any picture you like for it.

If you're modding though, you can probably use a white square, then add a tint line. Unfortunately you probably can't use a runtime tint, but you can still use code to specify the colour using this method.
Was, it was changed in 0.13.0 to be defined in the utility_sprites section. The reason being: performance.

The rendering of construction/logistic overlays is incredibly expensive to do because they're large and overlap so many times. It was optimized in 0.13.0 so they don't render overlapping sections and to make sure that the colors were consistent across the displayed area it was changed to use only 2 sprites defined in utility sprites.

Re: Customizable color for roboport radius

Posted: Fri May 12, 2017 6:18 pm
by 321freddy
Rseding91 wrote:Was, it was changed in 0.13.0 to be defined in the utility_sprites section. The reason being: performance.
Can you change it so that every force has it's own customizable color for construction/logistic overlays? Because forces have completely seperate logistic networks the player is never going to be able to select two networks from different forces with different colors at the same time.

I'm thinking these two properties:
LuaForce.logistic_radius_visualization_color : Color [RW]
LuaForce.construction_radius_visualization_color : Color [RW]