Experiment: Procedural Terrain

During my free time I have been experimenting with procedural terrain. The following is a tech demo of a landscape which is completely procedurally generated, on the fly, at runtime, while the player moves through it.

To accomplish this I first developed a system for dynamically loading and unloading terrain tiles near the player. Next I set out to enable different sources for loading these terrain pieces, including a procedural one. The procedural terrain generator uses a graph of noise modules and modifiers to generate the terrain height data using the Libnoise library. Following that, the terrain painter paints the terrain with several splatmaps depending on both elevation and slope. The resulting data is used on multiple unity terrain objects.

Unfortunately the height data function created by the node graph for creating a realistic landscape is quite intensive, so the frame rate drops dramatically during generation of new tiles. This shouldn’t be a problem for use cases where the player traverses the terrain slowly and thus this hiccup happens infrequently. For cases like flight simulators, a lower terrain resolution or a height function of reduced complexity might do the trick. Another approach is to do height generation on the GPU though this is quite a bit more difficult as it requires different methods of generating perlin and fractal noise, and they may not work on all target platforms.

I might revisit some of this if I happen to think of a game idea where a system like this would be appropriate. For now, it was just an experiment, nothing more, nothing less.