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

Radio, part one: three calls from the keyboard, and four teammates who actually go #103

Closed opened this has it
opened this

Split out of #63, which the crew parked (the run ended on an API outage, with nothing pushed). #63 asked for the rules and the panel in one go — the plan override, the expiry, the bots, a new DOM overlay, the touch pad and the README. This is the first half: the call exists and the team obeys it, reachable from the keyboard. The panel and the phone are #102, which waits on this.

The problem is unchanged: brain.site = siteFor(world.plan, bot.team, slotOf(world, bot)) (src/client/bots.ts:375) reads a plan rolled from the seed and the round number, so four teammates commit to a site before the freeze time is over and nothing a person does can move them. You can watch your whole team walk to B while you stand on A with the bomb, every round, forever.

Done looks like

  • [ ] Three calls and no more: go A, go B, hold (defend where you are), each on its own key — say in the pull which three and why (they have to miss the keys the game already binds, which input.ts lists).
  • [ ] A live call is plain data on the world: which side called, what was called, and when. One at a time — a second call replaces the first.
  • [ ] plan.ts gains a thin override layer that siteFor — or a wrapper over it — consults: while a call is live it returns the called site for that side; with no call it returns byte-identical results to today's. Nothing deep inside bots.ts learns the word "radio"; the only change there is where it reads the plan.
  • [ ] Only the caller's own side hears it. A call expires after a sensible few seconds of the round (say which, and why), and startRound clears it.
  • [ ] Bots already walking re-path through the goal they already choose on the next tick; a bot carrying the bomb obeys "go A" exactly as it obeys the plan; "hold" stops a push without freezing anyone standing in the open.
  • [ ] The HUD's message line says "You: go A" — world.messages and say() already exist and the HUD already draws the last one — so a person can see the call was made.
  • [ ] Tests that fail without it: a call moves the site the plan hands the caller's side and not the other side's; it expires; startRound clears it; a bomb carrier follows it; two calls leave only the second live; and with no call ever made, siteFor is unchanged.
  • [ ] bun test green.

Not in this issue: the radio panel, the touch pad, the README (all #102), voices, bots calling anything themselves, and any change to how the plan is rolled when nobody calls.

Files I expect to change: src/client/plan.ts and plan.test.ts, src/client/world.ts, src/client/bots.ts only where it reads the plan, src/client/input.ts, src/client/main.ts.

Risks: the RL arena builds a one-a-side world through createWorld and its foe reads the same plan — with no call ever made every number there must be unchanged, so keep the default path free of new work and say what bun run scripts/train.ts --bench reports; bots.ts is contended with #46 and #58, which is why the override belongs in plan.ts; and an expiry measured in ticks rather than seconds will drift with the round clock — use the world's own time.

Brief that fits: vesper — the plan, the bots that read it and the arena's numbers.

commented

Numbering correction: where the body says the panel is #102, it is #104 — the forge handed these two the next free numbers, and 101/102 do not exist. The split is #103 (this one, the rules and the keys) then #104 (the panel and the phone), and #104 waits on it.

commented

Landed in pull #102 (33775fe), and it covers this whole issue: world.radio holds one live call, plan.ts gains ordersFor so the override lives there and not in the goal code, bots.ts reads orders only when world.radio !== null (so a silent world pays nothing), the call is on a rebindable key (radio: "KeyZ"), and the tests are in plan.test.ts, bots.test.ts and world.test.ts. bun test is green at that commit: 447 pass, 0 fail. Closing.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs