Skip to content

Overworld Terrain ​

The generation described in this section will explain how Minecraft Beta 1.7.3 does its Overworld Terrain Generation. A lot of this will be based on educated guesses and the decompilation provided by RetroMCP. Additionally, certain historical bits and pieces will be taken from the Minecraft Wiki.

NOTE

The seed used throughout all of these comparisons is 3257840388504953787, the seed behind pack.png.

NOTE

In any visualizations, the shown chunks range from -1,-1 to 1,1. Additionally, up is always towards Negative Z, while right is always towards Positive X.

WARNING

This page is undergoing a large rewrite! For that reason, some info may be missing, even if it was once here before!

Initialization ​

Before any terrain generation can happen, the generator needs to be initialized in a very specific order. This is due to all of the noise generators relying on a shared PRNG for generating their permutation table. This is where the world seed is fed in.

Noise Generators ​

The overworld generator makes use of two types of noise generator: Perlin noise and Simplex noise. The perlin noise generators are used for terrain, while the simplex noise generators are used for climate and biome generation.

Terrain noises ​

8 Octaved Perlin Noise Generators are used by the overworld generator for the terrain. Due to needing to be initilaized by a shared PRNG object, their order is presented in the order they're seeded in.

GeneratorOctaves
Low Noise16
High Noise16
Selector Noise8
Sand & Gravel Noise4
Stone Noise4
Continentalness10
Depth Noise16
Tree Density8

MISSING

Where does 684.412 come from?? Find a source on this!

The best theory we have right now is

684.412=4×215×0.005221649073064327

Where 4 is the horizontal spacing between blocks (due to the 14 scale), 215 is the frequency multiplier of the 16th octave, and 0.005221649073064327 is the base noise frequency.

LowHighSelectorContinentalDepth
Low noiseHigh noiseSelector noiseContinentalness noiseDepth noise

Colors adjusted be more visible.

Continentalness and depth are 2D, while low, high and selector noise are 3D. As a result, only the lowest slice of each is shown here. Tree density is 2D as well, but only used during the population stage for trees.

Chunk Generation Pipeline ​

After the generator has been initialized, chunks are generated in a few discrete steps.

  1. Generate the Biomes
  2. Determine the initial terrain density
  3. Turn the terrain density into the base terrain
  4. Replace surface blocks with biome-dependent ones
  5. Carve caves into the terrain

Biome Generation ​

To find out more about what biomes exist and how they're defined, check out the biomes page.

This process uses 3 octaved Simplex Noise generators called Temperature, Humidity and Weirdness. This process is described here.

TemperatureHumidityWeirdness
Temperature mapHumidity mapWeirdness map

Temperature, humidity and weirdness values after being modified by this function. These values are in the 0.0 - 2.0 range.

With this a 16x16 Biome Array is generated, where any block column can contain any of the 13 Biomes.

Foliage ColorsMap Colors
Biomes with foliage colorsBiomes with map colors

Biomes colored as per the biomes page.

Terrain Density ​

The terrain density is used to determine where solid terrain blocks are placed, primarily stone. It provides the base terrain that later generation stages build ontop of.

Constants ​

Before we get started, we must discuss some of the relevant constants for this section.

Firstly, the maximum x, y and z values. Our noises are sampled at a reduced resolution, so the max bounds for the area is calculated as follows.

Xmax,Zmax=ChunkWidth4+1Ymax=ChunkHeight8+1

For the default chunk size of 16x128x16, this results in 5 for the horizontal axis and 17 for the vertical one.

Ywater is the global water level, which is 64 by default.

Chumi and Ctemp are the humidity and temperature values that were generated in the Biome generation step at the current X,Z coordinate. Same goes for Ncont and Ndepth, which are the continentalness and depth values of the current X,Z coordinate.

2D Noises ​

The following logic is iterated over along the X and Z axes. It's responsible for sampling the 2D noises, normalizing and combining them.

  1. Put temperature and humditiy together
h=1−(1−Chumi⋅Ctemp)4
  1. Normalize the contientalness values, apply the new humidity value, then clamp into the range 0.0 to 1.0, then offset by 0.5.
Cnorm=0.5+clamp(Ncont+256512⋅h,0,1)
  1. Calculate the depth values
d0=Ndepth8000d1={−0.3⋅d0d0<0d0d0≥0d2=3⋅d1−2d3={clamp(d2,−1,0)5.6d2<0min(d2,1)8d2≥0
  1. Force continentalness to 0.0 if depth is negative.
Cnorm={0d2<0Cnormd2≥0

This leaves the continentalness in a range of 0.5 to 1.5, unless a negative depth forces it to 0.0. This is the bit of math that prevents monoliths from happening.

  1. Calculate the base terrain height
Ybase=Ymax2+Ymax4d3

3D Noises ​

After this follow the 3D noises. These are iterated over bottom to top, inside of the above X,Z ordered iteration. y obviously represents the current vertical coordinate. Nlow, Nhigh and Nselector are our current Low, High and Selector noise samples. ρ represents our final terrain density.

  1. Combine our previously calculated values
d0=12(y−Ybase)Cnorm
  1. If they turn out negative, multiply by 4.0
d={4⋅d0d0<0d0d0≥0
  1. Normalize our low, high and selector noise samples
l=Nlow512h=Nhigh512s=Nselector/10+12
  1. Linearly interpolate (lerp) between the low and high noise in the places where the selector noise transitions between 0.0 and 1.0
t={ls<0hs>1l+(h−l)⋅s0≤s≤1
  1. Subtract the density offset
ρ=t−d
  1. Fade the terrain towards the world ceiling
ρ(y)={ρy≤Ymax−4ρ(1−f)−10⋅fy>Ymax−4

The result of this is placed into our 5x17x5 array of 64-bit floating point values.

Base Terrain ​

The base terrain density is initially determined using trillinear interpolated samples of our low-quality terrain density, iterating over the full 16x128x16 volume.

This gives us an upscaled set of values we can determine our base terrain with.

  1. Any block below the water level (Ywater), is water. Water blocks at the water surface (Ywater−1) can become ice, if the temperature (Ctemp) of the column is less than 0.5
Bfinal={Watery<YwaterAiry≥YwaterBfinal={Icey<(Ywater−1)∧Ctemp<0.5Air/Waterotherwise
  1. If the current interpolated density sample (ρi) is greater than 0.0, stone will be placed there
Bfinal={Stoneρi>0Air/Water/Iceρi≤0
  1. All other blocks default to being air
TerrainTerrain (water)
Terrain mapTerrain map with water level

Highest stone blocks. Color values have been tweaked to be more readable. Blocks at or below water level are marked in blue.

Biome Surface Blocks ​

MISSING

TODO: The following still contains code!

After the terrain shape has been generated, the chunk is transformed further by the Sand, Gravel and Stone Perlin Noise Generators.

GeneratorOctavesScale
Sand & Gravel Noise (Sand)4(1/32, 1/32, 1.0)
Sand & Gravel Noise (Gravel)4(1/32, 1.0, 1/32)
Stone Noise4(1/16, 1/16, 1/16)
SandGravelStone
Sand noiseGravel noiseStone noise

Sand, Gravel and Stone noise. Color values have been tweaked to be more readable.

X-Z Logic ​

The chunk is now iterated over in x-z order.

  1. The biome for the specified column is read (Cbiome)
  2. Its checked if sand is possible to be placed here (Asand)
Asand=Nsand+Rdouble⋅0.2>0
  1. Its checked if gravel is possible to be placed here (Agravel)
Agravel=Ngravel+Rdouble⋅0.2>3.0
  1. An integer is generated for if stone can be placed here (Astone)
Astone=Nstone3+3+(Rdouble⋅0.25)
  1. The biomes appropriate top (Btop) and filler (Bfiller) block is chosen (e.g. Grass and Dirt)

Y Logic ​

For this the current block column is iterated over from top to bottom, from 127 down to 0. Bblock is the current block value.

  1. Check if bedrock can be placed. This utilizes a number from the Java PRNG (R) between 0 and 4.
y≤Rint(5)

If bedrock gets placed, we just continue on to the next y value.

  1. If the current block (Bblock) is air, set Dstone to -1.0, and continue onto the next y value.
Dstone={−1Bblock=AirDstoneBblock≠Air
  1. If the current block (Bblock) is not stone, continue onto the next y value.

  2. From here, the chosen behavior splits based on whether the stone depth (Dstone) is -1 or greater than 0. If neither are true (Dstone=0), continue onto the next y value.

Dstone>0: ​
Dstone=Dstone−1Bfinal=Bfiller(Dstone,Bfiller)={(Rint(4),Sandstone)Dstone=0∧Bfiller=Sand(Dstone,Bfiller)otherwise

Then we continue onto the next y value.

Dstone=−1: ​
  1. Top and filler selection is done based on stone noise. This is also where erosions are generated.
(Btop,Bfiller)={(Air,Stone)Astone≤0(Btopbiome,Bfillerbiome)Astone>0∧Ywater−4≤y≤Ywater+1(Btop,Bfiller)otherwise
  1. Surface sand and Gravel placements are deteremined
(Btop,Bfiller)={(Air,Gravel)Agravel(Btop,Bfiller)otherwise(Btop,Bfiller)←{(Sand,Sand)Asand(Btop,Bfiller)otherwise
  1. Further water placements are determined
Btop={Watery<Ywater∧Btop=AirBtopotherwisef
  1. Lastly, the top and filler blocks are placed
Dstone=AstoneB(y)={Btopy≥Ywater−1Bfillery<Ywater−1

This finishes up the initial biome-based block layers.

Cave carving ​

See the cave generation wiki page

After this, the lighting is updated and the heightmap is generated.

Heightmap ​

The initial heightmap generation boils down to iterating through every xz coordinate, from the top to the bottom, and stopping if any block with an Opacity that isn't 0 is run into. Additionally, it keeps track of the lowest block height it has encountered up to that point.

Population ​

Continue onto the population page to find out more.

Further reading ​

History ​

The first version to have the Beta-era generator was Alpha 1.2.0, and it was used up until Beta 1.7.3.

However, we can see that the general shape of the terrain remains the same by using the same seed and spawn location in Alpha 1.1.2 (pre-rework), Alpha 1.2.3 (post-rework) and Beta 1.7.3.

A1.1.2A1.2.3

This similar pre-1.2.0 generation dates all the way back to Infdev 20100624, before which the world generation looked entirely different.

Inf20100624A1.1.2

Facing the other way reveals some of the more glaring differences between the generators.

A1.1.2A1.2.3

Between Alpha 1.2.3 and Beta 1.7.3 there only exist minor differences, mainly relating to the feature generation.

A1.2.3B1.7.3