Page 1 of 1

Relation between SolarPanelPrototype::solar_coefficient_property and value

Posted: Sun Jun 22, 2025 11:09 pm
by boomshroom
As it stands, the documentation for SolarPanelPrototype::solar_coefficient_property says that it can make the solar panel dependant on a surface property other than solar-power, but it doesn't explain how the property in question affects the power output. With the default solar-power, it seems to treat the property as a percentage, dividing by 100 before multiplying with the solar panel's power output. However, when trying to make a solar panel dependent on a different surface property that the planet I was interested in already had set to 300, and then defining the output as 1 watt, and performance_at_day and performance_at_night both to 1, the power the solar panel produced seemed to be way off from the expected 3W or 300W.

This was intended to replace what the mod I was tinkering with previously used an electric energy interface for (since solar panels should be more efficient for constant production than electric energy interfaces), so I didn't want to change the power output on the relevant planet nor its existing surface property, but my testing indicated the only way to do that was to guess values and then slowly tweak performance_at_day/performance_at_night until the power output looked "close enough", and even then its tooltip when placed showed crazy high and messy percentage multipliers.

P.S. the generator in question was surface locked anyways, so I didn't care about its production on planets with different values for the surface property. Also the "solar panel" in question would ideally be animated, which solar panels don't currently support, but that goes in a separate sub-forum.

Re: Relation between SolarPanelPrototype::solar_coefficient_property and value

Posted: Mon Jun 23, 2025 4:13 am
by boskid
Base solar panel output output (one unaffected by daytime) = SolarPanelPrototype::production * (value of surface property / SurfacePropertyPrototype::default_value)

When surface property is at its default, then solar output will also be at its default.

Re: Relation between SolarPanelPrototype::solar_coefficient_property and value

Posted: Mon Jun 23, 2025 5:09 am
by boomshroom
Thank you! I didn't realise the default value played a role. Might be a good idea to add that to the documentation.

With this, I was able to make the entity generate as much as it's supposed to, though I do now have to choose between the factoriopedia and item tooltips giving correct information, or the entity tooltip claiming that it has +4248% efficiency and a much higher max production than it actually makes.