Home
Miles Oram | Game Development Portfolio_
Procedural Terrain in Unreal Engine

PROCEDURAL TERRAIN GENERATION - UNREAL ENGINE

Project Overview

This project demonstrates the implementation of multi-threaded procedural terrain generation in Unreal Engine. The plugin generates diverse landscapes with adjustable parameters, using Procedural Mesh Components for a tile-based terrain in-editor and Hierarchical Instanced Static Mesh Components for foliage at runtime.

Terrain Generation

The terrain is created using a grid of tiles and procedural mesh components. By using Perlin noise and various tuneable parameters, you can create a wide range of procedural terrains. Configurations include:

Varying Terrain Texture with Height

The terrain material varies with height and each texture is lerped accordingly to appropriately blend textures at boundaries. Heights for material boundaries can be varied in the tool settings, as can the size of the height bands over which it transitions. Textures can be swapped out easily for producing different landscapes/biomes. With the current setup, the number of textures it can lerp is limited by the colour channels in the Vertex Colour but is otherwise simple to change.

Procedural Foliage Generation and Distribution

The foliage generation system uses HISM Components for efficient rendering of vegetation across the terrain. Foliage placement is determined procedurally based on tile location. The system supports multiple foliage types, each with customisable properties such as scale, radius, and growth curves. It checks for overlaps and adjusts growth based on proximity to other plants. This creates natural-looking distributions where smaller plants can co-exist near larger ones.

The foliage generation process uses FRunnable to create threads to concurrently create vegetation. You can easily swap out foliage types and adjust parameters to create varied biomes or landscapes. The current setup allows for a lot of customisation but could be improved to allow more precise control over foliage distribution.

Conclusion

This project deepened my understanding of procedural generation techniques and multi-threading in Unreal Engine. I also gained experience with UProperties and the reflection system, as well as general UE code conventions.