Files
dungeoncraft/DESIGN.md
T
Richard ZinkandClaude Opus 5.5 fb7dab3683 Title screen, pause menu, settings dialog and savegames
- title screen (continue/new/load/settings/help) and Esc pause menu
- settings: language & sound, camera, graphics, game, rebindable keys;
  stored in localStorage and in every savegame (always applied on load)
- savegames as JSON (.dcsave): download, load via file picker or drag & drop
- autosave to localStorage every 2 minutes and when the tab is hidden/closed
- configurable wall detail, light count, interface size, game speed, hints
- audio behind a cargo feature so native tests run (cargo test --no-default-features)
- savegame round-trip test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 23:08:33 +01:00

4.5 KiB
Raw Blame History

DungeonCraft – Design Decisions

An original dungeon management game (genre: dungeon building & defence) that runs as WASM in the browser.

Technology

  • Rust + macroquad (WebGL), target wasm32-unknown-unknown
  • User interface drawn entirely in the canvas
  • Font: DINOBYTE bitmap font (CP437, 6×8 px, CC BY 4.0, see CREDITS.md) for all texts, integer scaled
  • All UI windows use CP437 frames (single lines for panels, double lines for dialogs); bars (HP/mana/gate) are pixel bars
  • Sound: event system + macroquad audio prepared (volume, mute key M); sounds will be generated later
  • Languages: all in-game texts live in language files (lang/*.lang, key = text); English is the reference/fallback, German included, more can be added. The language is chosen on first start and stored in the browser.
  • Repository language: English (code, comments, docs, commit messages)

Graphics

  • 3D, true isometric (orthographic camera)
  • Camera freely rotatable 360° and tiltable
  • Walls with an irregular surface (noise displacement of the wall faces, seamless between neighbours)
  • Textures: procedural pixel art (tile atlas)
  • Units: pixel sprites as billboards (always facing the camera)
  • Lighting: dark + torches – dark base level; claimed areas and light sources (torches, core, portal, gate) are bright, flickering light
  • Tile outlines: subtle dark lines around every tile (floors, wall tops, vertical wall edges), following the irregular surface; toggle with G (later in the graphics settings)
  • The UI is a 2D layer on top, including a minimap

Controls

  • Left click: use the active tool (drag a rectangle for digging/rooms)
  • Right click: drop a unit from the hand
  • Camera: WASD/arrow keys, right mouse drag, mouse wheel zoom, screen edge
  • Rotate/tilt: middle mouse drag, Q/E rotate, R/F tilt
  • Spells: 0 lightning, X heal, V summon imp
  • Torches: placed automatically when ground is claimed; foreign areas are dimly visible

Menus, savegames, settings

  • Title screen (Continue, New Game, Load, Settings, Help) and pause menu on Esc (Resume, Save, Load, Settings, Help, Main Menu)
  • Savegames as JSON (*.dcsave, format tag + version, ~300 KB): save = download, load = file picker or drag & drop onto the game window
  • Autosave in the browser (localStorage) every 2 minutes and when the tab is hidden/closed; "Continue" on the title screen
  • Settings: language + sound, camera (rotation/zoom speed, edge scrolling, invert mouse), graphics (tile outlines, wall detail, light sources, interface size), game (speed 1×/2×, hints), key bindings (conflicts swap keys; Esc and arrow keys are fixed)
  • Settings are stored in the browser and in every savegame; loading a savegame always applies its settings

Planned

  • Music: own XM/MOD replayer in Rust, shared mixer for music + sound effects (streamed via a JS audio plugin, replaces macroquad audio)
  • Soundtrack (composed as .xm, editable in MilkyTracker): title/menu, several calm build tracks, battle, victory/defeat jingles; the title melody is a recognisable leitmotif in every piece

Game content

  • Digging: mark earth/gold → Pit Imps dig, bring gold home and claim ground
  • Rooms: treasury, lair, mushroom garden, training hall, library
  • Claim the portal → creatures: kobold, cave spider, shadow mage, stone ogre (depending on rooms)
  • Needs: sleep, food, wages (payday); unhappy creatures leave
  • Hand: pick up / drop own units (max. 8)
  • Spells (mana): lightning, heal, summon Pit Imp
  • Heroes: knight, archer, priest, dwarf miner, paladin of light (they dig their way to the Soul Core)

Goal

  • Victory: destroy the Hero Gate
  • Defeat: the Soul Core is destroyed

Attacking the gate

  • Attack flag: the player places a rally flag; free creatures march there and attack everything nearby (including the gate)
  • Gate: about 3000 HP, regenerates slowly when not under attack
  • Defenders appear at HP thresholds 75% / 50% / 25% (the last squad with a boss), challenging

Hero waves

  • Endless while the gate stands
  • Strength follows the army value (sum of HP × damage of all creatures incl. levels)
  • Wave strength grows from 60% to 100% of the army value, with some randomness
  • Grace period of 5 minutes, then a minimum wave (e.g. 2 knights) even with a weak army
  • Goal: always beatable, but challenging

Operations / testing

  • Build in Docker (multi-stage: Rust → nginx:alpine)
  • Test build on port 18093, later additionally a subdomain via Nginx Proxy Manager