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
Check · Review · Land · Live done — Landed and live in production.
Pushed. Here's the pull description:
shipped merged
Sign in to join this conversation.
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 newgunGoal, which swaps in a pickup's position whenworthTheDetour(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 beforegunGoalis 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 onbot.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 ongunGoal); a rifle across the map is not crossed for; an emptypickupslist returns the exact same goal reference untouched.Measured headless,
bun run scripts/measure.ts --matches 8 --seed 41onde_forge, before/after: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