Page 1 of 1

[0.18.40] Electric network priority

Posted: Tue Aug 04, 2020 11:18 am
by Artyom
Is there any priority according to which electricity network powers a consumer if it belongs to several of them?

Network #1:
1. Water pump
2. Boiler
3. Steam engine

Network #2:
1. Solar panel
2. Accumulator

The consumer is a lamp which can be powered from both of network that aren't connected. As you can see from the screenshots the lamp is powered by the steam engine though the solar panel has enough power and the accumulator is fully charged.

Re: [0.18.40] Electricity network priority

Posted: Tue Aug 04, 2020 12:06 pm
by mrvn
Have you tried changing the order in which you build the lamp and poles?

What if one of the networks runs out of power, will it change to the other? Will it stay there when power comes back or revert what it had first?

Re: [0.18.40] Electricity network priority

Posted: Tue Aug 04, 2020 12:18 pm
by boskid
Ref 79566

Re: [0.18.40] Electricity network priority

Posted: Tue Aug 04, 2020 4:14 pm
by Rseding91
Which ever electric network updates first in the list of networks will transfer power to the things that need it. I don't see that as changing since it would add a *huge* overhead to the transfer logic to first check all other connected networks for each entity it was about to give power to.

Re: [0.18.40] Electricity network priority

Posted: Tue Aug 04, 2020 6:18 pm
by boskid
Moving to Not a bug.

Trying to implement priority in case of multiple network would result in huge complication of electric network update logic since update would have to go in order "primary in network A, primary in network B, secondary in network A" etc. For simplicity, cache locality and performance i do not care if this would be ever implemented. The network with lower sub-network-id is the first to update so will have a priority.

Re: [0.18.40] Electricity network priority

Posted: Wed Aug 05, 2020 3:00 pm
by mrvn
I think he is saying it is drawing from both networks, using double the power. And the ref you added points in the same directions.

That certainly sounds like a bug. The entity should stop drawing power from later (whatever that is) electrical networks if it has it's buffer full.

Re: [0.18.40] Electricity network priority

Posted: Wed Aug 05, 2020 5:29 pm
by disentius
Hmm... I dont understand the problem, i think.
Made a test setup, and the three radars connect use one network only. if it runs out, it switches to the other one.
(tested in /editor)

[EDIT] On 0.18.42

Re: [0.18.40] Electricity network priority

Posted: Fri Aug 07, 2020 10:43 am
by mrvn
disentius wrote: Wed Aug 05, 2020 5:29 pm Hmm... I dont understand the problem, i think.
Made a test setup, and the three radars connect use one network only. if it runs out, it switches to the other one.
(tested in /editor)

[EDIT] On 0.18.42
From the ref 79566:
I am able to confirm this, and have found it is not the overlapping power networks per se, but just the lamps within overlapping power networks that cause the issue.

Re: [0.18.40] Electric network priority

Posted: Fri Aug 07, 2020 10:52 am
by disentius
Ah, thanks. I ll test again.