Do not show no_power_warning icon when using power switch

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

coppercoil
Filter Inserter
Filter Inserter
Posts: 470
Joined: Tue Jun 26, 2018 10:14 am
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by coppercoil »

Loewchen wrote:
Fri Nov 08, 2019 7:50 am
How would the game distinguish between intentional open switch disconnection and a broken connection creating a network that coincidentally contains an open switch?
... by hovering mouse over dead assembling machine. The tooltip shows available electricity amount for it. That’s enough.

There are million ways to break things in Factorio. Only very few cases are displayed by flashing icon. There’s no notification if machine is out of materials, if output is full, if wrong recipe set, if wrong items delivered, if inserter missing or it’s in wrong position etc. Player needs to check all these things to realize what’s wrong. We all have had hundreds small and big production fixes without any single icon. That was ok for us.

Some small mistakes are more frequent and not challenging at all, so flashing icon is useful (e.g. regular “no power” icon). BUT if there’s a power switch, that means electricity loss is planned by design. If something unplanned happened, player will check it like anything else in his factory.

Nevertheless, I think it’s ok to have some quiet icon “turned off”, which is not a warning, just informing, like “Bottleneck” mod. No annoying flashing.

DragonMudd
Inserter
Inserter
Posts: 27
Joined: Thu Oct 27, 2016 6:17 pm
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by DragonMudd »

Loewchen wrote:
Fri Nov 08, 2019 7:50 am
How would the game distinguish between intentional open switch disconnection and a broken connection creating a network that coincidentally contains an open switch?
That's your job not mine :P

Some of this thread and the other threads of the same topic include some discussion about this. Without intimate knowledge of the inner workings of the game it's difficult for me to give an adequate answer. I imagined that when the switch changes states, that alters the state of the entities. For example, if the switch moves from closed to open (and the entities (and thus the backside of the switch) aren't getting power from somewhere else, obviously), then it changes the state of the objects to some sort of "asleep" state. I don't see why they shouldn't stay that way, even if something gets disconnected "upstream". When the switch moves from open to closed, it checks to see if it has power, and if it does, then it changes the state of the entities to "awake", or whatever.

It seems some sort of system like that can save a whole lot of UPS checks, if that is still a thing.

User avatar
Oktokolo
Filter Inserter
Filter Inserter
Posts: 883
Joined: Wed Jul 12, 2017 5:45 pm
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by Oktokolo »

Loewchen wrote:
Fri Nov 08, 2019 7:50 am
How would the game distinguish between intentional open switch disconnection and a broken connection creating a network that coincidentally contains an open switch?
The power network is a graph of nodes (entities) and edges (wires).
If a node can only reach any power provider via a switch, it is a switched node.

The naive implementation would be to have a flag on each power-consuming node wich is updated whenever any switch changes state. That flag would store, whether this node has any path to any power source. This needs data structure updates whenever a switch is toggled.

Another aproach would be to define power networks as groups of nodes wich can reach each other without traversing a switch - and store for each switch, wich networks it connects (wich might be none, if the switch has been misplaced {hint: flash icon on such switches}).
This needs data structure updates whenever the topology of a power network changes.

As the power network ID already seems to be a thing, i assume, that the segmentation could be done whenever currently power network IDs are selected.

The on-tick power network calculations would either have to take the entities powered flag (first method) or their network ID (second method) into account. I assume the network ID to already beeing used in that code. In case of the second method, the code would also have to take network conections into account (optimizable by maintaining a list of switches and their state).

In all relevant cases there are far less switches than (partial) power networks. So i would expect the second method to perform better.

gGeorg
Filter Inserter
Filter Inserter
Posts: 387
Joined: Wed Jun 19, 2019 8:06 pm
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by gGeorg »

ssilk wrote:
Wed Nov 06, 2019 8:09 am
As already recommended: better to control the input lines (belts, pumps) and turn power off via a timer that counts the output items.
Lets take a look at beaconed production line, by starving it you still consume megawats of vasted energy. Not good solution.
Experiencing the angry flashing icon neighter.

Oktokolo just a post above had some nice algoritm ideas how to detect the status - disconected vs switched off.
It would make even performance gain, as switched off devices can fall asleap imediately, then they receive only wake up call by the switch, (in case player changes switched off network to the connected state by adding a pole, then switch (device) sudenly receives power from dead side, then he makes the wake up call to the sub-network. So all switched off entities dont even need to check anything, just wait in memory to wake up call.)

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by ssilk »

gGeorg wrote:
Thu Nov 21, 2019 12:44 pm
Lets take a look at beaconed production line, by starving it you still consume megawats of vasted energy. Not good solution.
Turning power off means (in my head) to turn it also off for beacons, not only assemblies. Of course... that's also much more simpler.

And I'm not sure if it is really so easy to check the state of a power circuit... I need to sit down and draw a decision table to see if it is possible.... :)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

User avatar
Oktokolo
Filter Inserter
Filter Inserter
Posts: 883
Joined: Wed Jul 12, 2017 5:45 pm
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by Oktokolo »

ssilk wrote:
Fri Nov 22, 2019 12:14 am
And I'm not sure if it is really so easy to check the state of a power circuit... I need to sit down and draw a decision table to see if it is possible.... :)
Ask Oxyd - the dev who recently optimized biter pathfinding.
It is definitely possible to do it UPS friendly for reasonably sane base layouts (less than a hundred switched segments wich are toggled in intervals of one second or more).

gGeorg
Filter Inserter
Filter Inserter
Posts: 387
Joined: Wed Jun 19, 2019 8:06 pm
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by gGeorg »

Oktokolo wrote:
Fri Nov 22, 2019 9:42 am
ssilk wrote:
Fri Nov 22, 2019 12:14 am
And I'm not sure if it is really so easy to check the state of a power circuit... I need to sit down and draw a decision table to see if it is possible.... :)
Ask Oxyd - the dev who recently optimized biter pathfinding.
It is definitely possible to do it UPS friendly for reasonably sane base layouts (less than a hundred switched segments wich are toggled in intervals of one second or more).
For sane base the number of switches is order of magnitude lower then number of (machines+inserters). So the procedure running on the switched off Switch could be quite beefy and its still performance gain. More over, player get improved gameplay in form of better info icons.

Switched off entities could receive a yellow dot, steady icon. An overlay. Same as modules do.
Last edited by gGeorg on Fri Nov 22, 2019 12:37 pm, edited 1 time in total.

ninjaj03
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon Jan 13, 2020 8:51 pm
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by ninjaj03 »

I agree that using the power switch is annoying because it creates the potential for the UI to be flooded with false signals (no_power_warning). I view this as a false signal because the UI intent of the no_power_warning icons is to alert the player that some machines do not have access to power. There should absolutely be a UI distinction and/or direct control over these warnings and IMO we shouldn't have to have a mod for this. In general, power systems management (sensing, switching, etc) all need love from the developers. IRL it's far easier to measure and switch voltage than count widgets in a box and move them.

User avatar
DingoPD
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Thu Jun 13, 2013 1:22 am
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by DingoPD »

Loewchen wrote:
Fri Nov 08, 2019 7:50 am
How would the game distinguish between intentional open switch disconnection and a broken connection creating a network that coincidentally contains an open switch?
First, I'm sorry for necroing my own post this long after, honestly i completely forgot about it after i didn't have time to play for a while.

I'm not exactly sure how the power distribution works within the game. I imagine it works somewhat the same as the logistic networks? with couple of variables indicating the power available and power required on each of the segments?

One solution i came up with would be to use negative number in power available variable when the switch is open, zero when there is no power and positive number when there is power? When the switch is open, the available power would be multiplied by -1? Thought not knowing any details on how it works this might not be feasible.
Efficiency is just highly developed form of laziness.

Loewchen
Global Moderator
Global Moderator
Posts: 8284
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by Loewchen »

DingoPD wrote:
Sat Sep 12, 2020 9:19 pm
Loewchen wrote:
Fri Nov 08, 2019 7:50 am
How would the game distinguish between intentional open switch disconnection and a broken connection creating a network that coincidentally contains an open switch?
First, I'm sorry for necroing my own post this long after, honestly i completely forgot about it after i didn't have time to play for a while.

I'm not exactly sure how the power distribution works within the game. I imagine it works somewhat the same as the logistic networks? with couple of variables indicating the power available and power required on each of the segments?

One solution i came up with would be to use negative number in power available variable when the switch is open, zero when there is no power and positive number when there is power? When the switch is open, the available power would be multiplied by -1? Thought not knowing any details on how it works this might not be feasible.
My point was not so much the technical implementation but rather how the game detects the users intent (or rather show that it is impossible to do so). I could give you a save that contains three electric networks of which two are separated via an open switch and there is no way for you to know if:

(a) I intentionally cut power via the switch
(b) I unintentionally cut power by accidentally removing a power pole two the third network

Nothing in the save file gives you -and therefore even less the game- the information to differentiate those two cases, only I know what I actually wanted.

User avatar
DingoPD
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Thu Jun 13, 2013 1:22 am
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by DingoPD »

The game can see the intent by detecting the presence of the power switch on the isolated network and whether the power switch itself is powered, in that respect the power switch would work the same as a power generator. Except that instead of generating the power by consuming some resource, it'd generate power by consuming power from the network it is connected to.

If there is no available power and switch that has power on the other input is present (and open), then the lack of power is intentional, any other case it is unintentional and the icon should be displayed.
Efficiency is just highly developed form of laziness.

User avatar
5thHorseman
Smart Inserter
Smart Inserter
Posts: 1193
Joined: Fri Jun 10, 2016 11:21 pm
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by 5thHorseman »

So let's say you have 3 logical sections of power in your base. Not actual sections, just logical divisions.

Section 1 has no power generation options.
Section 2 is using nuclear, and is connected to section 1 via a regular power pole. It is there to power section 1.
Section 3 is using steam, and is connected to section 1 via a switch. The intent is to only flip that switch if the nuclear plant can't handle the load. Or something.

I remove the power pole between sections 1 and 2. The switch is off. Note: I may have done this accidentally or on purpose. I'm not telling you because I wouldn't have told the game.

Should section 1's now-unpowered devices flash to tell me that they have no power?

User avatar
DingoPD
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Thu Jun 13, 2013 1:22 am
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by DingoPD »

5thHorseman wrote:
Sun Sep 13, 2020 1:36 am
So let's say you have 3 logical sections of power in your base. Not actual sections, just logical divisions.

Section 1 has no power generation options.
Section 2 is using nuclear, and is connected to section 1 via a regular power pole. It is there to power section 1.
Section 3 is using steam, and is connected to section 1 via a switch. The intent is to only flip that switch if the nuclear plant can't handle the load. Or something.

I remove the power pole between sections 1 and 2. The switch is off. Note: I may have done this accidentally or on purpose. I'm not telling you because I wouldn't have told the game.

Should section 1's now-unpowered devices flash to tell me that they have no power?
(TL:DR) No they should not.

The reasoning:

As far as the game can see, sections 1 and 2 are single power network, they are connected with power poles, there is no programmatic way to disconnect them without using a building action. They only become two isolated sections after you remove that power pole. For the sake of argument, this is the point in time i assume you are talking about.

If your steam power is fueled and on standby to go the moment the power is needed, there will be no warning, it is providing power to one side of the switch.

If your steam power is completely shut off (method or reason don't matter), then the switch is not powered on either side and there should be a warning
.

The logic is simple, if there is power on one side of an open switch, there will be no warning on the opposite side, if the switch is un-powered on both sides, then the warning should be displayed on both sides (if applicable).

The game doesn't really need to know your intent, there is either available power and you decided to turn it off, or there isn't any.
Efficiency is just highly developed form of laziness.

Theikkru
Filter Inserter
Filter Inserter
Posts: 353
Joined: Wed Mar 27, 2019 2:18 pm
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by Theikkru »

DingoPD wrote:
Sun Sep 13, 2020 2:20 am
(TL:DR) No they should not.
[...]
The logic is simple, if there is power on one side of an open switch, there will be no warning on the opposite side, if the switch is un-powered on both sides, then the warning should be displayed on both sides (if applicable).

The game doesn't really need to know your intent, there is either available power and you decided to turn it off, or there isn't any.
This. If you want to extend the idea a bit, you can have the warning appear, but different in some way that is far less intrusive (e.g. icon solid instead of flashing) to indicate that the network is unpowered AND behind a switch that could fix it. Regardless, any situation where the network would end up unpowered without the standard flashing icon is one where a power switch was installed by the player, and could potentially mitigate the problem when closed. The diagnostic steps from there are simple enough that the game shouldn't have to account for player intent.

This is a diagnostic path that already exists in the case where players (including myself) keep a steam setup as backup power. I have personally accidentally disabled my nuclear power, and failed notice for a while because my steam power kicked in (so no flashing power icon). I figured it out pretty quickly because my base was at a crawl and there was a pollution cloud over my backup where there shouldn't be. No biggie.

User avatar
DingoPD
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Thu Jun 13, 2013 1:22 am
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by DingoPD »

Theikkru wrote:
Sun Sep 13, 2020 3:14 am
This. If you want to extend the idea a bit, you can have the warning appear, but different in some way that is far less intrusive (e.g. icon solid instead of flashing) to indicate that the network is unpowered AND behind a switch that could fix it. Regardless, any situation where the network would end up unpowered without the standard flashing icon is one where a power switch was installed by the player, and could potentially mitigate the problem when closed. The diagnostic steps from there are simple enough that the game shouldn't have to account for player intent.
Honestly, I'd be really happy if the machines would just have a prominent red light on. just like the miners and logic circuits when they are powered down or exhausted resources.
Immersion would be better, with static sprite the load would be less on CPU and GPU, no reason to update it until the power comes back on, instead of a large yellow flashing sticker on everything in sight.
Efficiency is just highly developed form of laziness.

Theikkru
Filter Inserter
Filter Inserter
Posts: 353
Joined: Wed Mar 27, 2019 2:18 pm
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by Theikkru »

It has just occurred to me that the proposed change would in fact be entirely consistent with the strict definition of the plug icon, which is technically "not connected to an electrical network", as opposed to "no power", as demonstrated by the fact that it shows up on unconnected power providers (e.g. solar panels). Given the current definitions, it would actually be more consistent for the unpowered section 2 to show the red lightning bolt icon which DOES indicate a failure to provide power, instead of the yellow plug icon which indicates a lack of connection. (I'm sure there are internal implementation reasons why this is not the case, but to the player, that is immaterial.)

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by ssilk »

DingoPD wrote:
Sat Sep 12, 2020 9:19 pm
I'm not exactly sure how the power distribution works within the game. I imagine it works somewhat the same as the logistic networks? with couple of variables indicating the power available and power required on each of the segments?
No, it works as an “immediate supply network”. Any device that is connected in a power network comes in one of two lists: consumers and producers. All consumers and producers are summed up. And then the consumed energy is taken from the produced energy. I left away some things (priorities, available power etc.). The point is: the network can be really big, but every device is in that lists. Which means, for separated networks there is another pair of lists. And if you put a switch between them, and turn this switch on, these keeps separated, but the sum to compare consumption with production is taken over both pairs of lists, as long as the switch is on.
DingoPD wrote:
Sun Sep 13, 2020 2:20 am
(TL:DR) No they should not.
...
The logic is simple, if there is power on one side of an open switch, there will be no warning on the opposite side, if the switch is un-powered on both sides, then the warning should be displayed on both sides (if applicable).

The game doesn't really need to know your intent, there is either available power and you decided to turn it off, or there isn't any.
I thought long about it, if this logic is really useful. And I think it is.

But there are some special cases. I won’t explain them here, whoever that implements will find them. I think there are logical solutions to that, without assuming anything about users intend.

I think the point of this is, that the game needs to distinct, if a device is unpowered because there is possible/available power in a network or not. And available should it be, if in the neighbor networks or their currently switched on neighbors have any power production. A solar field at day is enough to trigger this rule. And finding this out needs just to look at the switches, that connects to different networks. If there is one switch that has power, the player needs just to open it and has a possible solution.

And yes, there should be kind of warning, that the network is turned off. But small. Red lights on all devices, I would like.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Sad_Brother
Fast Inserter
Fast Inserter
Posts: 209
Joined: Mon Jan 08, 2018 4:54 pm
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by Sad_Brother »

ssilk wrote:
Sun Sep 13, 2020 7:35 am
DingoPD wrote:
Sun Sep 13, 2020 2:20 am
...
The game doesn't really need to know your intent, there is either available power and you decided to turn it off, or there isn't any.
...
I think the point of this is, that the game needs to distinct, if a device is unpowered because there is possible/available power in a network or not. And available should it be, if in the neighbor networks or their currently switched on neighbors have any power production. A solar field at day is enough to trigger this rule. And finding this out needs just to look at the switches, that connects to different networks. If there is one switch that has power, the player needs just to open it and has a possible solution.

And yes, there should be kind of warning, that the network is turned off. But small. Red lights on all devices, I would like.
Game should not distinct Player's reasons. All, the game need to detect, is would be device have power if all switches are on?

And yes, simple indicator would be nice: red - no input, yellow - no output, green - working.
And yes, it would be good as a logic signal output, but that is another story.

And yes, power switch, disconnected on either side or both sides connected by poles, should be marked by flashing symbol as wrong.

User avatar
DingoPD
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Thu Jun 13, 2013 1:22 am
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by DingoPD »

ssilk wrote:
Sun Sep 13, 2020 7:35 am
No, it works as an “immediate supply network” ... Any device that is connected in a power network comes in one of two lists: consumers and producers. All consumers and producers are summed up. And then the consumed energy is taken from the produced energy ...
Thanks for the explanation, that really helps :)

One of the special cases you talking about would be an accumulator?
Efficiency is just highly developed form of laziness.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by ssilk »

Sad_Brother wrote:
Sun Sep 13, 2020 10:37 am
I think the point of this is, that the game needs to distinct, if a device is unpowered because there is possible/available power in a network or not. And available should it be, if in the neighbor networks or their currently switched on neighbors have any power production. A solar field at day is enough to trigger this rule. And finding this out needs just to look at the switches, that connects to different networks. If there is one switch that has power, the player needs just to open it and has a possible solution.
Game should not distinct Player's reasons. All, the game need to detect, is would be device have power if all switches are on?
Game does not distinct players reasons but distincts if an open switch has power on one side or not.
DingoPD wrote:
Sun Sep 13, 2020 11:59 am
One of the special cases you talking about would be an accumulator?
Ya, it’s both, producer and consumer. And about priorities. Solar production has a higher priority to be consumed than steam power.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Post Reply

Return to “Ideas and Suggestions”