A set of defined behaviours that enable Actors to act out combat in the desired way. Behaviours are broad enough to create dynamic interactions. Unit AI should enable a group of Actors to act in a unified way, Actor AI should allow Actors to work independently.
Definitions
Actor - a single entity that can act independently in combat.
Unit - a cohesive, linked group of Actors.
CombatActive - an ability or skill that causes effects on use.
Behaviour - a set of conditions that determine how an Actor will act (or behave).
Blob / Blobbing - moving to attack enemy actors, but not moving any distance to get into range, so they "blob" together.
Dangerous Terrain - a tile identified as being dangerous to the actor e.g. lava.
High Level Requirements
Minimum
Unit AI
A Unit can target another Unit;
When a Unit is targeting another Unit;
Actors in the Unit ignore their own targeting.
Actors in the Unit attempt to move towards the target Unit in formation.
Actors in the Unit attempt to attack Actors in the target Unit.
A Unit can be instructed to move to a target position.
When a Unit is moving to a target position;
Actors in the Unit ignore their own targeting.
Actors in the Unit attempt to move towards the target position.
A Unit targeting another Unit or moving to a target position will only do so for a period of time, before reverting to normal.
When a Unit is moving together (i.e. as a cohesive Unit), it will move in formation;
An organised formation, where Actors are in lines.
A disorganised formation, where Actors are in a clump/loose grouping.
Actor AI
Actors can act independently of their Unit;
Actors can identify their own targets, as determined by their target preferences.
Actors will move towards their identified target, until they are in range to use their CombatActives.
An Actor will try to stay close to the Actors in their Unit, meaning they Blob together when trying to get to the enemy.
Actors can use their CombatActives;
If the CombatActive is off cooldown.
If the CombatActive is in range of the target.
If the Actor has unblocked line of sight of the target.
Actors avoid colliding or existing in the same space as other physical bodies, such as Actors or obstacles.
Player
A Unit can be identified as being the Player and is entirely manually controlled.
A Unit controlled by the Player can only ever contain a single Actor.
Desired
A Unit can have defined Behaviours based on the Unit type;
Infantry - move as close to the target as possible and stay there.
Ranged - stay as close to the maximum range of the smallest-range CombatActive from the target.
Hit and Run (aka cavalry) - move as close to the possible to the target when CombatActives are off cooldown (i.e. ready) and as far away from the enemy otherwise.
A Unit can have a defined Behaviour set by circumstances;
Flee - move as far away from the enemy as possible.
Actors in a Unit can synchronise their use of a given CombatActive.
A Units target, whether position or enemy Unit can be indicated.
Ideal
Actors will always try to avoid Dangerous Terrain;
The "force" of this avoidance;
is configurable, such that some Actors are more or less likely to avoid Dangerous Terrain than others.
considers the "threat" to the Actor. (We dont want an Actor immune to fire damage running around fire)
Actors are not guaranteed to avoid Dangerous Terrain. The avoidance is a steer, not an override.
Technical Considerations
Actors can be different sizes.
For performance, do we need to support pathfinding with Quadtree and/or FlowField methods?
Summary
A set of defined behaviours that enable
Actor
s to act out combat in the desired way. Behaviours are broad enough to create dynamic interactions. Unit AI should enable a group ofActor
s to act in a unified way, Actor AI should allowActor
s to work independently.Definitions
Actor
- a single entity that can act independently in combat.Unit
- a cohesive, linked group ofActor
s.CombatActive
- an ability or skill that causes effects on use. Behaviour - a set of conditions that determine how anActor
will act (or behave). Blob / Blobbing - moving to attack enemy actors, but not moving any distance to get into range, so they "blob" together. Dangerous Terrain - a tile identified as being dangerous to the actor e.g. lava.High Level Requirements
Minimum
Unit AI
Unit
can target anotherUnit
;Unit
is targeting anotherUnit
;Actor
s in theUnit
ignore their own targeting.Actor
s in theUnit
attempt to move towards the targetUnit
in formation.Actor
s in theUnit
attempt to attackActor
s in the targetUnit
.Unit
can be instructed to move to a target position.Unit
is moving to a target position;Actor
s in theUnit
ignore their own targeting.Actor
s in theUnit
attempt to move towards the target position.Unit
targeting anotherUnit
or moving to a target position will only do so for a period of time, before reverting to normal.Unit
is moving together (i.e. as a cohesiveUnit
), it will move in formation;Actor
s are in lines.Actor
s are in a clump/loose grouping.Actor AI
Actor
s can act independently of theirUnit
;Actor
s can identify their own targets, as determined by their target preferences.Actor
s will move towards their identified target, until they are in range to use theirCombatActive
s.Actor
will try to stay close to theActor
s in theirUnit
, meaning they Blob together when trying to get to the enemy.Actor
s can use theirCombatActive
s;CombatActive
is off cooldown.CombatActive
is in range of the target.Actor
has unblocked line of sight of the target.Actor
s avoid colliding or existing in the same space as other physical bodies, such asActor
s or obstacles.Player
Unit
can be identified as being the Player and is entirely manually controlled.Unit
controlled by the Player can only ever contain a singleActor
.Desired
Unit
can have defined Behaviours based on theUnit
type;CombatActive
from the target.CombatActive
s are off cooldown (i.e. ready) and as far away from the enemy otherwise.Unit
can have a defined Behaviour set by circumstances;Actor
s in aUnit
can synchronise their use of a givenCombatActive
.Unit
s target, whether position or enemyUnit
can be indicated.Ideal
Actor
s will always try to avoid Dangerous Terrain;Actor
s are more or less likely to avoid Dangerous Terrain than others.Actor
. (We dont want anActor
immune to fire damage running around fire)Actor
s are not guaranteed to avoid Dangerous Terrain. The avoidance is a steer, not an override.Technical Considerations
Actor
s can be different sizes.Outstanding Questions
Examples
Images / Gifs
Moving in formation - Warhammer Total War
Leaving formation / deferring to Actor AI - Warhammer Total War
"Blobbing" - Hero's Hour
Reading
Article on moving in formation - https://github.com/libgdx/gdx-ai/wiki/Formation-Motion Efficient AI updating - https://youtu.be/Te2Nu7QmZDI?si=YCjQ-ozf5Z8pnt1n Godot moving in formation - https://youtu.be/y4yzgBWivNk?si=6GQGjQtVsK-L8ED1 Pathfinding physics tweaks - https://www.youtube.com/watch?v=NRmz5Bfrn4c&list=PLUpZYfr0B25kliLbLmz9NnYKkFeHOEOpZ&index=201 Godot formations: https://youtu.be/X07_J4C3lso?si=mhhr3EzZUpDUqg53