COMMUNITY - FORUMS - GENERAL DISCUSSION
The Shiny glint of sunlight off the water

Hail Elyrians,

Over the past few shinies, I've been talking about map making a lot. As you can probably imagine, it's on my mind as we move to complete Domain and Settlement Selection (while at the same time literally generating the game worlds you will experience when you play). One of the more vexing problems is how to deal with water.

If you paid attention to the Domain & Settlement Selection channel in our discord server, you have probably seen me talk about how Caspian has been working to tune the water simulation so that we can properly account for the various water features of each biome.

One aspect of that process is accounting for surface water. In a nutshell: Given the topology of a region, the rainfall it receives, and the quality of the soil, how does water flow and accumulate across its surface to form features like rivers and lakes?

Even more succinctly: Where does the water go when it rains in each biome?

We don't answer that question predictively, we actually simulate rainfall and water accumulation across the surface of the continent and watch where the water goes to gain an understanding of both how the water flows across the surface, and where it accumulates.

Some games have actually done this on a small scale before. One example that comes to mind is the unparalleled Dwarf Fortress which simulates the flow of water across its game's surface, though admittedly at a pretty coarse level. However, I don't think I've ever heard of a game that attempts this at the scope we are.

So, for example, here's how our test map looks at the first moment of the sim, when a year's worth of rainfall has just been dumped across the entire map:


Now, take in mind that what you're looking at here is a 2048x2048 image. I took that from the 4096x4096 debug mask that our sim spits out at the end of every iteration but that 4096x4096 map? That is, itself, a condensed version of the "full-scale" 65k by 65k dataset that we use for water simulation.

In other words, you're actually seeing only 1/32 of the overall data the sim itself is producing.

The simulation actually spits out two maps ever iteration, one that visualizes the flow of water (water that doesn't move or areas with no water appear darker than area with lots of water moving through them), and another that visualizes the accumulation of water (Areas with more water appear whiter and brighter than areas with little or no water).

Here's the water accumulation map at the start of the sim:


It appears nice and bright because a year's worth of rain has all been dumped on the map at once. So there's a LOT of water. That's why the map looks kind of flat on iteration 1.

But, if we fast forward a little, you can start to get an idea of what the water is doing on the continent. For example, if we look at the flow map we can begin to see where areas of true flow -- the likely locations of rivers and other flowing water features -- can be found:


Likewise, if we take a look at the water accumulation visualization we can begin to get a much better sense of where the water collects and pools:


These images from the first and the 36th iteration of the sim, but we actually run several hundred iterations of the sim to get a complete picture. Actually we run so many iterations of the sim to get it down to the right level of specificity that the OS has a tendency to deprioritize the running process, which is incredibly annoying - it makes the whole thing take longer, damnit! ;)

But, that irksome problem aside, the resulting data tells the world where the permanent rivers are (and where the wadis are too, though we don't actually simulate those in the live game), how fast they flow, how deep they get at each point, and where they pool and collect into ponds and rivers.

Now, that data gets analyzed pretty heavily by the system and any rivers or streams that analysis step deems "not active enough" or any lake or pond that isn't "deep enough" or large enough will be marked as "Do not show in-game," so don't expect to see quite as many rivers and lakes as you may see in these images. But, and this one of the things I love about this approach, we can say with some amount of authority that our rivers, streams, lakes and ponds are all real. Every rapids, every waterfall, that exists in Elyria does so because it would be there if the world were a physical place.

Nothing is placed simply because it looks cool (though, I'll admit, they will look cool) and that's because Elyria is more than just a "level" or a "Zone" -- Elyria is a world. Everything is there because it has a reason to be there, and a part to play in the massive clockwork mechanism that brings that world to life.

Stay Shiny friends!


  • Snipehunter
6/7/2019 1:08:40 AM #1

  • Snipehunter
6/7/2019 1:08:41 AM #2

Woot!!


Proud member of Vandiir, Magistrate of Fates Haven

Friend Code 8F214F

6/7/2019 1:11:38 AM #3

Shiny!


6/7/2019 1:11:39 AM #4

Thanks!!


6/7/2019 1:14:56 AM #5

That map's looking pretty moist. Thanks Snipe!


6/7/2019 1:15:53 AM #6

My blessed water! This is beautiful, thank you so much Snipe! <3


6/7/2019 1:16:18 AM #7

I love these. Thanks Snipehunter!


6/7/2019 1:16:35 AM #8

Good to see progress, thanks!


"Life before death, strength before weakness, journey before destination."

6/7/2019 1:17:34 AM #9

How does water flow get effected by Temperature? It's cold in the north. Is that being taken into account? Will we have excess snow to come instead of the rain? Does it evaporate in the deserts?

I guess it really comes down to how realistic will this end up being?


County of Kolglais

6/7/2019 1:27:07 AM #10

Ah, Dwarf Fortress; the best part of its water mechanics is simulating water pressure, which simply too few other sandbox games have attempted to pull off imo. And even if that most likely will remain true for CoE as well (due to lack of terraforming) I'm glad you guys intend to make the water have a more natural distribution within the world.

6/7/2019 2:24:25 AM #11

I guess I will have a lot of water in my biome Rainforest... Looks fantastic. Tnx Caspian and Snipehunter and all Sbs


6/7/2019 3:04:03 AM #12

You know, I instinctively want to cry out "do you have any IDEA how long I have been waiting for a game world this real?!"

But there's a very high likelihood that every member of SBS does, in fact, have a very good idea.

So...I'll just say "thank you for wanting this as much as I do."


"It's not the scales, the wings, the teeth, or even the breath that set a dragon at the pinnacle of creation. It's not the strength or senses, nor the size of his hoard. It's something that a dragon knows that only comes with age and experience. It's a skill mortals never truly master."

"A dragon...knows how to wait."

6/7/2019 4:02:09 AM #13

I praise you guys for doing real dynamic process simulations for this MEOW good sirs!

Professional salutations from an auld farte process engineer.

6/7/2019 4:22:45 AM #14

Now this also implies, if my expectations are correct, that for every simulated smallest finite vertical in-game pillar of Elyria eventually there will be:

  • a finite volume of water flowing (with velocity and direction) on top of the soil and subsoil,
  • a finite area subsoil, dependent on various soil conditions, that can be filled with water and can be affected by mann interaction such as tilling and enriching of the soil, but also by laying dense foundations,
  • a possibility for mann to alter the hydrodynamics of the top layers of the terrain and consequently also of the steady state reached during and after rainfall conditions,
  • rainfall conditions to effectively change the local water volumes and introducing a heavy dynamic effect where floods can become real and even would allow for / require accounting the risks of flood damage of soil layers and/or mann made structures.

This is just what pops to mind, but there is more.

Good luck on decision making about what to and what not to all take into account while balancing realism desires with playability needs!

If you wish for me to get into more detail and think along with you guys, you got my coordinates and NDA.

6/7/2019 7:16:17 AM #15

The maps looks amazing, and it's really cool to see the flow of water in action. And the effects that can have on farming and agriculture are immense.

I was just wondering though, how come there appears to be distinct lines where the boarders end, in the water flow and accumulation 36?

Does this mean that raining will literally stop at boarderlines?

And will there only be certain flows available in certain biome to how much is retained?

My thought is that the accumulation scenario has just taken the average of a dutchy and applied it to the Dutchy, with no storm crossing boarders taken into account. So has created that difference. Is that the case?