16 Battle AIs

In this tutorial we’ll set up the some basic battle AIs of our status system.

AI controlled combatants use battle AIs to select their actions in battle. Learn more about battle AIs in this documentation.

You don’t have to set up a complex battle AI for each individual combatant – you can, but it’s usually better to create smaller battle AIs, each for a specific task or action.

Combatants use battle AIs in the order they’re added for them. If an action isn’t available or can’t be used (e.g. due to use costs), the battle AI will continue until it finds an action that can be used. When a battle AI ends without finding an action, the combatant’s next battle AI is used.

In most of the battle AIs we’ll set up here, we don’t search for specific targets before using an action. If no found targets are available when an action is selected, the action will automatically select one based on it’s setup (auto target conditions) and the combatant’s AI targeting settings (e.g. using nearest target). We use this setup to allow using the Provoke effect of the tank influencing all other targeting.

Navigate to Battles > Battle AI, we’ll change the Default battle AI and add additional battle AIs.

0: Do Nothing #

This battle AI will simply use the None command.

It’s recommended to have this battle AI as the lowest, last used battle AI. In case no other action was found by other battle AIs, this makes sure that a combatant ends their turn.

Battle AI Settings #

  • Name
    Set to Do Nothing.

None #

Add Node > Action > None

This node will use the None command, doing nothing and ending the combatant’s turn.

No additional setup needed.

1: Base Attack #

Use the combatant’s base attack.

Battle AI Settings #

  • Name
    Set to Base Attack.

Attack #

Add Node > Action > Attack

Uses the combatant’s base attack.

No additional setup needed.

2: Random Ability 25% #

Has a 25% chance to use a random ability (available to the combatant).

In case the chance fails, this battle AI ends, continuing with the next battle AI fo the combatant.

Battle AI Settings #

  • Name
    Set to Random Ability 25%.

Chance #

Add Node > Base > Chance

Does chance checks and performs a next node based on it.

Range 0 #

This is the default chance that’s already added for us.

  • Minimum Range
    Select Value > Value.
    Set the value to 0.
  • Maximum Range
    Select Value > Value.
    Set the value to 25.

Ability #

Add Node > Action > Ability

Uses an ability of the combatant – we’ll use a random ability.

  • Use Random Ability
    Enable this setting
    This’ll use a random ability available to the combatant.
  • Use Highest Level
    Enable this setting.
    This’ll use the highest available (and usable) level that’s available to the combatant.

3: Random Ability 50% #

Has a 50% chance to use a random ability (available to the combatant).

Copy the Random Ability 25% battle AI and change the following settings.

Battle AI Settings #

  • Name
    Set to Random Ability 50%.

Chance #

  • Maximum Range
    Select Value > Value.
    Set the value to 50.

4: Random Ability 75% #

Has a 75% chance to use a random ability (available to the combatant).

Copy the Random Ability 50% battle AI and change the following settings.

Battle AI Settings #

  • Name
    Set to Random Ability 75%.

Chance #

  • Maximum Range
    Select Value > Value.
    Set the value to 75.

5: Heal <50% HP #

Heals an ally with less than 50% health.

Battle AI Settings #

  • Name
    Set to Heal <50% HP.

Check Status #

Add Node > Combatant > Check Status

This node is to go-to node for pretty much any combatant status related check. E.g. in our case, we’ll check for HP being less than 50%.

The node can use combatants matching the conditions as found targets, so later action nodes can use them as targets.

  • Found Targets
    Select Clear.
    Previously found targets will be removed.
  • Target
    Select Ally.
    Uses allies of the battle AI’s user.

Click on Add Status Condition.

  • Condition Type
    Select Status.
  • Status Needed
    Select Status Value.
  • Status Value
    Select Health Points.
  • Used Value
    Select Current Value.
    We’ll check the current health.
  • Check In
    Select Percent.
  • Check Type
    Select Is Less.
  • Check Value
    Select Value > Value.
    Set the value to 50.

Ability #

Add Node > Action > Attack

We’ll use Heal.

This node is connected to the Success slot of the Check Status node.

  • Ability
    Select Heal.
  • Use Highest Level
    Enable this setting.

6: Provoked #

This battle AI doesn’t use any action, it just uses a combatant with the Provoke effect as a found target. Using this battle AI before the others (but after the heal AI) will use the provoking combatant as target for any action, unless the action is targeting an ally.

The battle AIs of a combatant share their found targets, so this battle AI selecting a provoking combatant as found target will have it available in any battle AI coming after it.

Battle AI Settings #

  • Name
    Set to Provoked.

Check Status #

Add Node > Combatant > Check Status

We’ll clear previously found targets and select an enemy (of the battle AI’s user) with Provoke effect applied as found target.

  • Found Targets
    Select Clear.
  • Target
    Select Enemy.
    Uses enemies of the battle AI’s user.

Click on Add Status Condition.

  • Condition Type
    Select Status.
  • Status Needed
    Select Status Effect.
  • Status Effect
    Select Provoke
  • Is Applied
    Enable this setting.

Save Changes #

And that’s it for the battle AI setup.

Don’t forget to save your changes by clicking on Save Settings at the bottom of the editor.

Next, we’ll set up combatant types and the general settings for combatants.