Entities consuming/producing fluid never go to sleep

Post all other topics which do not belong to any other category.
danyax
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Tue Dec 26, 2017 9:29 am
Contact:

Entities consuming/producing fluid never go to sleep

Post 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?
posila
Factorio Staff
Factorio Staff
Posts: 5362
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Entities consuming/producing fluid never go to sleep

Post 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.
danyax
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Tue Dec 26, 2017 9:29 am
Contact:

Re: Entities consuming/producing fluid never go to sleep

Post 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.
conn11
Filter Inserter
Filter Inserter
Posts: 387
Joined: Wed Sep 14, 2016 5:02 pm
Contact:

Re: Entities consuming/producing fluid never go to sleep

Post 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...
danyax
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Tue Dec 26, 2017 9:29 am
Contact:

Re: Entities consuming/producing fluid never go to sleep

Post 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.
conn11
Filter Inserter
Filter Inserter
Posts: 387
Joined: Wed Sep 14, 2016 5:02 pm
Contact:

Re: Entities consuming/producing fluid never go to sleep

Post 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.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: Entities consuming/producing fluid never go to sleep

Post 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.
Last edited by Deadlock989 on Tue Mar 10, 2020 6:42 pm, edited 1 time in total.
conn11
Filter Inserter
Filter Inserter
Posts: 387
Joined: Wed Sep 14, 2016 5:02 pm
Contact:

Re: Entities consuming/producing fluid never go to sleep

Post 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.
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2529
Joined: Fri Nov 06, 2015 7:41 pm

Re: Entities consuming/producing fluid never go to sleep

Post 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".
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Entities consuming/producing fluid never go to sleep

Post 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
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
conn11
Filter Inserter
Filter Inserter
Posts: 387
Joined: Wed Sep 14, 2016 5:02 pm
Contact:

Re: Entities consuming/producing fluid never go to sleep

Post 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
danyax
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Tue Dec 26, 2017 9:29 am
Contact:

Re: Entities consuming/producing fluid never go to sleep

Post 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.
bobucles
Smart Inserter
Smart Inserter
Posts: 1708
Joined: Wed Jun 10, 2015 10:37 pm
Contact:

Re: Entities consuming/producing fluid never go to sleep

Post 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.
danyax
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Tue Dec 26, 2017 9:29 am
Contact:

Re: Entities consuming/producing fluid never go to sleep

Post 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
conn11
Filter Inserter
Filter Inserter
Posts: 387
Joined: Wed Sep 14, 2016 5:02 pm
Contact:

Re: Entities consuming/producing fluid never go to sleep

Post 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 5658 times
working refinery.PNG
working refinery.PNG (3.1 MiB) Viewed 5658 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 5658 times
no power.PNG
no power.PNG (900.43 KiB) Viewed 5658 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.
danyax
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Tue Dec 26, 2017 9:29 am
Contact:

Re: Entities consuming/producing fluid never go to sleep

Post 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.
Blackclaws
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Jun 06, 2022 10:28 pm
Contact:

Re: Entities consuming/producing fluid never go to sleep

Post 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.
aka13
Filter Inserter
Filter Inserter
Posts: 804
Joined: Sun Sep 29, 2013 1:18 pm
Contact:

Re: Entities consuming/producing fluid never go to sleep

Post by aka13 »

Does that mean, that flamethrower defenses are bad for ups?
Pony/Furfag avatar? Opinion discarded.
FunMaker
Fast Inserter
Fast Inserter
Posts: 107
Joined: Wed Jun 08, 2016 8:43 pm
Contact:

Re: Entities consuming/producing fluid never go to sleep

Post 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.
aka13
Filter Inserter
Filter Inserter
Posts: 804
Joined: Sun Sep 29, 2013 1:18 pm
Contact:

Re: Entities consuming/producing fluid never go to sleep

Post 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.
Pony/Furfag avatar? Opinion discarded.
Post Reply

Return to “General discussion”