Do not show no_power_warning icon when using power switch

Post your ideas and suggestions how to improve the game.
coppercoil
Fast Inserter
Fast Inserter
Posts: 103
Joined: Tue Jun 26, 2018 10:14 am
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by coppercoil » Fri Nov 08, 2019 8:35 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?
... 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: 24
Joined: Thu Oct 27, 2016 6:17 pm
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by DragonMudd » Sun Nov 10, 2019 1:36 am

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: 688
Joined: Wed Jul 12, 2017 5:45 pm
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by Oktokolo » Mon Nov 11, 2019 5:28 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?
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.

Post Reply

Return to “Ideas and Suggestions”

Who is online

Users browsing this forum: No registered users