Group all raw art by role under art/ (characters, levels, weapons, fx, anim, textures, ui, icons, fonts, hdri, materials), matching the earlier code reorg. Files are snake_case; asset uids are preserved so uid:// refs still resolve, and every res:// path reference is rewritten across scenes, scripts and project.godot. - Move the used assets out of Assets/ Animations/ fonts/ HUD/ HDRI/ Materials/ into art/; remove those dirs. - Materials snake_cased: barrel_metal, barrel_wood, bear_claw_fx, fire. - Delete unreferenced assets: alternate models, empty stub scripts, superseded BEAR_*.tres, marketing/spare PNGs, a spare font weight and the orphan M_Barrel_wood.gdshader. - Blender: drop .blend auto-backups and matador_v01/v02 (+ stale v02 fbx); keep matador_v03 and repoint create_matador_anims.py to it. .gitignore now blocks all Blender/*.blend[0-9] backups. - GLB Extract-Textures siblings (art/levels/*.png) kept and tracked. - Document the art/ layout in CLAUDE.md. Headless suite green; menu and gameplay shell boot clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FBbGXbzg3SD6ZBSadPPF5H
Tests
Headless, deterministic tests that run in CI (.gitea/workflows/ci.yml) and locally via
bash run_tests.sh. Nothing here needs a GPU — even the UI checks assert computed geometry
instead of comparing pixels, so the whole suite runs in plain headless Godot.
Run
bash run_tests.sh # lint + every headless test (+ gameplay assertions)
bash run_tests.sh --no-gameplay # skip the slower full-scene gameplay pass (what CI runs)
# a single test:
godot --headless --script tests/<name>.gd
Set GODOT to point at a specific binary: GODOT=/path/to/godot bash run_tests.sh.
The six layers
Order is cheapest first. The middle layers are where "don't break interactions/UI by accident" is actually won — none of them need a screenshot.
| Layer | What it drives | Example here |
|---|---|---|
| Scene smoke | Instantiate a scene headless, assert no errors | level_switch_test.gd (level modules load, no geometry leaks) |
| Unit / logic | Pure functions, no scene tree | logic_test.gd; harness_selftest.gd (proves test_helpers.gd) |
| Signal contract | Emit a signal, assert args/count | to add: died / health_changed / all_defeated fire correctly |
| Interaction | Feed synthetic input, step frames, assert state | touch_controls_test.gd, matador_charge_test.gd |
| Scenario / replay | Scripted inputs + fixed seed over a whole fight | difficulty_sim.gd (a report), bear_boss_test.gd |
| UI layout | Resize the viewport, query Control rects |
ui_layout_test.gd (on-screen, text fits, tap size, scroll) |
Shared harness
test_helpers.gd (class_name TestHelpers) holds the primitives every test used to re-implement:
TestHelpers.make_rng(seed)— a seededRandomNumberGenerator. Determinism is the precondition for the interaction/scenario layers; seed the RNG here instead of the globalrandf()/randi()so a test replays identically. (Reworking gameplay code to accept an injected RNG is tracked in the refactor plan's Workstream 2.)TestHelpers.approx(a, b, eps)/vec_approx(a, b, eps)— float/vector comparisons with tolerance, because computed positions never compare exactly equal.- A pass/fail tally:
t.ok(cond, msg)andt.report(), which printsResults: X passed, Y failedand returns the process exit code.
New tests follow the existing idiom: extends SceneTree, _init() → _run.call_deferred(),
print PASS: / FAIL:, and quit(t.report()).
Next step: GdUnit4
The hand-rolled harness is enough for CI today. The plan's Workstream 5 adopts GdUnit4 for a fluent assertion API, its scene runner (synthetic input + frame stepping — purpose-built for the interaction layer), and HTML/JUnit reports. Adoption is incremental, so the current tests keep running throughout:
- Add it under
addons/gdUnit4(AssetLib in-editor, or a git submodule) and enable the plugin in Project Settings → Plugins. - Point CI at GdUnit4's own GitHub Action (it publishes the JUnit report to the PR) alongside the
existing
run_tests.shstep. - Port suites one at a time —
test_helpers.gd's primitives map directly onto GdUnit4 assertions, so a ported test is smaller, not larger.
Do not vendor GdUnit4 into this repo by hand; install it through AssetLib or a submodule.