kfsone / kfsone/mucka

CombatTracker regexes English prose for fight ends the FE protocol tags explicitly (08 10/11/12)

Open
#150 0 comments 0 reactions 0 assignees View on GitHub
enhancement medium
Dominant language
C#
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

The MUD2 FE protocol tags fight ends explicitly. `CombatTracker` ignores those tags and regex-matches
English prose instead.

## What the protocol provides

`fecodes.txt:114-116`:

```
08 10 Fight ends - withdraw.
08 11 Fight ends - flee.
08 12 Fight ends - other.
```

Plus the rest of the family: `08` fight starts, `08 01`-`08 04` hit/miss both ways, `08 05` weapon
change, `08 06` dropped guard, `08 07` withdraw offer, `08 08`/`08 09` kills, `08 13` not updating
persona.

## What the client actually does

`CombatTracker.Observe(StyledLine line, DateTime)` receives only a rendered line and matches
`line.PlainText` against ~25 regexes. It never sees a C1 code.

The decoder does know the family — `Mud2C1Decoder.cs:885-887` references bare C08, C03, C08 and
C10/C11/C12 — but uses them **solely** to decide when to fire a stamina probe, not to classify combat
events.

And `CombatModels.cs:13` states the event taxonomy "Mirrors the event taxonomy validated offline in
tools/combat/reduce_combat.py: the '08' C1 code family (FightStart/Hit/Miss/WithdrawOffer/Kill/
FightEnd*)". So the enum was **named after** the codes and then reimplemented in English.

## Why this is worth acting on

The fight-end rework in commits `9ce4a4a`..`39183fd` leaned on a **one-word text distinction** to
separate two opposite outcomes:

- `The X has fled by going .` — it escaped, chasing is meaningful
- `The X has fled by trying to go .` — it never left, chasing it is nonsense

Getting that wrong in either direction corrupts the per-class flee statistics and can send a chase
assist after a creature standing in front of the player. It shipped wrong once already and survived
two rounds of being reported.

If the server distinguishes these with codes, that distinction has an unambiguous source and does not
need to rest on two words of English.

## Specific hypothesis to test against the captures

That a **failed** flee carries `08 12` ("other") while a **real** flee carries `08 11` ("flee").

If true it also explains cleanly something currently justified by observation alone: that
`You can fight it no longer.` always trails a failed flee. That line would simply **be** the 08 12
line. See `tools/combat/FIGHT-ENDS.md`, which currently derives this from frame analysis.

Also worth checking whether `08 10`/`08 11` attach to a line naming the creature. `08 12` evidently
does not — "You can fight it no longer." names nobody, which is exactly why the current
implementation treats it as a trailing acknowledgment rather than an attributable terminator.

## Note on a related documentation clash

`tools/combat/README.md:123` says `08 10`, `08 11` and `08 12` "are explicit combat ends" — **this is
correct** and matches `fecodes.txt`. `tools/combat/FIGHT-ENDS.md:74-77` says the `08 12` *text* names
no creature and so cannot close a fight on its own — also correct. They describe different layers
(protocol vs. our text parser). An audit initially read these as contradictory; they are not. Anyone
touching this should keep the distinction, because collapsing it in either direction produces a bug.

## Provenance

Surfaced while the owner corrected an audit finding, 2026-08-23. Also recorded in `TODO`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with fecodes.txt:114-116 and the C08 references in Mud2C1Decoder.cs:885-887, then trace CombatTracker.Observe and the taxonomy in CombatModels.cs:13. Compare those protocol events with the captures and tools/combat/FIGHT-ENDS.md to test the 08 10/11/12 mapping. Done means fight-end classification uses the explicit protocol distinction while preserving the separate 08 12 acknowledgment behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.