Terrain generation

"To infinity and beyond!"

The terrain featured in PathCraft is infinite and consistent. It features great landscapes, complex cave networks beneath the earth, seas, foliage and, of course, clouds. The player could spawn at any location in the world and go towards a certain place, and it would be the same every time. But... if they were to change the seed in the launcher of the application, the resulting world is entierly different. What was once a desert is now a vast sea, a vein of iron ore is now gone and oceans have frozen over. How is this achieved?

Noise generators

Noise generators lie at the heart of the algorithm. They return a value that is semi-random for given coordinates, but the number always the same if the input coordinates are the same. When input coordinates lie closer together, so will the output values. As such, a coherent noise generator might be a better name for this object. They come in very different forms, such as a well known Perlin noise generator or a less famous billow noise generator. Different generators can be used in different situations. Using simple modules that combine different noise generators, one can use these generators in many different ways.

For this project, the Noise Visualization Tool (NVT) was developed. this tool features a node-like system, not unlike for example the Blueprint system used in Unreal Engine 4. Combining different noise generators and modules, a very complicated generator can be created relatively easily. The output is visible in a grayscale image.

A heavily modified version of the open-source library named libnoise was used for this project. It is a great start for your own procedural project!

Biomes

Biomes consist of various noise generators that are used to shape the world. Terrain height, materials used for the voxels, found structures and more can all be specified for each individual biome. It is relatively simple to create a new biome as a developer, and more might be added in the near future!

Biomes are grouped together using biome groups, which can be seen as climates. These groups are based on real-life biomes.

Regions

Using an infinite voronoi diagram, the entire world is separated into regions. Each region is linked with a certain biome. To assign the correct biome to each region, we use a temperature map and a humidity map, both using perlin noise, as an overlay for the entire world. Using the control points, we find the temperature and humidity that for that region, and select the correct biome group using the Biome Diagram devised by Whittaker (as seen above). The corresponding biome group then assigns a biome from its group to that region. This can be random, or also based on certain conditions.


Voronoi Diagram

A Voronoi diagram is a diagram with various control points. The diagram is subdivided into different regions, based on the closest control point per point in the diagram. As mentioned earlier, this diagram is used in multiple parts of the terrain generation. We use an infinite Voronoi diagram, using noise to generate the different control points, which allows us to look up the necessary data on the fly!

Coordinate Displacement

Coordinate displacement, also known as "Turbulence", makes straight lines curve slightly, and allows for more less synthetic-looking results.

Voxels

In this project, we work with voxels. Voxels are the three-dimensional version of pixels. This makes the terrain a lot more "blocky", but allows for easier generation. Overworld terrain, for example, can be created by obtaining the height at a certain set of coordinates and placing voxels with the appropriate material from bottom to top and caves can just be carved out by removing voxels afterwards. We do not need very complex algorithms to work sets of vertices.