[1.1.61] Portable solar panels do not respect surface.solar_power_multiplier > 1 (unlike regular solar panels)

This subforum contains all the issues which we already resolved.
Post Reply
User avatar
Wiwiweb
Long Handed Inserter
Long Handed Inserter
Posts: 57
Joined: Sat May 08, 2021 2:36 am
Contact:

[1.1.61] Portable solar panels do not respect surface.solar_power_multiplier > 1 (unlike regular solar panels)

Post by Wiwiweb »

TL;DR:
Portable solar panels correctly get reduced power for surface.solar_power_multiplier < 1.
But they do not get increased power for surface.solar_power_multiplier > 1, unlike regular solar panels which do.
Simple repro setup:
1) Put on an armor with 1 battery and 1 portable solar panel.

2) Freeze daytime to 100% day:

Code: Select all

game.player.surface.freeze_daytime = true
game.player.surface.daytime = 1
3) Adjust solar_power_multiplayer to a value:

Code: Select all

game.player.surface.solar_power_multiplier = X
4) Pick up the battery and put it back down to reset its charge down to 0.

5) Count 10 seconds, check battery's charge, calculate effective power.

Results:

solar_power_multiplier = 0.5, 15kW power
solar_power_multiplier = 1, 30kW power
solar_power_multiplier = 2, 30kW power (!)

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2247
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [1.1.61] Portable solar panels do not respect surface.solar_power_multiplier > 1 (unlike regular solar panels)

Post by boskid »

This is quite tricky to fix. Normal solar panels (entities) are just increasing counter of solar panels so the electric network can compute power of one panel times the amount of panels and it works as expected. In case of a solar panel equipment, they are based on the electric energy source which has its own energy buffer with size, the solar panel equipment is adding the energy to this buffer and the electric network consumes the energy from this buffer. Issue is that this buffer has a capacity equal to one tick of energy production at the solar power multiplier of 1. In order to fix this i would need to go with simillar approach as solar panel entities which i do not want to do because of the amount of differences in code between 1.1 and 1.2 nearby, or i would need to adjust the buffer capacity each tick which i also do not want to do because that is an area that is tricky due to save-loading, or i would need to make the buffer N times larger than the required value but then the issue will reapper at higher solar_power_multiplier and the solar panel itself will start working as a tiny battery since it will hold some charge.

Xorimuth
Filter Inserter
Filter Inserter
Posts: 625
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: [1.1.61] Portable solar panels do not respect surface.solar_power_multiplier > 1 (unlike regular solar panels)

Post by Xorimuth »

Space Exploration doesn’t use solar multipliers higher than ~16, so setting the buffer size to ~30x would solve this problem for pretty much everyone. I doubt anyone would even notice an extra half-second’s worth of energy.
My mods
Content: Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings

User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 2247
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [1.1.61] Portable solar panels do not respect surface.solar_power_multiplier > 1 (unlike regular solar panels)

Post by boskid »

Thanks for the report. I was able to find a relatively simple fix for this so it is now fixed for 1.1.69. Fix was to change solar panel's energy source buffer size every tick to match the solar power multiplier if it goes above 1.

Post Reply

Return to “Resolved Problems and Bugs”