PFQNiet / Satisfactorio

Factorio mod that brings Satisfactory mechanics
GNU General Public License v3.0
11 stars 2 forks source link

Power changes #67

Closed PFQNiet closed 3 years ago

PFQNiet commented 3 years ago

May need to rework the power trip system, since using accumulators may not be feasible with the addition of batteries to Satisfactory.

Also, generators should constantly produce at 100% output, except for Biomass Burners. This may be possible by replacing the power-trip detection entities with energy voids, and if the energy void isn't getting power then trigger blackout. Again, this may need wrangling with energy priorities, and may not even be possible since they would need to have lower priority than batteries to avoid discharging them. Alternatively, have two separate entities for battery charge/discharge, and the power-trip logic can first check for batteries to use, flipping them to the other mode as appropriate. This way, factory buildings can have primary status (normally reserved for active defence ie. laser turrets), batteries can be secondary, and the power-trip detectors can remain tertiary. This flip can also trigger some GUI notification so that the player is aware of discharge occurring.

Geothermal generators would be made more interesting with variable power generation. Since these can only be built in limited numbers (on a suitable resource node), this can be updated basically realtime without any actual issues. It's not like you're gonna be building a thousand geothermal generators!

PFQNiet commented 3 years ago

It seems there's no easy way to have a generator consume at max capacity, and any attempt to add an energy void would just drain power from biomass burners. Instead, consider script-managing the assemblers of the coal/nuclear generators, as well as making the fuel generator into an assembler too - they can all produce "energy" as a pseudo-fluid, which is then drained from the output to power the EEI. This has the added benefit of allowing the EEI to be the full size of the entity, which allows better handling of power poles.

PFQNiet commented 3 years ago

Add an extra 60W to every generator. Spawn a 60W-consuming EEI on it. Periodically check if that EEI's energy is <1 and trigger blackout if so. This should actually be more robust than using accumulators anyway.

PFQNiet commented 3 years ago

Okay so I have the generators consuming at max capacity now, and the power trip uses a tiny energy void as well.

I still have an issue that buildings have a higher buffer size than strictly needed, and this seems to be somehow hard-coded because setting buffer_capacity on them does nothing. So there's still some potential issues when plugging a new thing in when trying to exactly match the power cap - especially early-game. I'm really not sure how to handle this...