What Is Procedural Generation? From Rogue to Minecraft and No Man's Sky
The principles and history of procedural generation, where rules and random numbers rather than people build game maps and items, told through Rogue, Elite, Minecraft, No Man's Sky and the Wave Function Collapse algorithm.
Every new Minecraft world has different mountains and seas, and in a roguelike the dungeon changes shape each time you die. Nobody drew that terrain or those dungeons by hand. They were produced on the spot by rules the developers wrote and by random numbers. This approach is called procedural generation.
This article explains what procedural generation is, why it first appeared, and which games, from Rogue to No Man's Sky, opened new frontiers with it. At the end, we look at its limits and how to use it well.
The basic principle of procedural generation
Procedural generation means "storing the method that makes the result instead of storing the result itself." It has three key ingredients.
- Rules: constraints such as "rooms must connect through corridors" or "water collects in low places."
- Random number generator: produces the random numbers that decide which choice to make within the rules.
- Seed: the starting number of the random number generator. Computer randomness is really a fixed calculation, so the same seed always gives the same result.
Thanks to seeds, procedural generation can build worlds that are "random yet reproducible." That is why Minecraft players share the seed numbers of worlds they like.
On the other hand, if a game uses fresh random numbers every time instead of a fixed seed, each player gets a completely different run of the same game. Some games mix the two: they generate runs randomly most of the time, and hand everyone the same seed only when a fair comparison is needed, as in tournaments or daily challenges.
Generation can happen the moment the game runs, or ahead of time during development. The first gives a new world every time you play but cannot be checked by hand; the second lets people pick the best generated results and polish them. A lot of procedural generation, like the placement of trees and rocks in large open-world games, works as a development tool in places players never notice.
A technique born from lack of memory: Rogue and Elite
Procedural generation first drew attention not for spectacle but for saving space.
Rogue, made around 1980 by Michael Toy and Glenn Wichman for Unix computers, created its dungeon levels, monsters and treasure anew every game. Because no two games were the same, it stayed fresh no matter how many times you played, and its name became the genre name "roguelike."
Elite, the space trading game released for the BBC Micro in 1984 by David Braben and Ian Bell, is an even more dramatic example. The game had eight galaxies with 256 planets each, but there was no way to store all that information in the small memory of an 8-bit computer. Instead, a single seed number was fed repeatedly through a fixed calculation to produce each planet's position, name and economy on the fly.
.kkrieger, a first-person shooter made in 2004 by the German demo group .theprodukkt, pushed the idea to the extreme. By storing every texture and model as generation rules, it won first place in a competition with a 96 KB size limit.
The math that builds terrain: Perlin noise
Plain random numbers are not enough for natural-looking mountains and clouds. Lining up numbers with no relation to their neighbors only produces something like TV static.
After working on the film Tron (1982), Ken Perlin devised a kind of noise whose values change smoothly between nearby points. Published in a 1985 paper, this "Perlin noise" became a basic tool for creating natural textures in computer graphics, and in 1997 Perlin received an Academy Award for Technical Achievement for it.
Layering noise at several scales produces terrain with small hills and rocks sitting on top of large mountain ranges. Terrain generation in Minecraft and countless other games builds on noise techniques like this.
What can be generated
Procedural generation is not used only for terrain and dungeons. The method changes depending on what is being generated.
- Terrain and maps: noise decides the elevation, and biomes such as water, forest and desert are laid on top.
- Dungeons and levels: rooms and corridors are placed, and the generator checks that a path connects the start to the exit.
- Items: random stats, prefixes and suffixes are attached to base weapons to create huge numbers of combinations.
- Plants and buildings: techniques like the L-system, devised by biologist Aristid Lindenmayer in 1968, repeat simple symbol-replacement rules to grow branching shapes.
- History and stories: Dwarf Fortress, released in 2006 by brothers Tarn and Zach Adams, generates centuries of civilizations, wars and personal histories along with the world itself.
In games that generate even their stories, the developers cannot know the results in advance. The fact that what a player experiences becomes their own story is one of procedural generation's greatest attractions.
Generation that gives you a reason to play again: Diablo and roguelites
Procedural generation soon became a device for "making you play again."
| Game | Year | What it generates |
|---|---|---|
| Diablo | 1996 | Dungeon layouts and items |
| Spelunky | 2008 | Cave layouts (combining pre-built room pieces) |
| Borderlands | 2009 | Gun stats and parts |
| Minecraft | 2009 (first public release) | All terrain, caves and ores |
Derek Yu's Spelunky is a good model. Instead of pure randomness, it connected room pieces designed in advance by people according to rules, guaranteeing that there was always a path to the end. This approach, combining hand-made quality with generated variety, became a basic technique widely used in later roguelite games such as Hades.
18 quintillion planets: No Man's Sky
Hello Games' No Man's Sky (2016) grew Elite's idea with modern technology. It builds the entire universe from a single 64-bit seed with deterministic algorithms, resulting in more than 18 quintillion (1.8×10¹⁹) planets. Each planet gets its own terrain, weather, plants and animals.
The game showed both the potential and the limits of procedural generation. At launch it was criticized because planets looked different but offered similar things to do. Over years of updates it added hand-crafted content such as base building and multiplayer, and its reputation rose dramatically. The lesson: "endlessly many" is not the same as "endlessly fun."
Wave Function Collapse: learning rules from examples
The Wave Function Collapse (WFC) algorithm, released by Maxim Gumin in 2016, started a new trend. Give it a small sample image or a set of tiles, and it extracts rules about which pieces can sit next to which, then produces a larger result with a similar feel.
The algorithm has been used for island generation in Bad North, a strategy game about defending against Viking raids; in Townscaper, a toy-like game for building towns; and for level generation in the roguelike Caves of Qud. Its advantage is that developers can steer the output with examples of the mood they want, without writing every rule in code.
How to use procedural generation well
Procedural generation is not a cure-all. Used badly, it produces a boring world where "everywhere feels the same." Successful games have a few things in common.
- Mix it with hand-made pieces: as in Spelunky, combining designed pieces with generation rules keeps quality stable.
- Always check that it can be beaten: verify by program that each generated map has a path to the exit.
- Make differences that matter: differences that change how you play stay in memory longer than planets that differ only in color.
- Use seeds: "daily challenges," in which everyone shares the same seed and competes on the same map, are used by many roguelikes and puzzle games.
The smaller the team, the bigger the appeal of procedural generation. If it is hard for people to build hundreds of levels by hand, one good set of rules can provide endlessly new runs. Refining those rules, however, takes as much time and testing as building things by hand.