Test-race scenarios and race bot in scripts/ #33

Closed
opened 2026-10-20 18:41:24 +00:00 by mintopia · 5 comments
Owner

Runnable race scenarios in scripts/ (ADR 0020 layout; tools stay in tools/, tools/modes/plans stays).

Acceptance

  • Scenarios: single-player race, split-screen, N-instance LAN; each instance takes its own mod loadout (ADR 0014), e.g. Bribe, Decoy_Drop.
  • Each instance gets its own game config by default: windowed, 1280x720, lowest graphics preset, no MSAA, vsync off; overridable (e.g. perf runs). Via the instance's profile, not host flags; dev-only host flag only if the game config can't express it.
  • Bot per racer via BLUR_PADFILE: full throttle (RT 255), fires each held powerup within ~1 s of it appearing in the feed's powerups, presses reset after ~3 s near 0 mph. No steering logic.
  • Padfile gains a left-stick X column (src/host/input/macos.mm vpad).
  • Menu navigation uses the dev-only menu state (#32).

Rules

  • Wire format: ADR 0019 (docs/decisions/0019-feed-message-contract.md). Repo data/tools: ADR 0020.
  • Fix and verify on BLUR_ENGINE=recomp only.
  • Update docs/state-websocket.md and examples/live-timing for any feed change.
  • Test races: use the scripts/ scenarios (windowed, low settings) once #33 exists.
Runnable race scenarios in `scripts/` (ADR 0020 layout; tools stay in `tools/`, `tools/modes/plans` stays). ## Acceptance - Scenarios: single-player race, split-screen, N-instance LAN; each instance takes its own mod loadout (ADR 0014), e.g. Bribe, Decoy_Drop. - Each instance gets its own game config by default: windowed, 1280x720, lowest graphics preset, no MSAA, vsync off; overridable (e.g. perf runs). Via the instance's profile, not host flags; dev-only host flag only if the game config can't express it. - Bot per racer via `BLUR_PADFILE`: full throttle (RT 255), fires each held powerup within ~1 s of it appearing in the feed's `powerups`, presses reset after ~3 s near 0 mph. No steering logic. - Padfile gains a left-stick X column (`src/host/input/macos.mm` `vpad`). - Menu navigation uses the dev-only `menu` state (#32). ## Rules - Wire format: ADR 0019 (`docs/decisions/0019-feed-message-contract.md`). Repo data/tools: ADR 0020. - Fix and verify on `BLUR_ENGINE=recomp` only. - Update `docs/state-websocket.md` and `examples/live-timing` for any feed change. - Test races: use the `scripts/` scenarios (windowed, low settings) once #33 exists.
Author
Owner

Implemented scripts/race.py single|split|lan (+ racelib.py, test_racelib.py) and the padfile left-stick X column (macos.mm vpad, docs/dev-flags.md, README).

  • Config: per-instance settings.xml in a copied save: windowed 1280x720, graphical_detail 0, no MSAA, vsync off; --set key=val overrides. LAN windows cascade.
  • Loadouts: LAN instances get --mods (default Bribe / Decoy_Drop) written to the loadouts_* store; roster confirmed bribe on racer0, decoy_drop on racer1.
  • Bot: RT 255, fires when a held powerup is >=0.5 s old, resets after ~3 s under 2 mph. Fire = pad A (found live: powerups vanished only after A pulses; RB did nothing).
  • Menu nav uses feed screen + dev_menu_item.
  • Verified on BLUR_ENGINE=recomp: single-player race, 2-pad split-screen, 2-instance LAN all finish with race_result final.

Known limits:

  • RESET = pad Y, not observed firing in a race.
  • Split-screen: feed marks only pad 0's racer local, so pads 1+ get throttle only.
  • --mods only applies to LAN (no selectable loadout in SP/split, ADR 0014).
  • LAN verified with 2 instances, not N>2.
  • No feed change, so no feed docs change.
Implemented `scripts/race.py single|split|lan` (+ `racelib.py`, `test_racelib.py`) and the padfile left-stick X column (`macos.mm` vpad, `docs/dev-flags.md`, README). - Config: per-instance `settings.xml` in a copied save: windowed 1280x720, graphical_detail 0, no MSAA, vsync off; `--set key=val` overrides. LAN windows cascade. - Loadouts: LAN instances get `--mods` (default Bribe / Decoy_Drop) written to the `loadouts_*` store; roster confirmed bribe on racer0, decoy_drop on racer1. - Bot: RT 255, fires when a held powerup is >=0.5 s old, resets after ~3 s under 2 mph. Fire = pad A (found live: powerups vanished only after A pulses; RB did nothing). - Menu nav uses feed `screen` + `dev_menu_item`. - Verified on BLUR_ENGINE=recomp: single-player race, 2-pad split-screen, 2-instance LAN all finish with race_result final. Known limits: - RESET = pad Y, not observed firing in a race. - Split-screen: feed marks only pad 0's racer local, so pads 1+ get throttle only. - `--mods` only applies to LAN (no selectable loadout in SP/split, ADR 0014). - LAN verified with 2 instances, not N>2. - No feed change, so no feed docs change.
Author
Owner

Comment-check fixes (6217be7): race.py exit docstring now states it checks a final race_result per instance (also sent on timeout/quit; pads 1+ unchecked); removed file-describing module docstrings in racelib.py and test_racelib.py. test_racelib passes.

Comment-check fixes (6217be7): race.py exit docstring now states it checks a final race_result per instance (also sent on timeout/quit; pads 1+ unchecked); removed file-describing module docstrings in racelib.py and test_racelib.py. test_racelib passes.
Author
Owner

Split: every pad now runs the full bot (pad k drives pad 0 racer + k). Verified on recomp split n=2: pad 0 fired 15 powerups, pad 1 fired 17, race finished. Feed JSON-string values are now decoded in Feed.get. Not verified in a live race: reset button (Y) firing after ~3 s stuck (covered by test_racelib; a forced-stuck run hung at the HUD) and LAN with N>2 (tested with 2 instances).

Split: every pad now runs the full bot (pad k drives pad 0 racer + k). Verified on recomp split n=2: pad 0 fired 15 powerups, pad 1 fired 17, race finished. Feed JSON-string values are now decoded in Feed.get. Not verified in a live race: reset button (Y) firing after ~3 s stuck (covered by test_racelib; a forced-stuck run hung at the HUD) and LAN with N>2 (tested with 2 instances).
mintopia removed their assignment 2026-10-21 03:29:10 +00:00
Author
Owner

Rebased onto a51e589 (develop slim README). Resolved README conflict: kept slim table + added scripts row; moved the full scripts row into docs/repo-structure.md (dropped stale ADR 0020 link; 0020 is game-lookup-data). test_racelib passes. No code change vs prior verified work.

Rebased onto a51e589 (develop slim README). Resolved README conflict: kept slim table + added `scripts` row; moved the full `scripts` row into `docs/repo-structure.md` (dropped stale ADR 0020 link; 0020 is game-lookup-data). test_racelib passes. No code change vs prior verified work.
Author
Owner

Completed and merged by Harmonic (task 35).

Completed and merged by Harmonic (task 35).
Sign in to join this conversation.
No description provided.