ORK Framework Logo - RPG Editor for Unity
  • ORK 4 BETA
  • Features
  • Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK

ORK 3 Documentation

  • Getting Started
    • Introduction
    • First Steps
    • Game Starters
    • Components Overview
    • Player/Camera Controls
    • Game Over
    • Support: Sending Test Projects
  • Editor
    • Editor Overview
    • Base/Control Section
    • Game Section
    • UI Section
    • Templates Section
    • Status Section
    • Inventory Section
    • Combatants Section
    • Battles Section
  • Features
    • Animations
    • Areas & Teleports
    • Combatant Triggers
    • Control Maps
    • Difficulties
    • Factions
    • Formations
    • Formula Nodes
    • Logs
    • Loot
    • Move AI
    • Quests
    • Research Trees
    • Schematic Nodes
    • Shortcut Slots
  • Status System
    • Status Values
    • Status Effects
    • Attack/Defence Modifiers
    • Abilities
    • Combatants
    • Classes
    • Status Bonuses
    • Status Conditions
  • Inventory System
    • Inventory System Overview
    • Currencies
    • Items
    • Equipment
    • AI Behaviours/Rulesets
    • Crafting Recipes
    • Shops
  • Battle System
    • Battle Systems
    • Adding Battles to Scenes
    • Calculating Action Results
    • Battle Menus
    • Battle AI
    • Battle AI Nodes
    • Battle Ranges
    • Battle Camera
    • Target Selection
    • Battle Spots
    • Battle Texts
    • Battle End & Loot Dialogues
    • Action Combos
    • Damage Types
    • Cursor Prefab Components
    • Grid Battles
    • Adding Battle Grids to Scenes
    • Battle Grid Highlights
    • Battle Grid Formations
  • UI System
    • UI System Overview
    • Start Menu
    • Option Categories
    • Menu Screens
    • Notifications
    • Combatant Selections
    • Quantity Selections
    • Text Display Settings
    • Cursor Settings
    • Console (In-Game)
    • Menu Requirements
    • HUDs: Content Providers
    • HUDs: Conditions
    • HUDs: Click Actions
    • HUDs: Text Content
    • HUDs: Value Bar Content
    • HUDs: Status Values
    • HUDs: Status Effects
    • HUDs: Attack Modifiers
    • HUDs: Defence Modifiers
    • HUDs: Shortcuts
    • HUDs: Abilities
    • HUDs: Equipment
    • HUDs: Class Slots
    • HUDs: AI Behaviours
    • HUDs: AI Rulesets
    • HUDs: Quests
    • Timebar HUD
  • Scripting
    • Scripting Overview
    • Access Handler
    • Code Extensions
    • Custom Settings
    • Custom Targeting
    • Combatant Scripting
    • Custom Nodes
    • Custom Component Save Data

ORK 3 Tutorials

  • 2D RPG Quickstart
    • START 2D RPG Quickstart
    • 01 Initial Setup
    • 02 Player Setup
    • 03 Music & Scenes
    • 04 UI System Setup
    • 05 UI Boxes
    • 06 Flying Texts
    • 07 Status Values
    • 08 Status Effects
    • 09 First Abilities
    • 10 Fighter Setup
    • 11 First Enemies & Battle AI
    • 12 Battle System Setup
    • 13 Animating Battle Start and End
    • 14 Random Battles
    • 15 Animating Actions
    • 16 Player Battle HUD
    • 17 Elemental Attacks
    • 18 Animating More Actions
    • 19 Inventory & Loot
    • 20 Equipment
    • 21 Loot, Start Equipment & Viewers
    • 22 Magic Abilities
    • 23 Caster Setup
    • 24 More Enemies
    • 25 Start Menu & Save Games
    • 26 Menu Screens
    • 27 Interactions
    • 28 Item Collectors
    • END 2D RPG Quickstart
  • 3D RPG Quickstart
    • START 3D RPG Quickstart
    • 01 Initial Setup
    • 02 Player Setup
    • 03 Music & Scenes
    • 04 UI System Setup
    • 05 UI Boxes
    • 06 Flying Texts
    • 07 Status Values
    • 08 Status Effects
    • 09 First Abilities
    • 10 Fighter Setup
    • 11 First Enemies & Battle AI
    • 12 Battle System Setup
    • 13 Animating Battle Start and End
    • 14 Random Battles
    • 15 Animating Actions
    • 16 Player Battle HUD
    • 17 Elemental Attacks
    • 18 Animating More Actions
    • 19 Inventory & Loot
    • 20 Equipment
    • 21 Loot, Start Equipment & Viewers
    • 22 Magic Abilities
    • 23 Caster Setup
    • 24 More Enemies
    • 25 Start Menu & Save Games
    • 26 Menu Screens
    • 27 Interactions
    • 28 Item Collectors
    • END 3D RPG Quickstart
  • Status System Setup
    • START Status System Setup
    • 01 Status Values
    • 02 Status Development
    • 03 Attack/Defence Modifiers
    • 04 Status Effects
    • 05 Formulas
    • 06 Ability & Item Types
    • 07 Abilities Part 1: Attacks
    • 08 Abilities Part 2: Support & Sabotage
    • 09 Abilities Part 3: Elemental Magic
    • 10 Items
    • 11 Equipment Part 1: Slots & Slot Set Templates
    • 12 Equipment Part 2: Weapons
    • 12.5 (Optional) Equipment Part 2.5: Weapons
    • 13 Equipment Part 3: Shields, Armor & Accessories
    • 13.5 (Optional) Equipment Part 3.5: Shields, Armor & Accessories
    • 14 Equipment Part 4: Available Equipment Templates
    • 15 Loot
    • 16 Battle AIs
    • 17 Combatants Part 1: General Settings
    • 18 Combatants Part 2: Players
    • 19 Combatants Part 3: Enemies
    • 20 Combatant Groups
    • END Status System Setup
  • 3D RPG Playground
    • START 3D RPG Playground
    • 01 Player Setup
    • 02 Start Menu
    • 03 First Interaction
    • 04 Music
    • 05 Areas
    • 06 Collecting Items
    • 07 Displaying Equipment
    • 08 Combatant Prefabs, Icons & Portraits
    • 09 Combatant Animations
    • 10 Camera Positions
    • ANIM 01 Battle Start/End Schematics
    • ANIM 02 Use, Cast & Camera
    • ANIM 03 Abilities & Items
    • ANIM 04 Physical Attacks
    • ANIM 05 Special Actions
    • BATTLE 01 Battle Menu
    • BATTLE 02 Prepare for Battle
    • TURN 01 Turn Based Setup
    • TURN 02 Turn Order HUD
    • ATB 01 Active Time Setup
    • ATB 02 Cast Times
    • ATB 03 Timebar HUD
    • BATTLE 03 The First Battle
    • BATTLE 04 Hunting Move AI
    • BATTLE 05 Spawning Combatants
    • 11 Save Games
    • MENU 01 UI Boxes
    • MENU 02 Template HUDs
    • MENU 03 Overview Menu
    • MENU 04 Menu Screens
    • 12 Shop
    • BATTLE 06 Random Battles
    • DUNGEON 01 Enter the Dungeon
    • DUNGEON 02 The Trapdoor
    • DUNGEON 03 Enemies on Level 1 & 2
    • DUNGEON 04 Traps on Level 3
    • DUNGEON 05 Going Deeper
    • 13 Bestiary (+MENU+ANIM)
    • QUEST 01 Hunting Quests (+MENU)
    • QUEST 02 Guard NPC
    • QUEST 03 Forest Ruin Cheese
    • QUEST 04 Witch NPC with Cheese
    • QUEST 05 Quest Mark HUDs
    • 14 Research Trees (+MENU)
    • CRAFT 01 Crafting Materials
    • CRAFT 02 Crafting Recipes
    • CRAFT 03 Crafting Menu
    • CRAFT 04 Crafting Proficiency & Critical Crafting
    • CRAFT 05 Materials Loot
    • 15 Changing Choice Dialogue
    • 16 Follow Me!
    • BATTLE 07 Sequence Loot Dialogue
  • 3D Action RPG
    • START 3D Action RPG
    • 01 Status System Setup
    • 02 Player Setup
    • 03 Player Weapon
    • 04 Player Attacks
    • 05 Enemy: Chomper
    • 06 Chomper Attack
    • 07 Hit & Death
    • 08 HUDs
    • 09 Rolling on the Floor
    • 10 Enemy: Spitter
    • 11 Spit Attack
    • 12 Potion
    • 13 Grenade
    • 14 Item HUD
    • 15 Enemy: Grenadier
    • 16 Grenadier Melee Attacks
    • 17 Grenadier Flamethrower
    • 18 Item Drops
    • END 3D Action RPG
  • 2D Grid Battle RPG
    • START 2D Grid Battle RPG
    • 01 Player Setup
    • 02 Prefab & Music Setup
    • 03 Randomizing Combatants
    • 04 UI Setup
    • 05 Battle Start, End & Phase Schematics
    • 06 Battle System Setup
    • 07 Battle Grid Setup
    • 08 Grid Move
    • 09 Forest Battle Grid
    • 10 Battle AI
    • 11 Ability Ranges
    • 12 Death & Use Schematics
    • 13 Attack Schematic
    • 14 Shoot Schematics
    • 15 Battle Selection Interaction
    • END 2D Grid Battle RPG
  • Schematics
    • Simple Start Schematic
    • Battle Start Schematic
    • Battle End Schematic
    • Moving to Target and Back
    • Animating a Base Attack
    • Animating a Magic Ability
    • Animating Target Selection
    • Grid Movement
    • Open and Close UI Animations
    • Flying Text Mover
  • UI Setups
    • Unity UI: Initial Setup
    • Unity UI: TextMesh Pro Setup
    • Unity UI: UI Box
    • Unity UI: Flying Text
    • Unity UI: Dragging Notification
    • Unity UI: Canvas with Screen Space Camera
    • Unity UI: Interaction HUD
    • Unity UI: Simple Player HUD
    • Unity UI: Quest HUD
    • Unity UI: Battle Actions HUD
    • Unity UI: Shortcuts HUD
    • Unity UI: Currency HUD
    • Unity UI: Tooltip HUD
    • Unity UI: Control HUD
    • Unity UI: Attack Modifiers
    • Unity UI: Defence Modifiers
  • Gameplay Bits
    • 2.5D Setup
    • Body Part Weakpoint
    • Click Attack
    • Combining Input Origins
    • Combining Status Value Flying Texts
    • Fun With Flying Text
    • HUD Effects With Conditional Schematics
    • Inventory Containers
    • Local Multiplayer
    • Multi Interaction Controllers
    • Target Selection Lines
    • World Space HUD
    • World Space Dialogue
View Categories
  • Guide
  • ORK 3
  • ORK 3 Documentation
  • Battle System

Battle AI

The battle AI controls which actions an AI controlled combatant uses in battle.

All combatants that are not members of the player group are always controlled by AI – player combatants can optionally also be controlled by AI when set up that way in their AI settings.

Battle actions can be:

  • using the combatant’s base attack
  • using an ability
  • using an item
  • defending
  • escaping
  • changing members
  • etc.

Battle AIs are created in Battle > Battle AIs using the node editor.

How it works #

The battle AI, simply put, finds targets by checking for different conditions and uses defined actions accordingly.

E.g. checking your allies health and using healing items/abilities when it’s low, or abuse an enemy’s weakness to a certain attack modifier by checking the enemy’s modifier value and using an ability to exploit it.

Use Mode #

The battle AI can be used in two modes:

  • First Useable
    Uses the first useable action.
    The battle AI exits at this point and doesn’t process any further.
    I.e. the battle AI can only select one action each time it’s executed.
  • Queue
    Adds actions to the combatant’s AI action queue.
    The battle AI continues until the end.
    I.e. the battle AI can queue multiple actions to use them in order they’re added.

The use mode is defined where you select the battle AI to use, e.g. in the combatant’s battle AI setup and equipable AIs (AI behaviours/ruleset).

Additionally, you can define if a battle AI is used at all if actions are already added to the AI action queue at the start of the action selection. I.e. if there are actions queued from a previous turn, the battle AI can either process again (maybe clearing the queue or adding/inserting additional actions), or not process until the action queue is empty.

Using the AI action queue doesn’t mean that a combatant can perform multiple actions in one turn – that’s up to the used battle system and it’s setup.

Action Use Mode #

Action nodes (e.g. Ability or Item) can overrule the use mode.

  • Default
    Uses the battle AI call’s use mode (i.e. either First Useable or Queue).
  • Can Use Check Only
    Only checks if the action can be used and doesn’t use or enqueue the action.
  • Use
    Uses the action, exiting the battle AI and not executing any further battle AI.
  • Queue
    Adds the action to the end of the AI action queue.
  • Insert Queue
    Adds the action to the front of the AI action queue (i.e. it being the next action).

If none of the combatant’s battle AIs returns an action, the first action in the AI action queue will be used.

Finding Targets #

Check/condition nodes are used to find the targets and add them to the battle AI’s found targets – action nodes will use the found targets for their action.

If the found targets don’t match the target type of the action (e.g. an ability targets enemies, but the found targets only contain allies), a target will be selected based on the combatant’s AI settings, e.g. using the nearest target or the user itself (e.g. for defend).
In that case, the found targets are ignored and all possible targets (e.g. all enemies) are used for the selection. Also, an ability with a Single target range (i.e. targeting only one combatant) will only use one of the found/available targets.

Which Targets? #

Check/condition nodes have two important settings to define which combatants will be checked or kept as targets:

  • Found Targets
    Defines how already found targets (from previous nodes) will be handled.
    E.g. you can Keep them, Clear all previously found targets (i.e. remove all) or Check them and remove those who don’t match the conditions.
  • Target
    Defines which combatants will be checked by the node.
    E.g. all Enemy or Ally combatants, or None to check only the previously found targets (according to Found Targets setting).

There are also options to not use the matching combatants as found targets (e.g. to only check for conditions without selecting as targets) and other settings to manage target selection.

Tip!

If you want to filter down already found targets without adding new targets to the list, use the following setup:

  • Found Targets
    Select Check.
  • Target
    Select None.

This’ll check (and remove combatants that don’t match the conditions) the already found targets and not check other, new targets.

Remembering Targets #

You can store and load found targets to reuse them between battle AI executions, or during a battle AI’s execution to switch between different target groups.

Targets can be stored either for the individual combatant, or for the combatant’s group – this is controlled via the Group Target setting in the nodes:

  • Individual
    The targets are available in the combatant’s battle AIs.
  • Group
    The targets are available in the battle AIs of all members in the combatant’s group.

Targets are stored via a target key to identify them, i.e. you can store different target lists.

The Store Targets node will store the currently found targets, the Load Targets node will load stored targets into the current found targets. The Has Stored Targets node checks if targets are stored for a defined target key.

Example #

A Check Status node checks for HP < 50% on the allies of the user. All combatants with less than 50% HP are now stored in the found targets – if any where found, the node’s Success slot is executed next, otherwise the Failed slot.

At least one target was found, an Ability node using a single target healing ability is connected to the Success slot and will use the ability on one of the found targets.

Combatant’s Setup #

A combatant can have multiple battle AIs – if none of the battle AIs results in an action, the combatant will try performing it’s base attack (or do nothing if that fails).

The default battle AI for all combatants is defined in Combatants > Combatants > General Settings in the Battle Settings > Default Battle AI.

Each combatant can optionally add additional battle AIs or replace the default battle AIs. When using both, the combatant’s battle AI is used first. The individual combatant’s setup is found in their Battle Settings > Battle AI.

Nodes #

The battle AI nodes are divided into different categories.

You can see a list of all available battle AI nodes in this documentation.

Action Queue #

Nodes to manage the combatant’s AI action queue, e.g. clearing the queue or checking the count of added actions.

Action #

Use actions like attack, an ability or item, defend, escape, etc.

If the action can be used, based on the battle AI call’s Use Mode and the action node’s Action Use Mode, the battle AI will either exit at this node and perform the action, or continue to the next node.

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 battle AI continues at the next node.

Base #

Basic nodes, e.g. using a random next node, a chance check (e.g. 25 % chance), check the game’s difficulty or use another battle AI.

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

Check #

Contains all check/condition nodes from other categories.

These nodes (also in the other categories) are usually used to select the targets for action nodes (via the found targets).

Combatant #

Nodes 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 modifier Fire above 100, is a certain status effect applied to the user of the AI.

You can also use targets that are within combatant triggers of a combatant. Learn more about combatant triggers in this documentation.

Grid Formation #

Nodes to manage the grid formation of the combatant’s group.

Grid formations are only available grid battles.

Learn more about grid formations in this documentation.

Move AI #

Nodes to check the combatant’s Move AI, e.g. to select the current move AI target or use combatants that are valid hunting targets of the move AI.

You can also change the combatant’s move AI or the move AI’s used mode (e.g. switching it to Hunt mode).

Learn more about the move AI in this documentation.

Position #

Nodes to check positional conditions, e.g. distance or orientation of the combatant to a target (e.g. is the user behind the target).

Selected Data #

Nodes to manage selected data, e.g. selecting a combatant or ability and storing it as selected data.

Target #

Nodes to manage the found targets, e.g. clearing all found targets or using the combatant’s last target as found target.

You can also store and load found targets to remember targets between battle AI executions or to switch between different target groups.

Variable #

Nodes to check and change variables.

Table of Contents
  • How it works
    • Use Mode
      • Action Use Mode
    • Finding Targets
      • Which Targets?
      • Remembering Targets
      • Example
    • Combatant's Setup
  • Nodes
    • Action Queue
    • Action
    • Base
    • Check
    • Combatant
    • Grid Formation
    • Move AI
    • Position
    • Selected Data
    • Target
    • Variable
Sitemap
  • ORK 4 BETA
  • Features
  • Showcase
  • Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2 Hub
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK
  • Contact
  • Blog
  • Makinom
  • gamingislove.com
Categories
  • News (73)
  • ORK 2 (137)
    • Tutorial (137)
      • Game tutorial (50)
      • Gameplay (32)
      • How-to (55)
  • Release (156)
Search

© 2015 Gaming is Love e.U.

Disclosure: This site may contain affiliate links, which means I may receive a commission if you click a link and purchase something that I have recommended. While clicking these links won’t cost you any money, they will help me fund my development projects while recommending great assets!