Skip to content

Water Flattening Algorithm

May 5, 2016

I’m working on my water flattening algorithm again. The algorithm has a smallest slope acceptable of 0.005 depth difference. This often creates gradients of depth, effectively creating hills of ocean. In the older version of the algorithm, enough water is poured into the world to fill every tile with 5 units of water. The water is randomly allocated to random plots. This has the draw back of blocking off water that could be placed elsewhere to make the world flatter, but it creates pleasant gradients.

Screen Shot 2016-05-05 at 4.05.41 PM

Random starting placement of water

In this second setup, water is placed evenly across all the tiles. This means that there is little flattening to do out in the ocean, but you’ll notice that there is deeper water around the continents. This is because the water slips off the continental slopes into the nearest valley. This water is also blocked off from the remaining ocean by the accuracy.

Screen Shot 2016-05-05 at 4.03.44 PM

Water starts on every tile

One might think to set the accuracy expectation to 0, but what ends up happening is that we are constantly chasing the tiniest of slopes. Then, you may think to calculate the ocean height by comparing the heights of all the provinces at once, but then you may not get the same inland oceans as the algorithms pictured above.

Advertisements
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: