Combatants

Combatants are entities with a status system that can fight in battles.

This includes the player, allies and enemies – but can also be used for things like destroyable objects in the scene or traps damaging a combatant.

If combatants are allied or enemies depend on their faction. See the faction documentation for details.

Combatant Types #

Combatant types are used to organize combatants by separating them into different types.

You’ll mainly use them to filter combatants in the editor, but can also give additional content information to combatants, used for condition checks or to separate combatant in bestiary menus.

Combatant types can be sub-types of other combatant types for a more detailed organization.

The combatant type also defines the item type of it’s combatants, e.g. for when they’re sold in shops.

Combatant types are set up in Combatants > Combatant Types.

General Settings #

The general settings define some basic and default settings for all combatants. Each combatant can optionally override the default settings (and in some cases add to them).

The general settings are found in Combatants > Combatants > General Settings.

Schematics #

Combatants can automatically use schematics upon certain states:

  • Init
    Used when the combatant is first initialized.
  • Spawn
    Used when the combatant’s prefab (game object) is spawned.
  • Turn Start
    Used at the start of a combatant’s turn.
  • Turn End
    Used at the end of a combatant’s turn.

These schematics can be used to e.g. create custom systems, do some special setup (e.g. randomize the name upon initialization) or perform some animation at the start/end of a turn.

Custom Schematics #

Additionally, custom schematics allow to define schematics for a combatant bound to a call key.

Schematics can call these custom schematics using a Custom Combatant Schematic node, which provides a call key. A combatant will use a schematic with a matching call key.

E.g. use this to perform different animations for each combatant at the start or end of a battle (battle start/end schematics) or cause different reactions when getting hit by an ability, etc.

Status #

You can define status bonuses and level up settings for all combatants.

Status bonuses can give bonuses to chances, status values, attack/defence modifiers and change status effects. Learn more about status bonuses in this documentation.

A level up can optionally fully recover a combatant (set Consumable status values to their maximum), cause status effect changes and use a schematic (e.g. for creating a custom level up system).

Attacks & Abilities #

Set up the default base attack, counter attack and auto attacks of all combatants.

The base attack is a combatant’s standard action/attack – usually a physical attack, but it can be any kind of ability you want. The counter attack usually is the same as the base attack and will be used when a combatant counters an attack.

Auto attacks can optionally perform an attack periodically without using a combatant’s turn or timebar.

Additionally, you can define default action combos and shortcut slots for all combatants. Learn more about shortcut slots in this documentation.

Inventory & Equipment #

Define the default start inventory, loot, available equipment and steal settings for all combatants.

Each combatant can either add to the default inventory/loot or replace it completely. E.g. you can use the general settings to define a basic set of items and loot that all combatants will have, while individual combatants can add their own items to the mix. Learn more about loot in this documentation.

Classes and combatants can also replace the default available equipment with their own settings. Learn more about equipment in this documentation.

Battle Settings #

The general settings define many of the default battle settings you’ll use for most of your combatants. You’ll usually only have a few special combatants that’ll replace something of these settings.

Death Settings #

These settings handle what happens upon a combatant’s death. E.g. a combatant can automatically leave their group or not be revivable.

Animating a combatant’s death is done in the Battle Animations using a schematic (see below).

Auto Start Battles #

A combatant can automatically start battles with the player upon defined conditions. This is only used when the player and the combatant are enemies (based on their factions) and there is currently no battle running.

E.g. a battle can start if an enemy comes within a defined distance to the player.

Grid Cell Size #

By default, a combatant will occupy a single cell in a grid battle. Optionally, you can use grid shapes to use multiple cells for a combatant.

Combatant Links #

Combatants can be linked to others via the Link Combatants node in schematics. These links can be automatically released to free up memory.

Battle AI #

Defines the battle AIs that are used by all combatants. Each combatant can either add additional battle AIs (used before the default battle AIs) or replace them completely.

Learn more about battle AIs in this documentation.

AI Settings #

All non-player group combatants are AI controlled – player group members can optionally also be AI controlled.

The AI settings also define how an AI combatant selects targets (e.g. using the nearest target), how it’ll become aggressive (for Real Time Area Battles) or how long it’ll take to make decisions.

AI Behaviour/Ruleset Slots #

AI behaviours/rulesets are equipable AI and can influence which battle actions a combatant will use.

These settings define the default setup for all combatants.

Battle Animations #

Define schematics that’ll be used to animate special actions in battle, e.g. defend, escape or death.

Additionally, you can also use schematics before and after using an ability/item – e.g. if using an item always has a use animation before using it, it’s a good idea to set it up here and not have to do it in each item. Abilities/items can also be set up to not use these schematics.

Animation & Movement #

The general settings define many of the default animation/movement settings you’ll use for most of your combatants.

Animation System #

Defines the animation system (legacy, Mecanim or a custom system) that’ll be used for all combatants.

Animations #

Defines the animation setup that’ll be used for all combatants. You can define multiple animation settings for overall use and overrides during battle (e.g. to play different movement animations in battle).

Learn more about animations in this documentation.

Auto Animation #

ORK can optionally handle the idel and movement animations of a combatant based on the combatant’s current movement speed.

Move Speed #

Define walk, run and sprint movement speeds. These can be used by the move AI or movement nodes to move a combatant.

Movement Component #

Defines which component is used to move a combatant (e.g. Nav Mesh Agent).

This is mainly used by the move AI, but also used to move the player combatant when an interaction uses Move To Interaction.

You can create custom movement component integrations by deriving from the BaseMovementComponentSetting class.

Move AI #

Defines the default move AI used by all combatants. Move AIs can detect targets and e.g. hunt or flee from them.

Individual combatants and scene setup components (Combatant Spawner or Add Combatant) can override the default move AI.

Find Ground #

Define how combatants check if their game object is on the ground or in the air. This is e.g. used by auto animations and control maps.

If no ground check is used, the combatant is always on the ground.

Sound #

Define a sound template and custom sound assignments for combatants.

They’re used when a sound type is played on a combatant. Learn more about this in the Makinom documentation.

Combatants #

Combatants are entities with a status system that can fight in battles. This includes the player, allies or enemies – but can also be used for things like destroyable objects in the scene or traps damaging a combatant.

Combatants are set up in Combatants > Combatants.

Settings that have already been covered in the general settings will not be listed here.

Base Settings #

Define some basic settings of a combatant, e.g. their buy price when they’re available in shops.

Prefab #

The combatant’s prefab is spawned in a scene to represent the combatant.

You can use Conditional Prefabs to change the combatant’s prefab upon certain status and variable conditions, e.g. wearing a defined equipment or exceeding a level.

Object Variables #

Optionally add object variables to a combatant’s game object – though you don’t need a game object to be able to access the object variables of a combatant.

It’s recommended to use Local Variables instead of an Object ID to have unique object variables per combatant instance instead of shared between all combatants.

Control Maps #

Control maps are used to bind actions to input keys. This is only used by the player (and for the combatant the player is currently controlling).

Please keep in mind that only control maps that are added to a combatant are available.

UI #

Define UI related settings.

Portraits #

Combatants can define portrait sets – a combatant randomly selects a set that’ll be used when it’s created.

Portrait sets allow combatants to have different portraits, even if they use the same combatant settings.

Beside just using images as portraits, you can also use prefab view portraits to show the combatant’s prefab. This uses render textures and a camera.

Custom Text Codes #

Combatants can overrule custom text codes defined in UI > Text Codes. Dialogues will first use text codes of the speaker’s actor (e.g. coming from a combatant), before using the default custom text codes.

This can e.g. be used to customize dialogue messages for combatants, even when used in the same dialogue.

Information Overrides #

Combatants can override some default UI settings, e.g. number formatting or console texts.

Additionally, combatants can also block flying texts completely, e.g. if you use a combatant for a destroyable object in the scene but don’t want to display damage numbers on it.

Status #

Defines the initial status of a combatant, e.g. start level and class, as well as bestiary related settings.

Learn more about classes in this documentation.

Status Values #

These settings determine the initial values of the combatant’s status values.

You can use an (optional) status development and define start values for selected status values. When using both, the status development takes priority over defined status values. Additionally, you can add random status value bonuses.

The experience and normal status value rewards the player receives when defeating the combatant (enemy) are also defined here.

Learn more about status values in this documentation.

Modifiers #

Define the combatant’s start values for attack/defence modifiers, as well as the combatant’s defence modifier IDs.

Learn more about attack/defence modifiers in this documentation.

Status Bonuses #

A combatant can either add to the default status bonuses (general settings) or replace them completely.

Learn more about status bonuses in this documentation.

Attacks & Abilities #

Defines the abilities of the combatant. You can also replace the base/counter/auto attack defined in the general settings.

Ability Development #

Set up which ability will be learned at which level, or use ability developments as templates.

Learn more about abilities and ability development in this documentation.

Research Trees #

Add the research trees that are available to the combatant.

Research trees are used to upgrade status values, learn new abilities or create items, equipment, etc.

Learn more about research trees in this documentation.

Menu Ability Types #

Menu screens and battle menus showing empty ability types can optionally be limited to ability types that will be available to the combatant.

You can define ability types that will be available in addition to the types that are found based on the combatant/class ability development and research trees.

Inventory & Equipment #

Defines the inventory and equipment of the combatant. You can also add to or replace the default start inventory, loot and steal settings defined in the general settings.

Available Equipment #

Optionally override the available equipment (equipment slots and available equipment) coming from the combatant’s class or the default setup (general settings) with a different available equipment setup.

The combatant can define which equipment slots will be available at the start, as well as which equipment can be equipped.

Learn more about equipment in this documentation.

Start Equipment #

Define the combatant’s starting equipment in equipment sets based on level range.

E.g. level 1-10 can use a different equipment than when the combatant starts at level 11-20, etc.

This allows using a combatant for a wide range of levels (in combination with status development).

Battle Settings #

Most of the combatant’s battle settings are made in the general settings. A combatant can override them with individual setups.

You’ll usually only add or replace the battle AI.

Battle AI #

You can add additional battle AIs to the default battle AI defined in the general settings or replace them completely.

The combatant’s battle AI is used before the default battle AI.

Animations & Movement #

Most of the combatant’s animations & movement settings are made in the general settings. A combatant can override them with individual setups.

Sound #

The combatant’s sound settings will be used before the default settings from the general settings.

If no sound for a sound type is found here, it’ll fall back to the default settings.

Combatant Groups #

Combatant groups are used to create reusable group setups – they’re mainly used by the various battle components (e.g. Battle or Combatant Spawner). Learn more about adding battles to scenes in this documentation.

Combatant groups are set up in Combatants > Combatant Groups.

Combatant groups can also use formations – they allow move AIs to move in a formation and can also be used to define the combatant placement in battles.

Combatants #

Add the combatants that should be part of the group.

Used level #

You can use different start levels than the combatant’s defined start level:

  • Default
    Uses the combatant’s start level.
  • Player
    Uses the player’s level with a min/max offset.
  • Random
    A random level between two defined levels.
  • Variable
    Uses an int variable’s value.
  • Formula
    Uses the result of a formula.

Additionally, Level Zone components can be used to define the levels of combatants within a defined area of a scene, or the whole scene.

Requirements #

If a combatant is part of a group can depend on the game’s difficulty and variable conditions.

Battle Spot #

Optionally use a custom battle spot for a combatant.

Group Battle Gains #

Add additional battle gains the player receives when defeating the group.

You can add items, equipment, currency, crafting recipes, AI behaviors and AI rulesets.

Adding combatants to scenes #

Combatants can be added to scenes in different ways, e.g. using components or schematics.

Player #

The player is usually spawned, either via a Spawn ORK Player node in schematics or by changing scenes (e.g. via Scene Changer components).

The player combatant can be set up/added in the start schematic using a Join Group node. Optionally, you can also use a combatant group to define the player’s starting group. Both (start schematic and start group) are set up in UI > Start Menu in the New Game Settings.

Combatant Spawner Component #

Combatant spawners do what their name suggests – spawn combatants.

The combatants are spawned using their prefab. They can be spawned at defined positions or at a random position within a defined area.

Learn more in this documentation.

Add Combatant Component #

This component adds a defined combatant to a game object in your scene.

It doesn’t spawn the combatant’s prefab.

Schematics #

The Add Combatant node will do the same as the component of the same name, add a combatant to a game object (i.e. not spawning the prefab).

The Spawn Combatant node will spawn a combatant at a defined position using the combatant’s prefab.

The Spawn Battle Combatant node is used to spawn combatants participating in battle at their battle spots (usually only used in a battle start schematic).

Scripting: Accessing a game object’s combatant #

A combatant is assigned to a game object via the Combatant Component – which also shows the combatant’s status and state information in the inspector.

Getting the combatant of a game object can be done in a single line of code:

Combatant combatant = ORKComponentHelper.GetCombatant(gameObject);

Naturally, gameObject is the GameObject you want to get the combatant from.

Requires using the GamingIsLove.ORKFramework namespace.

using GamingIsLove.ORKFramework;