I recently read a paper on society development in the old world. I wanted to create a more rigorous version of the model since the modelling assumptions do not define a unique model. In addition, I wanted to change some of the governing equations to more realistic ones. It seemed worthwile to apply this model to computer generated maps. So I developed a fun model to generate landscapes. So here we are!
The
image is pretty self-explanatory. Blue is sea/water which has been set
to value 0. Then the turquoise is set to height 1, and see the colorbar
for more :P
Method: There are actually many algorithms
out there for this kind of stuff (e.g. diamond square algorithm), but
these are generally more aimed at 3D. I wanted to create a 2D elevation
map. So it is like a top down 3D map. Of course you could use a 3D model
and project it on a 2D plane but that is not an optimal way of doing things.
It works by stacking layer upon layer. First the sea/water-level and the lowest ground level are created by making random pixels blue and turquoise. Then, the pixels look at their neighbours and change their color to equal the majority of adjacent pixels. In case of ties a random color is selected. Repeat this a couple of times and you get a nice base landscape. Then random parts of the elevated areas are selected to make space for higher elevated domains, the greenish pixes. Just boring pixel squares are placed but these are then diffused using the previous neighbour method. If you want higher elevated areas the last part can just be repeated.It is quite surprising how well this works:
There
are lots of parameters to play around with to generate more hilly type
of landscapes or more flat ones. I haven't gotten round to mess around
with those yet. It seems more fun to add some hum'ies to the world.