A roguelike used to be the project a beginner started, three nights in, and quietly abandoned. The genre asks for more than a platformer does at the same level of polish. Permadeath needs a clean run-state reset. Procedurally generated dungeons need an algorithm choice and a parameter pass that produces interesting space, not noise. Turn-based combat needs an action queue. Items need a tiny entity-component system. Field of view needs a shadowcast. Each piece is a small, well-known problem, but together they intimidate — and that is exactly the kind of multi-system scaffolding that AI agents now do in a single prompt. The 2026 version of “how to make a roguelike” collapses every one of those subsystems into a browser tab and a few rounds of conversational iteration with an agent that already knows the algorithms.
How to make a roguelike — the workflow at a glance
The whole pipeline is five named steps, each one a single conversational round with the agent. Open WizardGenie in a browser tab. Step one is a single prompt that names the genre, the procedural-generation algorithm, the perspective, the combat style, and the permadeath rule. The agent scaffolds a Phaser 4 project with named files for the dungeon generator, the actor model, the combat resolver, and the run state. Step two tunes the procedural generation — room size, corridor width, density, seed handling. Step three fleshes out the run loop with combat, items, and the inventory. Step four folds in art (sprites for the hero, enemies, doors, items) and audio (footsteps, hits, ambient loops). Step five picks the right model for the kind of iteration you are doing and ships the build. Total wall-clock time for a playable first build: ten to twenty minutes if the prompts are concrete, an hour or two if they are vague and you spend it iterating.
Two upfront facts to take with you. First, browser-native means you do not install Godot, Unity, GameMaker, or any Python interpreter. The whole project lives in a tab and ships as a static site. Second, the agent picks the algorithm only if you let it; if you have a preference (BSP for clean rooms, drunkard’s walk for caves, cellular automata for blended caves-and-corridors, Wave Function Collapse for tile-authored dungeons), name it in the first prompt. The procedural generation choice has more impact on how the game feels than any other single decision.
What a roguelike actually is (mechanically)
The word roguelike covers a range of games — the strict 1980 Berlin-Interpretation roguelike (turn-based, grid-based, ASCII-friendly, permadeath) and the much looser “roguelite” (real-time, with persistent meta-progression). Both end up needing the same five mechanical components. Naming them upfront keeps the agent’s scaffolding focused.
- Procedurally generated levels. Each new run produces a different floor plan from a seeded random number generator. The algorithm can be deterministic or stochastic; either way the seed is captured so the same dungeon can be replayed for debugging. The canonical roguelike uses BSP rooms because they are easy to populate with treasure and enemies.
- Turn-based action. The player acts; every other actor in initiative order acts; the turn ends. Time only passes when the player decides to act. That single rule is what gives the genre its puzzle-like pacing and lets a beginner understand the consequence of every step.
- Permadeath. When the player dies, the run is over and the run state clears. The permadeath rule is what makes every decision matter; without it the game collapses into a save-scummed grind.
- Item synergy. The fun comes from combining unidentified items in unexpected ways — a wand of fire next to a potion of frost, a ring of teleport stacked with a scroll of mapping. Items are tiny entities with named effects, not balanced power tiers.
- Field of view + line of sight. The player sees only what the hero can see; everything outside the visible cone stays in fog of war or in remembered-but-unseen state. Field of view calculation is usually a shadowcast or a recursive ray walk and is a famously fiddly piece of code to get right by hand — prime territory for letting the agent write it.
Tell the agent which of the five you actually want. A modern roguelite can drop turn-based action and field of view (think of the action-roguelikes that play in real time) and still satisfy the genre on the procedural-generation, permadeath, and item-synergy axes.
Step 1 — the minimum-viable roguelike prompt
The first prompt is the most important one of the project. The agent will pick algorithms, file structure, and tile system based on what you say in this single message. A vague first prompt produces a mush of generic boilerplate that takes ten rounds of conversation to undo; a concrete first prompt produces a real scaffold that takes one round to refine.
A workable starter prompt looks like this:
A turn-based dungeon roguelike in Phaser 4. Top-down grid view, 32-pixel tiles.
Procedural floor plan: BSP, five to ten rooms, corridor width 1, minimum room area 16 tiles.
The hero is a wizard who throws fireballs and walks one tile per turn.
Three enemy types to start: goblin (melee, weak), rat (fast, low HP), shadow (ranged, glass cannon).
Permadeath. Seed exposed in the URL so the same run can be replayed.
Field of view by recursive shadowcast, 8-tile radius. Fog of war for unseen tiles.
Items: heal potion, wand of fire, ring of teleport. Inventory hotkeys 1 through 9.
HP, gold, dungeon depth shown at the top of the screen. Combat is one hit, one resolve.
Use a single main.js plus separate files for dungeon, combat, items, and fov.
Note what the prompt does and does not name. It names the algorithm (BSP), the parameters (five to ten rooms, corridor width 1, minimum area 16), the engine (Phaser 4), the perspective, the tile size, the actor types, the combat style, the inventory size, and the file split. It does not name colors, fonts, sprite sheets, level scripts, or boss patterns — those come later. The agent now has enough constraint to make sensible choices for everything you did not specify.
The same prompt-shape works for any roguelike variant. Swap BSP for drunkard’s walk and you get an organic cave game. Swap turn-based for real-time and you get a roguelite. Add “meta-progression: permanent gold buys upgrades between runs” and you get a Hades-style structure. The agent reads the constraints and assembles them into the right scaffold.
Step 2 — wire up procedural floor generation
Procedural floor generation is the algorithmic heart of any roguelike. Pick the wrong algorithm and the dungeon will feel monotonous regardless of how much content you stuff into it; pick the right one and the game feels different on every run with no extra authoring effort. The four standard choices map cleanly to game feels:
- Binary space partitioning (BSP). Recursively split the dungeon rectangle into smaller rectangles until each is below a maximum area, then carve a room inside each leaf and connect the rooms with corridors. The resulting dungeon is a clean grid of rectangular rooms with straight corridors — the canonical “dungeon roguelike” look. Easy to populate (each room is a discrete encounter slot) and easy to tune (room size, depth limit, corridor width are all single constants).
- Drunkard’s walk. Start at a random tile and randomly carve floor tiles in a meander until enough of the map is open. Produces a single connected organic cave with very few dead ends. The right choice when the game is about exploration through a continuous space rather than tactical room-clearing.
- Cellular automata. Start with random noise, then apply a Conway-style smoothing rule for several iterations until walls and floors form natural-looking blobs. Tune the rule and iteration count for either tight caves or open chambers. The middle ground between BSP rigidity and drunkard’s-walk chaos.
- Wave Function Collapse. Author a small library of tile patterns and constraint rules; the algorithm collapses the level until every tile satisfies the constraints. The most authored option — use it when the game needs a coherent visual style (e.g. a recognizable temple or castle layout) on every run rather than free-form geometry.
Ask the agent to expose the parameters as named constants at the top of the file. MIN_ROOM_AREA, MAX_ROOMS, CORRIDOR_WIDTH, BSP_DEPTH_LIMIT — each one a number you can tune by chat (“bump MIN_ROOM_AREA to 25”) without touching the code yourself. Ask for the seed to be exposed in the URL or in localStorage so a particularly good run can be replayed for debugging or capture. And ask for a flat generateDungeon(seed) function as the only entry point — keeping the API surface small means iterating on the algorithm later does not break the rest of the project.