ai-code-battle/bots
jedarden cecbc4a2a0 fix(bot): fix Opportunist retreat and attack pathfinding bugs
Two bugs in the Opportunist bot strategy:

1. retreatMove: when a lone bot is surrounded by enemies with no nearby
   allies, all passable directions scored below the -1 initial threshold
   due to flat enemy penalties. Fixed by scoring distance-from-enemies
   as a positive value (further = better) instead of a flat penalty,
   ensuring the bot always picks the safest direction.

2. attackMove: BFS could never reach enemy targets because the passable
   function excluded all enemy positions. The target IS an enemy, so the
   path was unreachable. Fixed by wrapping passable to treat the target
   position as passable during attack pathfinding.

All 19 tests now pass, including TestComputeMovesRetreat and
TestComputeMovesNearbyAdvantageAttack.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 17:03:02 -04:00
..
assassin chore: add .gitignore to assassin bot, remove build artifacts 2026-04-22 16:56:23 -04:00
defender feat(bot): add Defender bot (C#) — core-hugging perimeter archetype 2026-04-22 16:19:08 -04:00
farmer feat(bot): add Farmer bot (Go) — economy-maximizer archetype 2026-04-22 16:30:26 -04:00
gatherer Complete Phase 2: HTTP protocol and 6 strategy bots 2026-03-24 07:00:38 -04:00
guardian Complete Phase 2: HTTP protocol and 6 strategy bots 2026-03-24 07:00:38 -04:00
hunter Complete Phase 2: HTTP protocol and 6 strategy bots 2026-03-24 07:00:38 -04:00
kamikaze feat(bot): add Assassin bot (Rust) — decapitation archetype 2026-04-22 16:55:33 -04:00
nomad feat(bot): add Nomad bot (Python) — constant relocation archetype 2026-04-22 16:48:12 -04:00
opportunist fix(bot): fix Opportunist retreat and attack pathfinding bugs 2026-04-22 17:03:02 -04:00
pacifist feat(bot): add Pacifist bot (JavaScript) — non-aggressive attrition archetype 2026-04-22 16:32:50 -04:00
phalanx feat(bot): add Phalanx bot (Rust) — tight formation archetype 2026-04-22 16:43:39 -04:00
raider feat(bot): add Raider bot (Java) — hit-and-run harasser archetype 2026-04-22 16:44:34 -04:00
random Complete Phase 2: HTTP protocol and 6 strategy bots 2026-03-24 07:00:38 -04:00
rusher Complete Phase 2: HTTP protocol and 6 strategy bots 2026-03-24 07:00:38 -04:00
scout feat(bot): add Scout bot (Python) — fog exploration archetype 2026-04-22 16:40:35 -04:00
swarm Complete Phase 2: HTTP protocol and 6 strategy bots 2026-03-24 07:00:38 -04:00