Level building – A new approach

A few weeks ago I had a major rethink about how I wanted to create the levels that you explore and build constructions in.  Originally I had planned to have pre-made terrains, that were carefully crafted with obstacles to overcome, and set locations where things were placed.  I came to the realisation that this was going to be far too much work for me to take on, and would result in limited replayablity.  So I decided to sacrifice the crafted set pieces and move to a procedural approach.

Procedural terrain generation

Over the last couple of weeks I’ve implemented a basic procedural terrain generator, that always generates an island (giving a natural boundary to the playable area).  It generates a height map by taking a cone shape with fractal turbulence applied to form the basis of the island, then modulating it with fractal ridge noise to give the mountains and rocky ridges.  Then, based on elevation and surface slope, an alpha map is generated (this is used to blend between the various terrain textures, sand, dirt, rock etc.)  These maps are then plugged into a Unity terrain for rendering.  I’ve also added some water, using a modified version of the Unity water shader, which provides a nice visual boundary to the edge of the island.  You can see the results so far in the images above.

There is still more to do to improve the height map generation, namely I need to ensure there are more relatively level areas for the player to build constructions on, and also it would be nice to break up some of the more obvious ridge lines (by adding more noise perhaps).

Same goes for the alpha map generation, I need to add more terrain texture types for variety and to break up the often noticeable texture tiling.  Also, I want to procedurally place rocks, vegetation and trees to add more interest to the environment.

Final thoughts

In addition to the terrain itself, I’m thinking of trying a procedural / emergent approach for other aspects of the gameplay.  Perhaps the things you might encounter as you explore the island…

On that mysterious note, I’ll sign off and hopefully update soon with some gameplay news.  In the meantime, check out the new terrains in the web-player build at the usual link: https://dl.dropboxusercontent.com/u/157530041/WebPlayer.html.