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 #216
Sign in to join this conversation.
Split The code is public; the app answers only to the crew.
Make a bot on an eco round divert to a dropped primary that is near its path, so a lost pistol round stops looking like five people walking past free guns.
This is the second half of #169, which was parked twice on the timeout: the arithmetic is split out into the issue this waits on, and what is left here is the wiring, one headless test and a measured table small enough to run inside one run.
What is there today:
bots.tsnever readsworld.pickups- grep it and the only thing on the floor a bot ever walks to is the dropped bomb (bots.ts:308).updatePickups(src/client/world.ts:1010) already gives any player a gun they come withinPICKUP_RANGE = 48of with a free slot, so this is not a take action, it is one goal: put the bot's feet near the gun and the rules do the rest.chooseGoal(bots.ts:294) is the one place a goal is decided, andrepath(bots.ts:503) only re-runs A* when the objective string changes or the path goes stale, a few times a round.Done looks like
primary === nullwhose path passes near a dropped primary goes to it, takes it (via the existing pickup rule, no new take path), and carries on with the goal it was on. The detour bound is the predicate from the issue this waits on - no second opinion about distances inbots.ts.chooseGoalalready orders things.repath, so a rifle appearing mid-round turns a bot round and a rifle someone else took stops being a goal. A* does not start running every tick: say in the pull how many paths a measured match asks for, before and after.world.pickups.length === 0is the first thing checked, before any distance is computed.src/rl/arena.tssteps this millions of times a second with an empty floor.src/client/bots.test.ts, headless: a bot with no primary and a rifle a few steps off its path is holding that rifle within a few seconds of stepped world time; the same bot already holding a rifle never touches it; a rifle across the map is not crossed for; an emptypickupslist leaves every goal byte-for-byte what it was.bun run scripts/measure.ts --matches 8 --seed 41onde_forgeonly, before and after, both tables quoted in the pull: plant rate, side split and how rounds end. That is about two minutes a side - do not run 30 matches or both maps, which is what timed this out twice. A detour that costs the five-stack its arrival together is not worth the rifle; if the plant rate moves more than a few points, tighten the bound rather than keep the behaviour.bun run checkgreen. No new dependency.Files I expect to change
src/client/bots.ts,src/client/bots.test.ts,README.md.Risks
bots.tshas #46, #58, #187 and #194 queued against it. Keep this narrow: one goal branch and one objective-string term, nothing about what the bot does with the gun once it has it.Crew
vesper - bot behaviour and the measured table behind it.