How Minecraft generates Worlds you want to explore
Minecraft strikes an impressive balance in its world design. From towering mountains to a diverse cast of biomes, today let's dive into the generation of a Minecraft world.
Terrain Shaping
Minecraft creates worlds through a process called Procedural Generation. These are systems which create content by following a set of rules and instructions.
Perlin Noise
In Minecraft, the first step is to shape the world’s terrain. To do this the game uses a technique called Perlin Noise. This is a type of randomness like the White Noise you might see on an old TV. Perlin Noise however creates a smooth gradient between its high values (shown as white) and low values.
Let’s see what happens if we use these values to generate our terrain. This looks pretty decent. However, sure it’s random but everywhere kind of feels the same. Not to mention the unnatural smoothness of the terrain. So, Minecraft builds on Perlin Noise with two more additions.
Fractal Noise
First, the game adds more detail to the noise. We do this by adding layers of Perlin Noise on top of each other. In this method, known as Fractal Noise, each new layer will add finer and finer details but also contribute less to the overall Noise Map.
We see a massive improvement doing this and can already get some pretty interesting terrain. It’s no longer super smooth like standard Perlin Noise, giving us a more realistic rough look. Now we can address the second issue: the lack of variety in the terrain.
Multi-Noise
Mojang’s solution to this comes in the form of three separate Fractal Noise Maps named: Continentalness, Erosion and Peaks & Valleys. Each one represents different characteristics in the world. For example, Continentalness could be thought of as how inland a part of the world is, whilst Erosion describes how flat an area will be. It’s important to note, that these names are only a hint at how each Noise Map influences the terrain, not explicit gameplay mechanics. Let’s look at how Minecraft blends these together to create more dramatic terrain!
Combined these Noise Maps determine the height of terrain across the world. To blend these together the developers use curves known as Splines. Splines control how we convert the values from the Noise Maps to Terrain Height. The smoothness of Perlin Noise can make it difficult to add dramatic terrain. So splines allow us to add steep changes in elevation.
By mixing different splines and the three noise maps together Minecraft creates a fantastic mix of terrain types. Let’s see how these interactions could play out in practice.
An area with high Continentalness, low Erosion and high Peaks & Valleys might have massive, steep-sided mountains.
Whereas an area with high erosion will likely be very flat.
Terrain Variance
In Minecraft, it’s important that there’s a variety of terrain types near spawn that can cater for any player. Where one person may want to build at the peak of a mountain another might be looking for an expanse of flat land. Minecraft’s generation strikes an impressive balance of terrain “drama“ and consistency.
3D Noise
There’s one more technique Minecraft uses for Terrain Shaping, 3D Noise. So far we’ve only looked at 2D Noise. This is great for determining terrain height, with landforms like hills or valleys. But what about Minecraft's iconic overhangs, arches and floating islands? With 2D noise these are impossible.
As a result, Minecraft uses a small amount of 3D Noise to add even more variety to the world. This is done, by carving out parts of the terrain based on altitude and the three Noise Maps. Allowing for the bizarre landforms, Minecraft has become famous for.
Biome Mapping
Ok, so we’ve got a beautifully carved world with huge mountains, deep valleys and vast plateaus. Let’s start decorating it with Biome Mapping.
More Noise Maps
A biome is a region in a world with distinct geographical features. What biome an area receives is based on five main factors. The first three are once again: Continentalness, Erosion and Peaks & Valleys. Followed by two new Noise Maps: Temperature and Humidity. Like before, these are only used to guide the world generation and act as a metaphor rather than representing any real gameplay systems.
Biome Placement
To choose an area’s biome Minecraft uses a Table-like system. I suspect the game begins by categorising each area by its Continentalness and Erosion. From here the game is able to use the Temperature and Humidity values to pick a specific biome.
This is likely an extreme oversimplification, with more complex systems at play under the hood.
For some biomes a further sixth Noise Map is used, Weirdness. This as you might guess, is just another layer of variance. When weirdness is high enough certain Biome variations will be spawned such as Bamboo Jungles or Ice Spikes.
A large portion of this article was based on Henrik Kniberg’s talks and explainer videos. So, if you found this interesting check out his work here.
And that’s everything, thanks for reading this first instalment of Design with Dawnosar. Until the next one!