Skip to content

Top-down RPG bundle

The Top-down RPG bundle is a 60-second gameplay slice. An apprentice walks around a tilemapped hub, talks to three NPCs (Halden, Wren, Iolen), fetches Master Halden’s hammer from beside the well, and delivers it to complete a fetch quest. About 800 lines of TypeScript across 17 files plus 8 system components, a Yarn-style dialogue node graph, and a 3-state fetch-quest FSM.

This is the most complete bundle. It demonstrates roughly every tool surface Forge has. If you’re building an adventure, RPG, or anything top-down, start here.

  • Hub map and forest map with collision layers, painted tilesets, and signpost transitions between them.
  • Three NPCs with portraits, dialogue trees, and per-NPC schedules (Halden walks from smithy to signpost at midday, Wren paces between hut and well, Iolen drifts the south path).
  • A fetch quest FSM wired through EventBus: pick up the hammer, return it to Halden, quest complete banner.
  • In-world combat with melee swings, contact damage, iframes, XP and leveling, loot tables.
  • Day/night shader that tints the camera based on time-of-day. 90-second day cycle.
  • Full game shell: main menu, pause, settings (4 audio sliders + screen shake), credits, game-over.
  • Per-map music with AudioManager crossfade on transition.
  • Inventory overlay with collected items, save toast on autosave.
  • Voice-over slot wired on the Dialog bus, drop MP3s into public/audio/vo/ and key them in manifest.json to layer real lines on top of the per-NPC blip SFX.

The Top-down RPG bundle ships with 8 systems registered:

InputAction
WASD or arrow keysWalk in 8 directions (diagonals normalized)
E / Space (near NPC or item)Talk or pick up
E / Space (during dialogue)Advance text or skip typewriter
Click a choice buttonPick that branch
J / Space (in combat)Swing
Esc (combat-stub scene)Return to hub
R (after quest complete)Reload from a fresh start

The bundle’s main purpose is to teach the harness. Each of these takes a minute and exercises a different Forge tab:

  1. Theme palette: open src/data/theme.palette.json in the Palette tab. Shift the accent hue. Save. The dialogue overlay and quest banner repaint immediately.
  2. Tileset and tilemap: open public/data/overworld.tilemap.json in the Tilemap tab. Paint a tree-base tile in the collision layer; save. Walk into that tile in the preview, the player stops.
  3. Player animation: open src/data/player.animation.json in the Animation tab. Drop the idle_down clip’s fps from 4 to 2. The apprentice’s idle breath slows.
  4. Sprite sheet: open public/character/player.json in the Sprite Sheet tab. The atlas is an 8x4 grid; replace player.png with your own art and animations keep working as long as frame names match.
  5. Hub map: open src/data/hub.topdown-scene.json in the Top-down Scene tab. Drag Halden five tiles east. Save. He teleports there on next load.
  6. Dialogue: open src/data/quests.dialog.json in the Dialog tab. Edit Halden’s first line. Save. Talk to him in-game.
  7. Audio bus: Inspector → Systems → AudioManager. The Dialog bus ducks Music by 8 dB and SFXLoop by 6 dB whenever a dialogue node plays. Pull Music down 6 dB to verify changes are live.
  8. Combat: walk to the training arena past the hut, press E. Three slimes, 3 HP shown as hearts. Clear them to “win” and auto-return.
  9. Multi-map transition: walk to the signpost in the middle of the hub, press E. The scene rebuilds with the forest map (pond, dirt path, dense trees, two pickups, three wandering spores). Music crossfades.
  10. NPC schedules: watch the hub for 30 seconds. Each NPC walks their assigned waypoints over the 90-second day cycle.
  11. Day/night shader: open src/shaders/daynight.glsl in the Shader tab. Shift the sunset color. Save. Wait for sunset (cycle is 90s).

The bundle’s README inside the project root walks through 16 sections including emotion portraits, voice-over wiring, the loot table, and the XP curve.

  • Add an NPC: drop a portrait at public/portraits/<id>/idle.png, add dialogue nodes to data/quests.dialog.json, register in src/entities/npcs.ts, place in hub.topdown-scene.json.
  • Add a tile category: add 8 tiles to a strip of public/tiles/overworld.png, bump tilecount and width in the tileset JSON, paint with the Tilemap tab.
  • Add a hub area: copy hub.topdown-scene.json, edit placement, import + register in src/data/maps.ts, wire a signpost in hub-scene.tryInteract().
  • Branching dialogue: change a node’s next to choices: [{label, target}]. The choice rack auto-renders.
  • No bundled voice-over. The playback path is wired and the Dialog bus ducks Music + SFXLoop when a voice line starts. Drop MP3s into public/audio/vo/ and write the manifest to enable.
  • No multi-slot save. Single autosave slot. XP and level live on Phaser’s cross-scene registry, not the save file, so closing the tab resets progression.
  • No inventory UI beyond the overlay. Picked-up items go into a Set on the scene but there’s no equip system. Extend collectItem() in hub-scene to mint a real entry.

The bundle’s README inside the project covers the multi-map transition recipe, the loot table format, the XP-to-next-level curve in hub-scene.xpForNextLevel, and the emotion-portrait fallback rules.