The Reaction Quirk
Running the duel’s _DoCombAction on the real 68000 code
(How We Verified the Rules) exposed a bug that has
shipped in both Spirit of Excalibur and Vengeance of Excalibur: when a
fight is refused (code 5), one of the four calls that adjust how two
characters regard each other is missing an argument. This page asks how much
that matters in play. Short answer: it almost never changes whether a fight
starts, and almost always changes how much the character who backed away
likes the one they backed away from. Raw notes:
docs/spirit/amiga/reaction-quirk-study.md in the main repo (not part of this
site).
Labels follow the project’s convention: confirmed means checked against the real code; hypothesis means a reading of intent that no oracle can settle.
What the code does (confirmed)
Section titled “What the code does (confirmed)”_Reaction(a, b, mode) scores how a regards b (0-99) and, with a non-zero
mode, adjusts a remembered grudge in the 50-entry _aReact table. After
_FightDone(opponent, 1) starts no fight, code 5 prints the “backs away”
text and runs two “ask, and if the score is above 5, knock it down by 2”
blocks:
if _Reaction(opp, actor, 0) > 5: _Reaction(opp, actor, -2) ; calls 1 and 2if _Reaction(actor, opp, ??) > 5: _Reaction(actor, opp or ??, -2) ; calls 3 and 4Calls 1, 2 and 4 push three longs and clean up with LEA 12(A7),A7. Call 3
pushes two and cleans up with ADDQ.W #8,A7 (Spirit Excal.asm:15605-15636,
CODE+0xB2F4-0xB364; Vengeance ExcalII.asm:26769-26807). _Reaction reads
its third argument from wherever the stack happens to hold it, and writes its
final mode back there.
| Spirit | Vengeance | |
|---|---|---|
What call 3 reads as mode |
the caller’s two id locals, opponent << 8 | actor: always a large positive number |
a stale word whose low byte duel code 7 left (the last side-A id) and whose high byte the previous _Reaction wrote back |
| What the write-back clobbers | the two id locals, so call 4 runs on ids (255, 0) or (0, 0) instead of (actor, opp) |
nothing that matters: the ids sit outside that word |
Effect on actor -> opp |
pushed straight to the ceiling: the entry saturates at 255 | nudged up by an id-sized amount per refusal |
The fixed reading (hypothesis)
Section titled “The fixed reading (hypothesis)”Calls 1 and 2 are a query and a punish. Call 3 has the same shape as call 1
with the ids swapped and its CLR.L -(A7) (the literal 0) missing, and the
> 5 guard only makes sense for a plain query. So the intended code is taken
to be call 3 (actor, opp, 0) and call 4 (actor, opp, -2): a symmetric pair.
That is the one fixed variant modelled. It is a reading of intent; the quirk
itself is not.
How it was measured
Section titled “How it was measured”A seeded simulation (tools/excalibur/sim-reaction-quirk.ts) imports the
verified spiritReaction and vengeanceReaction rules unchanged, loads the
compiled defaults through the harness, overlays one real EPISODE<n>.DAT
(Spirit 1-5, Vengeance 1-7), draws a cast of named characters and replays the
same stream of candidate refusals through each variant. Before every event it
asks what the real _FightDone asks: if either direction scores below 40 the
fight starts instead.
Ground truth. The real _DoCombAction code 5 was run ten times back to
back in one oracle script with no reset, on pairs from real episodes, and the
whole 50-entry table compared after every call:
| Game | Quirk model | Fixed model (null control) |
|---|---|---|
| Spirit, episodes 1 and 3 | 10/10 and 10/10 | 0/10 each |
| Vengeance, episodes 1 and 3 | 10/10 and 10/10 | 0/10 each |
Results
Section titled “Results”Means over the episodes, light regime (a cast of 8, 40 candidate events a run, 8 seeds x 40 runs per cell). “actor” backed away from “opp”.
| Metric | Spirit quirk | Spirit fixed | Vengeance quirk | Vengeance fixed |
|---|---|---|---|---|
| refusals played | 26.4 | 26.3 | 18.4 | 18.3 |
| fights started instead | 13.6 | 13.7 | 21.6 | 21.7 |
mean R(actor, opp) at the end |
98.8 | 50.9 | 86.9 | 51.2 |
R(actor, opp) >= 90 (the generous branch) |
99.5% | 0% | 58.9% | 0% |
R(actor, opp) < 40 (would fight) |
0% | 1.1% | 0% | 1.0% |
anyone refusing to deal (< 30) |
0% | 0% | 0% | 0% |
In the heavy regime (a cast of 24, 320 events) the grudge table fills and most new claims fail, which washes much of the effect out: the generous branch is open for 22.4% of Spirit pairs and 18.1% of Vengeance pairs, against 0 when fixed. Spirit’s clobbered fourth call scores two characters that do not exist (ids 255 and 0, or 0 and 0); across 442,598 real pair scores it changed none, only leaving on average one stray row in the table until the next claim overwrites it.
What a player would notice
Section titled “What a player would notice”Almost nothing about fights. Whether a duel starts is decided by the lower of the two regards, and the direction the bug leaves alone is the one that wears down by 2 a refusal in both versions. Fights started instead of a refusal agree to within 0.1 per run in both games, and nobody refuses to trade at these numbers.
What changes is generosity. After an NPC has backed away from your hero,
the original has them thinking very highly of you: in Spirit one refusal is
enough (the score goes to 99 and stays), in Vengeance a handful. That puts
them in _GiveItem’s generous branch (90 or more), where a build with the
argument intact would leave them at the middling 50 or so they started with.
If it is your own character who backs away, the pinned direction is
hero-to-NPC, which only the seizure code reads, so that case is mostly
invisible. A long campaign with many grudges washes the quirk out; a short one
with a few feels all of it.
Caveats
Section titled “Caveats”- The fixed reading is a hypothesis about intent; the quirk is confirmed.
- The cast, the 50/50 actor choice, the side-A id and the refusals per duel are modelling assumptions. The sensitivity runs (three refusals per duel; a cast of 12 with 60 events) keep the headline: Spirit 94.1 against 51.8 and 89% generous, Vengeance 85.0 against 51.9 and 54%.
- In Vengeance only code 7’s write to the stale word is known and modelled; whether another duel code at the same stack depth writes it was not traced.
Read next
Section titled “Read next”- How We Verified the Rules: the harness that found it.
- Vengeance: How We Verified the Rules: the sequel’s version of the same routine.