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

A bot reloads only when its magazine is empty, so it reloads in the middle of the fight it just started #231

Merged opened this

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

Merged

Pushed.

shipped merged

opened this

Pushed.

Bots now reload on their own schedule instead of discovering an empty magazine in the middle of a duel.

  • topUp (bots.ts): the moment a bot's pickTarget finds no enemy to see, a magazine at half capacity or less requests a reload — same branch the fight itself already gates on, so this can never start a reload with someone watching.
  • outOfAmmo replaces the two old mag === 0 checks: a bot that runs its current weapon dry mid-fight now draws its loaded sidearm (switchTo) instead of reloading, falling back to reload only once the sidearm itself is empty too.
  • Both behaviours are difficulty-agnostic by construction — nothing in either path reads skill.
  • Four new tests in bots.test.ts cover the four cases from the issue; two fail against main (verified), all pass with the fix.

Measured headless over 30 seeded SHORT matches (seed 41), before/after: plant rate 67% → 81%, rounds ending in elimination 26% → 12% — bots dying while standing still reloading was costing rounds outright. scripts/duel.ts (the 6-second arena duel) is essentially unchanged (71%/38% vs README's 73%/39%, within the arena's usual run-to-run noise), as expected since a fresh 30-round rifle rarely runs dry in a 6-second episode.

Left out: no change to observe.ts or the policy's inputs, per the issue's constraint — a bot's own magazine is already implicit in its behaviour, not something the learned policy reasons about.

Closes #187

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs