Different power icon for buildings disabled by a switch

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Different power icon for buildings disabled by a switch

Post by Rseding91 »

And what do you suggest should happen when you have a power switch that gives additional power but isn't the sole source of power and the machines are out of power? Technically it's both out of power and not getting enough power because the power switch is disconnected.

There's no perfect solution and there's no way (that isn't very expensive) for the game to know that "entity X doesn't have enough power because this power switch is disconnected".

So, it's not likely to happen.
If you want to get ahold of me I'm almost always on Discord.

BenSeidel
Filter Inserter
Filter Inserter
Posts: 584
Joined: Tue Jun 28, 2016 1:44 am
Contact:

Re: Different power icon for buildings disabled by a switch

Post by BenSeidel »

Rseding91 wrote:And what do you suggest should happen when you have a power switch that gives additional power but isn't the sole source of power and the machines are out of power?
I would suggest that the same thing occurs if there is no additional power connected at all, that the icons show "disconnected". Please don't blink it :)

Here is a simple way to have it operate in the disconnected state, don't do anything different in the connected state:
If both networks are powered, current behaviour.
If both networks are unpowered, current behaviour.
If one network is powered and the other network is not powered, mark the unpowered network as "disconnected".
All entities connected to a "disconnected" network, are marked with a disconnected icon (no blinking please).
If an entity is connected to a "disconnected" network and an unpowered network, mark it as disconnected.
If an entity is connected to a "disconnected" network and a powered network, well power the damn thing.

As the entity already checks (each tick mind you) if the network is powered, adding an additional bit for the disconnected state and and additional if statement in the rendering should not cause any issues. As it's impossible to get a -ve power supply on a network you could encode the "disconnected" state as a -1.0 value or something similar (although I don't know how the code is).

Sure you may get some corner case where someone has their main base shutdown during the night, only running their lasers on steam, but the disconnection icon is still appropriate there as well. It basically says "If you enable your switch, these will run.... albeit slowly".

The real question is, what do you do with a network that is connected to a network that is connected to a network that has power? Personally I would only mark the middle network, as that is the only network that you can supply power to if you switch a switch. Other people may expect both to blink disconnected though.

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

Re: Different power icon for buildings disabled by a switch

Post by ssilk »

Hm.
I think this goes into right direction and I would say instead of explaining with much word we need a clear rule. I use often decision matrix for that.

We need three columns:
A) current network (including all networks that are connected with open switch): powered?
B) connection to a powered network via CLOSED switch? (Yes/no)
C) connection to an UNpowered network via CLOSED switch? (Yes/no)

(There could be more than 3 Networks involved but that cases are not important/too complex)

That are 8 cases that needs to be thought of. For each case we have 3 possible answers:
- no Icon
- disconnected
- unpowered

A:0 B:0 C:0 => unpowered (This is an unpowered local network)
A:1 B:0 C:0 => nothing
A:0 B:1 C:0 => disconnected
A:1 B:1 C:0 => nothing
A:0 B:0 C:1 => unpowered
A:1 B:0 C:1 => nothing
A:0 B:1 C:1 => unpowered
A:1 B:1 C:1 => nothing

You see: A doesn't matter. And only the third case is disconnected.

Which means: show disconnected only, if there is one connected closed switch to another powered network and no other closed switches involved.
This needs to be calculated only per network, when a switch or an generator is placed/mined, so CPU -usage is no excuse. :)

Hope that helps.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

quyxkh
Smart Inserter
Smart Inserter
Posts: 1028
Joined: Sun May 08, 2016 9:01 am
Contact:

Don't warn if power _should_ be off

Post by quyxkh »

So there'd be say the normal "ungated" power networks and "gated" power networks that have "off" power switches but no boilers/accumulators/panels. If a device is connected only to gated power, don't flash the "no power" warning icon.

When I've bothered to set conditions when the power _should_ be off I've usually shut down large swathes and flashing the big yellow warning is noise, not signal, like the leprechaun's yellow ribbons. Maybe you could even have the warnings show on the world map when this is in.

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

Re: Don't warn if power _should_ be off

Post by ssilk »

This has been also discussed here viewtopic.php?f=6&t=28899 Discuss: Power Switch should not "Blink"
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

quyxkh
Smart Inserter
Smart Inserter
Posts: 1028
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Don't warn if power _should_ be off

Post by quyxkh »

No, that's about the behavior of the power switches themselves.

I'm talking about the "no power connected" warning, the yellow blinking warning triangle, that shows up on devices not connected to a power network with both a producer and a consumer. If you're not using power switches, that's an almost-certainly-unintentional disconnect, and the warning's helpful. If you _are_ using switches, the warning's almost certainly wrong.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Don't warn if power _should_ be off

Post by darkfrei »

New logo for switched off entities. You can see that they are don't have energy, but from another reason, not the problem of energy supply, but switched.

User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Don't warn if power _should_ be off

Post by Deadly-Bagel »

Whether it should be off or not is entirely up to your interpretation, there is no logic that can tell you with 100% accuracy whether it is supposed to be off. Consider I might have an outpost connected to the main network through a switch, it relies on the main grid for its laser defences but if the main grid accumulators drop low it disconnects from that network and connects a separate set of private accumulators. It's a busy night so those accumulators run dry too - do you display the warning or not?

Even if you somehow manage to work that out, the logic doesn't really allow for this type of check. A network has no awareness of if it's connected to a power switch and even if they did put that in there's no concept of "sides" - from the network's perspective, it splits one power grid into two, what's to say which grid is immune to the "no power" alert?

Besides, controlling your factory by killing power to sections of it is the wrong way to handle things. First of all it actually increases the load on the CPU (IIRC from a similar thread) because each entity needs to constantly check for power being restored (disabling the inserters via circuits lets assemblers "sleep" instead), and it's very easy to accidentally connect the two networks. You should only really be using power switches to manage multiple power sources.
Money might be the root of all evil, but ignorance is the heart.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Don't warn if power _should_ be off

Post by darkfrei »

Switcher conduct one virtual Watt per tick. When here's no energy, than we are warning of low energy. If we have that virtual Watt, then only symbol that this entity switched off.

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

Re: Don't warn if power _should_ be off

Post by ssilk »

quyxkh wrote:No, that's about the behavior of the power switches themselves.
Ups. Seems, that I posted the wrong link. :)

viewtopic.php?f=6&t=39421 Low power warning
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

quyxkh
Smart Inserter
Smart Inserter
Posts: 1028
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Don't warn if power _should_ be off

Post by quyxkh »

Okay, I take rsedling's point there, that it's impossible to be perfect about it, but the situation of e.g. a factory or boiler complex on a power network with no power suppliers and an open switch is, given you're using switches at all (else, why have them?), guaranteed to happen, desirable, cheap and easy to detect, rarely even needs checking, and factorio currently gets it wrong, every damn time. Grump.

User avatar
ickputzdirwech
Filter Inserter
Filter Inserter
Posts: 768
Joined: Sun May 07, 2017 10:16 am
Contact:

Re: Different power icon for buildings disabled by a switch

Post by ickputzdirwech »

[ick] Merged four threads about no-power-icons and power switches.
Mods: Shortcuts for 1.1, ick's Sea Block, ick's vanilla tweaks
Tools: Atom language pack
Text quickly seems cold and unfriendly. Be careful how you write and interpret what others have written.
- A reminder for me and all who read what I write

Post Reply

Return to “Ideas and Suggestions”