Case study 01 // game engineering // art direction

Dawnbringer_

A dark-fantasy roguelike auto-battler built in Godot 4.5. Build a hunter, read each foe's gear, then pay the Landlord or fight. This page covers the deterministic battle engine, the data and test pipeline, and the Votive Gothic art direction.

  • Godot 4.5
  • GL Compatibility
  • GDScript
  • v0.7.2 source
  • 640×360 base viewport
  • 14 export presets

Official links

Plate 00 // Key art at 1280×720, the 2x density of the 640×360 design space.

01 // Stack

Language and runtime constellation

Counted on disk with os.walk, skipping .git, .godot, exports and build folders. Select a node to read its role.

Dawnbringer stack constellation: GDScript at the hub, GLSL, Python and JSON with CSV on the inner ring, TypeScript, SQL and Shell on the outer ring. Dawnbringer stack constellation: GDScript at the hub, GLSL, Python and JSON with CSV on the inner ring, TypeScript, SQL and Shell on the outer ring.

01 // GDScript // 1,068 files1,051 files in game/ and 17 in tools/. 517 are GUT test files with 4,671 test functions; the rest run the battle engine, run flow, HUD and HdTexture. Plus 81 .tscn scenes.

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.

Fig. 01 // Godot 4.5 architecture. Select the diagram to enlarge it.

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

  1. L0Rules, content, economy and i18n. Under 2 minutes, on every push.
  2. L1UI and flow. 13 minutes on Linux, about 20 on a PC, on every push in CI.
  3. L2Balance bots in game/tools/bot/*.gd.
  4. L3Automated evolution bots on a dedicated test machine.
  5. L4Automated bots that play the game through text.
  6. 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.

03 // Art direction

Votive Gothic

"A candle carried through a house that belongs to someone else."docs/v3/ART_DIRECTION.md // the direction in one line

The weight and cold of Dark Souls, the small expressive motion of Undertale and the instant state reading of Slay the Spire, drawn as 2x pixel art in the 32 colours of Dark Fantasy 32. Each pillar comes with a test an artist can run on a frame.

  1. P1

    The wick is the only warm thing

    #FFE9A8 belongs to Hesper's fire, champion wicks, heal, crit and revive FX, The Last Light and UI focus. Darkness and Landlords stay cold.

    #FFE9A8 appears only in those reserved roles.

  2. P2

    Silhouette first

    Every figure must read at design size: 32 px for champions and monsters, 64 px for Landlords.

    a flat #0B0710 silhouette on #3A2A3C is still recognizable.

  3. P3

    Pose over frames

    Weight comes from held key poses and long recoveries, not from frame count.

    anticipation lasts at least 2x the strike frame, and dangerous moves telegraph before they hit.

  4. P4

    Small motion, big character

    Idles carry 1 to 2 design pixels of personality, documented as beat in the JSON sidecar.

    an idle where the whole sprite slides fails.

  5. P5

    State is never in doubt

    Screen shake and flash have hard caps.

    any frozen combat frame answers who is winning and what is lethal within 2 seconds.

04 // Palette

Dark Fantasy 32 and the six biomes

game/assets/palette.json locks 32 colours in 9 ramps. Light comes from the upper left, the outline is a selective 1 px #0B0710, and anti-aliasing is forbidden. Each biome lists its base ramps, accent quotas and forbidden colours. Pick a biome, then click a swatch to inspect and copy it.

ink
stone
skin
blood
steelblu
ember
poison
arcane
steel

Outlined: base rampOrange ring + %: accent quotaStruck: forbiddenR: reserved role

Dark Fantasy 32 // all colours

32 colours in 9 ramps: ink, stone, skin, blood, steelblu, ember, poison, arcane and steel. tests/art/test_backdrops.gd checks the backdrops against it.

Selected colour

Click a swatch to see its ramp, its role in the current biome and to copy its hex.

05 // Rendering

2x HD pipeline with sharp-bilinear sampling

Artists rig every sprite in design space, and the generators rasterize it natively at 2x density. Nothing is upscaled.

Champions
32×32 design, 64×64 texels
Landlords
64×64 design, 128×128 texels
Items
16×16 design, 32×32 texels
Backdrops
640×360 design, 1280×720 texels
Shading
5 tones per material (hd.RAMP5), 1 to 2 texels of occlusion, selective 1-texel #0B0710 outline

HdTexture (game/scenes/battle/hd_texture.gd) reports the design size to Godot's layout and hands the 2x texels to the GPU.

At 1080p one texel covers 1.5 screen pixels, and phones scale by fractional factors. Plain nearest sampling then draws some texels wider than others and shimmers when sprites move. hd_sharp.gdshaderinc applies sharp-bilinear sampling so blocks stay crisp and keep equal widths.

06 // Motion

Animation contract

116 sprites × 14 strips. Every strip has a JSON sidecar with durations_ms, events (hit, release, footstep, wick_out) and beat. At 2x and 4x speed no frame drops under 33 ms. The game drops smear frames first, then follow-through, and never drops anticipation or impact. Hit-stop never drops under 30 ms.

Sheet A // Light attack in 6 frames: 110 / 160 peak hold / 40 smear / 90 impact / 100 / 120 ms. The hit lands at 310 of 620 ms.
Sheet B // Landlord entrance: dark at 0 ms, eyes at 300, cold rim at 700, loom at 1200, settle at 1500. 2.4 s with the name card.
Sheet C // Panel open 180 ms (ease-out-back, alpha 100 ms), close 110 ms (ease-in).

The sheets live in docs/v3/art_direction/ next to palette_roles.png. ANIMATION_DIRECTION.md defines the timing contract they illustrate.

The attack holds its peak for 160 ms and spends 40 ms on the smear. When the player speeds the fight up, the smear goes first: the 160 ms hold is what makes the blow read as heavy.

07 // Plates

Gameplay plates

In-game captures at the 640×360 design resolution. Select one to view it at full size.

Battle // Round 1, Ironbound Penitent against the Ladle Smelter and Slag Beetles.
Landlord // The Orchard Eater asks a tithe of 18. Pay it or fight.
Build // Hunter sheet with gear slots and family set bonuses.
The House // Hunter setup, starting weapon and the item pool before a run.