Held powerups per racer in standings #26

Closed
opened 2026-10-19 22:08:16 +00:00 by mintopia · 2 comments
Owner

What to build

Emit each racer's held powerups inside their standings entry, in the contract agreed on #19 and already consumed by the live-timing page (#24):

{"racer":3, "...": "...", "powerups":["bolt","shunt",null]}
  • Slot-ordered lowercase names, null = empty slot, array length = that racer's slot count, key absent = unknown.
  • Source per ADR 0017: poll in the 5 Hz scan (src/host/race_scan.cpp), no hook. Count at racer +0xeb4 (0..3); entries at *(racer+0xeac), 0x18 bytes each, i32 kind at +0. Entries past the count are stale.
  • Kind enum (0xf6ea80): 0 nitro, 1 shock, 2 shunt, 3 bolt, 4 barge, 5 mine, 6 repair, 7 shield. Share the name table with hit_event.cpp (which currently stops at repair).
  • Read the array, never +0xea0 (stays -1 for remote racers on LAN).
  • Covers local, AI and remote LAN racers.

Acceptance criteria

  • SP race with 19 AI on BLUR_ENGINE=recomp: every racer has powerups; the local racer's matches the HUD through collect and fire
  • 2-instance LAN race: the remote racer's powerups match on both instances
  • Unit test for the JSON (empty, partial and full queue; unknown kind)
  • docs/state-websocket.md documents the field

Blocked by

None (ADR 0017 has the offsets).

## What to build Emit each racer's held powerups inside their `standings` entry, in the contract agreed on #19 and already consumed by the live-timing page (#24): ```json {"racer":3, "...": "...", "powerups":["bolt","shunt",null]} ``` - Slot-ordered lowercase names, `null` = empty slot, array length = that racer's slot count, key absent = unknown. - Source per ADR 0017: poll in the 5 Hz scan (`src/host/race_scan.cpp`), no hook. Count at racer `+0xeb4` (0..3); entries at `*(racer+0xeac)`, 0x18 bytes each, `i32 kind` at +0. Entries past the count are stale. - Kind enum (`0xf6ea80`): 0 nitro, 1 shock, 2 shunt, 3 bolt, 4 barge, 5 mine, 6 repair, 7 shield. Share the name table with `hit_event.cpp` (which currently stops at repair). - Read the array, never `+0xea0` (stays -1 for remote racers on LAN). - Covers local, AI and remote LAN racers. ## Acceptance criteria - [ ] SP race with 19 AI on `BLUR_ENGINE=recomp`: every racer has `powerups`; the local racer's matches the HUD through collect and fire - [ ] 2-instance LAN race: the remote racer's `powerups` match on both instances - [ ] Unit test for the JSON (empty, partial and full queue; unknown kind) - [ ] `docs/state-websocket.md` documents the field ## Blocked by None (ADR 0017 has the offsets).
Author
Owner

Implemented: powerups per racer in standings (always 3 slots, names via shared hit::powerup_name, now incl. shield; key absent if queue not read). Scan reads +0xeb4 count and *(+0xeac) entries in race_scan.cpp. Unit tests added in race_feed_test (empty, partial, full, unknown kind, absent); docs/state-websocket.md updated.

Not verified here (unattended, no game/LAN available; dev_env.h missing so race_scan.cpp was not compiled): the SP 19-AI HUD match and 2-instance LAN acceptance runs need a human/recomp run.

Implemented: `powerups` per racer in `standings` (always 3 slots, names via shared `hit::powerup_name`, now incl. shield; key absent if queue not read). Scan reads `+0xeb4` count and `*(+0xeac)` entries in `race_scan.cpp`. Unit tests added in `race_feed_test` (empty, partial, full, unknown kind, absent); `docs/state-websocket.md` updated. Not verified here (unattended, no game/LAN available; `dev_env.h` missing so `race_scan.cpp` was not compiled): the SP 19-AI HUD match and 2-instance LAN acceptance runs need a human/recomp run.
Author
Owner

Completed and merged by Harmonic (task 27).

Completed and merged by Harmonic (task 27).
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
mintopia/blur#26
No description provided.