02 // Architecture
Software architecture blueprint
Four zones from left to right: data and localization, a deterministic rules core in game/core/, the 2x renderer with procedural audio, and edge services. Six verification layers run under all four.
game/core/battle/battle_sim.gd // 1,398 lines
Deterministic integer battle engine
The simulation uses integers only. A grep for randi, randf, randomize or RandomNumberGenerator across game/core/battle/ returns no hit. Each fighter acts every TICKS / pace ticks. A tie goes to the fighter with more time, then to the hero.
const MAX_SPEED := 16
const TICKS := 5342931457063200
const CLOCK_DIV := 16
const MAX_ROUNDS := 30 # past this, the hero loses
const DUSK_ROUND := 13
const HARD_DEF_K := 50
The first death ends the fight. Damage goes through hard DEF first, floor(A * def / (def + HARD_DEF_K)), then armour, then HP. Entry points are simulate, simulate_group, simulate_duel and fingerprint.
game/content/*.json // data only
Data-driven content
The content folder holds JSON and nothing else. No .gd file lives in game/content/. Counts come from parsing each file.
- 105items
- 19Landlords
- 19monster cards
- 6biomes
- 9vows
- 4guilds
- 31events
- 6champions
- 10spells
Text lives in Godot CSV catalogs in game/i18n/: ui.csv for everything the code shows and content.csv for the JSON fields. English is the source, with 13 translations (14 shipped locales in total) plus the eo pseudo-locale.
docs/TESTING.md // 4,671 GUT tests in 517 files
Six-layer verification pipeline
- L0Rules, content, economy and i18n. Under 2 minutes, on every push.
- L1UI and flow. 13 minutes on Linux, about 20 on a PC, on every push in CI.
- L2Balance bots in
game/tools/bot/*.gd.
- L3Automated evolution bots on a dedicated test machine.
- L4Automated bots that play the game through text.
- L5Automated bots that play from the screen image, on 12 screen formats.
CI pins Godot 4.5-stable and checks its SHA-512 against SHA512-SUMS.txt before it runs the fast and ui matrix.
tools/audio // tools/*-worker
Procedural audio and edge Workers
gen_sfx.py synthesizes the sound effects with no samples and no ffmpeg: 44.1 kHz, 16-bit mono, a seeded generator instead of the system RNG, peak normalization and DC blocking. The same seed writes the same file.
The audio.gd autoload runs 14 SFX voices with a 35 ms minimum repeat and a 1.4 s music crossfade. set_landlord_tension(t) drives the adaptive Landlord night track.
bugreport-worker turns in-game reports into issues and receives opt-in telemetry in the RunTrace format; the game asks at most twice. pvp-worker answers 503 on every route unless PVP_ENABLED is true, and a headless verifier replays each challenge through verify.gd. The 0.7.2 build ships with pvp/online=false, so this path is off in production.