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

Overhaul
3 days ago
2.0
898
Environment Fluids Power

g Methods to refill water

14 days ago

Hi, I've been enjoying your mod quite a bit, it works well and making water finite adds a cool layer to the game.
However, I'm on a large mod list including Space Exploration and Krastorio 2, and it will last a long while. I know that the Dynamic Rain mod has water refill, but how much of it does it refill? Are there methods to maybe create large ponds to catch as much rainwater as possible?

14 days ago
(updated 14 days ago)

Hi, thanks for your interest in the mod. Right now there's only one way to refill water - rain. With the default rain settings and the default "Rain water refill rate" of 0.0001, each active water tile will gain roughly 1,000 units of water over about 400 real hours of gameplay.

If you increase the refill rate option by x10, for example, you'll get around 10,000 extra units of water per tile over the same 400 hours of gameplay.

You can also change the water multiplier option in the mod's startup settings. It affects how much water a single water tile holds initially, but it only applies to newly generated water tiles. By default, each water tile holds between 600 and 2,400 units, depending on its depth.

I should probably think about adding other ways to refill water, maybe something like underground sources

14 days ago
(updated 14 days ago)

Well I was thinking about several things:
The ability to construct artificial water-reservoir tiles that can hold much more water than natural tiles (10.000?). That way we can collect water from lakes and transport it via pipe or train via outflow into such reservoirs for later usage.
If we make very large reservoirs we can then catch more rain water.

A possible optimization: right now the average-calculations can get pretty intensive. What if, when you place a pump, it calculates surfaces of the entire water surface, in layers. So for example you have a 5x5 pond of only deep water. So 25 tiles of 2.400 units of water = 60.000 units of water in that pond, and then it just starts draining from that global pool. When it reaches 0, all tiles become mud at the same time.

If there's different depths, then you can calculate all the different depth-surfaces, then lump all the water in a single pool again. But here, you calculate the tresholds of the global pool when those tiles should become mud.
Example, you have a 5x5 pond of deep water (60.000) and around that a layer of regular water (1800) of 2 tiles wide. So in total the pond is 7x7.
There will be 25 tiles of deep water (60.000) and (7x7)-25 = 24 tiles of regular water, which is 43.200 units of water. In total there is 103.200 units of water. However, in this case, once all tiles have been drained of 600 units of water (conceptually), the outer layer of water should become mud, with the inner core still having the leftover water.
So that means, if 49 * 600 = 29.400 units of water have been drained, turn the outer layer into mud.

If you have a larger pond, you can thus calculate the the global pool, and the specific tresholds of when different areas (different tiles) should become mud. Does it make sense?
Of course, for SUPER large oceans, the calculations could become intense, but at the very least you only need to do them once. Even if you remove the pumps, you can just store the state of the pond somewhere in the game.

You will lose some 'realism', of course, but I think for gameplay it's a much more scalable system. let me know what you think!

(* I edited because I did some mistake in my calculations, it's fixed now)

14 days ago

I thought about artificial reservoirs, but I realized that we already have artificial reservoirs: a 3x3 water tank holds 25k water, so I don't think we need anything else.

As for optimizations, dynamic water evening is now a core feature of the mod, and rewriting it would require changing almost all of the logic. I think this should be a separate mod.

By the way, we already brought up a similar idea about optimizations with Tooster here: https://mods.factorio.com/mod/water-is-not-infinite/discussion/68aa145c8bf9457738b9fde5 I think it might work well

13 days ago

That concept is really cool, and precisely what I think the mod needs to get to the next level.

My main concern for this mod is scalability. It would be a shame if we had to limit ourselves greatly because the calculations overtake what the game can handle. I'm already now trying to avoid draining too much water, not because of the limited availability of the water, but just because of it hogging the CPU resources. So I'm not trying to find methods to save water for the right gameplay reasons.

About artificial reservoirs, it's true that we have tanks, but tanks can't catch rain water. I've cranked up the rain refilling rate just to see how it would work (500 units of water per hour per tile right now). Plus, I think there's a great 'cool' factor with being able to build giant artificial lakes, but if this is not within the vision of the mod, then I can always landfill an ocean into the shape I want.

Very excited to see what the future of this mod holds!

12 days ago

My main concern for this mod is scalability

Yes, scalability is a weak point of the mod.
Thanks for sharing your concern. I'll think about how to sort it out :)

9 days ago

So I just noticed, placing a pump creates few tiles of very deep water of 2600, and a look at your code seems to confirm this.
First of all, this is kind of exploitable if the original depth isn't returned when the pump is removed. Secondly, this means that there's already code in place to change the depth of tiles? That could be very interesting for expanded functionality.

8 days ago

Haha, that's nice that you found this behavior :)

I added these workaround to make sure offshore pumps always have enough water. It's important when you have a semi-dried water body. The mod does create and control depth, for sure, so you can dig the bottom this way :)

That could be very interesting for expanded functionality.

What do you mean? Please reveal your ideas

8 days ago

Well, having a kind of building or other mechanic that allows to equalize the full water pond depth and/or just remove the marsh water tiles would be nice. Something like the excavator mod, but for digging the actual water tiles deeper.
I tried doing this already by placing landfill every 3 tiles in long lines, placing pumps everywhere, deconstructing and moving everything by 2 tiles and doing it again, to make the entire water area have the same maximum depth. But it felt a little bit exploity and gimmicky. With an official mechanic, there's more control over the gimmicky behaviour.

7 days ago

Hello, I'm playing with your mod, but I have a problem. I had several coastal pumps extracting water, and now I have the terrain evolution mod. Several coastal pumps have disappeared due to a rise in water levels, which is fine. My problem is that the mod is still leveling the water where the coastal pumps were located. How do I stop this water leveling? It's using a lot of CPU, and I'm getting almost 10 FPS because of it. I tried uninstalling and reinstalling the mod, but it stopped working. Another question: when we use landfill, does the leveling still occur on those tiles? They're dirt, so there shouldn't be any water leveling.

4 days ago

Hello, I'm playing with your mod, but I have a problem.

Hello, sorry to hear that. It does sound like a bug. I need some time to reproduce it and fix it

When we use landfill, does the leveling still occur on those tiles?

Landfill does participate in the calculations. It is important to properly remove all simulated cells when pumps are mined or destroyed. And if there are no pumps in a water pond, the leveling should stop. Even if some landfill remains

3 days ago

I found out that Terrain Evolution is incompatible with my mod. It modifies water tiles and removes pumps silently, without raising any events, so I cannot handle it reliably.

If active simulated water cells still remain, enable my mod, place a pump in that area (visible with SHIFT+F10), wait until the scanning finishes (about a minute), then remove the pump. This should clean up the simulated water cells from that area

3 days ago

By the way, it might be better to create a new topic, since this looks a bit off-topic here :)

New response