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
Mod category: Tweaks
Small changes concerning balance, gameplay, or graphics.
I'm thinking about reworking the mod overall, switching from tile-based simulation to water-body-based calculations. I will probably rewrite most of it from scratch, keeping only the Factorio entity logic (offshore pumps, outfalls) and maybe part of the tile transition code.
But it would probably be a different mod, Water is Not Infinite 2.0 :)
For now, I just want to fix some bugs and make minor improvements to this mod
What about making it with precalculation?
For example, the mod changes tiles like stages after X interactions, although it might require to change pump as a prototype to use it effectively as a workaround or it might require new API features with pumps.
If I understood your idea correctly, then changing tiles is not the bottleneck. The bottleneck is the constant recalculation of water levels and the BFS from pumps in memory. It is not related to the Factorio API at all, just Lua array processing.
If we run the calculations less often, water will not have enough time to equalize between tiles, and pumps will drain only the local area and then stop