miuradio
How It SpawnsThe tricks inside famous games, shown running.›

How It Spawns

How do random numbers make a cliff? Since 1.18, the answer is a curve.

Premieres today. Follow to see it first.

Story

In Minecraft Java Edition 1.18 (2021) the team set out to build big mountains. Every spot on the map gets a smooth random number from minus one to one: the noise. Make that number the height and you get rolling hills that, after a while, all look the same. Henrik Kniberg, who worked on Minecraft's world generation, says it was missing cliffs, plateaus and mountain ridges: "where is the drama". Turning the noise up doesn't fix it: bigger lumps, steeper everywhere, still no cliff and no flat top. Smooth numbers make smooth ground.

So 1.18 doesn't change the noise. It bends what the noise means. Between the number and the height sits a curve, set point by point; in Kniberg's words, "we ended up using spline points for that". In his own simplified example the height climbs gently from 50 to 100 between minus one and 0.3, then from 0.3 to 0.4 it shoots up to 150 and stays there. Same smooth noise, and now there are cliffs with flat tops. In our rebuild, turning the noise up took the steepest step from 3 blocks to 6; the bent curve made it 16, with level ground on top.

The real curve reads three noises: continentalness (how far inland), erosion (how worn down) and peaks and valleys, and mountain ridges rise where all three agree. In 1.18's files we count 201 points in the height curve alone, and two more curves set how flat and how jagged the land gets (factor and jaggedness). Kniberg: "we've spent a lot of time fine-tuning these spline points". Today's data still starts it the same way.

The island in this film is our own simplified version, built in code: our own noise, Kniberg's example curve (his numbers, labelled as his) and our own three-noise curves shaped like the 1.18 data, not Mojang's numbers.

What's the best cliff you've ever spawned next to?

Sources: Henrik Kniberg, "Minecraft terrain generation in a nutshell" (video, 6 February 2022); Minecraft Java Edition 1.17.1, 1.18, 1.18.2 and 26.4 Snapshot 4 worldgen data.
Not an official Minecraft video. Not approved by or associated with Mojang or Microsoft.

Link copied