The battle AI will decide the battle actions of any combatant who’s not part of the player group (or an AI controlled member of the player group).

Battle AIs are created using a node editor – you can learn more about the node editor in this how-to. You can find the battle AI editor in the ORK Framework editor in Battle System > BattleAI.

howto_battle_ai1

The battle AI, simply put, checks for different conditions and uses actions accordingly. Like checking your allies health and using healing items/abilities when it’s low, or abuse an enemy’s weakness to a certain attribute by checking the enemy’s attribute value and using an ability that uses the attribute. A combatant can have multiple battle AIs – if none of the AIs results in an action, the combatant will try performing it’s base attack (or do nothing if that fails).

Battle AI Steps

The battle AI steps are divided into different categories.

Action

The action steps will use battle actions like attack, an ability or item, defend, escape, etc.

If the action can be used, the battle AI will end and user will perform the battle action – if the action can’t be used (e.g. due to an abilities use costs or because the user’s inventory doesn’t contain the item), the next step will be executed and the AI continues.

Base

The base steps can execute a random next step, a chance check (e.g. 25 % chance), check for the game’s difficulty, call another battle AI or clear the targets found by condition checks.

By calling another battle AI, you can combine multiple AI trees – this allows reusing already existing AIs in a larger context and create more complex behaviours without getting to crowded.

Check

The check steps are a collection of all available check steps.

Combatant

The combatant steps are used to check a combatant’s state, like the current turn or status – e.g. is an ally’s HP below 25 %, is an enemy’s attack attribute Fire above 100, is a certain status effect applied to the user of the AI.

Move AI

The move AI steps are used to check the battle AI user’s Move AI, e.g. to select the current move AI target or use combatants that are valid hunting targets for the move AI.

Position

The position steps are used to check the distance or orientation of the battle AI’s user to a target (e.g. is the user behind the target).

Variable

The variable steps are used to check and change game variables.

Finding Targets

The battle AI operates on a Found Targets list, which will be used by action steps to use the actions on. Check steps will fill the found targets list with the combatants that match the checked condition.

Each check step has 2 important settings that define which combatants will be checked and kept as found targets:

  • Found Targets
    This setting handles what happens to already found targets (from previous steps).
    You can either keep them, also check them with the step’s condition or clear them (i.e. remove them completely).
    When checking the found targets, only those will be kept that match the step’s condition.
  • Target
    This setting defines which combatants will be checked by the step.
    You can either check the user itself, the allies or enemies of the user, or no combatant at all (e.g. when you only want to check the found targets).

Check steps will add the combatants that match their condition to the found targets list.