Battle AI
Every hero, monster and summon in battle is run by the same AI. Each time a unit can act, it goes through the steps below and takes the first action it finds. Most of its choices come from decision trees: one for its self-buffs, and one for each role. You set each hero's role priorities when you edit the hero.
Each time a unit acts
- If it's enraged, it attacks whoever enraged it.
- If it's scared, it moves away from whatever scared it, and does nothing else.
- If an ally (or itself) is below 15% HP and it has a healing ability (Healing Prayer, Sanctuary, Holy Force, Suture), it tries its Support tree first, as long as Support is one of its roles.
- It tries its Self-buffs tree.
- It tries the trees of its roles, in the order of its role priorities.
- If none of them finds an action, it waits.
Carrying out an action
- If its target is out of the ability's range, it moves towards it first; if the target is too close for the ability, it moves away.
- If it can't afford the action yet, it uses Adrenaline when it's short on AP, or Mystic Focus when it's short on MP, if it has them.
Decision trees
A tree asks questions about the battle, and each answer leads to the next step. Where a tree would use an ability the unit doesn't have or can't afford, it carries on as shown under “If it can't”. A tree that finds nothing to do leaves the choice to the next one.