World-building

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@mathowl·
0.000 HBD
World-building
<p>I recently read a paper on <a href="https://www.pnas.org/content/110/41/16384" target="_blank">society development</a> 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.&nbsp; So I developed a fun model to 
generate landscapes. So here we are! </p><p><img style="width: 527.5px;" src="https://res.cloudinary.com/drrz8xekm/image/upload/v1566404089/wgpqlh8jk3hoqiklwfw8.png" data-filename="wgpqlh8jk3hoqiklwfw8"><br></p><p>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&nbsp; <br></p><p><br></p><p><b>Method:</b> There are actually many algorithms 
out there for this kind of stuff (e.g. <a href="https://en.wikipedia.org/wiki/Diamond-square_algorithm" target="_blank">diamond square algorithm</a>), 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.&nbsp; <br></p><p><img style="width: 527.5px;" src="https://res.cloudinary.com/drrz8xekm/image/upload/v1566403522/tzem7zpbugtlin7pzga1.png" data-filename="tzem7zpbugtlin7pzga1"><br></p><p><br></p><p>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:</p><p><br></p><p><img style="width: 527.5px;" src="https://res.cloudinary.com/drrz8xekm/image/upload/v1566403678/ou5t6pluvfoc8k3q6lpl.png" data-filename="ou5t6pluvfoc8k3q6lpl"><br></p><p><br></p><p>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.&nbsp; It seems more fun to add some hum'ies to the world.<br></p><p><br></p>
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,