Page 1 of 1

Entities consuming/producing fluid never go to sleep

Posted: Mon Mar 09, 2020 12:36 pm
by danyax
I noticed that entities consuming/producing fluid never go to sleep. At megabase scale they stay awake (and consume UPS) even in no ingredients/fully backed up. While entities using solid ingredients happily go to sleep under same conditions.

In this correct? Any plan to fix it?

Re: Entities consuming/producing fluid never go to sleep

Posted: Mon Mar 09, 2020 1:04 pm
by posila
danyax wrote: Mon Mar 09, 2020 12:36 pmIn this correct?
Yes.
danyax wrote: Mon Mar 09, 2020 12:36 pmAny plan to fix it?
Currently no plans for optimizing it.

Re: Entities consuming/producing fluid never go to sleep

Posted: Tue Mar 10, 2020 3:05 pm
by danyax
posila wrote: Mon Mar 09, 2020 1:04 pm
danyax wrote: Mon Mar 09, 2020 12:36 pmAny plan to fix it?
Currently no plans for optimizing it.
Is there any other existing or planned for implementation way to put them to sleep ? Like powering off, disabling with circuits, etc.

I might be naive, but would it possible to put entities that we inactive for 10-15 seconds to semi-sleep and check them once per second, not every tick? This will solve the problem of megabases with lots of fluids such as Bob + Angels.

Re: Entities consuming/producing fluid never go to sleep

Posted: Tue Mar 10, 2020 4:53 pm
by conn11
danyax wrote: Tue Mar 10, 2020 3:05 pm Is there any other existing or planned for implementation way to put them to sleep ? Like powering off, disabling with circuits, etc.
I might be naive, but would it possible to put entities that we inactive for 10-15 seconds to semi-sleep and check them once per second, not every tick? This will solve the problem of megabases with lots of fluids such as Bob + Angels.
Like setting circuit conditions controling power switches to turn the power off and on, when your buffering fluid tanks are full or empty enough?
Provided of course your fluid handeling areas aren't too interconnected with the rest of the grid...

Re: Entities consuming/producing fluid never go to sleep

Posted: Tue Mar 10, 2020 5:27 pm
by danyax
conn11 wrote: Tue Mar 10, 2020 4:53 pm
Like setting circuit conditions controling power switches to turn the power off and on, when your buffering fluid tanks are full or empty enough?
Provided of course your fluid handeling areas aren't too interconnected with the rest of the grid...
Exactly. Imagine independent rail-based factory block. Once output tanks reach certain level, like 3-4 full train loads, I can switch factory block to power off to save UPS. I do not care about idle building power usage, UPS is my only concern.

Re: Entities consuming/producing fluid never go to sleep

Posted: Tue Mar 10, 2020 5:59 pm
by conn11
danyax wrote: Tue Mar 10, 2020 5:27 pm
conn11 wrote: Tue Mar 10, 2020 4:53 pm
Like setting circuit conditions controling power switches to turn the power off and on, when your buffering fluid tanks are full or empty enough?
Provided of course your fluid handeling areas aren't too interconnected with the rest of the grid...
Exactly. Imagine independent rail-based factory block. Once output tanks reach certain level, like 3-4 full train loads, I can switch factory block to power off to save UPS. I do not care about idle building power usage, UPS is my only concern.
But this solution is fully implementable with the vanilla cicuit network (Just thinking about a setup with power switches and SR-Latches in the afore mentionded buffer area). Since -correct me, if I'm wrong- unpowerd building, fluid utilising or not, shouldn't "stay awake" and therefore not consuming UPS, the issue you've described, is more of a layout and design problem. No new mechanic necessary.

Re: Entities consuming/producing fluid never go to sleep

Posted: Tue Mar 10, 2020 6:35 pm
by Deadlock989
conn11 wrote: Tue Mar 10, 2020 5:59 pm -correct me, if I'm wrong-
danyax wrote: Mon Mar 09, 2020 12:36 pm I noticed that entities consuming/producing fluid never go to sleep. At megabase scale they stay awake (and consume UPS) even in no ingredients/fully backed up. While entities using solid ingredients happily go to sleep under same conditions.

In this correct?
posila wrote: Mon Mar 09, 2020 1:04 pmYes.
Entities which can handle fluid have fluid boxes. Unpowering a machine doesn't/shouldn't clamp off the pipe connection feeding into it. If the fluid box went to sleep then the fluid connections would be severed - either that or the fluid simulation along the entire pipe segment would also need to go to sleep. This would be particularly heinous for entities with pass-through fluid boxes.

Re: Entities consuming/producing fluid never go to sleep

Posted: Tue Mar 10, 2020 6:40 pm
by conn11
Deadlock989 wrote: Tue Mar 10, 2020 6:35 pm
conn11 wrote: Tue Mar 10, 2020 5:59 pm -correct me, if I'm wrong-
danyax wrote: Mon Mar 09, 2020 12:36 pm I noticed that entities consuming/producing fluid never go to sleep. At megabase scale they stay awake (and consume UPS) even in no ingredients/fully backed up. While entities using solid ingredients happily go to sleep under same conditions.

In this correct?
posila wrote: Mon Mar 09, 2020 1:04 pmYes.
Missing ingredients/ backed up production is not necessarily the same case as no power.
Question remains.

Re: Entities consuming/producing fluid never go to sleep

Posted: Tue Mar 10, 2020 6:43 pm
by Deadlock989
conn11 wrote: Tue Mar 10, 2020 6:40 pm Missing ingredients/ backed up production is not necessarily the same case as no power.
Question remains.
The answer was "no".

Re: Entities consuming/producing fluid never go to sleep

Posted: Tue Mar 10, 2020 6:44 pm
by Bilka
conn11 wrote: Tue Mar 10, 2020 6:40 pm Missing ingredients/ backed up production is not necessarily the same case as no power.
Question remains.
Missing *item* ingredients definitely goes to sleep, red circle means sleeping:
Image

Same for backed up *item* production
Image

Re: Entities consuming/producing fluid never go to sleep

Posted: Tue Mar 10, 2020 7:16 pm
by conn11
So in conclusion, fluid consuming entities behave as to be expected.
Any UPS issues, if not mod related, or theorized, it‘s not clear from OP should be fluid related.
Entities which can handle fluid have fluid boxes. Unpowering a machine doesn't/shouldn't clamp off the pipe connection feeding into it. If the fluid box went to sleep then the fluid connections would be severed - either that or the fluid simulation along the entire pipe segment would also need to go to sleep. This would be particularly heinous for entities with pass-through fluid boxes.
Seemingly (credit to Deadlock989) with good reason and even if not, is off the charts before 1.0

Re: Entities consuming/producing fluid never go to sleep

Posted: Tue Mar 10, 2020 8:19 pm
by danyax
conn11 wrote: Tue Mar 10, 2020 7:16 pm So in conclusion, fluid consuming entities behave as to be expected.
Any UPS issues, if not mod related, or theorized, it‘s not clear from OP should be fluid related.
Let me state again the problem. I have no way to put to sleep entities that has no *item" output but have fluid output only. They remain always on, consuming UPS (I have extensively tested this in creative mode). So factory blocks containing hundreds of chem plants, despite all fully backed up, are always awake with noticeable impact on UPS.

Pass through entities could be excluded from the solution, if it is difficult to include them.

Fluid management time is not a problem, just entity update time. 1000 of entities fully disconnected from pipes still consume UPS.

This is not a mod problem, you can reproduce it with vanilla refinery.

All picture presented are correct, but it does not help if no *items* involved.

If powering off would put entities to sleep, it will solve the problem.
Entities which can handle fluid have fluid boxes. Unpowering a machine doesn't/shouldn't clamp off the pipe connection feeding into it. If the fluid box went to sleep then the fluid connections would be severed - either that or the fluid simulation along the entire pipe segment would also need to go to sleep. This would be particularly heinous for entities with pass-through fluid boxes.

Clamping off is not needed, just entities sleep will help a lot. Putting entities to less frequent updates if they are not working for some time also solves the problem.

Re: Entities consuming/producing fluid never go to sleep

Posted: Tue Mar 10, 2020 11:44 pm
by bobucles
Wait, so a fluid producer can have nothing to do and still be active? Neat. Post your save, devs love that sort of weird stuff.

Re: Entities consuming/producing fluid never go to sleep

Posted: Wed Mar 11, 2020 8:29 am
by danyax
bobucles wrote: Tue Mar 10, 2020 11:44 pm Wait, so a fluid producer can have nothing to do and still be active? Neat. Post your save, devs love that sort of weird stuff.
Just put oil refinery in vanilla without any pipe connection at all - it will consume UPS. Stamp in creative mode 1000 of them and see you UPS drops

Re: Entities consuming/producing fluid never go to sleep

Posted: Wed Mar 11, 2020 5:25 pm
by conn11
danyax wrote: Wed Mar 11, 2020 8:29 am Just put oil refinery in vanilla without any pipe connection at all - it will consume UPS. Stamp in creative mode 1000 of them and see you UPS drops
Your observations can be validated:
idle.PNG
idle.PNG (844.27 KiB) Viewed 6316 times
working refinery.PNG
working refinery.PNG (3.1 MiB) Viewed 6316 times
all fluid only using and outputing entities aren't showing the inactive state, regardless if actually working or not.

Concordantly for powerd and unpowerd refineries:
powered.PNG
powered.PNG (871.76 KiB) Viewed 6316 times
no power.PNG
no power.PNG (900.43 KiB) Viewed 6316 times
Note recipe (BOP) was set but not shown.

This would conclude, that unpowering such entities isn't going to save any UPS. As for mechanic change,
posila wrote: Mon Mar 09, 2020 1:04 pm Currently no plans for optimizing it.

Re: Entities consuming/producing fluid never go to sleep

Posted: Wed Mar 11, 2020 6:15 pm
by danyax
conn11, good that you come to the same conclusion regarding how game mechanics works now.

Still, I think forum purpose is to provide feedback to developers of real problems dedicated players have. I play with 10 000 science multiplier and expensive recipes on full A&B mods, and many issues that are relevant for megabases I experience at red science level. This is my choice of course, but exactly same problems will be relevant for any megabase.

If developers decided for whatever reason to not implement it now or never, so be it. But my preference as someone with 4500 hours of Factorio playtime is clearly UPS optimization for fluids production, as complex mods use much more fluids then vanilla.

That said, current state of fluid optimization is great overall, my only pain is idle entities update time. You can safely overbuild item producing staff, use direct insertion with non perfect ratios - and it work like magic, UPS is consumed strictly proportional to actual production. I would really love to have same luxury for fluids.

Re: Entities consuming/producing fluid never go to sleep

Posted: Mon Jan 02, 2023 9:09 pm
by Blackclaws
I just ran into a similar issue with 9544 pumps that won't go to sleep and use 1ms of update time. Those pumps are mainly used in stations or to boost the throughput of long pipes. I was under the impression that pumps that are shut off using a circuit connection would properly go to sleep. But they unfortunately do not.

Re: Entities consuming/producing fluid never go to sleep

Posted: Tue Jan 03, 2023 7:27 am
by aka13
Does that mean, that flamethrower defenses are bad for ups?

Re: Entities consuming/producing fluid never go to sleep

Posted: Wed Jan 04, 2023 2:59 pm
by FunMaker
Well, i don't know how the fluid system is currently implemented. But i think there is some threshold implemented to negate wavebuilding in pipes and mechanisms to reduce reflections on ends. So in my opinion if no fluid is put into the system and none goes out, this system will at some point go into a state that we could consider constant.

If all inputs and outputs of an entity are in this constant state and the entity production is in some input starving or output filled condition, that entity could go into sleep until one input or output state changes it's content and would not be considered constant anymore.

Well, there are cases that have to be considered but looks like a simple oberserver pattern to me. And yes, i know this is a massive simplification and things might not be that easy.

But in grand scale bases, where many fluid using entities were built, this would reduce the active entity count by huge amount.

Re: Entities consuming/producing fluid never go to sleep

Posted: Wed Jan 04, 2023 7:45 pm
by aka13
I have isolated segments of flamethrowers, and they never have the red circle on them, so I assume they do not sleep.
They are fully pressurised with pumps.