With just a small change I was able to make pipeworks and dynamic_liquid work together. Still some problems as the total volume is not preserved (water is created in the pipes in my tests) but a way forward! On VanessaE's suggestion, I'll look into a flow logic branch that has been dormant in her repo for a while when I am finished playing with my unicode problems :-)zargulthewizard wrote:Could you create an addon to change pipeworks to function with this mod? This would be totally cool: the water pipes would have an actual purpose instead of doing this:
Not necessarily. After all, in real life water flows only happen because of local considerations (but the tick is much higher!). I suspect that by simulating pressure and making water (and pressure) move around you could even have the air bubble behavior but do we really want an ABM on air nodes?FaceDeer wrote:Indeed, it's a definite limitation that I've been reluctant to address due to performance concerns. As the mod currently stands each node only needs to know about its immediate neighbors, but to have water flow through a U-bend a node at the top of one column will need to do some kind of search through a long distance to find whether there's a connected node on the other side of the U-bend that it can move to.
I need to think more about it, but on first approximation I think that you could have a pressure number per water block, an ABM that computes the current pressure by taking the maximum of the pressure of the 4 touching cubes at the same level, the pressure of the above cube +1 and of the bottom cube -1 (because of gravity. 1=pressure added by the weight of a cube of water).
State for instance that atmospheric pressure is 100. Make a cube move up into air if it has a pressure of 102 or more, giving priority to the highest-pressure water neighbor. That means that in a pool at rest, pressure would rise of 1 per cube of depth.
Of course reaching equilibrium will take much longer and instead at moving at several km/s, pressure changes move at one cube/s. But ideally in most cases the equilibrium should be similar.
In a U-shaped tube, here is how the pressure would look like (making the atmosphere=0 for simpler visualization):
Code: Select all
▯.▯.▯ ▯_▯_▯
▯~▯.▯ ▯1▯_▯
▯~▯.▯ ▯2▯_▯
▯~▯.▯ ▯3▯_▯
▯~~~▯ ▯444▯
▯▯▯▯▯ ▯▯▯▯▯
Code: Select all
▯_▯_▯ ▯_▯_▯ ▯_▯_▯ ▯_▯_▯ ▯_▯_▯ ▯_▯_▯ ▯_▯_▯
▯1▯_▯ ▯1▯_▯ ▯1▯_▯ ▯1▯_▯ ▯1▯_▯ ▯_▯_▯ ▯_▯_▯
▯2▯_▯ ▯2▯_▯ ▯2▯_▯ ▯2▯_▯ ▯_▯_▯ ▯1▯_▯ ▯1▯_▯
▯3▯1▯ ▯3▯1▯ ▯3▯1▯ ▯_▯1▯ ▯1▯1▯ ▯2▯1▯ ▯2▯1▯
▯44_▯ ▯4_2▯ ▯_22▯ ▯222▯ ▯222▯ ▯222▯ ▯322▯
▯▯▯▯▯ ▯▯▯▯▯ ▯▯▯▯▯ ▯▯▯▯▯ ▯▯▯▯▯ ▯▯▯▯▯ ▯▯▯▯▯