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
25 days ago
2.0
1.18K
Environment Fluids Power

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

a month ago
(updated a month 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.

a month 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

a month 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.

a month ago

Haha, it's incredible, but this is the case: "A robot placing the offshore pump before another robot can place the landfill (unlikely, as that would be a base game bug)."

https://youtu.be/xjoGtfCtTIY

a month ago

This raises another question: the pump in the video didn't explode, so what is special about the ones that do explode? Maybe it's something else happening?

Also: did you find/file a bug report for the behaviour shown in that video? (I hear that the developers are pretty good at fixing small bugs like that.)

a month ago
(updated a month ago)

I have seen pumps explode several times. The thing is, the mod checks flooding (and destroy entities) only when it changes tiles to water or deep water. If there are no tile changes, it does not touch any entities.

This behavior is unexpected, but I am not sure it is a bug. By the way, there is already a bug report: https://forums.factorio.com/viewtopic.php?t=119110

29 days ago
(updated 29 days ago)

I eventually saw a pump explode, and yes it matches what you are describing:
- The ghost pump is placed on water and it adds ghost landfill,
- Water moves and tht tile becomes dry lakebed,
- The pump is placed on the dry lakebed, by construction bots (also, if there is a construction bot trying to place landfill, it hovers in-place),
- The water moves more until the dry lakebed becomes water again, destroying the pump.

One possiblity for preventing this is to allow the placing of landfill on dry lakebed (especially by construction bots filling in a landfill ghost). I have wanted that for other reasons too, so I could place electric poles, roboports, and pipe-to-ground on landfill across dry lakebed, so that they won't get destroyed if/when the lake re-fills.
But I don't know how easily mods can change where you can place landfill, so I don't know if this would be hard to do or buggy.

28 days ago

I'm not sure it is possible to both place landfill on a dried lakebed and place buildings on a dried lakebed. I need to look into this

New response