Project Cerberus
A 2D fighting game in Godot 4.7, built on the
openfight fighting-game engine
(GDExtension, LGPL-3.0), with
NRR vendored as the default upscaler —
installed, loading, running, and declining every frame for a reason it states out
loud. See The render path below.
The roster and stages come from the ZERO's Universe lore bible — five
properties that share one anthology: Conquest of Verelin / Diaporia (high
fantasy), New Aurora 3187 (cyberpunk), FEaster in Franklin (slasher
horror), Us vs. The Clowns (1992 biker), and Yokai Hon'nō Academy
(shonen). The first vertical slice is Tsu Ibano vs. Fei Young in the
Gijutsu Gym.
Status: M0–M1 complete
|
|
| ✅ M0 |
openfight GDExtension builds natively on macOS arm64 and loads in Godot 4.7.2; class registers; 600-frame headless smoke test; Metal render test |
| ✅ M1 |
health, damage, best-of-three rounds and 4 Godot signals patched into the engine — a full match runs headless and passes its assertions |
| ✅ M2 |
full menu flow — title, fighter select, stage select, match, results, options and an in-match pause menu; gamepad bindings; settings persisted to disk. Walked end to end headless. |
| ✅ M3 |
art + YAML pipeline; the two vertical-slice fighters are playable end to end — every state reachable, every hitbox connecting |
| ⏳ M3.5 |
art fidelity: alpha, 1:1 pixels, 16-colour palettes, AI-generated frames |
| ⏳ M4 |
vertical slice lock |
M2, verified
tools/verify/m2_flow.tscn drives the whole flow the way the UI does and
asserts on where it lands:
roster: 1 entr(ies), first is 'RYU'
stages: 1 entr(ies), first is 'TRAINING ALLEY'
gamepad bindings present on all 12 sampled actions
InputBindings is idempotent (second run added 0 events)
settings round-trip through user://settings.cfg
flow reached the match: title -> char select x2 -> stage select -> match
match reported winner 0
last_result agrees with the signal: winner 0
round wins total 2: [2, 0]
results screen heading: 'PLAYER 1 WINS'
rematch re-entered the match
PASS: full menu flow with no dead ends
The match shell itself is covered by m2_hud.tscn:
round labels : ["ROUND 1", "ROUND 2"]
announcements : ["ROUND 1", "FIGHT!", "K.O.", "ROUND 2", "PLAYER 1 WINS"]
bar target min: p1=100 p2=0
result label : 'PLAYER 1 WINS'
M3, verified
tools/verify/m3_roster.tscn loads the real match with Tsu Ibano against Fei
Young and forces a fight to a decision — the pipeline emitting plausible PNGs is
not the claim, the claim is that a fighter built from a design sheet is
playable.
matchup: TSU IBANO vs FEI YOUNG in GIJUTSU GYM
=== M3 roster test summary ===
elapsed : 19.7s (1174 frames)
hits : 30 (210 damage)
hit strengths : { "HIT_M": 30 }
defender states: ["hurt_mid"]
min health : p1=100 p2=0
winner : 0
PASS: the generated fighters are playable end to end
The hit strength is the interesting line. A light punch reaches 1punch, which
carries HIT_M, and the defender's own state machine turns that into hurt_mid —
so the assertion pins the whole chain LP -> 1punch -> HIT_M -> hurt_mid rather
than merely noticing that something landed.
tools/verify/m3_boxes.tscn is the check that fails when it stops being true. It
walks player one in and screenshots the engine's own box overlay, which the
generated YAML switches on with show_hitbox. A hitbox that is in the wrong place
leaves everything else looking healthy — every frame loads, every state is
reachable, the round timer runs — so the only symptom is an absence, and a
screenshot of where the engine tested is worth more than any amount of reading
where it should have:
=== M3 box overlay check ===
hits : 15 (105 damage)
PASS: hitboxes and hurtboxes connect in the engine
All ten scenes pass:
m0_smoke PASS m0_render PASS
m1_match PASS m2_render PASS
m2_hud PASS m3_boxes PASS
m2_flow PASS video_options PASS
m3_roster PASS
walls PASS
Movesets
Six normals — light, medium and heavy for each limb — two specials, and a chain
per limb.
|
LP |
MP |
HP |
LK |
MK |
HK |
| state |
1punch |
2punch |
3punch |
1kick |
2kick |
3kick |
| lands on |
hand |
hand |
hand |
foot |
foot |
foot |
| world y |
20–26 |
21–27 |
21–28 |
−1–5 |
10–17 |
14–22 |
| strength |
HIT_M |
HIT_M |
HIT_H |
HIT_L |
HIT_M |
KNOCK_DOWN |
Damage follows the strength, out of the engine's own table (actions.cpp): 4 / 7 /
11 / 10. The kicks come off foot_far and the punches off hand_far, so a move
named for a leg reaches with a leg. Every strike used to be _strike, which
animates the arm and leaves lift — the only parameter that moves a leg — at 0
for the state called kick: the move named for a leg reached out with an arm, and
the hitbox was a fist the game called a foot. The three kicks are a shin kick, a
hip-height kick and a chest-height kick, which is what those hip and knee angles
actually produce rather than what they were named.
Combos are the engine's own combo: true: while the current animation is a
combo, a command only takes effect if the opponent is hurt. The chain is therefore
confirmed by the hit rather than by a timer — LP → MP → HP and LK → MK → HK,
with the heavies as enders that cannot themselves be cancelled out of, because a
chain with no ender is not a chain. A whiffed jab plays out and returns to idle
like any other move.
Specials are two off one motion, which is the shape the fixture already uses —
its own QCF_LP and QCF_HP are the same F,~D prefix with the punch button
choosing: QCF+HP is the field (KNOCK_DOWN), QCF+LP a lighter, faster version
of it (HIT_M).
tools/strike_strip.py composes every strike on the frame its hitbox is live, so
what can be checked by eye is what the game will actually test.
The pushbox has no answer for a wall
The engine's pushbox is two velocities — the mover is shoved back half its speed,
the opponent twice it. That is fine while the opponent has somewhere to be shoved
to. A fighter clamped against a wall does not, so the mover walks into the space it
is standing in: measured with walls and nothing else changed, p1 reached 107.83
against p2's 108.00, fully overlapped, after which its own punch began 8.7 units
past the opponent and the fight never connected again.
Patch 0004 resolves the remainder of the separation in steps — and only when the
opponent is at a wall, which is the case the shove cannot handle. Running it
always also separates a free opponent, and that is not an improvement: the
fixture's own match test went from 20 hits to 6 and stopped reaching a decision,
because two fighters that never touch cannot shove each other across the stage
either. The shove is the engine's design; the patch repairs the one situation it
has no answer for rather than replacing it.
Stage walls
A fighting game has edges; openfight had none. Nothing anywhere in it bounded a
fighter's x, so both of them walked off the stage and kept going until the round
ended — visible as a fighter strolling past the opponent and out of the picture.
Patch 0003 clamps x inside Player::moveXpos, which is the single function
every position change goes through — walking, the pushbox, and the pushbox's shove
of the opponent — so there is one edge rather than three. The bounds are stage
data (bounds in the stage manifest) rather than constants, because the right
answer depends on how much of the world is on screen, and this engine's camera has
never moved: Camera is constructed, read by the renderer, and never written. The
backgrounds are 200 units wide against a view of about 130, so they already
overflow it — a follow camera is what turns these bounds from "the screen's edges"
back into "the stage's".
The patch also exposes get_player_x, without which none of this is checkable:
the node published no position at all, which is exactly why "walked off the stage"
went unnoticed. walls drives a fighter into each edge and asserts the pair
stops there:
left wall : furthest -10.00 (edge -10.0) p1 -10.00 p2 70.00
right wall : furthest 108.00 (edge 108.0) p1 100.84 p2 108.00
PASS: the stage has edges and the fighters stop at them
p1 stops at the left wall exactly. On the right it stops at 100.8 rather than 108
because walking right drives p1 into p2, and the pushbox carries p2 to the wall
and pins it there — which is the correct interaction, and why the check asserts
the pair reaches the edge rather than one fighter.
The render path
The game draws at 768x432 and enlarges that to whatever the window is, and how
it enlarges is a setting: NRR (neural, the default), Nearest
(pixel-perfect) or Smooth (interpolated). The options screen offers all three
and shows which one is actually in force.
NRR is vendored at addons/nrr; its native binding is built for macOS arm64 from NRR
198dba7 plus the four patches in patches/nrr/, and it loads, runs and upscales.
Measured headless on this machine, CPU execution provider, release build:
nrr_probe:
384x216 -> 768x432 200 ms half-resolution canvas -> canvas
768x432 -> 1536x864 834 ms canvas -> the 2x model's grid
1024x576 -> 2048x1152 1440 ms
1920x1080 needs a 2.5x head, because 2.5 x 768 = 1920 exactly and the ratio belongs to
the model: nothing outside the graph resamples the frame, so a tier is chosen by
installing a model rather than by setting one.
The reason this section used to give for NRR declining every frame was wrong, and the
correction is worth more than the original entry. It said 512x512 was the runtime's
limit and blamed a pinned revision older than the released model. The real cause was that
the macOS build contained no ONNX Runtime at all: NRR's CMake looked for the Android and
Windows layouts and neither of the Unix ones, so NRR_HAVE_ONNXRUNTIME stayed off, the
configure log said ONNX Runtime: not found (placeholder inference path), and the
runtime's placeholder path -- which reports a fixed 1x3x512x512 input shape and has no
session to execute -- was the only thing answering. 512x512 was the one size it agreed
to run, in 1.9 ms, without a model. Linking ORT exposed a second defect behind it: the
Godot binding read its result back from the texture it had allocated itself rather than
the one nrr_render returns, which is sized to the model's output grid, so every frame
came back correctly sized, correctly formatted, entirely zero, with an empty error
string. Both are now patches/nrr/0003 and patches/nrr/0004, and
tools/verify/nrr_output_check.gd is the tool that made the empty frame visible: a
checkerboard in, both frames out, so a crop, a resample, a same-size refinement and an
empty frame are four different pictures.
Nor would installing one help, which is the finding worth having. Scored against
our own art -- a frame composed at the game's own 6 px/unit, downscaled, then brought
back up against the frame itself as ground truth -- the released 2x model loses to
bicubic by 3.8-4.6 dB at every tier, including the 128-to-256 tier it was trained at,
and its error map is dense inside flat regions rather than at edges: it invents texture
on flat 16-colour art. The 2.5x model is the one that matches 1080p from this canvas
(2.5x of 768x432 is exactly 1920x1080, which is why the Hub publishes it at all), and
it lands level with bicubic while needing a depth plane this renderer has no source
for. Both are trained on 3D-rendered Godot captures, and a flat 2D canvas has nothing
for them to reconstruct.
That is why the options screen prints the runtime's own words rather than a summary of the
file listing. An upscaler that is selected, installed and silently not running is
indistinguishable from a working one unless somebody asks it, so video_options asks it
and asserts that the screen agrees with the answer -- and a pass that returns a frame of
the wrong size, or an empty one, is exactly what that assertion is for.
So NRR runs now, and the shipped default still does not use it, for a measured reason:
834 ms against a 16.6 ms frame budget. A 768x432 -> 1536x864 pass costs 0.83 s on this
machine's CPU provider and roughly 1.4-2 s for a 1080p output. That is a quality pass
rather than a frame-time one, and the GPU route is a build away rather than a setting:
NRR's provider preference offers CUDA and CPU (NRR_EXECUTION_PROVIDER), and ONNX
Runtime's CoreML provider is present on this machine but nothing in the binding selects
it. What would change the verdict, given the model finding above, is a model trained on
this art -- the trainer, the pairing generator (gen_training_pairs.py --ratio 2.5) and
the gates are all in the NRR tree and now reachable from here, and the 2.5x model that
came out of them is 91 k parameters. Until then the shipped default stays NRR selected,
with the honest pixel-perfect picture behind it.
Open bug: a round restart can stop the fight connecting
Reproduce with m3_boxes.tscn at PUNCH_PERIOD_FRAMES = 24: round one ends by KO
as normal, and round two then runs its full 99-second timer with the fighters
adjacent, animating, and no hitbox ever drawn in front of them. It is not a
geometry problem — the same match completes when the punch cadence is 14 frames,
and enlarging the hitbox and hurtbox both make it land again. It is recorded in
tools/verify/m2_flow.gd next to the cadence it constrains, because the symptom
imitates a box bug closely enough to be worth a warning.
M1, verified