minetest icon indicating copy to clipboard operation
minetest copied to clipboard

liquid flow leaves an air gap before reaching the end of another liquid flow

Open Lemente opened this issue 2 years ago • 4 comments

Minetest version
5.5.1
Summary
When a liquid flow reaches the end of a different liquid flow, it doesn't spread to the air node inbetween.
This only happen in specific directions.
Steps to reproduce
- place on liquid on a flat surface
- wait for it to fully flow
- place second liquid close enough in each directions

tested with the void game in a flat world, with this custom mod : void_liquid.zip

screenshot_20220717_202419

similar issue : https://github.com/minetest/minetest/issues/2399

Lemente avatar Jul 17 '22 18:07 Lemente

I don't remember this being a problem. Would you please be so nice to check if it worked in 5.0.1 or other version? Try to bisect if possible. It's been a while since the last liquid changes.

SmallJoker avatar Jul 17 '22 19:07 SmallJoker

same issue in 5.0.1 screenshot_20220717_213959

Lemente avatar Jul 17 '22 19:07 Lemente

I think this – or something similar – also happens in 5.4.1 at least.

I don't remember this being a problem.

The problem created by this is that player-built machinery that relies on liquids touching for something to happen may only work in some directions. Most prominently, this probably affects cobble generators across a wide range of games where flowing lava and flowinrg water can touch to form cobble.

erlehmann avatar Jul 17 '22 21:07 erlehmann

can confirm this issue

wsor4035 avatar Jul 25 '22 00:07 wsor4035

screenshot_20230119_233124

Lava can flow into flowing water and creating stone in only two orthogonal directions, in the opposite directions the lava will not flow.

Minetest 5.6.1 Minetest Game 5.6.1

Also does this in MineClone, so it seems like an engine bug.

There is another bug/glitch that seems related: It is possible to place a solid node near the player's head in such a way that it clips the player's head into the node, resulting in x ray vision. This also only works only in two orthogonal directions, not in the opposite directions, just like the lava flow pictured above.

Edit: the x ray glitch is reported in https://github.com/minetest/minetest/issues/12429

kab0u avatar Jan 19 '23 22:01 kab0u

can confirm this occurs for me too

dontfwiththestream avatar Jan 19 '23 22:01 dontfwiththestream

I think I have an idea what's causing this: it might be related to the fact that the transform liquids function scans neighbors in a particular order (+y, +z, +x, -z, -x, -y) and picks the first liquid neighbor it finds as the source of what should flow into the empty/air node - and doesn't select any of the other neighbors as candidates to flow in. The check whether the neighbor has enough liquid level to flow into the current node doesn't happen till later, and then if it fails, it won't retry.

If this is right, the issue should happen when there's a max-distance (aka min level) liquid on the +z/+x/-z side first before any other liquid - and from what I tested, this is the case. I'm going to try something to fix this to make sure.

ZenonSeth avatar Nov 30 '23 10:11 ZenonSeth

So that was the cause, and I think I got a fix, this is how it looks now with OPs mod/setup:

image

Just need to make sure it doesn't break anything else before making a PR

ZenonSeth avatar Nov 30 '23 12:11 ZenonSeth

Also to note, I don't think the Seeing through blocks glitch bug mentioned above is at all related.

This bug was caused purely by water update logic, that bug likely has nothing to do with that logic.

ZenonSeth avatar Nov 30 '23 12:11 ZenonSeth