Procedural Terrain Generation with Perlin Noise

simulator intermediate ~10 min
Loading simulation...
4-octave Perlin terrain — 35% water coverage

A 4-octave Perlin noise terrain with 0.5 persistence generates naturalistic landscapes with broad hills and fine surface detail. At 35% water level, continents form with coastal regions and inland elevation variety.

Formula

noise(x,y) = Σ(i=0 to octaves-1) persistence^i × perlin(x × frequency × lacunarity^i, y × frequency × lacunarity^i)
elevation = (noise(x,y) + 1) / 2 (normalized to 0–1)

Infinite Worlds from a Single Equation

In 1983, Ken Perlin was working on the original Tron film and needed a way to generate realistic textures procedurally. His solution — Perlin noise — would go on to win an Academy Award for Technical Achievement and become the foundation of procedural content generation in games, films, and simulations. The core idea is elegantly simple: interpolate between random gradient vectors on a grid to produce smooth, continuous noise.

Layering Octaves for Realism

A single layer of Perlin noise looks like smooth rolling hills — too uniform for realistic terrain. The breakthrough comes from layering multiple octaves at increasing frequencies and decreasing amplitudes. The first octave (low frequency, high amplitude) defines continents and mountain ranges. Each subsequent octave adds finer detail: hills, ridges, surface roughness. The persistence parameter controls how quickly each octave fades, and lacunarity controls how quickly frequency increases.

From Noise to Worlds

Real game terrain generation goes beyond raw height values. The noise output is mapped to biomes using elevation and moisture thresholds: low elevation below water level becomes ocean, low elevation above water becomes beach, mid-elevation becomes forest or grassland, and peaks become mountain or snow. This simulator generates a 2D heightmap and applies basic biome coloring so you can see how parameter changes reshape the landscape.

The Power of Seeds

Every procedural world begins with a seed — a number that initializes the pseudo-random number generator. The same seed always produces the same terrain, which is how games like Minecraft let players share world seeds. Change the seed and you get an entirely new landscape. This deterministic property is essential: it means infinite content that can be regenerated on demand without storing any data.

FAQ

What is Perlin noise and why is it used in games?

Perlin noise is a gradient noise algorithm invented by Ken Perlin in 1983. Unlike random noise (which looks like TV static), Perlin noise produces smooth, continuous values that create natural-looking patterns. It's used to generate terrain, clouds, textures, and any content that needs to look organic without being hand-crafted.

What are octaves in procedural generation?

Octaves are layers of noise at increasing frequencies. The first octave creates broad landforms (continents), the second adds hills, the third adds ridges, and so on. Each octave doubles the frequency and reduces the amplitude by the persistence factor. Combining 4–8 octaves produces terrain with both large-scale and fine detail.

How does Minecraft generate its worlds?

Minecraft uses multiple layers of Perlin/Simplex noise: one for base terrain height, another for cave systems, others for biome distribution, temperature, and humidity. The seed number initializes the noise function, ensuring the same seed always generates the same world — that's why seeds can be shared.

What is the difference between Perlin noise and Simplex noise?

Simplex noise, also by Ken Perlin, is an improved version that works better in higher dimensions and has fewer directional artifacts. Perlin noise uses a square grid; Simplex uses a simplex (triangle in 2D). Modern engines often use Simplex or OpenSimplex, but the term 'Perlin noise' is commonly used as a generic term.

Sources

Embed

<iframe src="https://homo-deus.com/lab/game-design/procedural-generation/embed" width="100%" height="400" frameborder="0"></iframe>
View source on GitHub