Page 1 of 1

Make fluid flow "even" with rotating update order

Posted: Tue Nov 30, 2021 3:46 am
by farcast
My current understanding is that fluid flow is uneven because one connection gets a bigger chunk of fluid than the others due to it always being first to update. My suggestion is to rotate which connection gets the bigger chunk on each tick, so if the normal update order for connections is N>E>S>W, the next tick it'll be W>N>E>S, then S>W>N>E and so on. The purpose being to evenly distribute the uneven distribution, making fluid flow (hopefully) close enough to even.

Would this be feasible? Would it even be effective?

Re: Make fluid flow "even" with rotating update order

Posted: Tue Nov 30, 2021 5:17 am
by ssilk
farcast wrote: Tue Nov 30, 2021 3:46 am Would this be feasible? Would it even be effective?
Feasible: yes. Effective: no. Or maybe.

The logic for turning the algorithm would be quite complicated, so that it will slow down the calculations much.

Maybe like this: implement the algorithm four times. One implementation per preferred direction. And then change every tick which one is taken.

I see this meanwhile as a part of the gameplay. It’s quite ugly, but it could be seen like that.

For example how this could be simply played out:

This kind of “all or nothing” happens only, if the pipes are empty. It’s much easier to make just so much fluids of each type, that this flaw doesn’t matter. How? By letting only so much fluid through the refineries, that the tanks don’t run empty; they an distribute fluid at any time, but only for very short time, until the tank runs below the minimal level. Quite simple trick but quite effective.

Or use other tricks to guarantee a kind of equal split.

Re: Make fluid flow "even" with rotating update order

Posted: Fri Jun 21, 2024 12:17 pm
by Koub
[Koub] Implemented in 2.0 yay \o/ :
https://factorio.com/blog/post/fff-416