solar_power_in_space has a confusing default/behavior

Place to report issues and suggest improvements to the API documentation.
DaleStan
Filter Inserter
Filter Inserter
Posts: 399
Joined: Mon Jul 09, 2018 2:40 am
Contact:

solar_power_in_space has a confusing default/behavior

Post by DaleStan »

According to https://lua-api.factorio.com/latest/pro ... r_in_space, the default for solar_power_in_space is 1.0. That default made me think "The value 1 means 100% of Nauvis production" but the values of solar_power_in_space (60 to 600) make it clear that "The value 1 means 1% of Nauvis production" instead.

If 1.0 is the correct default, I'd like a note to the effect of "This default is 1% of the solar production on Nauvis".
Last edited by DaleStan on Sun Jun 28, 2026 12:04 am, edited 1 time in total.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 4642
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: solar_power_in_space has a confusing default

Post by boskid »

Code: Select all

{
  type = "surface-property",
  name = "solar-power",
  default_value = 100
},
multiplier for solar panel output is based on ratio of "solar_power_in_space / default_value" (with solar_power_in_space taken from space SpaceLocationPrototype or interpolated from adjacent 2 locations; and default_value being a default of the "solar-power" surface property).

Default of 1 is 1% only because 1/100 is 1%. By changing default_value of that surface property to be 50, you would get 1 being 2% (1/50).
DaleStan
Filter Inserter
Filter Inserter
Posts: 399
Joined: Mon Jul 09, 2018 2:40 am
Contact:

Re: solar_power_in_space has a confusing default/behavior

Post by DaleStan »

Now I think I'm more confused. If I change data.raw["surface-property"]["solar-power"].default_value to 50, that doubles the power produced by all solar panels on all surfaces?

I would not expect changing the default to change the behavior of solar panels that have opted for a non-default value, regardless of how that non-default value got set.
Post Reply

Return to “Documentation Improvement Requests”