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

How It Spawns

How did Rogue build a brand new dungeon every time you played? It plays tic-tac-toe.

Story

Roguelikes are named after one game: Rogue, from 1980, by Michael Toy and Glenn Wichman, later with Ken Arnold. Most adventure games then were "canned", Wichman wrote, the same every time, so they decided the program itself should build the dungeon.

Drop rooms anywhere and they crash into each other, and some have no way in. In Rogue's code (version 5.4), the 80 x 24 screen is cut into a three by three board. Each square gets one room, random in size and spot but never outside its square, and up to three squares stay empty, just a spot the tunnels pass through. Then the tunnels: from a random room, dig to a neighbor that isn't joined yet, again and again until all nine are in, so every room can be reached. Then up to four extra tunnels, "so that there isn't always just one unique passage through it", as a comment in the code says.

The dungeons in this film are our own run of Rogue 5.4's rules, built in code; the crashing rooms are our own naive version. Not affiliated with or endorsed by the makers of Rogue.

Which game's level generator should we open up next?

Sources: Rogue 5.4.4 source code, rooms.c and passages.c (Michael Toy, Ken Arnold and Glenn Wichman, BSD licence). Glenn R. Wichman, "A Brief History of Rogue", 1997.
Sounds: our own, made in code.

Follow

TikTok@howitspawns›Instagram@howitspawns›YouTube@howitspawns›X@howitspawns›
Link copied