Files
sor/Server
babf5f9821 fix(ai): prevent greedy engine from freezing after a high-value ability activation
When an ability activation raised the score baseline significantly (e.g.
bouncing a unit, dealing damage, healing), no subsequent move or attack
could beat that new baseline, so the AI ended its turn after just one
action leaving all other units idle.

Two-part fix:
1. Relax the selection threshold by NoRegressTolerance (1.0 pts) so that
   moves/attacks that are near-neutral still qualify as candidates.
2. Track serialised-state hashes for every state seen during the turn;
   candidates that would revisit a prior state are skipped, preventing
   the tolerance from enabling intra-turn cycles.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-04-14 06:22:59 -04:00
..