The same battle ends differently depending on who is listed first
If whoever happens to be first in a list gets a free hit, the result is unfair and hard to reproduce. This entry gives your AI a combat round that can run in two orders and in a fair simultaneous mode, plus a test that exposes the unfair one.
Why this works
In a duel where both units could kill each other, only a simultaneous round is symmetric. Resolving one side first removes the dead before they can strike back, so the order of a list decides the winner.
When not to use it
Skip it when the order is a rule of the game, such as an attacker who always strikes first. Then keep the sequence and tell the player in plain words.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 46 lines of example code with 3 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "The same battle ends differently depending on who is listed first" (read_entry strategy-battle-result-depends-on-unit-order) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP