Home › Mechanics › AI targeting

AI targeting

How enemies decide

Every enemy on this page decides the same way. Only the numbers differ by faction. Each turn:

  1. The whole group decides to attack or defend. If it defends, nobody walks up (see Range advantage).
  2. Each enemy scores every action it can take, such as walking up, throwing or Recover. No dice are involved.
  3. Actions that score less than 25% of the best action are dropped.
  4. One dice roll picks one of the remaining actions. An action with twice the score is twice as likely to be picked.
  5. If it walks, it picks the tile and the bro as shown below.

When an enemy walks up, it picks two things, the tile and the bro. No dice are involved:

  1. Every empty tile next to a bro is an option, however far away. A tile next to two bros counts as two options, one per bro.
  2. Each option scores that bro's targeting value (walking) plus the tile points.
  3. The enemy walks to the highest-scoring option. If it is too far for one turn, it walks as far as it can toward it and decides again next turn.
  4. Until the next round, every enemy that chose a bro lowers the score of the tiles next to him for other enemies (especially Orcs).
  5. After walking, it attacks the bro in reach with the highest targeting value (attacking). Usually that is the bro it walked to, but not always.

Tiles it cannot reach without walking through a zone of control do not count. Neither do tiles 2 or more levels above or below the bro (a cliff).

To save time, it only checks a path to the 18 best options, ranked by a quick score that uses −0.8 per tile of distance instead of AP spent.

Targeting value

For Bandits & Nomads, Barbarians, Orcs and Goblin Skirmishers.

Add the plain numbers, then multiply by every ×. Targeting values for walking up and attacking can slightly differ.

PointsConditionExceptions
11Enemy Hit Chance, per 100% hit chance
6One-Hit Damage, per 100% of HP + armor lost in one hitBarbarians and Orcs: 5
−0.5Bro Armor, per 100 total armor (body + head)Orcs: −0.4
0Random bonus, rolled again every timeOrcs: 0 to 2
2Bro has a shield, enemy can destroy or ignore shieldFor attacking: 0
2Bro has a two-hander, enemy can stunFor attacking: 0
×1.98Bro dies to one hitFor attacking: ×3
×1Bro's armor gone after one hitFor attacking: ×1.5
×1Bro has Riposte activeFor attacking: ×0.5
×0.5Bro is fleeingOrcs: ×0.6 to ×0.8
×1000Bro taunted this enemy
×1.5Bro has Killing Frenzy active
×1.33Bro has Rally the Troops
×1.2Bro has Killing Frenzy inactive
×1.1Bro has Adrenaline
×1.1Bro has Berserk
×0.5Bro has Indomitable active
×0.33Bro is bait (see Bait below)

Tile points

Enemies walk to tiles, not to bros. Each tile scores its tile points plus the targeting value of the bro next to it.

General

PointsConditionExceptions
10Bro has no enemy next to him yet, and this enemy reaches him this turn (not from a lower tile or swamp)
5Bro has no enemy next to him yet, and this enemy does not reach him this turn
4This enemy has AP left to attack after the move
9Tile 1 level higher than the bro
−9Tile 1 level lower than the bro
−0.5Each other enemy closer to the bro than this enemy
−0.625Each other enemy that already chose this bro this roundOrcs: −1.25 to −1.88
−1.25Each other enemy already next to the broOrcs: −2.5 to −3.75
−0.8Each AP this enemy spends to get thereOrcs: −0.67 to −1.11
−2.5Each bro whose zone of control covers the tileOrc Berserker with AoE attack: +2. Other orcs: −1.5 to −2. Goblin Skirmisher: −3
−4Tile is swamp
−10.6Each bro with Spearwall up next to the tileEnemy with Shieldwall up: −8. Orcs: −8.8 to −10.6
−12Tile is on fire, has miasma, or is about to be hit by a mortar or lightning storm

Nearby allies

Enemies try to be close to each other (except Orc Berserkers), so they value tiles near their allies.

PointsConditionExceptions
xx = 3.27 × √( sum of (4 − distance) ). Each enemy within 3 tiles of the tile adds 4 − distance to the sum, including the walking enemy itself (from where it stands now)Barbarians: x = 8 × (sum ÷ 8)0.375. Goblin Skirmisher: x = 2.83 × sum0.75. Orc Berserker: x = 0, and he counts: 0 for other orcs
5.7Example with 1 enemy 1 tile awayBarbarians: 5.5, Goblin Skirmisher: 6.5
7.3Example with 1 enemy 1 tile away and 1 enemy 2 tiles awayBarbarians: 6.7, Goblin Skirmisher: 9.5
12.2Example with 3 enemies 1 tile away, 2 enemies 2 tiles away and 1 enemy 3 tiles awayBarbarians: 9.9, Goblin Skirmisher: 20.5

Charge

Orc Young and Orc Berserkers try to charge. If they cannot charge, they usually stop 3 tiles away and charge next turn.

PointsCondition
8Tile next to a bro it can charge this turn
−12Tile 2 tiles from a bro, if no bro is in charge reach
−24Tile next to a bro, if no bro is in charge reach

Ranged

Ranged Bandits & Nomads (Poacher, Marksman, Nomad Slinger, Nomad Archer) and ranged goblins (Ambusher, Overseer, Shaman) shoot instead of walking up. Every turn they pick a tile to shoot from, then the bro to shoot.

Targeting value of a bro, when shooting:

PointsConditionExceptions
13.2Enemy Hit Chance, per 100% hit chanceGoblin Overseer: 15.4, Goblin Shaman: 11
4One-Hit Damage, per 100% of HP + armor lost in one hitGoblin Ambusher and Goblin Overseer: 3, Goblin Shaman: 6
−1Bro Armor, per 100 total armor (body + head)Goblin Shaman: −0.5
×0.5Bro is fleeing
×1.5Bro is a Ranged BroGoblin Ambusher and Goblin Overseer: ×1.75, Goblin Shaman: ×1.33

Tile to shoot from: it moves to the tile with the most points.

PointsCondition
0.5 × targeting valueEach bro it can shoot from the tile
×2.5On that bro's points if he can reach the enemy with no AP spent (less the more AP he needs, ×1 at a full turn)
×0.5On that bro's points if the line of fire to him is blocked
×0.225On that bro's points if the line of fire to him is blocked by another enemy (total)
1Each level the tile is above the bros it can shoot (their average level)
−1Each AP spent
−4Each Melee Bro within 1 turn of the tile who is engaged or rooted
−6Each Melee Bro with a reach weapon 2 tiles from the tile
−24Each Melee Bro who can reach the tile with no AP spent, less the more AP he needs, 0 at a full turn. Ranged Bros count 0

Bro to shoot: the highest targeting value, changed by:

PointsCondition
+12.5%Each other bro next to the target adds 12.5% of his own targeting value
×0.5Line of fire blocked by an obstacle or another enemy
−12Each other enemy next to the target
SkipNever shoots a bro with 4+ enemies next to him

Melee enemies against your Ranged Bros:

PointsConditionExceptions
×1.33Targeting value of a Ranged Bro, when a melee enemy walks upOrcs: ×1.33 to ×1.5
×1Targeting value of a Ranged Bro, when a melee enemy attacks
−2Tile points for a swamp tile next to a Ranged Bro, instead of −4

Rules:

Definitions

Bait

Every enemy gives a bait bro ×0.33 targeting value. A bro is bait if his armor is at most 1/3 of the company average, and he is either level 1-2 in a company averaging level 6+, or has no weapon in hand.

Waiting

An enemy that has picked its tile can press Wait instead of walking. No dice are involved. It waits only if all of these are true:

Flee, Retreat and Protect

These are not part of the dice roll. When they apply, the enemy always does them.

Perks the AI counts

The AI estimates hit chance and damage from a bro's current stats. Perks that only work at the moment a hit lands are ignored.