Power switch should have built-in delay before switching.

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
mattj256
Fast Inserter
Fast Inserter
Posts: 203
Joined: Sun Mar 27, 2016 7:25 am
Contact:

Power switch should have built-in delay before switching.

Post by mattj256 »

TL;DR:
siggboy wrote:The power switch should be nerfed so that it can not switch more often than the animation of the sprite suggests is possible (maybe once per second, give or take, the exact time does not matter much).
I am summarizing from this thread: viewtopic.php?f=6&t=28899

WHAT and WHY
MeduSalem wrote:I agree that turning the Power Switch on/off once every tick is absolutely ridiculous and unrealistic with electric currents this strong. It would wear out the hardware quite fast. It's by no means a transistor working in a circuit network and it shouldn't work like one. Power switches designed for several hundred thousand volts are always mechanical and they always have a huge delay for closing/opening.

That brings me to the point that as long as there is not an explicit timer combinator in the game for convenience sake I think that adding a delay to the power switch is probably the best/easiest way to go about it. (I say explicit timer combinator because creating a timer with a combinator is not really straight forward for casual players. I realize that experienced circuit designers may have their fun with that but most people don't.)

So the animation takes something like 5 seconds to close the switch after which it becomes connected, and when shutting off the networks disconnect immediately but the animation takes another 5 seconds to finally reach the open state, from which it can be closed again.

No more On/Off flickering.
siggboy wrote:If the switch is flipped (be it manual or from a circuit/logistic condition), the switch should become unswitchable until the animation has completed (or 1 second has passed, or whatever the appropriate timeout is). Changing circuit/logistic conditions should simply be ignored during that time. The manual switch should be locked/greyed out/unavailable.

Example: the switch is currently "off", and the condition is "Red = 1". You pulse "Red = 1" into the switch. The switch will turn "on" (from the condition), and after 1 second (assuming that's the timeout) it will turn "off" again. If you sent an oscillating "Red" signal into the switch it would turn "on" and "off" every 1 second.

Are there any problems with this approach that I'm currently not seeing?
FURTHER DISCUSSION
ssilk wrote:Power switches are not meant to switch on and off in microseconds, 30 times per second for Factorio.
mattj256 wrote:I hate seeing those cycles back and forth 30 times a second
Neotix wrote:Real power switch (mid voltage) have three state: OFF, Armed/Ready, ON.
Before you turn power switch ON you have to arm spring and that need time (you can do it manually or electric motor can do it). When spring is ready, you can press ON. OFF switch can be used any time and it also disarm spring. So when you hold OFF you can't arm spring and if you can arm it, you can't turn switch ON.

So if we want to implement that behawior in Factorio we need:
1. Cooldown after turning OFF (no cooldown after turning ON).
2. OFF signal witch higher priority then ON signal.
COUNTERARGUMENT
fandingo wrote:This doesn't address the problem. The issue is that closed loop control systems cannot use an instantaneous value, even if time-boxed, and reach stability. They will always oscillate. All this change does is increase the period of oscillations. As I said originally, oscillating systems are fine in video games. It's computationally prohibitive to implement stable control algorithms. I'd rather see a "delay combinator" (or even better a moving mean combinator) with a configurable period instead of it being built into just one circuit network entity. It would be broadly useful in lean factories.

I still think the power switch issue is merely cosmetic on the power graphs. There's no functional problem. Change the power graphs to always include solar power production if either solar is reasearch or there's an entity anywhere on the map. The graphs will still show oscillations, but that's an accurate representation of what happens, and to be honest, absolutely what should happen.
Neotix wrote:
mattj256 wrote:Do nothing. fandingo says this is only a cosmetic problem, not a functional problem. I don't have a good counterargument. What I will say is that someone who wants to avoid these oscillations should be able to do so without having to use advanced features of the circuit network.
To be honest I also think that way. If power switch oscillate that's menat the control design is bad. The same way player can build rail network witch tones of deadlocks or bots swarm that roam around entire map or moving everything on belts even from far outposts. There is many bad designs that can kick performance in the ass of cause serious problem in factory but it not mean that devs have to develop complicated features to avoid that.

Post Reply

Return to “Ideas and Suggestions”