How to Make a Roguelike Game
A roguelike is a promise that the next run will be different. Here is how to structure runs, generate rooms that are always fair, and make death feel like progress.

Key takeaways
- Structure the run first: how many floors, rooms per floor, where the boss sits, and how long a winning run takes.
- Generate floors by stitching hand-made room templates onto a graph, with a seeded random generator so runs can be replayed and shared.
- Meta-progression should widen the player’s options (new items, characters, starting choices), not only make them stronger.
A roguelike is a game made of runs: each run generates a new layout, the player collects items that change how they play, and death ends the run. To make one, design the run structure first (floors, rooms, bosses, length), then build a generator that assembles floors from hand-made room templates, then an item pool with synergies, and finally a light meta-progression that gives each death some value. Here is how each piece works and what to put in your brief.
Roguelike or roguelite?
Purists reserve “roguelike” for turn-based, grid-based games with permadeath like the original Rogue or Brogue. Most people searching for it mean what is often called a roguelite: real-time action (Hades, The Binding of Isaac, Dead Cells) or card-based runs, with some persistent unlocks between runs. Both share the core: procedural runs and permanent death of the run. Decide which you want, because turn-based games are far more forgiving to build and play on phones, while real-time ones need tight controls.
Design the run on one page
Before any generation code, write the run as a skeleton. A good first scope:
- Length: a winning run takes 20 to 30 minutes. A losing run ends anywhere, often in the first 5.
- Floors: 3 floors, each ending in a boss. A short game with a beatable final boss beats a long one nobody finishes.
- Rooms per floor: 8 to 12, including one start room, one boss room, one treasure room, one shop and the rest combat.
- Rewards: clearing a combat room gives a chance at a pickup; treasure rooms give an item; bosses give a guaranteed item and heal.
- Difficulty: enemy health and damage step up per floor, and the enemy pool shifts toward harder types.
This skeleton is a data file, not code: floors, room counts, room types, enemy pools per floor. Changing the shape of a run later is then a matter of editing numbers.
Procedural rooms that are always fair
Fully random layouts (noise, cellular automata, random walks) are great for caves and terrible for fair combat. Most action roguelikes use hand-made room templates placed procedurally: you design 20 to 40 rooms by hand, and the generator decides which ones appear, where, and in what order.
A simple, reliable floor generator
- 01Start from a room on a grid. Grow the floor by repeatedly picking an existing room and adding a neighbor in a free direction, until you have the target count.
- 02Place the boss room at the dead end farthest from the start (measured in steps, by breadth-first search), so the player has to explore.
- 03Place the treasure room and shop at other dead ends.
- 04For each remaining cell, pick a combat room template that fits its doors (a room with doors north and east needs a template with those exits) and the floor’s difficulty.
- 05Fill each room’s enemy spawn points from the floor’s enemy pool.
This is roughly how The Binding of Isaac’s floors behave, and it guarantees two things random caves cannot: every room is reachable, and every room was designed by a person who tested it. On Startbase you can lay out room templates by hand as levels in the World Editor, with walls and door gaps from the building blocks, then ask the agent to load those levels as the template pool.
Seeds: randomness you can replay
Use a seeded random number generator (a small one like mulberry32 is fine) rather than `Math.random`. The same seed must always produce the same floor. Two good habits: show the seed on the death screen so players can share a run, and use separate random streams for the map, the loot and combat. Otherwise opening a chest in room 2 changes the layout of floor 3, and seeded runs stop being comparable. A daily run (everyone gets today’s seed) is then almost free. The procedural generation basics guide covers seeds and room templates in more detail.
Items and synergies
Items are why people replay roguelikes. The best ones change how you play, not just a number. Some guidelines:
- Start with 30 to 40 items. Roughly half simple stat changes, half behavior changes (shots split in three, dashing leaves fire, enemies drop bombs).
- Rarity by weight: common, uncommon, rare with weights like 70, 25, 5. Remove an item from the pool once the player has it.
- Tags for synergy: give items tags (fire, projectile, dash, poison). Items that refer to a tag (“fire damage spreads on kill”) create combos players discover themselves.
- Describe effects as data: each item is a list of effects such as `{on: hit, do: ignite, chance: 0.2}`. It keeps items consistent and lets the agent add new ones without rewriting combat.
- Readable text: one line per item, with numbers. “+20% damage” beats “Feel stronger”.
Permadeath with meta-progression
Permadeath gives every run stakes. Meta-progression gives every death a point. The trick is to keep the meta from replacing skill. Meta that widens options keeps runs interesting: unlocking new items into the pool, new characters with different starting kits, new starting choices, shortcuts to later floors. Meta that only adds raw power (+5 percent health per death, forever) turns the game into a grind and makes early runs feel pointless in hindsight.
A balanced setup: a currency earned during runs that persists after death, spent between runs at a hub on unlocks, with a small amount of permanent power capped early. Save the meta state to the device; if you want it across devices, attach Startbase Cloud with player sign-in and store it in the database. Saving game progress explains what to store and how to keep saves working after updates.
The brief to paste
A top-down 2D action roguelike for phone and desktop. A candle spirit clears haunted cellars. A run is 3 floors with a boss each; a floor is 10 rooms grown on a grid from the start room, boss at the farthest dead end, one treasure room and one shop at other dead ends. Combat rooms come from 15 hand-made templates matched to their doors; doors lock until the room is cleared. Use a seeded random generator with separate streams for map, loot and combat, and show the seed on the death screen. 30 items defined as data with tags (fire, wax, light, speed) and rarity weights 70, 25, 5. On death, keep collected embers to spend at a hub on unlocking new items and a second character. Save the run at every room transition. Left thumb moves, right thumb aims and shoots; on desktop, WASD and mouse.
Roguelike pitfalls
- Unwinnable seeds. A first floor with no damage upgrades and a hard boss. Guarantee one useful item on floor 1, from the treasure room.
- Item soup. Twenty stacking stat items and nothing that changes play. Every new item should create a decision.
- Too long, too early. If the first run takes 45 minutes to fail, players never try a second. Make early floors quick.
- Unclear death. On death, show what killed you and what you had. That screen teaches more than any tutorial.
Roguelikes are content-hungry, so build in small slices: one floor, five rooms, ten items, then play twenty runs before adding more. Restore a checkpoint if a big change makes runs worse. For tuning the movement of a real-time action character, the platformer guide covers acceleration and input buffering that apply here too. For the fight at the end of each floor, read boss fight design.
Frequently asked questions
What is the difference between a roguelike and a roguelite?
Strictly, roguelikes are turn-based, grid-based games with permadeath and no persistent progress, like Rogue. Roguelites keep procedural runs and permadeath but add persistent unlocks between runs, as in Hades or Dead Cells. Most people use the words interchangeably.
How do roguelikes generate levels?
Many action roguelikes stitch hand-designed room templates onto a procedurally generated layout, so each run is new but every room is fair. Others use algorithms like random walks or binary space partitioning for caves and dungeons.
How long should a roguelike run be?
Many popular roguelikes aim for winning runs of roughly 20 to 45 minutes. For a first game, 20 to 30 minutes with three floors is a manageable scope.
Why use a seed for random generation?
A seed makes randomness repeatable. The same seed produces the same run, which lets players share runs, lets you reproduce bugs, and makes daily challenges possible.

