Simulating Erosion: An experiment

A screenshot showcasing Satisfactory’s beautiful terrain.

My first attempt

I wanted the possibility overlaps and caves, perhaps even the beautiful sky arches from Satisfactory. Thus, a 2D heightmap was not going to be enough. Instead, I decided to use a 3D grid, witch each cell being a number between 0 and 1 representing how much sediment was in that cube. Then the result was rendered with marching cubes.

The result of algorithm 1, at least there is no shortage of overhangs.

Algorithm 2

Algorithm 2 made many small improvements. A drop would finish it’s whole path before subtracting sediment from all places at once, to prevent it effecting itself. Rain drops entirely enclosed in terrain would slow down much faster, to prevent long underground cracks. Subtracting sediment would have a small area of effect to smooth the terrain more, and attract other drops from a larger radius.

Terrain generated with algorithm 2. Blue line is a raindrop. Colors represent hardness.

Algorithm 3

This version changes the way that sediment is subtracted, to prevent the asymmetry around the edges and prevent holes. Instead of subtracting for every point in the path, this version recalculates a series of points to be equally-distant segments. This prevents the speed of the drop from effecting how the path is drawn. Specifically, when a drop “falls” after reaching the edge, it will subtract along it’s entire path from the edge to the ground, counteracting the asymmetric subtracting at corners.

Result of algorithm3, coloring is for steepness now.

Final Algorithm

At the end I changed the subtraction algorithm more so water drops that do not reach the edge don’t subtract past their halfway point at all.

Terrain with trees and grass.

Future Additions

While I’m pretty happy with the result, there needs to be a lot more work if the terrain should actually be used in a game.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store