Crawl How to Make a Roguelike (Run + Meta Loop 2026)

By Arron R.16 min read
How to make a roguelike in 2026: design the run loop and meta layer on paper (permadeath wipes the run, currency and unlocks persist), generate hero, enemies, d

People searching how to make a roguelike in 2026 usually get one of two bad answers: a Python tutorial that shows how to draw an @ on a grid with the tcod library and stops there, or a marketing page for an asset store that promises a "roguelike kit" and delivers a top-down template. The honest 2026 answer is different. A modern roguelike has two loops, not one: a short-run loop where the player descends a procedurally generated map and permadies in 20 to 40 minutes, and a longer meta loop where every death unlocks something — a new starting item, a new class, a new dungeon branch — that persists into the next run. This guide walks the recipe for both: design the run and meta loops on paper first, generate the asset pack in Sorceress, then let WizardGenie wire the browser-first tick loop so a playable slice ships in two weekends.

How to make a roguelike pipeline: design run and meta loops, generate procedural asset pack in Sorceress, let WizardGenie code the browser dungeon crawler
The 2026 roguelike recipe: run loop and meta layer on paper, hero + enemy sprites + dungeon tiles + chiptune music from Sorceress, WizardGenie wires the procedural map generator, permadeath reset, and meta-unlock save file. Two weekends, roughly one dollar in credits, one playable browser dungeon.

What "how to make a roguelike" actually means (run + meta loop, not just permadeath)

The word roguelike is contested. The purist definition — the Berlin Interpretation from 2008 — demands turn-based grid movement, ASCII graphics, and permadeath, all inherited from the 1980 game Rogue. According to the roguelike entry on Wikipedia, that strict definition covers the classic canon (NetHack, Dungeon Crawl Stone Soup, ADOM, Caves of Qud) but not the modern indie hits people actually search tutorials for: Hades, Dead Cells, Slay the Spire, Enter the Gungeon, The Binding of Isaac, Balatro, Vampire Survivors. Those games are usually filed under rogue-lite or procedural death labyrinth. The one thing every game in both camps shares is the two-loop structure: a short expedition ("run") that ends when the player character dies or wins, plus a meta layer that persists across runs and rewards the player for playing again.

That two-loop split is why roguelikes feel different from other permadeath action games. In a survival game, dying is punishment. In a roguelike, dying is a comma — the player loses the run but keeps the meta unlocks (a new weapon in the starting pool, a new room type in the generator, a new enemy in the bestiary, a new NPC in the hub). Modern rogue-lites have made the meta loop the actual game: Hades hides half its story inside dozens of runs, Slay the Spire hides half its cards inside dozens of victories, Dead Cells hides half its map inside runes you have to bring back from earlier runs. If a tutorial only teaches the run loop and skips the meta layer, it is teaching how to make a Berlin-purist roguelike from 1988 and calling it a 2026 tutorial. This one teaches both loops honestly.

The roguelike run loop in one minute (spawn descend die reset)

Every roguelike, purist or lite, runs the same core run-loop. Understanding it in one minute is the difference between a real project and a stalled prototype:

  1. Spawn. The engine rolls a fresh seed, generates a dungeon floor (rooms + corridors, or a scrolling side-view level, or a card deck), spawns the player character at the entrance with their starting inventory (which the meta layer may have modified since the last run).
  2. Descend or advance. Player explores the floor, fights enemies, picks up items, spends resources, opens doors, finds the exit to the next floor. Combat is turn-based (classic roguelike), real-time twin-stick (Hades, Enter the Gungeon), platformer (Dead Cells), or card-based (Slay the Spire). The genre is defined by the loop, not the moment-to-moment control scheme.
  3. Escalate. Each floor rolls a harder enemy table, better loot table, and a new modifier (curse, boon, boss). Difficulty ramps until the player either wins the run (defeats the final boss, escapes the dungeon) or dies.
  4. Die or win. Permadeath fires. The current-run save file is wiped — hero, floor, inventory, gold, buffs. The player watches a short death screen ("You reached Floor 4. You died to a wolf. Runs completed: 7.") and hits Restart.
  5. Meta unlock. On death or win, the game evaluates what the run earned: XP toward a permanent level, currency toward the meta shop, story flags for the hub NPCs, unlocks for new starting items or classes. This is the layer that survives the wipe. The player’s next spawn starts from a slightly better baseline. Loop back to step 1.

Every per-frame update runs off the browser-standard animation loop. The requestAnimationFrame API documented on MDN fires roughly 60 times per second in sync with the display refresh; every tick the game code advances enemy AI within the visible room only, updates the player state, decrements any temporary buff timers, and checks for room transitions. Turn-based classic roguelikes still use requestAnimationFrame for the render pass but freeze the world logic between player inputs. Either way, the outer run loop is not a game loop — it is a state machine that returns to Spawn every time Die fires.

Pick your engine in 2026: WizardGenie, Godot 4, or Phaser 4

The engine question decides how much boilerplate you write vs how much you skip. Three honest 2026 answers, ranked by "playable slice in two weekends":

  • WizardGenie (recommended for a first project). AI-powered game engine that runs in the browser and, on desktop, ships as a Windows installer with auto-updater. You paste the run-loop and meta-loop design docs into a paragraph; WizardGenie writes, runs, and iterates on the code in real time using its dual-agent Planner+Executor loop. The Planner (a top-tier reasoner) breaks the roguelike into procedural map generation, combat resolution, and meta-save tasks. The Executor (a cheap fast typer like DeepSeek V4 Pro) writes the actual JavaScript. Model lineup verified 2026-08-06 in src/app/_home-v2/_data/tools.ts: Claude Opus 4.7, Claude Sonnet 4.6, GPT-5.5, Gemini 3.1 Pro, DeepSeek V4 Pro, Kimi K2.5, Grok 4.2, MiniMax M2.7 — bring your own key or use the fallback trial key.
  • Godot 4. Free open-source engine, current build released 14 July 2026 per the official Godot Windows download page verified 2026-08-06. The scene tree cleanly holds one Room scene instanced N times by the generator, plus a persistent AutoLoad singleton for the meta save (currency, unlocks, run count). TileMap for the dungeon grid, CharacterBody2D plus move_and_slide() for real-time movement, or a hand-rolled turn queue for classic turn-based. Best if you want to hand-code the engine and understand every roll.
  • Phaser 4. Popular 2D HTML5 game framework, currently at Phaser v4.2.1 "Giedi" released 9 July 2026 per the official Phaser download page verified 2026-08-06. Tilemap support for the dungeon grid, arcade physics for the hero, group management for enemies, container objects for procedural rooms. Best if you want a pure JavaScript build that ships as a single HTML bundle to itch.io.

The rest of this guide assumes WizardGenie for the code side. Every step still applies unchanged if you swap in Godot 4 or Phaser 4 by hand — the "AI writes the loop" step becomes "you write the loop against the design doc." Unity and Unreal are fine at commercial scale but heavier than a two-weekend prototype needs, and their web-export paths are noticeably fatter than a hand-rolled JS build for a small dungeon crawler. Scratch is technically roguelike-capable (search results show tutorials on how to make a roguelike in scratch) but its lack of a real random-with-seed API makes reproducible runs harder than they need to be.

Step 1 — design the run loop, the meta layer, and the seed system on paper

Skip this step and you will rewrite the roguelike four times. This is the genre where the design doc must be finished before the code starts, because every meta unlock cascades into every future run, and every seed choice cascades into every playtest. Do the design in 60 minutes on paper (or in a text file) and the AI code generation halves. The design doc needs five sections:

  1. Run structure. How many floors per run (3 to 5 is right for a first project). How many rooms per floor (7 to 12). Boss frequency (final floor, or every third floor). Approximate run length in minutes (20 for a first project, so the death-restart cycle stays snappy). What ends a run: hero HP hits 0, or hero wins by defeating the final boss.
  2. Combat system. One choice: turn-based grid (classic), real-time top-down (Hades-like), platformer (Dead Cells-like), or deckbuilder (Slay the Spire-like). All four are honest roguelike answers. Pick one and stick with it for the first project.
  3. Loot and enemy tables. Per-floor tables. Floor 1 enemy pool: goblin (weight 60), rat swarm (30), sleeping ogre (10). Floor 1 loot pool: bread (30), rusty knife (25), gold coin (25), health potion (15), rare relic (5). Wikipedia’s entry on procedural generation in games describes the same weighted-table pattern that has powered every roguelike since Rogue. Add one new enemy and one new loot entry per floor.
  4. Meta layer. This is the point of a rogue-lite. Three-to-five permanent unlocks for a first project. Reasonable defaults: a run-currency (souls, coins, dust) that persists on death; a hub shop that spends currency on permanent starting-inventory items; a class-select unlocked after run 3; a shortcut to Floor 3 unlocked after run 5; a bestiary card unlocked the first time each enemy is defeated. Write which resources persist and which reset on death — hero HP resets, meta currency persists.
  5. Seed system. Every roguelike needs deterministic random. Pick a seed source: Date.now() at run start (unrepeatable), a user-entered seed (daily-run mode, tournament mode), or a hash of the meta save (each run different but reproducible). Store the seed with the run save so bug reports can reproduce the exact dungeon.

Put the whole design doc in a single markdown or JSON file. WizardGenie parses this structure well and will use it to seed the procedural generator, the enemy AI, the loot roll, and the meta-save schema. The same "design doc first, code second" approach powers every genre-specific tutorial in this series: Sprawl How to Make a Metroidvania (Map + Ability Gates) uses the same approach for room graphs and ability gates, Brave How to Make a Survival Game (Hunger + Loot 2026) uses it for hunger meters and loot tables, and Fortify How to Make a Tower Defense Game (Wave Loop 2026) uses it for enemy waves and tower economy.

Roguelike design doc showing run structure, combat system, floor loot tables, meta layer unlocks, and seed system laid out on one dashboard
The roguelike design doc is the whole game on one page. Run structure, combat, floor tables, meta layer, seed system. Every unlock feeds the next run — that is what makes the loop feel like a roguelike, not a permadeath demo.

Step 2 — generate the roguelike asset pack (hero, enemies, dungeon tiles, chip music)

The asset stack for a first roguelike slice is small compared to the design doc. Roughly one hero sprite sheet, three-to-five enemy sprites, one dungeon tileset, one ambient dungeon loop plus a boss loop, and a handful of one-shot SFX. Broken down:

  • Hero sprite sheet. Open Sorceress Quick Sprites. Prompt: "top-down roguelike hero, 32x32 pixel art, hooded rogue with dagger, 4-direction 4-frame walk cycles (up, down, left, right), plus 4-direction attack and hurt animations, cool dungeon palette, transparent background". Quick Sprites bills 9 credits per generation (verified 2026-08-06 in src/app/quick-sprites/page.tsx line 21 as CREDITS_PER_GEN = 9). Iterate two or three times to lock the silhouette so it reads at 32x32 on a torch-lit dungeon floor.
  • Enemy sprites. Three-to-five enemy generations in Quick Sprites: goblin (idle + hurt + attack), rat swarm (idle + hurt), skeleton (idle + hurt + attack), and one boss (large 64x64 with 3-frame idle and 6-frame telegraph). Roughly 45 credits for a full first-floor bestiary.
  • Dungeon tileset. Open Sorceress Tileset Forge. Prompt: "top-down dungeon crawl tileset, 32x32 tile grid, stone floor, cracked stone floor variant, wall corner, wall edge, door closed, door open, chest closed, stairs down, torch sconce, seamless edges, cool low-saturation palette". Tileset Forge outputs a tileable strip you slice inside the standard tile-based video game grid described on Wikipedia. Roughly 20 to 40 credits to iterate to a clean result.
  • Chip music. Open Sorceress Music Gen. Prompt: "90-second looping chiptune dungeon crawler track, minor key, driving bass, arpeggio lead, low percussion, tense but restrained mood, ends cleanly for loop". Music Gen bills 10 credits per generation (verified 2026-08-06 in src/app/music-gen/page.tsx line 28 as MUSIC_CREDIT_COST = 10). Add a second boss-fight track: "45-second looping chiptune boss track, faster tempo, big drums, ominous brass lead, cinematic climax". Add 2 credits per WAV export.
  • SFX one-shots. Open Sorceress SFX Gen. Six sounds — hit.wav (dagger on flesh), miss.wav (dagger through air), door.wav (heavy dungeon door), pickup.wav (item into inventory), levelup.wav (meta-unlock chime), death.wav (hero permadeath sting). SFX Gen bills 1 credit per second, minimum 1 credit (verified 2026-08-06 in src/app/sfx-gen/page.tsx line 23 as SEED_AUDIO_CREDITS_PER_SECOND = 1). Six short one-shots at roughly one second each = about 6 credits total.

Drop every downloaded file into a single assets/ folder on your desktop. In WizardGenie, upload the folder in one drag-and-drop and paste the design doc into the same prompt. Total asset generation time: roughly 20 to 25 minutes. Total credits spent: 130 to 170 depending on iteration.

Step 3 — let WizardGenie wire the run loop, meta unlocks, and save file

Open WizardGenie in a browser tab. Attach the assets folder. Paste the design doc as a single prompt with five sections labelled RUN_STRUCTURE, COMBAT, FLOOR_TABLES, META_LAYER, SEED. Then add a short freeform paragraph: Make a top-down roguelike where the hero descends four floors of a procedurally generated dungeon, fights enemies, picks up loot, and either wins by defeating the boss on Floor 4 or dies. On death or win, wipe the run save but keep the meta save (currency, unlocked classes, unlocked starting items, bestiary). Use requestAnimationFrame for the render loop but freeze the world logic between player inputs (turn-based). Use a seeded PRNG for the map generator so runs are reproducible. Save the meta layer to localStorage under one key. Play hit.wav on melee hit, pickup.wav on item pickup, levelup.wav on meta unlock, death.wav on hero death.

WizardGenie generates the seven-module roguelike loop in one pass. The output structure is predictable across models: a RunState object holding hero position, hero HP, current floor, current-run inventory, current seed, and turn count; a separate MetaState object holding meta currency, unlocked classes, unlocked starting items, bestiary flags, and total-run count; a generateFloor(seed, depth) function that lays out rooms and corridors using a BSP or drunkard-walk algorithm and rolls enemies plus loot from the depth’s weighted tables; a resolveTurn(playerAction) function that runs the player’s move, then runs every visible enemy’s AI, then checks for death or floor exit; an onDeath() function that computes meta rewards, wipes RunState, updates MetaState, and returns to the hub; a saveMeta() that JSON-stringifies MetaState into localStorage under one key; and a loadMeta() that reads it back on page load. The RunState is deliberately not persisted — permadeath is defined by that omission.

WizardGenie roguelike code architecture with seven modules: run state, meta state, floor generator, turn resolver, death handler, meta save, sound hooks
The WizardGenie roguelike architecture in seven modules. The split between RunState (temporary, wiped on death) and MetaState (persistent, saved after every run) is what makes the code honestly roguelike — the permadeath contract is enforced by the schema, not by convention.

Iterate in three rounds. Round one: play one full run, note the first thing that feels off (dungeons too small, enemies clump into unwinnable rooms, meta currency accumulates too fast). Paste the observation back to WizardGenie: Floor 1 rooms are too small, target 8 to 12 rooms per floor instead of 4. WizardGenie tunes the generator and reloads the preview. Round two: add a small polish beat (death screen shows run stats, meta shop shows unlocked items with lock icons, hero animation loops during idle). Round three: playtest three full runs end-to-end and confirm the meta curve holds — a new unlock roughly every second death for the first six runs, then every third-to-fifth death after that. If the meta curve is flat, tune the meta-currency drop rate on the floor tables; if it spikes, raise the meta-shop prices. Fifteen minutes of tuning per round.

Common issues (and how to fix each in under a minute)

Every first roguelike project trips on the same handful of small bugs. Fix them by tuning numbers or schema, not by rewriting code:

  • Every run generates the same dungeon. The seed is not being passed into the PRNG, or the PRNG is Math.random() which is unseeded. Ask WizardGenie to swap in a seeded PRNG (mulberry32, splitmix32, or the seedrandom npm package) and pass the run seed into every table roll.
  • Meta unlocks apply on the current run. The unlock is being written to RunState instead of MetaState, or the run save is being loaded on death instead of the meta save. Confirm onDeath() writes MetaState, wipes RunState, and reloads only MetaState on next spawn.
  • Player can walk through walls after a floor transition. The old floor’s collision map is still active. Confirm generateFloor() tears down the previous floor’s TileMap or grid before laying the new one.
  • Enemies pathfind through walls. A* is running on the raw grid instead of the walkable-tile mask. Confirm the pathfinder receives the tile-passability grid, not the sprite-layer grid.
  • Boss dies to the first attack. Boss HP was computed against a global HP scale that assumes floor 1 stats. Boss HP should scale with depth (roughly linearly or slightly super-linearly). Ask WizardGenie to add a depth-scaling multiplier to the boss stat table.
  • Meta save file breaks on schema change. Add a schemaVersion field to MetaState and a migration function on load. Bump the version whenever you add a new unlock category. Missing this is why every early roguelike prototype breaks between weekend one and weekend two.

What a how to make a roguelike project costs on Sorceress in 2026

Concrete asset budget for the dungeon-crawl roguelike slice above, all numbers verified 2026-08-06 against the local Sorceress source:

  • Hero sprite sheet: 2 to 3 Quick Sprites generations x 9 credits = 18 to 27 credits (0.18 to 0.27 USD). Iterate on the four-direction walk and attack frames until the silhouette reads at 32x32.
  • Enemy bestiary (goblin, rat swarm, skeleton, boss): 4 to 5 generations x 9 credits = 36 to 45 credits (0.36 to 0.45 USD). Add another boss on Floor 4 for +9 credits.
  • Dungeon tileset: 2 to 4 Tileset Forge generations = 20 to 40 credits (0.20 to 0.40 USD) to iterate to a clean tileable strip. A second dungeon variant (icy, sewer, crypt) doubles the total.
  • Chip music (ambient dungeon + boss loops): 2 loops x 10 credits + 4 credits WAV export = 24 credits (0.24 USD). Add a hub-town track for another 12 credits.
  • SFX pack (six one-shots): 6 sounds at roughly 1 credit each = 6 credits (0.06 USD).

Total AI asset cost: roughly 105 to 135 credits, or 1.05 to 1.35 USD at Sorceress’s 100 credits per dollar standard rate (verified 2026-08-06 in src/lib/models.ts line 69 as CREDITS_PER_DOLLAR = 100). New accounts start with 100 free credits (verified 2026-08-06 in src/app/api/admin/credits/route.ts line 12 as SIGNUP_GRANT = 100), which covers most of the asset pack for a first roguelike project. The Sorceress Lifetime tier at 49 USD one-time (verified in src/app/plans/page.tsx line 51 as LIFETIME_PRICE = 49) covers unlimited Quick Sprites, Tileset Forge, Music Gen, and SFX Gen for the life of the account — useful once you start iterating on three or four dungeon variants and a full bestiary and want to skip the per-generation credit math entirely.

WizardGenie itself is bring-your-own-key or trial-key on the model side, so the model cost depends on which coding model you pick from the eight-model lineup. On the cheap end, DeepSeek V4 Pro or MiniMax M2.7 runs the whole two-weekend roguelike build for a few cents in tokens. On the premium end, Claude Opus 4.7 or GPT-5.5 as the Planner paired with a cheap Executor still lands well under the price of one commercial engine seat per month. The dual-agent Planner+Executor pattern is specifically designed to make premium reasoning affordable by never putting the expensive model on the typing side.

Bigger picture: this workflow — design doc on paper plus AI-generated assets in a parallel tab plus WizardGenie writing the run loop and meta save — is the standard for solo indie devs shipping playable roguelike slices in a weekend. If you want to go deeper on the assets side, the Sorceress Tools Guide is the wide index of every tool referenced above and the front page at Sorceress is where each of them lives. For related genre-specific tutorials that use the exact same asset pipeline: Brave How to Make a Survival Game (Hunger + Loot 2026) covers the meter-and-loot design for permadeath survival, Sprawl How to Make a Metroidvania (Map + Ability Gates) covers the room-graph and ability-gate pattern, and Fortify How to Make a Tower Defense Game (Wave Loop 2026) covers the wave loop and tower economy. All four articles share the same "design first, generate assets in Sorceress, code the loop last" spine as this roguelike recipe.

Frequently Asked Questions

How long does it take to make a roguelike?

A first playable roguelike slice on the recipe above takes about two weekends of focused work: one weekend for the run-loop and meta-layer design plus the asset pack, one weekend for the code loop, procedural generator, and meta save. That gets you roughly one dungeon type, four floors, three enemies plus one boss, three meta unlocks, and a full death-restart loop, which is enough to prove the two-loop tension feels right. A commercial-scope roguelike (multiple dungeon variants, deep bestiary, class trees, hundreds of items, dozens of hours of meta content) is a multi-year project even with AI assets. Hades took Supergiant Games about three years from prototype to 1.0 release, Slay the Spire took Mega Crit Games about two and a half years, and Dead Cells took Motion Twin about three years including Early Access.

What is the easiest engine for a roguelike in 2026?

For a first browser-first roguelike, WizardGenie is the fastest path: you paste the run structure and meta layer into one prompt and it iterates the procedural generator, turn resolver, meta save, and localStorage schema for you in a browser tab. For hand-coding, Godot 4 (verified stable 14 July 2026 on godotengine.org) is honest because its scene tree cleanly holds the current floor scene plus a persistent AutoLoad singleton for the meta save, and TileMap handles the dungeon grid without any custom render code. Phaser v4.2.1 Giedi (released 9 July 2026 per phaser.io/download/stable) is the pure JavaScript answer if you want a single HTML bundle. Python plus the tcod library is the traditional classic-roguelike answer but only ships to desktop, not to the browser.

What is the difference between a roguelike and a rogue-lite?

The Berlin Interpretation from 2008 defines a strict roguelike as turn-based, grid-based, ASCII-graphical, permadeath, and non-modal (single character, single world). The classic canon (NetHack, Dungeon Crawl Stone Soup, ADOM, Caves of Qud) fits that definition. A rogue-lite loosens one or more of those rules. Real-time combat (Hades, Enter the Gungeon, Dead Cells) breaks the turn-based rule. Modern graphics (all of them) break the ASCII rule. Persistent meta unlocks (Hades weapons, Dead Cells runes, Slay the Spire cards) break the permadeath rule (the character dies, but the run economy carries forward). In practice the two words describe a spectrum, not two separate genres, and search engines treat them almost interchangeably. This tutorial covers the two-loop structure that both share.

Do I need to design the meta layer before writing roguelike code?

Yes. The meta layer is the point of a modern roguelike, and it decides the entire save-file schema. If you write the run code first and add the meta layer later, you will have to refactor every place the run code touched persistent state, because permadeath makes the wipe boundary schema-critical. Write which resources reset on death (hero HP, current floor, run inventory, gold-in-hand) and which persist across runs (meta currency, unlocked classes, unlocked starting items, bestiary flags, run count). Store them in two separate objects, RunState and MetaState. Save only MetaState to localStorage. WizardGenie parses this split cleanly if the design doc names the two objects explicitly.

Can I make a browser roguelike people actually play?

Yes. A WizardGenie or Phaser 4 roguelike exports to a standard HTML5 bundle that runs in any modern browser and saves the player's meta layer to localStorage so a returning player keeps their unlocks and currency between sessions. Free static hosts that accept HTML5 games include GitHub Pages, Netlify, Vercel, and itch.io. The itch.io free tier is the community standard for indie roguelike jam builds and its Web-playable filter surfaces browser-first entries at the top of every jam. Godot 4 also exports to HTML5, though the WASM bundle is heavier than a hand-rolled JS build. Total hosting cost for a browser roguelike is 0 dollars per month on itch.io or GitHub Pages.

Sources

  1. Roguelike - Wikipedia
  2. Procedural generation - Wikipedia
  3. Tile-based video game - Wikipedia
  4. Window: requestAnimationFrame() method - MDN Web Docs
Written by Arron R.·3,555 words·16 min read

Related posts