loot-and-logic documentation
Choose a version
Version Other / archived
Loot & Logic client and engine #
The validated browser MVP proved the game concept but stalled at its desktop harnesses. The Tauri client had no generated Wilds stage and hid its canvas while in the overworld; both the Tauri and Electron harnesses reduced Wilds navigation to east/west action buttons, and neither preserved the MVP’s keyboard playthrough. Rather than keep expanding those helpers, the engine decision was reopened.
Decision #
Godot (4.7.2) is the primary client candidate, with Babylon.js in a web shell as the fallback.
Godot is a purpose-built game engine rather than a desktop web shell: dedicated 2D rendering and tilemaps now, a 3D path later, named rebindable input actions, desktop exports without a web shell, and WebSocket clients on desktop. The existing Node host and versioned WebSocket protocol remain the authoritative game boundary; only the renderer and client changed.
Options considered and rejected: plain Canvas in Tauri/Electron (rebuilds every engine system), Phaser (2D only), Babylon.js plus Tauri (retained as the fallback), a custom Java/Rust/C++ engine (engine construction cost), and Unreal or Unity (heavier than this project needs).
Client/host boundary #
The Godot client never reimplements game rules. It connects over the versioned WebSocket protocol:
POST /v1/join → Node authoritative host → authenticated WebSocket
→ SNAPSHOT, STATE_DELTA, COMMAND_RESULT, WORLD_CHUNKS → Godot presentation
Chunk generation, terrain collision, room bounds, loot, and exit rules remain authoritative host state. The MVP terrain generator lives in shared production code so the host, client, and tests all use the same rules.
Proof status #
- Title-first launch, start action, and escape menu.
- Deterministic 3×3 Wilds chunk streaming around the player.
- Four-direction keyboard movement with held-key repeat.
- Authoritative rejection of movement into water and rock.
-
base → Wilds → Ore Vault → loot → same Wilds entrance → base. - Local save and resume of the same player and world after a host restart.
- Packaged standalone build and manual keyboard traversal.
- Full MVP gameplay parity in the selected client.
The thin proof currently runs at 1280 × 720. See the roadmap for how the remaining gates are sequenced.
2D now, 3D later #
The next playable build remains top-down 2D. The Wilds data stays renderer-independent: seed, chunk coordinates, terrain, structures, entrances, discoveries, and persistent edits belong to the authority, not to sprites or meshes. Only after the full 2D loop reaches parity will a small 3D voxel experiment answer camera, navigation, readability, and chunk-streaming questions before 3D becomes the product direction.