Smarter enemy AI: flexible action order, no more passive campers
30.04.2026
A turn used to commit to strict per-actor move-then-cast pairs โ Hero 1 moves and casts, then Hero 2 moves and casts, fixed order. That constraint is gone. Inside one CAST_SPELLS event, hero actions can now be ordered freely (Tara moves โ Maya moves โ Tara casts โ Maya casts is now valid), and on the enemy side three seeded strategies decide the ordering: paired (the old default), moves-first (everyone moves, then everyone casts), and reversed-paired. Base weights are 60/30/10. Planning is still committed in advance โ only the ordering of actions inside the event is flexible.
Coordinated melee feels different now. Chapter 1 close-type enemies โ Fire/Water/Iron/Wind Ghoul, Earth/Iron/Water/Wind/Fire Golem, Wind Brute โ carry a coordinatesAttacks template flag that shifts the weights to 20/70/10. Moves-first becomes dominant, so packs walk in together before throwing punches. The phase-2 cast decision in moves-first re-checks who's already been targeted this turn, so two coordinated enemies don't dogpile a single hero by accident.
Passive enemies that spawn out of striking distance no longer camp at the back line. If a close-range Passive can't reach any hero, the AI flips it to Aggressive and it advances. Plus a small visual cleanup: stat bars hide on dead enemies so the field reads cleaner during multi-fight battles.
End-state is provably unchanged โ no friendly fire, area-from-caster targeting, heal-by-id are all preserved. This is a contract + UX shift, not a balance retune.