Declare Blockers AI takes several minutes to resolve against a large, evasion-heavy token board (possible short-circuit opportunity)
- Dominant language
- Java
- Stars
- 2.7k
- Forks
- 1.1k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 163
Description
I ran into a case where the AI took roughly 5 minutes on a single Declare Blockers step against a board with a large number of near-identical tokens. I ended up conceding rather than force-closing the app, specifically so I could pull the game log and report this properly.
**Setup:** By turn 33 of the game I was attacking with 70 creatures, 66 of which were identical 1/1 flying deathtouch Insect Tokens (from Hornet Queen, multiplied through Doubling Season, Séance, and Growing Ranks), plus 4 non-token creatures. My opponent had no creatures with flying or reach in play. Given that, the flying damage alone was unavoidable regardless of how any ground blockers were assigned. The AI still spent several minutes on Declare Blockers before I conceded.
**Why I think this is worth a separate report from #6985:** #6985 covers the Declare Attackers side (the token holder's own AI struggling to decide whether/how to attack with dozens of copies) and was closed by the stale issue bot rather than resolved. This looks like the same root cause showing up on the other side of combat, the AI evaluating a block assignment for defense instead of offense. Distinct enough symptom that I didn't want to just necro the old thread, but clearly related, and my reasoning below might help advance both.
**Suggested angle:** I don't know the internals of the combat AI, so take this as an outside suggestion rather than a diagnosis, not trying to redesign anything, just flagging where the cost seems to come from. The blocker search seems to reason over the full token stack as individual creatures rather than as N copies of one card, which turns the assignment space combinatorial. A cheap early out before running that search: check whether the attacking side's unblockable/evasive damage alone already exceeds the defending player's life total. If so, no legal block assignment for the remaining blockable creatures can change the outcome, and the AI could skip the exhaustive search or fall back to a simple greedy assignment instead of a full optimization. That preserves the existing logic for the cases where it actually matters (close life totals, meaningful trades) and only short-circuits the case where it provably can't matter. More generally, an obscene number of attackers or blockers seems to trigger excessive hanging in the thinking step regardless of the specific evasion detail, so this may be worth handling as its own category rather than only as an evasion edge case.
**Environment:** Forge, Android, latest APK as of 2026-09-07. Happy to provide additional details on request.
Contributor guide
Research direction
Start at the Declare Blockers combat-AI entry point and reproduce the reported Android board setup with many evasive token attackers. Done means the Declare Blockers step no longer hangs for several minutes in this case, while ordinary close-life-total and meaningful-trade decisions still use the existing logic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- ai, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100