How can a game fit billions of worlds into a few numbers?
Two programmers fit a galaxy of planets, prices and names into a game without storing any of them. A single number did the work, and a flaw could trap players.
โถ Start the storyProcedural generation means making a game's content with an algorithm instead of by hand, usually by combining human-made pieces with rules and computer-generated randomness. The trick that makes it work is the seed. A map seed is a relatively short number or string used to procedurally create the game world. The same seed always gives the same world, so the world does not need to be stored: it is regenerated whenever you need it. You can even reset it or share it with another player just by sharing the seed.
The idea is older than video games. Advanced Dungeons & Dragons let a dungeon master build dungeons and terrain with random die rolls. Early computer games such as Beneath Apple Manor (1978) and Rogue (1980) did it on screen, producing dungeons randomly, and the genre was named roguelikes after Rogue.
The classic example is Elite. A single seed number is run through a fixed algorithm and produces a sequence of numbers that determine each planet's composition, including prices and even a name and description. This means no extra memory is needed to store planets, yet each is unique and fixed. Elite was originally planned to contain about 282 trillion galaxies, but the publisher feared that such a gigantic universe would cause disbelief, and eight were chosen.
Step 1: A seed
One short number
Step 2: A fixed algorithm
Run the appropriate number of times
Step 3: A sequence of numbers
Fixes position, prices, name and details
Step 4: A planet
Unique and fixed, with no extra memory
Today No Man's Sky features a universe of 18 quintillion planets, and Minecraft's 64-bit seeds allow 18 quintillion maps. The catch is that quantity is not variety. Writer Kate Compton called the risk procedural oatmeal: thousands of worlds that are mathematically different but feel the same.
18 quintillion
Quiz me
0/3
Recap
A procedural world is a recipe plus a seed, and the hard part is making the results feel different, not just be different.
๐ก A trick to remember it ยท Think of a seed as a recipe card number: the same number and the same recipe bake the same world, but a new recipe changes the bake.
Surprising fact ยท A seed only works with the version of the algorithm that made it, so changing the recipe changes the world.
Connects to
- ๐ป How do Pac-Man's ghosts hunt you without being very smart?
- โฑ๏ธ How do speedrunners turn a game's glitches into a sport?
- ๐ Why is opening a loot box so hard to stop?
- Deterministic system
- Pseudorandom number generator
Sources (2)
No source, no claim. Every fact in this lesson (16 claims) cites at least one of these.