Water is not infinite


Makes water a finite resource. Uses a depth map: each water tile has a depth based on its type. Pumps drain lakes; depleted tiles become land. Refill with outfall pipes and rain

Tweaks
13 days ago
2.0
1.03K
Environment Fluids Power

g Offshore pumps sometimes suddenly destroyed when robots must place landfill first

10 days ago
(updated 10 days ago)

Background (same as my previous bug report): In non-Space-Age 2.0.72, using water-is-not-infinite_0.11.0, I have built a network of offshore pumps across a large body of water, to supply a large factory. Many of those offshore pumps I have been placing in remote view, using ctrl-shift-click to automatically place landfill underneath first. I also place pipes, pipe-to-ground, roboports, and power lines with ctrl-shift-click to hook it up to the large water network in the lake, and to let the robots reach to build it.

Problem: Very occasionally (every 5-10 IRL hours or so), something strange will happen and an offshore pump will get destroyed that is supposed to be placed on the lake on landfill (not on a dried-up tile that can be re-filled by water.) I don't recall seeing what happens when it happens, possibly because I am no longer looking at it in remote view when it happens (it takes >30 seconds for robots to get to that body of water after I give the order to construct, because my base is large, so I will have been be looking elsewhere). It is also possible that it's something other than an offshore pump is getting destroyed.

I don't know how to reproduce these events other than I keep playing and very rarely they will happen. The impact is low because there is ghost offshort pump so it gets replaced by robots pretty soon.

I have a load of other mods installed but none look like they would be related to this problem.

My speculations on possible causes:
- Some obscure combination of water depth/type changing or drying/flooding on ghost landfill tiles.
-- Perhaps a race condition if it happens on the same tick as something a robot builds on that tile, or the same tick player gives an order to change the tile.
- In change_tiles, you might need to search for ghost entities (using ghost_type) as well as non-ghost entities (using type), to find things that need to be destroyed.
- A robot placing the offshore pump before another robot can place the landfill (unlikely, as that would be a base game bug).
- The landfill being placed on an adjacent tile and breaking the rules for offshore pump placement/orientation (e.g. it could be related to the rules that prevent placing on diagonal shoreline?). I don't know the exact rules though.
-- I do have some oddly-shaped arrangements of offshort pumps, pipes, and pipe-to-grounds.
- I recall from other experiences (without the Water Is Not Infinite mod), that placing offshore pumps with ctrl-shift-click to automatically landfill can be buggy and cause the ghost of the pump to suddently vanish when other landfil is placed nearby. (This was with the Fun Mode mod so it may be unrelated.). It could therefore be related to a bug already present in the base game and just exacerbated by the number of offshore pumps that WINI is encouringing me to build on top of landfill.

3 days ago

Thank you for your research and hypothesis. More likely, the reason is somewhere in change_tiles. I'll try playing with landfill and ghosts to reproduce the issue

3 days ago

Thanks for looking into it.

I've been looking out for it happening again. When I look at the area, moments after the pump destruction alert, I often see that many tiles near the pump location are changing frequently between dry lakebed and shallow water, because their water level is right on the boundary of drying up completely and the water is shuffling around.

New response