Endless 2D Terrain Generator

Since I haven’t programmed in a while, in the last few days I decided to do a fast programming exercise: a generator that can make on the fly an endless 2D terrain. I created it in Unreal Engine, and made it with 3D models instead of the usual 2D ones, so it’s in so-called 2.5D.

Based on the parameters of moisture and temperature, it produces a total of nine different biomes. In each biome every material can be different, having four basic kinds of materials: the soil is sand in the hot desert, and gravel in the cold desert, while it’s dirt in the other biomes, the common rock is conglomerate only in the swamp, the walls of the caves are usually made from limestone, but not everywhere, and each biome has its special mineral found in deposits.
The surface of the ground is mostly dirt, while the deeper you go the more rock you find, leaving the depths completely rocky.
The presence of caves is influenced by biomes too, and in the hot desert you’ll find more caves than usual.
Near the water you’ll find beaches, and under the water lays a bed of clay, that becomes thicker with depth.
Some areas are mostly flat, while others can have very steep mountains, and water too can be found in small ponds or large lakes.
Every time the generator is started, it will change the average steepness of the ground, and the values that define what is average, high or low dampness or temperature, so different worlds will have more or less mountains, with different common height and steepness, and biomes will have a different distribution too, since a world can have the tendence to be hotter, or colder, drier, or damper, or more average in its characteristics.
I put in some different trees that inhabit specific biomes: there are oaks in the average forest, cedars in the hot forest, firs in the cold damp taiga, willows in the swamp, mahoganies in the jungle and palms in the hot desert.

I made some fast textures and tree models to be able to see the generator, and I’ve set the biomes to be small, for easier evaluation.

Leave a Reply