Random_genesis

- Scientific worldbuilding

Constructing fictional places has always been one of the main goals in the general field of procedural generation.
However, in most cases, even the generation of entire worlds has just been a necessary step in the creation of some other product. The generation tends therefore to focus on a few aspects that are core to the final product, while many variables are left aside.

The idea is to try and create large territories, where many different variables are scientifcally taken into account: geology, geography, climate, ecology...
Possibly, through the application of some "Guns, Germs and Steel-like" mechanics it will be possible to simulate large scale interactions between humans and the environment, and among humans on a large scale.

"More noise" (Feb 2018)

>Previous Update


The map generation algorithm was refined iteratively, trying to obtain meaningful maps, while simultaneously trying to keep the generation time under control.
Both white noise and perlin noise layers are generated in linear time. On the other hand, the voronoi layer is quite time consuming, since it requires K steps to generate the seed, and KN steps to assign every point to the correct partition (it involves calculating a minimum distance between the point and K centroids). It could be optimised, but the asymptotic complexity cannot be decreased.
I am therefore keeping the number of voronoi layers limited to 1, and limiting the size K of the seed. Such layer is used as a starting point and influences the shape of landmasses.


Too low K values (K=60) produce maps with chunky landmasses and straight coastlines. The results are too geometric and simple, lacking both variation and resolution. (the map is 384x256)

Increasing K sixfold (K=360) results in sufficiently irregular lines and organic-looking landmasses. However, the map generation is exactly 6 times as long as before. Larger K values make the output converge towards pure perlin noise, since partitions become smaller and more regular in shape, like plain pixels.


180 partitions seem to be enough.
There is no relevant loss of resolution/variety, and the generation is faster (half of the time required with K=360).

This is the current implementation of the algorithm, in pseudo code. Stretching and smoothing fuctions are explained in the previous update.
Every layer has a weight value W, used in the weighted average that normalizes the final result. The normalisation is actually performed every time a new layer is added When "resolution" is specified it means that rather than giving a different value to each point, the layer assigns the same value to "squares" of NxN points.

1. create empty heightmap of zeroes
2. add a voronoi noise layer: 180 partitions, perlin sampling scale = 1.3, W = 16
3. add a perlin noise layer: sampling scale = 1.1, W=4
4. stretch the map by a factor of 1.5
5. smooth: radius=3, 6 passes
6. add a perlin noise layer: scale=1.1, resolution=4, W=4
7. add a white noise layer: resolution=8, W=2
8. stretch the map by a factor of 1.2
9. smooth: radius=2, 4 passes
10. add a white noise layer: resolution=2, W=1
11. add a white noise layer: resolution=1, W=1
12. selectively add a white noise layer with res=2, W=2, only to heights in [0.4,0.6]
13. smooth: radius=2, 1 pass
14. stretch by a factor of 1.2
15. selectively smooth with radius=2, 2 passes, only in [0.48,0.52]
16. smooth: radius 1, 1 pass.

In total 6 layers are generated and added.

The first two layers, voronoi + perlin, have together a weight of 20 on a total of 30. Their contribution is 2/3 of the final value. A strong smoothing (step n.5) is therefore necessary to make this heavy "base" less rough, before "thinner" layers are added.
Towards the end of the process, steps 12 and 15 adjust the noisiness of coastlines, only changing heights around sea level.

Below, one final result and a GIF of how the algorithm gets there. This is not finished, but it's acceptable as a base to start from. I might further change/improve/refine the algorithm later.

>Next update