How to Make a Roguelike in Godot (Browser AI Stack)

By Arron R.13 min read
How to make a roguelike in Godot 4.6.3 with AI in 2026: scaffold the TileMapLayer grid, write the turn-based _input loop and Action-class movement with WizardGe

A vibe coder who built their first browser platformer in WizardGenie and now wants a grid-based dungeon crawler, a jam developer with three weeks and zero pixel-art skill, and an indie who dropped Unity after the latest licensing rumble all land on the same question in 2026: how to make a roguelike in Godot without writing every system from scratch. Godot 4.6.3 stable (released May 20, 2026, verified June 10, 2026) ships the right primitives — the TileMapLayer node, a signal-driven event model, an idiomatic class_name and Resource workflow, and an HTML5 export — but the systems a traditional roguelike needs (turn-based movement, procedural dungeons, field of view, permadeath) are still wiring the developer has to write. This post walks the honest six-pillar build inside Godot 4.6.3, then maps the Sorceress browser stack that supplies the sprite art, the dungeon tiles, the chiptune loops, and the GDScript itself.

Six-panel diagram of how to make a roguelike in Godot — TileMapLayer map, Sprite2D player, turn-based _input movement, FOV shadow casting, turn-based combat, and permadeath reset
The six pillars of a Godot 4.6.3 roguelike: a TileMapLayer dungeon, a Sprite2D player with stats, a turn-based _input Action loop, field-of-view shadow casting, turn-based combat, and permadeath. The Sorceress browser stack supplies every asset and every line of GDScript.

What “how to make a roguelike in Godot” actually means in 2026

A roguelike is the genre with the sharpest mechanical constraints in 2D game design: a tile-based grid, turn-based movement, procedural dungeons that rebuild every run, field-of-view that fogs unexplored tiles, and permadeath that voids every save when the player dies. The first roguelike (Rogue, 1980) ran in an ASCII terminal; the modern interpretation keeps the grid and the turns but renders pixel-art sprites in a real engine. Godot 4.6.3 is a good fit for the modern interpretation because the engine’s scene-tree plus signal model lets every system stay independent, the TileMapLayer node holds the grid losslessly through saves, and the GDScript language is what every leading 2026 AI coding model writes most fluently.

The 2026 honest framing is that Godot 4.6.3 ships every primitive a roguelike needs and zero of the systems pre-assembled. Sprite2D and AnimatedSprite2D handle the player and monsters. TileMapLayer (the modern grid node, replacing the deprecated TileMap) handles the dungeon. Resource and class_name handle the data definitions. The _input method on the Game node handles turn-based input correctly (continuous polling with _process is the wrong shape for a roguelike). FileAccess plus JSON handle the run save. Signals handle the cross-system events. The developer’s job is to wire those primitives into the six systems the genre requires, which is exactly where an AI coding agent earns its keep.

The six building blocks of every roguelike (map, player, movement, FOV, combat, permadeath)

Every Godot roguelike worth shipping in 2026 is built on six pillars. Naming them up front gives the AI a clean target for each prompt and keeps the project from drifting into a single 2,000-line script-of-everything.

Pillar 1: The map. A WorldScene with one TileMapLayer per render layer (ground, walls, decorations, overhead). Tiles store as a Dictionary keyed by Vector2i so walkability and explored-state lookups stay O(1). The dungeon generator overwrites the ground TileMapLayer every time the player descends a stair.

Pillar 2: The player. A Sprite2D (or AnimatedSprite2D for visible walk frames) with a stats Resource (current_hp, max_hp, attack, defense, depth_reached) and a small inventory Array. Position is stored as Vector2i grid coordinates, not pixel coordinates, and converted on render with global_position = grid_pos * TILE_SIZE.

Pillar 3: Turn-based movement. An EventHandler node that converts InputEventKey into an Action subclass (MovementAction, AttackAction, EscapeAction), all registered with class_name for type-safe dispatch. The Game node calls action.execute(self) when the player presses a key, then advances every monster, then ends the turn.

Pillar 4: Field of view. A symmetric shadow-casting algorithm that walks rays from the player to a radius (usually 7 to 10 tiles), marks every tile a ray reaches as visible, and marks every tile a ray has ever reached as explored. The renderer dims explored-but-not-visible tiles and fully hides never-seen tiles. Field of view is one of the two systems Godot does not ship pre-built (the other is the dungeon generator).

Pillar 5: Combat. A bump-to-attack pattern where moving into a monster’s tile triggers a damage roll instead of a position change. Damage = max(1, attacker.attack - defender.defense); on hp_zero the entity emits a died signal that the GameLog UI subscribes to.

Pillar 6: Permadeath. A SaveSystem autoload that writes the current run to user://current_run.json after every turn and deletes the file on death. Permadeath is the constraint that makes every decision matter; without the delete-on-death step, the roguelike is just a turn-based RPG.

Step 1 — Set up the Godot project (4.6.3, viewport, TileMapLayer)

Open Godot 4.6.3 and create a new project. Three Project Settings changes matter for a roguelike before any code gets written.

Viewport size. Navigate to Display → Window and set the viewport to 640 x 360. At a 16 by 16 tile size, that renders a 40 by 22.5 visible grid, which matches the canonical roguelike aspect and gives the player enough room to see the dungeon ahead without scrolling. The 16:9 aspect upscales cleanly to 720p and 1080p browser windows.

Stretch mode. Display → Window → Stretch → Mode = viewport. Godot renders at the native 640 by 360 resolution and upscales the entire viewport to fit any screen size, which keeps the pixel art crisp on any monitor.

Default texture filter. Rendering → Textures → Canvas Textures → Default Texture Filter = Nearest. This is the single most important setting for any pixel-art project. Without it, every sprite gets bilinear-interpolated to a blurry mush as soon as the engine upscales. With it, pixels stay pixels.

With the project configured, create the WorldScene root node (Node2D), parent four TileMapLayer children (Ground, Walls, Decorations, Overhead), and create a shared TileSet resource on each. The TileSet holds the source PNG atlas and the per-tile physics, navigation, and terrain data. Tile-based world structure is the idiomatic Godot 4.6 approach and replaces the deprecated TileMap node entirely. Each TileMapLayer can be saved, scrolled, and re-rendered independently, which matters when the dungeon generator only needs to rewrite the Ground layer between floors. The Walls layer holds the unbreakable border and any indestructible decoration; the Decorations layer holds doors, torches, and pickup glows; the Overhead layer holds anything that should render above the player (low ceiling, archways).

Step 2 — Generate pixel tiles and sprites with AI (free AI sprite pack from Sorceress)

The art is the second-largest cost on an indie roguelike after the time. The Sorceress browser stack generates every asset class a roguelike needs from a text prompt, and the 100 starter credits every new account gets at signup cover roughly the first dungeon’s worth of art for free.

Quick Sprites generates the hero and monster sprite sheets. The tool runs the Retro Diffusion rd-animation model at 9 credits per generation (verified at MODEL_ID = 'retro-diffusion/rd-animation' and CREDITS_PER_GEN = 9 in src/app/quick-sprites/page.tsx on June 10, 2026). The three preset shapes are Four Angle Walking at 48 by 48 (four-direction four-frame walk cycles for the player and humanoid NPCs), Small Sprites at 32 by 32 (six-row layout for monsters and bystanders), and VFX Effects at 24 to 96 pixels for spell hits, fire, and pickup glows. Output is a packed PNG sheet plus an animated GIF preview that imports straight into a Godot 4 SpriteFrames resource.

True Pixel handles image-to-pixel-art conversion and palette enforcement. The tool ships eight palette presets (PICO-8 16, SWEETIE-16, Endesga 32, Game Boy, CGA, NES 54, Grayscale 8, 1-Bit, verified against PALETTE_PRESETS at line 24 of src/app/pixel-art/page.tsx on June 10, 2026). Endesga 32 is the modern roguelike default; SWEETIE-16 gives the saturated palette of newer indie roguelikes; PICO-8 16 gives the classic constraints. Drop in any AI image and True Pixel quantizes it to the palette and downsamples it to the chosen pixel resolution.

AI Image Gen handles the tileset bases, the prop sheets, the title-screen background, and the death-screen image. Seven leading models drive the picker: Nano Banana Pro and Nano Banana 2 for top-tier general-purpose generation, GPT Image 2 for photoreal text-in-image, Seedream 5 Lite for stylised illustration, Flux 2 Pro for hyper-detailed fantasy, Z-Image Turbo at 2 credits for fast iteration, and Grok Imagine for creative compositions (verified against src/app/_home-v2/_data/tools.ts on June 10, 2026). Z-Image Turbo at 2 credits is the workhorse for tileset iteration.

Music Gen produces full chiptune loops at 10 credits per track (verified at MUSIC_CREDIT_COST = 10 in src/app/music-gen/page.tsx on June 10, 2026). One dungeon track, one boss track, one town track, and one game-over sting covers an entire roguelike for 40 credits. Sound Studio and SFX Gen handle the sword-hit, footstep, coin-pickup, and door-creak SFX. Godot 4.6 imports MP3, OGG, and WAV directly into an AudioStreamPlayer node.

Four-panel diagram of the Sorceress browser stack for a Godot roguelike — Quick Sprites for character sheets, True Pixel for dungeon tiles, Music Gen for soundtracks, and SFX Gen for hit sounds
The Sorceress browser stack supplies every asset class a Godot roguelike needs: Quick Sprites for the hero and monster sheets, True Pixel for the dungeon tile palette, Music Gen for the chiptune loops, and SFX Gen for the bump-to-attack and pickup SFX.

Step 3 — Write the turn-based movement loop (_input, Action classes, class_name)

The single most important architectural choice in a Godot roguelike is using _input instead of _process. The canonical Godot Roguelike Basic Set tutorial and the SyntaxCache GDScript roguelike walkthrough (both verified June 10, 2026) both lead with this point, and for good reason: a roguelike is event-driven, not frame-driven. Nothing in the game advances until the player presses a movement key, then one round resolves, then the game waits.

The pattern has three pieces. First, register the input actions in Project Settings → Input Map: move_up, move_down, move_left, move_right, ui_cancel (for ESC). Second, write a base Action class:

class_name Action
extends RefCounted

func execute(game: Game) -> void:
    pass

Then subclass it: MovementAction extends Action with an offset: Vector2i field and an execute that calls game.entity_manager.player.move(offset); EscapeAction extends Action with an execute that calls game.quit(). The class_name statement registers each Action subclass as a global type, so other scripts can type-check the returned action without an import.

Third, write the EventHandler node that converts InputEventKey to an Action:

class_name EventHandler
extends Node

const DIRECTIONS := {
    "up": Vector2i.UP,
    "down": Vector2i.DOWN,
    "left": Vector2i.LEFT,
    "right": Vector2i.RIGHT,
}

func handle_input_event(event: InputEvent) -> Action:
    if event is InputEventKey:
        for direction: String in DIRECTIONS:
            if event.is_action_pressed("move_%s" % direction):
                return MovementAction.new(DIRECTIONS.get(direction))
        if event.is_action_pressed("ui_cancel"):
            return EscapeAction.new()
    return null

Fourth, wire it into the Game node:

class_name Game
extends Node

@onready var event_handler: EventHandler = $EventHandler
@onready var entity_manager: EntityManager = $EntityManager

func _input(event: InputEvent) -> void:
    var action := event_handler.handle_input_event(event)
    if action:
        action.execute(self)
        entity_manager.advance_monsters()

The pattern is extensible: a new Action subclass (UseItemAction, ThrowAction, WaitAction) drops in without touching the Game or EventHandler scripts. A prompt to WizardGenie like “write the four GDScript files for the Action class hierarchy, the EventHandler node with DIRECTIONS dictionary, and the Game node with _input dispatch for a Godot 4.6.3 turn-based roguelike” produces all four files in one session.

Side-by-side diagram of Godot 4 roguelike movement — the wrong _process polling pattern on the left versus the right _input event-driven pattern with Action classes on the right
The right turn-based movement loop in Godot 4: _input on a Game node converts each InputEventKey into an Action subclass instance, then dispatches with action.execute(self). The _process polling pattern on the left double-fires on key repeat and wastes CPU between turns.

Step 4 — Procedural dungeons (BSP rooms vs Drunkard’s Walk vs Cellular Automata)

Procedural generation is what makes every run fresh. The four canonical algorithms in 2026 roguelike tooling (verified June 10, 2026 against the Godot Roguelike Basic Set procedural-dungeon-generation chapter and the SyntaxCache map-generation series) are Drunkard’s Walk, Cellular Automata, BSP Rooms, and Noise Terrain. The right pick depends on the dungeon shape the game asks for.

Drunkard’s Walk is the simplest. Pick a starting tile near the center of the grid, then walk N steps in random cardinal directions, marking every walked tile as floor. The algorithm gives organic curving paths and is great for a quick playable demo. The total floor tile count controls the dungeon density: too few and the dungeon is a single corridor, too many and it’s an open arena. The classic tuning is N = (grid_width * grid_height) * 0.45.

Cellular Automata gives cave-shaped chambers. Initialize a 2D grid where each cell is randomly floor (45% probability) or wall (55%). Run a smoothing pass where each cell becomes whatever the majority of its eight neighbors is; run the pass three to five times. The result is rounded caves with natural-looking walls. Cellular automata were the canonical roguelike cave algorithm long before the procedural-content-generation literature formalized them.

BSP Rooms is the structured pick. Binary space partitioning recursively splits a rectangle in half (horizontally or vertically, alternating) until each leaf rectangle is below a target size, then carves a randomly sized room inside each leaf, then connects adjacent leaves with L-shaped corridors. The result is the classic roguelike layout: rectangular rooms connected by hallways, exactly what most players associate with the genre. BSP is the default pick for a serious roguelike because the rooms create natural choke points for monster placement and the corridors create natural choke points for combat.

Noise Terrain samples an OpenSimplex or Perlin noise field. Walls go where the noise value is above a threshold; floors go below. The result is island and biome shapes, which fit outdoor or open-world roguelikes more than classic dungeon crawlers.

The mature build uses a strategy pattern: an enum DungeonAlgorithm { DRUNKARD, CELLULAR, BSP, NOISE } and a DungeonGenerator class with a switch that dispatches to the right algorithm per floor. The seed is stored in the save data so every floor regenerates identically on reload. A representative WizardGenie prompt looks like: “write a DungeonGenerator GDScript class for Godot 4.6.3 with four algorithms (Drunkard’s Walk, Cellular Automata, BSP Rooms, Noise Terrain) selectable via enum, accepting a grid size and a seed, returning a Dictionary[Vector2i, TileType]. Include unit-test-style demo calls in a separate _demo function.” The eight coding models in WizardGenie all produce a working DungeonGenerator on the first turn when prompted with that level of specificity.

WizardGenie: the browser path that skips Godot entirely

The Godot path is the right call for a developer who wants to learn engine internals, ship to desktop and HTML5 from one project, and own every line of code. For a vibe coder who wants a playable roguelike in a browser tab without installing anything, WizardGenie ships the same six-pillar roguelike on Phaser 4, Three.js, or HTML5 plus Canvas. The browser-native path trades the Godot scene-tree for a single JavaScript bundle that runs anywhere a modern browser runs.

WizardGenie drives eight frontier coding models from a single picker: Claude Opus 4.7, Claude Sonnet 4.6, GPT-5.5, Gemini 3.1 Pro, DeepSeek V4 Pro, Kimi K2.5, Grok 4.2, and MiniMax M2.7 (verified against the CODING_MODELS array at line 734 of src/app/_home-v2/_data/tools.ts on June 10, 2026). The Dual-agent Planner+Executor pattern pairs an expensive reasoner (Claude Opus 4.7 or GPT-5.5) on the planning side with a cheap fast typer (DeepSeek V4 Pro, Kimi K2.5, or MiniMax M2.7) on the code-emission side, landing the typing cost at roughly one-fifth of single-frontier cost. For a roguelike, that pattern matters because the dungeon-generator script, the FOV script, the combat-resolution script, and the save-load script are all classic boilerplate-heavy GDScript or JavaScript files, exactly the shape the executor model handles cheaply and fast.

WizardGenie also ships with the asset stack pre-integrated. The same Quick Sprites, True Pixel, AI Image Gen, Music Gen, Sound Studio, and SFX Gen tools that drop assets into a local Godot project also drop assets into the WizardGenie editor automatically; a prompt like “generate a hero sprite, a goblin sprite, a rat sprite, a dungeon tile set with stone walls and torches, a chiptune dungeon loop, and a sword-hit SFX” populates the project tree without any manual file management. The full Sorceress stack runs at $49 lifetime access plus credit packs at $10/1000, $20/2000, $50/5000, and $100/10000 (verified against src/app/plans/page.tsx on June 10, 2026), with 100 starter credits granted at signup.

The verdict on how to make a roguelike in Godot in 2026

How to make a roguelike in Godot in 2026 is a three-decision project, not a hundred-decision project. Decision one: Godot 4.6.3 stable, GDScript not C#, TileMapLayer not the deprecated TileMap. Decision two: the six-pillar architecture (map, player, turn-based movement via _input + Action classes, FOV via shadow casting, bump-to-attack combat, FileAccess permadeath saves). Decision three: which dungeon generator (Drunkard’s Walk for a demo, BSP for a classic feel, Cellular Automata for caves, Noise for outdoor maps).

The art and audio side is solved by the Sorceress browser stack. Quick Sprites at 9 credits per generation handles every hero and monster sheet, True Pixel quantizes any image to a roguelike palette in seconds, AI Image Gen at 2 to 8 credits per image produces tilesets and backgrounds, Music Gen at 10 credits per track produces chiptune dungeon loops, and Sound Studio plus SFX Gen handle the per-hit SFX. The full asset pack for a single 12-floor roguelike lands well under $50 worth of credits, and the 100 starter credits cover the first playable build for free.

The GDScript side is solved by WizardGenie. The eight-model picker writes accurate Godot 4.6 GDScript (TileMapLayer, _input, class_name Actions, Resource and .tres, FileAccess, signals) when prompted with the 4.6 idiom in the system message. The Planner+Executor cost pattern keeps the typing bill at one-fifth of single-frontier cost, which is what turns a feature-rich roguelike from a frontier-only budget question into something an indie can ship in a month.

If the Godot specifics are not load-bearing for your project, the browser-native WizardGenie path on Phaser, Three.js, or HTML5 plus Canvas ships the same roguelike with a smaller bundle, faster startup, and the same AI workflow. The decision is the engine, not the AI — the AI rides on top of either one.

Frequently Asked Questions

What version of Godot should I use to make a roguelike in 2026?

Godot 4.6.3 stable, released on May 20, 2026 (verified against the official Godot Engine download archive and the godotengine/godot GitHub release tag on June 10, 2026). The 4.6 line is the right adoption target for new roguelike projects because it ships the TileMapLayer node (each tile layer is its own node, replacing the deprecated single-TileMap-with-many-layers shape), the steady 2D physics interpolation, and a faster multithreaded resource loader, all of which matter for a roguelike with one map per dungeon floor and a fresh procedural rebuild every run. The 4.6.3 maintenance release fixes stability and usability bugs on top of 4.6 and is the recommended adoption target for new projects; the 4.7 branch is still in active development. Godot is free and open source under the MIT license with builds for Windows, macOS, Linux, Android, and a self-hosted web editor, so the engine cost on a roguelike is zero before the art and AI bills start.

Should I use _process or _input for turn-based roguelike movement in Godot 4?

Use _input, not _process. The _process method runs every frame and is the right call for real-time games that need continuous input polling. A roguelike is turn-based and event-driven: nothing in the game advances until the player presses a movement key, then the player moves, then the enemies move, then the round ends. Polling every frame inside _process wastes CPU cycles and creates double-input bugs on key repeat. The canonical Godot 4 pattern (documented in the Godot Roguelike Basic Set and the SyntaxCache GDScript roguelike tutorial, both verified June 10, 2026) wires the Game node’s _input method to an EventHandler node that converts each InputEventKey into an Action subclass (MovementAction, EscapeAction, AttackAction), then calls action.execute(self) on the returned action. The Action classes are registered with class_name so the Game node can type-check the returned action and dispatch the round.

What is the difference between TileMap and TileMapLayer in Godot 4 for a roguelike?

TileMap is deprecated in Godot 4. The new TileMapLayer node holds exactly one layer of tiles, references a shared TileSet resource, and exposes the same atlas-coordinate and source-ID API as the old TileMap but one node at a time (verified against docs.godotengine.org TileMapLayer class reference on June 10, 2026). A roguelike that wants a ground layer, a wall layer, a decoration layer, and an overhead foreground uses four TileMapLayer nodes parented to a single World scene; each layer can be saved, scrolled, and updated independently. The TileMapLayer also exposes get_tile_map_data_as_array and set_tile_map_data_from_array, which is the right serializer for the permadeath save buffer because tile state round-trips losslessly without hand-serializing every Vector2i atlas coord. For a roguelike specifically, the ground TileMapLayer is the procedurally generated dungeon, the walls layer is the unbreakable border, and the decorations layer holds the doors, torches, and stairs.

Which dungeon generation algorithm should I pick for a Godot 4 roguelike?

Start with Drunkard’s Walk if you want instant visual feedback, BSP if you want classic roguelike rooms with corridors, Cellular Automata for cave-shaped open chambers, and Noise terrain for natural-feeling islands. The four are the standard set documented in the Godot Roguelike Basic Set series (verified June 10, 2026). Drunkard’s Walk is the simplest: pick a start tile, walk N steps in random cardinal directions, mark every walked tile as floor; gives organic curves and is great for one-floor demos. BSP (Binary Space Partitioning) is the structured pick: recursively subdivide a rectangle into rooms, connect the rooms with L-shaped corridors; gives the classic roguelike layout that most players associate with the genre. Cellular Automata starts with a grid where each cell is randomly floor or wall, then runs a smoothing pass where each cell becomes whatever the majority of its eight neighbors are; gives cave-shaped chambers with natural-looking walls. Noise terrain samples a Perlin or OpenSimplex noise field; gives island and biome shapes. The mature roguelike build uses a strategy pattern with an enum DungeonAlgorithm and a switch that picks between the four at run time, which lets the same dungeon floor template support multiple biomes.

How do I generate sprites for a Godot roguelike without drawing?

Quick Sprites at 9 credits per generation handles every character, NPC, and enemy sheet (verified at CREDITS_PER_GEN = 9 and MODEL_ID = 'retro-diffusion/rd-animation' in src/app/quick-sprites/page.tsx on June 10, 2026). The Four Angle Walking preset produces a 48 by 48 four-direction four-frame walk cycle ready for the player and humanoid NPCs. The Small Sprites preset gives a 32 by 32 six-row layout with right walk, left walk, arm movement, look, surprise, and lay-down poses, which is the right shape for monsters and bystanders. The VFX Effects preset spans 24 to 96 pixels for spell effects, fire, explosions, and pickup glows. Output is a packed PNG sheet plus an animated GIF preview that drops straight into a Godot 4 SpriteFrames resource or AtlasTexture, with pixel-perfect render preserved by setting the Default Texture Filter to Nearest in Project Settings. For the dungeon tiles themselves, True Pixel at /pixel-art handles image-to-pixel-art conversion with eight palette presets (PICO-8 16, SWEETIE-16, Endesga 32, Game Boy, CGA, NES 54, Grayscale 8, 1-Bit), and AI Image Gen at /generate produces tileset bases at 2 to 8 credits per image.

Can WizardGenie write the full Godot roguelike GDScript end to end?

WizardGenie writes the GDScript scripts, the scene-tree wiring, the signal connections, the Action class hierarchy, the dungeon generator class, and the save and load functions. It does not directly open the local Godot editor, so the workflow is: prompt WizardGenie for a system (“write an EventHandler node that converts InputEventKey to MovementAction or EscapeAction, with DIRECTIONS dictionary keyed by InputEvent action names”), copy the GDScript output into the local Godot 4.6.3 editor, attach the script to the matching node, and run the scene. The eight coding models in the WizardGenie picker (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, verified against src/app/_home-v2/_data/tools.ts on June 10, 2026) all write accurate Godot 4 GDScript when prompted with the 4.6 idiom (TileMapLayer not TileMap, _input not _process, class_name for Action types, Resource and .tres for data). The Planner+Executor pattern pairs a Claude Opus 4.7 or GPT-5.5 planner with a DeepSeek V4 Pro, Kimi K2.5, or MiniMax M2.7 executor and lands the typing cost around one-fifth of single-frontier.

How do I save and load a roguelike run in Godot 4.6.3?

Use FileAccess plus JSON for the player and run state, and use TileMapLayer.get_tile_map_data_as_array and set_tile_map_data_from_array for the dungeon-floor tile state (verified against the official Godot 4.6 TileMapLayer documentation on June 10, 2026). The Dictionary holds player_stats (level, current_hp, max_hp, attack, defense, depth_reached), inventory (Array of item ids), seen_tiles (Array of Vector2i tiles the player has explored, stored via var_to_str), current_floor, and rng_seed; serialize with JSON.stringify, write through FileAccess.open(“user://current_run.json”, FileAccess.WRITE) and file.store_string(json_text). The TileMapLayer state goes to a parallel .sav file written through file.store_buffer(tilemap.get_tile_map_data_as_array()). For permadeath, delete both files when the player dies; for save-scumming prevention, encrypt the JSON with FileAccess.open_encrypted and a per-install key. The user:// path resolves to AppData on Windows, Application Support on macOS, and ~/.local/share on Linux, so saves survive engine updates and live outside the project folder.

Should I ship a Godot roguelike to the browser the way Phaser roguelikes ship?

Yes, through the Godot HTML5 export template (verified against the official Godot 4.6 export documentation on June 10, 2026). The 4.6.3 release ships precompiled web export templates and a self-hosted web editor build, so a finished roguelike project exports to a static HTML plus WebAssembly plus PCK bundle that runs on any modern browser tab. The trade is download size and startup latency: a 2D turn-based roguelike with the standard Godot 2D nodes runs comfortably on web once loaded, but the initial WASM bundle is 30 to 60 megabytes after compression, which is noticeable on the first visit. For a tighter web target, set the export-template resolution down, use Vorbis instead of WAV for audio, avoid threading-dependent code paths, and strip unused modules in the custom build. The HTML5 build then drops onto itch.io, a custom domain, or any embed surface. If browser-first matters more than Godot-specific features, the WizardGenie path that ships native HTML5 plus Canvas or Three.js roguelikes is the better fit: smaller bundle, faster startup, the same AI workflow.

Sources

  1. Roguelike - Wikipedia
  2. Godot (game engine) - Wikipedia
  3. Procedural generation - Wikipedia
  4. Binary space partitioning - Wikipedia
  5. Cellular automaton - Wikipedia
  6. Field of view in video games - Wikipedia
  7. Permadeath - Wikipedia
  8. Tile-based video game - Wikipedia
Written by Arron R.·2,966 words·13 min read

Related posts