Terrain Hydrology
terrainHydrology is a terrain generator. It implements the algorithm described in Terrain Generation Using Procedural Models Based on Hydrology. This category contains a series of posts that document my work on the repository (based on a partial implementation by GitHub user bmelaiths).
The project itself, along with documentation on how to use it, is found at wattzhikang/terrainHydrology.
The algorithm
Most approaches to terrain generation focus on the terrain exclusively. Everything else (climate, river flow, etc) is generally an afterthought—if it is simulated at all.
But real-world terrain is strongly influenced by hydrology. In fact, the flow of water is the dominant factor in almost all terrain on Earth. Even the driest deserts are dominated by intermittent flows in the present, or more generous flows in the past. Even other planets have been carved up by water!
This is a major weak point of many ontogenetic algorithms. Fractal and pseudo-fractal algorithms such as the midpoint displacement algorithm and Perlin noise produce many local minima. While the resulting terrain may look good at a glance, this is a characteristic artifact. Because real-world terrain is carved by water, terrain has many local maxima, but very few local minima. To mitigate this problem, professional software must often use computationally-expensive teleological erosion and hydrology algorithms to achieve the right look.
So the authors of this paper decided to approach the problem of terrain generation in reverse: generate the network of rivers, and interpolate terrain in between them. This novel approach is very good at eliminating the shortcomings of many ontogenetic algorithms.
The implementation
In 2019, GitHub user bmelaiths wrote a partial implementation of the algorithm in Python.
In December 2020, I discovered his implementation, and over the next 8 months, I refactored and expanded it with many new features.
Important links
- Project repository: wattzhikang/terrainHydrology
- Original paper: Terrain Generation Using Procedural Models Based on Hydrology