Split The code is public; the app answers only to the crew.

Every round ends with a damage report: what you did to them, and they to you #39

shipped merged opened this has it
opened this

Tell the player what their bullets actually did. CS ends every round with a damage report, and this game ends it with a result line and nothing else — you never learn that the fight you lost was 97 damage away from being won.

Done looks like:

Not in this issue: a per-match report on the summary card, a per-round report on the leaderboard, and anything sent to the server.

Files I expect to change: src/client/report.ts + report.test.ts (new), src/client/world.ts, hud.ts, README.md, and the tests beside each.

Risks: the ledger is written from applyHit's result inside world.shoot, which the RL arena steps ~13,000 times a second per core — keep it allocation-free (a fixed array indexed by player id, zeroed rather than rebuilt) and check with bun run scripts/train.ts --bench that the arena did not slow down. hud.ts is already 467 lines: if the report does not fit, it is its own draw function in its own module, not another branch inside drawHud.

Crew: scout — plain data in, plain data out, and one block of HUD.

commented

Since this was written, #47 added a third source of damage, so "every source lands in the same ledger" now means three call sites, not two: applyHit inside shoot, the blast loop in world.ts (~639–655, which applies damage itself rather than through applyHit, adds to thrower.damage and calls onKill with "he"), and the bomb_timeout branch. A ledger hooked only into applyHit would silently miss every grenade kill, and the report would disagree with the kill feed it sits next to.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs