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

A bot with an empty primary slot walks over the rifle on the floor, when it is on its way #227

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Pushed. Here's the pull description:

shipped merged

opened this

Pushed. Here's the pull description:

A bot with an empty primary slot now diverts to a dropped rifle it passes near, instead of walking by it. chooseGoal's normal-movement branches (walking to a site, hunting, rotating to contact) run their goal through a new gunGoal, which swaps in a pickup's position when worthTheDetour (the arithmetic from #222, plan.ts) says the extra walk costs at most 2 seconds. The bomb carrier's branch and both planted-bomb branches return before gunGoal is ever called, so a carrier never stops for a gun and a planted bomb always outranks one. repath's objective string gains a :guns<n> term, gated on bot.primary === null, so a rifle appearing or being taken turns a bot round without A* running every tick for bots that already hold one.

Tests (bots.test.ts): a bot with no primary picks up a rifle a few steps off its path within a few seconds of stepped world time; a bot already holding a primary never diverts (unit test on gunGoal); a rifle across the map is not crossed for; an empty pickups list returns the exact same goal reference untouched.

Measured headless, bun run scripts/measure.ts --matches 8 --seed 41 on de_forge, before/after:

beforeafter
plant rate54%58%
endsdetonated 22 · time 6 · elimination 22 · defused 6detonated 24 · time 5 · elimination 20 · defused 6
side splitT 45% · CT 55%T 47% · CT 53%

Both within a few points, so the bound wasn't tightened. The same 8 matches asked A* for fewer paths overall (11218 → 10778) — rounds resolve a little sooner, not because any bot repaths more often for a gun.

README's The bots gets one sentence: a bot with an empty primary slot now detours for a dropped rifle nearby, but never crosses the map, the site, or the bomb carrier's own plan for one.

Left out: nothing about what a bot does with the gun once it has it (auto-pickup handles that already), and no change to secondary/pistol pickups — only primaries divert, per the issue.

Closes #216

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs