Do not show no_power_warning icon when using power switch

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

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: Thu Sep 17, 2020 7:59 am
Khagan wrote: Thu Sep 17, 2020 7:28 am[...]And if a biter has eaten your homework[...]
Someone has to use Factorio in a Computer Science class and make this happen. Don't let your memes just be dreams.
I think factorio would be a great way to teach kids about circuit logic. And they could play all on the same server too, dev's might need to make a teacher player model lol.
Efficiency is just highly developed form of laziness.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by ssilk »

Khagan wrote: Thu Sep 17, 2020 7:28 am
ssilk wrote: Thu Sep 17, 2020 7:00 am The game cannot know if you accidentally forgot to open the switch.
No it can't. Not now, not ever, never. But that applies just as much to a single switch as to a chain of two or more. Right now the game treats all 'off' switches as errors, which is silly; the only other consistent and practicable behaviour is to treat them all as intended.
Sorry, but that’s a little bit of stupid argument. :)

And you have been going over the logic behind it: right now the game treats all ‘off’ switches as errors. So the next logical step is to look at single switches. Not just all or chains of switches.
ssilk wrote: Thu Sep 17, 2020 7:00 am But you closed #1 (where your nuclear power is) due to some wrong programming. Or a biter has eaten the combinator that decides switching. Now it would be correct to show big warning in the network behind switch #2.
These are both switching errors, so (as I agreed with you just above) the game cannot know that they are errors. The big warning should be for hard-wired electric network faults, which the game can identify. And if a biter has eaten your homework combinator, it will presumably eat the switch shortly afterwards, at which point we do have a network fault! (More seriously, there is already a big warning for destroyed objects anyway.)
Lol. :D

Well, you have been going over the little difference.

network1 — sw1 — network2 — sw2 — network3

Your first example:
network1 and 2 has no power or power production. Sw1 and sw2 are “off”, network3 has power.

You look at sw1 and 2 to find out, that there is any power in this network and display small warning. I look at sw1 and see there is no power in the adjacency network and display big warning.


Now to my example: again network1 has no power or power production. Network2 has power production, but only solar/accumulator. network3 has power (nuclear). Sw1 and sw2 are “off”.

Btw that is a classical power setup: your main network (network2) is solar driven and you switch on power (sw2), if solar/accumulator is out. In both cases a small warning is displayed.

Now night falls. Solar turns off, accumulator go empty. The switches are still closed to whatever reason. What happens with network1?

Your suggestion: there is still power production in network3, so -> small warning.

Mine: no power in the next network (network2) -> big warning.

I don’t see anything wrong with it. Because if you open now sw1 there would be still no power. You need to open sw2, too. And this case needs to be checked every tick and my algorithm is O(1), while yours can be O(n).
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
Khagan
Filter Inserter
Filter Inserter
Posts: 254
Joined: Mon Mar 25, 2019 9:40 pm
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by Khagan »

ssilk wrote: Fri Sep 18, 2020 2:14 am
Khagan wrote: Thu Sep 17, 2020 7:28 am
ssilk wrote: Thu Sep 17, 2020 7:00 am The game cannot know if you accidentally forgot to open the switch.
No it can't. Not now, not ever, never. But that applies just as much to a single switch as to a chain of two or more. Right now the game treats all 'off' switches as errors, which is silly; the only other consistent and practicable behaviour is to treat them all as intended.
Sorry, but that’s a little bit of stupid argument. :)
Let me unpack it one more time (and then I'll leave it, because I don't think we are going to agree). Even if it had a Turing-test passing AI, the game engine could not reliably tell whether a given switch being off (open) was deliberate or an error, so a practicable solution has to assume one or the other. There is no reason to think that a single switch is significantly less likely to be erroneously off than one in a chain, so consistency requires them to be treated the same. Your algorithm assumes that a single off switch is correct, but a chain of two is an error, which is statistically back-to-front: the chance of two in a row being wrong is obviously much less than the chance of a single one being wrong.

Turning that last point around slightly: if a consumer is separated from the nearest source by one currently open switch, there is a small but possibly significant chance that the switch was meant to be on and is off by mistake; if it is separated from the nearest source by two open switches there is only a vanishingly small chance that both are off by mistake. So if you were going to warn about only one of these two cases it should be the former.
ssilk wrote: Fri Sep 18, 2020 2:14 am Now night falls. Solar turns off, accumulator go empty. The switches are still closed to whatever reason. What happens with network1?

Your suggestion: there is still power production in network3, so -> small warning.

Mine: no power in the next network (network2) -> big warning.

I don’t see anything wrong with it.
What's wrong is that you are warning on the wrong network. In the situation you describe, network #1 still has no power by intent, because switch #1 is off. It's network #2 that is unintentionally unpowered, and for which it might be nice to have a warning; but that is never going to happen without magical code that can read the player's mind.
ssilk wrote: Fri Sep 18, 2020 2:14 am my algorithm is O(1), while yours can be O(n).
It's Sad_Brother's algorithm, not mine. And it requires exactly one extra check: would this sub-network be powered if all switches were on (closed)? Since the electricity network is designed to operate efficiently for any configuration of switches that shouldn't be hard. It doesn't care about the current power status of individual neighbouring sub-networks, nor about the topology of the overall network.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Do not show no_power_warning icon when using power switch

Post by ssilk »

Uffz. I give up. :D We only have proven, that the devs are right: there is no solution to this problem, which will satisfy everybody. :cry: :roll:

Because this is like so I suggest a simpler way: let the player decide, when he wants to have which warning in a network. Or whatever. We need a new device for that, just a new combinator. If present in a power network it can control, which icon is displayed on all devices (not only when unpowered).

Whatever signal is been inputed into this device is displayed. The count gives how fast it will flash. 60 is once per second, 1 is every tick, negative is never. We then need also a combinator that can measure the power. There are already mods like that.

First implementation can be modded, we need just the lua api interface for it.
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
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: Fri Sep 18, 2020 8:04 am Uffz. I give up. :D We only have proven, that the devs are right: there is no solution to this problem, which will satisfy everybody. :cry: :roll:
That is unfortunate.
All this talk of player intent, and player intent in the end doesn't matter at all. I think what matters is a predictable simple logic, "If this then that" kind of thing.
ssilk wrote: Fri Sep 18, 2020 8:04 am Because this is like so I suggest a simpler way: let the player decide, when he wants to have which warning in a network. Or whatever. We need a new device for that, just a new combinator. If present in a power network it can control, which icon is displayed on all devices (not only when unpowered).

Whatever signal is been inputed into this device is displayed. The count gives how fast it will flash. 60 is once per second, 1 is every tick, negative is never. We then need also a combinator that can measure the power. There are already mods like that.

First implementation can be modded, we need just the lua api interface for it.
How about a compromise? Toggle in the switch window that will allow people to choose whether no power warning icon should be displayed on connected entities when the switch doesn't have power on either side? Default the setting to 'yes' to preserve current behaviour, and if unchecked, it disables the warnings for that network, or shows a li'l red light on the machines, or whatever.

Something like this:
switch_warning.png
switch_warning.png (99.13 KiB) Viewed 2454 times
Efficiency is just highly developed form of laziness.
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: Fri Sep 18, 2020 8:04 am Uffz. I give up. :D We only have proven, that the devs are right: there is no solution to this problem, which will satisfy everybody. :cry: :roll:
And never will :(
So option:
Mark unpowered as intended if {one switch off|any switch off}.
DingoPD wrote: Fri Sep 18, 2020 8:28 am How about a compromise? Toggle in the switch window that will allow people to choose whether no power warning icon should be displayed on connected entities when the switch doesn't have power on either side? Default the setting to 'yes' to preserve current behaviour, and if unchecked, it disables the warnings for that network, or shows a li'l red light on the machines, or whatever.
Oh, not this misleading, please.
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 »

Sad_Brother wrote: Fri Sep 18, 2020 3:07 pm Oh, not this misleading, please.
misleading?
Efficiency is just highly developed form of laziness.
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 »

What warning?
When would it show?
As a player I cannot tell.
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 »

Sad_Brother wrote: Fri Sep 18, 2020 5:18 pm What warning?
The no power warning.
Sad_Brother wrote: Fri Sep 18, 2020 5:18 pm When would it show?
It would show by default (that's the compromise), just like now, if you uncheck the box, then it will never show for the network(s) the switch is part connected to.
Sad_Brother wrote: Fri Sep 18, 2020 5:18 pm As a player I cannot tell.
That why i said that player intent has no place in determining what should happen, the rules governing when the power warning icon is displayed should be simple, and not change because of something as abstract as 'player intent'. Trying to guess what the player is thinking is waste of resources, after all they could be dead drunk and the game will never know it.

---

I don't like the compromise i was talking about. Still, it' would be better than what we got now. I'd still much rather prefer if the nearest network containing power provider was set as parent, regardless of the number of switches in between the network and the switch in question.
Only when the provider is no longer part of parent network, and there is no other network (with power providers) connected that could act as a parent, big yellow warning icons should be displayed.

But i understand that not everyone likes this.

I don't need the game to protect me from my own mistakes. If i screw up something, and miss it during testing, I'm sure to notice when there is nothing coming down the belts.

Right now I'm playing with the icons replaced by transparent pixel, so i don't see any power warnings at all. It doesn't solve the CPU/GPU waste caused by the warnings. But at least it's not distracting.
Efficiency is just highly developed form of laziness.
Post Reply

Return to “Ideas and Suggestions”