The b(ack)log

Every man (and woman) should have an island. Or at least that is what I think!

The idea came from a few places, first – at a modelling and simulation conference someone gave a talk about an island created by NATO to use with training simulations.

Second, I read about a game, The Wittness, that is set entirely on a single Island. Maybe games like Myst and Riven, My Min City and a bunch of others also had an influence.

And thirdly, the concept of procedurally generating terrain, islands and even complete planets and environments intrigues me.

I started by playing around in blender and after some unsatisfying results I took a step back. Direct manipulation is nice, but I also want to create something generative.

isla-falta

I started by drawing a more map like island using Inkscape, below is the result:

isla-falta-map

After this I exported the map to gimp and played with the raster image a little:

isla-falta-hm-1024-918

This feels like it is getting somewhere. I can imagine seeing the map displayed somewhere and the heightmap looks nice, but the actual terrain is rather bland and when you look at it closely it is very artificial.

falta-render

Next step, start writing code!

I decided to experiment with the diamond square algorithm. It can be used to generate terrains that are semi realistic and it is also possible to seed to algorithm to give some shape to the result! I implemented two flawed versions of the algorithm, one vanilla version and one seeded version. The image below shows the output from the different implementations. The code is written in python and lives in github.

combined-small

And this is where I’m at at the moment. The heightmap can be used to generate a 2.5D terrain that looks somewhat realistic. It still feels artificial, the peaks doesn’t look that great and the resolution of the heightmap is static, but it’s getting better!

falta-render-2

So what is next? I’m working on a WebGL version, just so that it can all happen in your browser. Creation of the seed image will still be up to you. Next I would like to consider implementing a dynamic level of detail (LOD) algorithm that can keep on generating realistic terrain when you get closer. Then there are texturing, foliage, etc.

And that’s all for now.