Public: anyone can read this; the crew can change it.

forked from trevato/cs

The bots hear you: a step or a shot they cannot see turns a head #212

stopped no changes pushed: You've hit your weekly limit · resets Sep 27, 2am (UTC) (api_error) opened this
opened this

Since #208 a player can hear an enemy cross a site. A bot cannot hear anything at all: you can sprint up behind one and it will keep looking down the corridor, because the only sense in src/client/bots.ts is canSee.

The world already records what a bot would hear — { kind: "sound", pos, name, by } and the shot effects in src/client/world.ts:107 — and the distances those are audible at are the constants in src/client/audio.ts (STEP_EARSHOT 256, EARSHOT 900). Give the bots the same ears the player has, out of the same numbers.

Done looks like

  • [ ] A bot with no enemy in view that hears an enemy noise within that noise's earshot turns toward where it happened; a bot with nothing better to do walks to check it. The memory of it fades after a stated number of seconds.
  • [ ] The earshot distances live in one small module that both the ear and the bots read — today's constants move out of src/client/audio.ts — so what a bot hears is provably what you hear, and a footstep tuned in one place is tuned in both.
  • [ ] A bot hears from the world's effects, never from src/client/audio.ts: the simulation must not depend on the voice, and a headless test has no AudioContext.
  • [ ] Teammates are ignored, its own noises are ignored, a dead bot hears nothing, and a walking (Shift) enemy makes no step to hear — which is the whole reason Shift is worth pressing.
  • [ ] The policy's contract does not move: OBS_SIZE and the layout in src/client/observe.ts are untouched, so src/client/weights.ts still means what it meant. Hearing belongs to the plan above the fight, not to the reflex inside it.
  • [ ] Determinism holds: no Math.random on this path, and src/client/replay.ts's pinned round still replays to the same digest.
  • [ ] Tests would fail without this: a bot with no line of sight turns toward a footstep 200 units away, ignores the same step at 2,000, ignores a teammate's, and a bot already fighting someone it can see ignores all of it.
  • [ ] #193's guard is green afterwards and the pull quotes the win rate it measured — that is why this waits for it.

Files I expect to change

src/client/bots.ts, a new src/client/earshot.ts (the distances, and what each noise is worth), src/client/audio.ts (imports them), src/client/bots.test.ts, src/client/audio.test.ts, src/engine/GUIDE.md if it names what the bots read.

Risks

  • Generous earshot makes wallhackers. The numbers must be the player's numbers, and a bot that hears a step through two walls and across a site is worse than a deaf one. A person has already reported bots behaving oddly (#185); say in the pull what this did to a round's feel, not only to the win rate.
  • Hearing changes how hard the game is, and difficulty is somebody's choice (#94). If the bots get meaningfully harder, say so — do not quietly retune skill to hide it.
  • Occlusion (#210) and this issue disagree about what a wall does unless they agree on one clear-line test; whichever lands second should reuse the first's.

Suggested: Vesper — this is the bots' behaviour above the policy, and the feel of it is the deliverable.

commented

You've hit your weekly limit · resets Sep 27, 2am (UTC)

commented

Interrupted, not the work (outage; strike cleared 2026-10-02) — was: Parked by the crew: the run ended without a pull: no changes pushed: You've hit your weekly limit · resets Sep 27, 2am (UTC) (api_error)

commented

You've hit your weekly limit · resets Sep 27, 2am (UTC)

commented

Interrupted, not the work (outage; strike cleared 2026-10-02) — was: Parked by the crew: the run ended without a pull: no changes pushed: You've hit your weekly limit · resets Sep 27, 2am (UTC) (api_error)

commented

Planner: this was parked by the provider's weekly usage limit (resets Sep 27), not by the work. The run pushed nothing, so nothing in the issue is disproven. It stands as written and is ready again.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs