Skip to content

Battle AI

RBM replaces much of the base game's battle AI, from army tactics down to how a single soldier blocks, steps and picks his weapon. Armies use tactics that suit their army, their culture and the ground. Archers shoot from a good spot and take cover behind their infantry. Cavalry rides in formation until close, charges, then pulls back to regroup. Infantry lines advance at the pace of their slowest men, charge only when close and jostle for position once they meet the enemy. Soldiers fight according to their skill.

Everything on this page needs the RBM AI toggle (on by default). Turning it off returns the battle AI to the base game. A few parts also need RBM Combat, as noted below. The posture and stamina system is part of RBM AI too, and has its own page: Posture & Stamina. Settings are listed in Settings.

Tactics by culture

In field battles, every side can use every tactic of its role, whatever its culture. Each culture has a signature tactic, which gets a bonus:

Side Tactic Signature culture Picked when the army has
Attacker Embolon: heavy cavalry forms a wedge in front of the infantry Empire a cavalry wing of 20+ riders, at least 10% of the army (best from 30%), mostly barded heavy horse
Attacker Split Skirmishers: javelin troops form a separate screen Aserai a strong infantry force (60+ men, 25% stronger than the enemy's) with enough javelin men
Attacker Split Infantry: the infantry splits into a center and two flanks Sturgia 80+ infantry, at least 35% of the army, best when it outnumbers the enemy's infantry
Attacker Split Archers: archers deploy on both flanks Battania 30+ archers, at least 12% of the army (best from 35%)
Attacker Ranged Harassment (from the base game) Khuzait a large share of archers and horse archers, more than the enemy's
Attacker Full-scale attack none infantry
Defender Split Archers (defensive version) Battania as above
Defender Split Infantry (defensive version) Sturgia as above
Defender Hold the Choke: the infantry blocks a narrow pass, bridge or ford Sturgia 40+ infantry, at least 30% of the army, and such a passage it can reach well before the enemy
Defender Hedgehog: the infantry forms a square (a circle when surrounded) with room for its archers Battania 40+ infantry, at least 30% of the army, mostly with polearms or shields, against an enemy much stronger in cavalry
Defender Defensive line, defensive engagement, full-scale attack none (base game rules)

Each tactic is rated by how well the army suits it, and the best one is used. That rating is then adjusted:

  • Culture: a culture's signature tactic counts 1.5 times as much; a signature tactic of another culture counts 0.8 times. So an army usually uses its own culture's tactic when it suits it, and another culture's only when the army is clearly built for it. Full-scale attack and the two defensive tactics have no signature culture.
  • Commander (campaign lords only): Valor makes attacking tactics (full-scale attack, Embolon) more likely and defensive ones less likely, by 10% per trait level; a cowardly lord the other way. Calculating makes the manoeuvring tactics (Embolon, the split tactics, Ranged Harassment) 10% more likely per level. A high Tactics skill favours the manoeuvring tactics too: from 85% at skill 0 to 115% at 250.
  • Variation: each battle, every tactic gets a random ±10%, so the same two armies don't always fight the same way.

Defenders whose army is almost all infantry (over 90%) always go for a full-scale attack. A side down to under 10% of its strength with only mounted men left routs. Several base-game tactics, such as the all-out charge, the defensive ring and the coordinated retreat, are not used in field battles.

Split Infantry puts about a sixth of the infantry on each flank, filled first with men carrying two-handed axes and polearms. Split Skirmishers puts up to a fifth of the infantry, the lower-tier javelin troops, in a separate formation that skirmishes ahead of the main line. In Split Archers, the infantry waits for its archers if they fall too far behind. An army keeps its plan for at least 30 seconds.

Reading the ground (setting Terrain-aware battle plans, on by default). In field battles the AI reads the ground once the armies have deployed and uses it in its plans. Defenders pick where to fight: a hill, crest, narrow pass, bridge or ford they can reach well before the enemy, and the more they are outnumbered the harder they look for such ground. Flank groups go round the enemy's open side, and flanks covered by water, cliffs or woods are not guarded. Archers take nearby hills, cavalry charges along clear runs and avoids woods and rough ground, and foot formations loosen up in woods. An attacker looks for a better way in, round a held bridge or pass or toward an open flank, and goes straight in once close. Sides under about 60 men, bandits and sally-outs skip these plans.

Deep water (setting Deep water blocks AI paths, on by default). Water about 1 m deep or more is walled off for everyone (missiles pass). AI paths and formations go round it, and soldiers who end up in it are walked back out. Fords and bridges stay open.

How a battle unfolds

Most tactics have two phases.

Advance. The main infantry moves forward in good order. Archers stand just behind it and shoot over it, cavalry guard the flanks, and javelin troops skirmish ahead. The attacker never stands still in this phase: its formations stop to regroup for at most 10 seconds at a time, and in Ranged Harassment its infantry keeps walking forward (6 m every 4 seconds) while its archers shoot, or simply advances if it has no usable archers.

Battle joined. The tactic switches to attack once the infantry lines are close (around 70 to 95 m depending on the tactic), once a good part of the main infantry is already fighting in melee, or once the enemy has only cavalry left. From then on the infantry charges, archers shoot from their own spot, and cavalry charge.

Reacting to the battle (setting "AI reacts to the battle", on by default). Through both phases each AI army checks the fight once a second and can give one free formation a short job on top of its plan:

  • Help. One of its formations is attacked in melee, or an enemy group closes in on it (its archers or a flank group). The nearest free infantry walks over and joins the fight, or free cavalry rides to the attacker's flank or rear and charges. A defending line holding its position that will come to help by itself is given about 3 seconds to do so first. The main line's head-on fight with your main line does not count.
  • Cut off cavalry. Your cavalry rides round its line, at its archers or at its rear. Free cavalry rides out to stand between them and charges your riders before they arrive.
  • Hit an opening. One of your formations is stuck in melee with one of its own and nothing else of yours guards its flank or rear. Free cavalry rides round and charges it from the side or behind.
  • Hunt your archers. Your archers keep landing arrows on one of its formations, or have stood within about 200 m of its main line for 20 seconds while it has little to shoot back with. Free cavalry rides to their side or rear (about 30 m out) and charges; infantry goes only when it is within about 80 m of them. The archers actually shooting are hunted first. It does not go when your infantry stands within about 60 m of the archers, when your cavalry waits near them or near the hunters, or when the way passes close to your infantry or in front of your main line, and it gives up when your infantry comes up to cover them or they keep running away. Infantry never chases horse archers, and cavalry goes after them only while they stand still. Horse archers riding about while they shoot get a screen instead: cavalry stands between them and the formation they shoot at and charges only when they come within about 40 m, then rides back to its place once they pull away (no chase). One hunt at a time; the same archers are not hunted again for a minute.
  • Screen parked cavalry. Your cavalry or horse archers wait beside or behind its line, within about 250 m of its archers or a flank, for 8 seconds. Free cavalry (or infantry) takes up a screen between them and the likely target and charges only when they come in.
  • Change plans when the battle turns. When the balance has shifted a lot since the army chose its battle plan (the strength of one side against the other moved by about a third, your cavalry or archers are almost gone, or it lost half its own archers or cavalry) and stays that way for a few seconds, the army weighs its plans again and takes the best one if it is clearly better, for example dropping the hedgehog once your cavalry is gone. At most once every 45 seconds and four times a battle; a defending line that is already fighting is only pulled out when the battle turned very sharply (one side's strength doubled against the other's).
  • Turn to face you. A defending line holding its position turns in place toward where most of your army is (your infantry counts most) when you move more than about 35° round it and it is not fighting; its archers face the same way. A line holding a choke point turns only within about 60° of the pass.
  • Give up a bypassed choke point. When your main force goes round a held choke point (behind its line, or beside it within about 300 m where the pass's sides are open), the defender drops the choke after about 8 seconds, picks a new plan at once and looks for a new position from where you actually stand.
  • Use the time you give it. When you pull your army back, the defender looks for a better position again. It moves only when it can get there and form up well before you could arrive, never while its line is fighting or you are within about 200 m; a long pull-back lets it move again even after its usual two moves (at most five a battle).

A job ends when the threat is gone or beaten, after about a minute (a minute and a half in melee), when the formation would be drawn too far from its army or chases without getting closer, or when it is threatened itself; the formation then goes back to its plan. Small groups are ignored, at most two such jobs run at a time (plus one "opening" attack, one archer hunt and one screen), and a formation that has just finished one rests for 20 seconds (not when the enemy simply turned away, so a feint does not tire it out; a screen even keeps its place while your riders stay near). Your own formations are never moved, but an allied AI army defends them as it does its own. A big line still gets help against a group a fifth of its size (it judges as if it had at most 100 men). In a small army with no free formation, the main line may step out to help its own archers when they are attacked right next to it and no other enemy infantry is near, and goes back to its place soon after. Formations holding a choke point or a hedgehog keep their jobs.

Armies with little or no infantry. An army whose infantry is less than about a quarter of its strength does not build its plan round an infantry line, and a handful of men of one kind (under about 10% and 60 men) is never treated as a main body. A defending army of mostly archers picks a spot and stands there, shooting and fighting in place instead of backing away endlessly. What infantry it has stands just in front of the archers and charges enemy infantry that comes within 40 m; a few riders or horse archers ride beside the main body instead of going off on their own. An attacker whose arrows can't hurt the enemy, for example a shield wall, eventually closes in instead of shooting forever. Armies heavy on cavalry and horse archers also get their own handling; normal mixed armies fight as before.

Infantry

Marching in step. An advancing AI formation moves at the pace of its slower men, so the line arrives together instead of strung out. Only men who have fallen behind their place may run to catch up; men level with or ahead of the line keep the formation's pace. A tidy line is allowed to move faster than a ragged one. These pacing rules also apply to your own formations when you give them a Move order.

Line shape. While advancing, the AI keeps its infantry line wider than it is deep. Within 150 m of the enemy, an AI infantry formation of 30 or more men picks its own arrangement: a shield wall if most men carry a large shield, loose order if most carry two-handed weapons, otherwise a line.

Charging in formation. AI infantry marches up in formation and breaks into the charge only within 40 m of its target (about 10 m for a shield wall, square or circle), so it arrives as a block instead of a tired crowd. Your own foot formations do the same when you order a charge from far away. Charging men keep pace with comrades running ahead of them, stop a step short of the man in front, and fight the formation they charged instead of scattering after passing horsemen. In smaller armies the infantry stays in one block instead of splitting into several small ones.

Bracing against cavalry. When enemy cavalry within 150 m charges an AI infantry formation that is not yet fighting, the infantry stops, forms a shield wall and turns to face the horsemen. A handful of riders (fewer than 5, or under a tenth of the infantry's men) is not enough to make it brace. Infantry does not chase cavalry it can't catch: it holds its formation facing the riders and fights them when they come in, but keeps fighting enemy infantry that is already on it.

Javelin volleys. When an AI infantry formation is busy throwing javelins at a nearby enemy, it holds its ground (or steps back a little) to finish its volley before closing in.

Shields up. AI soldiers charging an enemy with a one-handed weapon and a shield raise their shield as they close. In a shield wall, the front rank holds shields low toward the enemy and the men at the ends of the line cover the flanks; in a square or circle, the outer rank holds its shields toward the enemy. Men carrying a bow, crossbow or two-handed weapon are left out of this unless the formation is ordered to hold fire.

The frontline

The Frontline System (on by default, setting Frontline System) changes what happens when two infantry lines meet. Instead of every man pressing straight forward into a crowd, each soldier in a charging infantry or archer formation looks at the allies and enemies directly around him and chooses to:

  • attack the enemy in front of him,
  • step back a little,
  • close ranks with the nearest ally,
  • sidestep left or right,
  • rest to recover, if the posture system is on, his posture is low and no enemy is in front of him.

He keeps each decision for a short random time, so the line shifts and rotates naturally: tired and battered men drop back, fresh men step forward, and gaps close. Shield-bearers prefer to close ranks, men with two-handed weapons attack and sidestep more, banner bearers hang back, and wounded or exhausted men are less eager to attack. This also applies to your own formations when they charge.

Formations of 25 men or fewer are left out (setting: Frontline Min Formation Size). Further settings adjust how long each decision is held and how much each choice is favored.

Leaving the line. Some rules apply whether the frontline system is on or off:

  • Infantry under a charge order turn to face their own opponent once he is within 20 m.
  • AI archers draw a sidearm when an enemy is within about 2.5 m. While skirmishing, an archer who has had nothing to shoot at for a while near the enemy charges in.
  • AI cavalry riders break ranks when several enemies are close, and a rider who loses his horse leaves the formation.
  • In sieges, an AI soldier (not in a shield wall, square or circle) leaves his place to fight an enemy within a couple of meters.

Archers

After contact. Once the lines meet, AI archers stand and shoot from one place with a clear view instead of running back and forth. They stand their ground against cavalry and horse archers, take cover beside or behind their infantry from enemy infantry, and shoot back at enemy archers. They pick line or loose order by the situation and form a loose ring when surrounded.

Before contact, archers stand just behind their own infantry, about 4 ranks deep, and shoot over it. Attacking archers move with their army and face the way it advances. Fewer than 30 archers stay in one group instead of splitting into two.

Holding fire out of reach (needs RBM Combat). AI bowmen, crossbowmen, slingers and javelin throwers do not shoot at targets their missiles cannot physically reach.

Opening range. AI archers judge their range correctly and open fire at real bow range.

Picking up ammunition. AI soldiers no longer run out to collect arrows, bolts, stones or throwing weapons when an enemy is near the item (within 25 m, or 45 m for an enemy rider), while they still have at least 15% of their ammunition, or while they are drawing, shooting or reloading.

Out of arrows. In field battles, AI formations are re-sorted by what each man carries: an archer with 5 or fewer arrows left joins the infantry, and a rider with a bow and ammunition joins the horse archers.

Cavalry

Charges. AI cavalry charges the enemy's infantry first, then its archers. It rides in formation until about 35 m from its target and only then breaks into the charge. Riders ride through the enemy, carry on past, then regroup on open ground before charging again, and keep their target instead of switching mid-fight. If they get stuck in melee for several seconds, they pull out. Under fire they charge again only once regrouped. They are more eager to charge downhill, and less eager to charge other cavalry.

Flank guards. Before contact, cavalry guards the flanks of the main infantry, out to the side and somewhat forward. It only charges enemy cavalry within about 70 m of its post, or any enemy within about 35 m; horse archers and arrow fire do not draw it out. The charge is called off when the enemy pulls away, when the riders get about 60 m from their post or start to scatter, or after 25 seconds. The riders then regroup at the post and wait 5 seconds before they can charge again. With no room on their flank (map edge, water) they wait behind the infantry, and once their own infantry is gone they attack.

Embolon (Empire). Heavy cavalry forms a wedge in front of the advancing infantry before the battle is joined.

Horse archers ride an oval loop around their target formation, shooting as they go. The riders keep their places in the formation as it circles; a rider only breaks off on his own to get away from an enemy within about 15 m, and draws his sword within about 5 m. The formation keeps its target unless another enemy formation is clearly closer. If they get close to the map edge, they break off and reposition. Horse archers are much less likely to charge into melee.

Mounted javelin troops skirmish: they ride in, throw, ride back and repeat. In some tactics they are shared evenly between the two flank formations.

Charging into infantry. When a horse slams into an enemy infantryman in a field battle, he may panic and flee for a few seconds, more likely when he is knocked down or hit from behind. He rallies once nobody has hit him for 10 seconds. A charge that neither knocks the man down nor knocks him back does no damage and only pushes him aside. Riding into your own men does no damage either. Riders surrounded by infantry keep pushing forward.

Javelin skirmishers

Javelin troops on foot and on horse (in Split Skirmishers, for example) run a cycle: wait beside their own infantry, dash forward to throwing range, throw for a few seconds, fall back, and repeat.

Defending

A defending formation holds a position and freezes there, facing the enemy, once the enemy is within 200 m. Defensive positions are kept away from the map edge. Holding lines are hard to bait: small groups, distant archers and passing riders don't draw them out. They fight in place, charge only real infantry that reaches them and return to their post afterwards. Defending cavalry reserves wait behind their line and ride out after your horsemen only when strong enough, staying close to their army.

Reinforcements and rallying

Spawn position (field battles). Reinforcements arrive behind where their own army is now, instead of at the spot fixed at deployment. RBM looks for a point on the map border behind the army, steps it inward, prefers a spot well away from enemy formations, and keeps the men out of water. When the base game's own spawn point is used, reinforcements appear 50 m in from the border instead of right on it.

Field share. Your battle size setting is split between the sides by the square root of each side's men left, so the bigger army has more men on the field, but less than its full numbers advantage:

Army sizes Men on the field
1:1 50:50
2:1 59:41
3:1 63:37
5:1 69:31
9:1 or more 75:25 (the limit)

A small army always gets at least as many places as the smaller of its own size and the battle size minus its size. So an army that fits in half the battle size brings everyone (at battle size 1000, 400 men against 5000 start 400 vs 600), and the guarantee fades for slightly larger armies instead of cutting off.

The share is recalculated from the men each side has left (on the field and in reserve) at every reinforcement wave, so it shifts as the armies take losses. A side that can't fill its share leaves the room to the other side.

Synced waves. When one side's reinforcement wave arrives, the other side's wave is brought in too. Each wave brings its side back up to its field share, as long as it has men left in reserve.

Rallying. AI infantry whose men are scattered far ahead of or behind the formation stops to regroup before pressing on, unless the enemy is close. After a reinforcement wave, the formation gathers at a point a little in front of where the wave arrived, so the newcomers join up before advancing. A rally lasts at most 45 seconds, and the formation can't rally again for 30 seconds after that.

Ending the battle. When you win a field battle in the campaign, the defeated side's remaining troops are counted as wounded, so the battle does not continue into a second round.

How individual soldiers fight

Skill decides. An AI soldier's blocking, parrying, feinting and attack decisions depend on his melee skill. His aim depends on his ranged skill: a skilled archer shoots more accurately, steadies his aim faster and shoots more often. Accuracy suffers when shooting on the move. The Combat AI difficulty option in the game settings scales the AI's skill. The setting Vanilla AI Block/Parry/Attack keeps the base game's values for melee decisions instead.

Shields against missiles. Melee troops raise their shields against incoming missiles. Archers and other ranged troops do not.

Stamina. With the posture and stamina systems on, a tired soldier moves, swings, reloads and reacts more slowly, and aims worse. See Posture & Stamina.

Weapon speed. The speed bonus from weapon skill stops growing at 150 skill. Fighting on horseback does not slow weapons down.

Weather. Rain and other weather no longer reduce bow and crossbow power or missile range.

Spear or sidearm. AI troops who carry both a polearm and a sidearm keep the polearm until an enemy stays within about 2.5 m for a couple of seconds, then switch to the sidearm. They go back to the polearm once there has been no enemy close for a few seconds. They no longer switch back and forth constantly.

Two-handed specialists. Some troops always fight with their two-handed weapon: Imperial cataphracts and heavy horsemen, Khuzait lancers, druzhinniks and Aserai faris keep the shield slung on their back and only draw shield and sidearm at close quarters. Battanian falxmen, Sturgian shock troops and berserkers and several Nord troops never use a shield, and only throw their throwing weapons at targets between 6 and 25 m away. This only affects the AI; you can still use every grip of the same weapons.

Re-arming. An AI soldier who has lost his melee weapon looks for one on the ground within 15 m.

Banner bearers stop swinging at enemies who are out of reach.

Kicks and bashes

With AI Kick and Bash on (the default), AI soldiers kick, shield bash and weapon bash. The base game's AI never kicks.

When the AI tries. Both fighters must be on foot, and the enemy close (about 1.4 m) and in front. The AI looks for an opening: an enemy who is blocking, holding his weapon ready, turning his back, or whose posture is broken or nearly broken (25% or less). Without an opening, only a more skilled fighter will try. Attempts are more likely from behind and against an enemy whose posture is broken or nearly broken, and there is a pause of several seconds between attempts. A man who is already down is left alone. Against an enemy holding a shield toward him, the AI kicks rather than bashes. Any AI soldier can kick or bash, whatever weapon he holds, but never while bracing a polearm.

Skill. Kicks and bashes use a mix of Athletics and the skill of the weapon in hand. The more skilled fighter tries more often and knocks down more often.

Cost. Every kick or bash, the player's included, costs the attacker posture and stamina (if those systems are on), hit or miss. Higher skill makes it slightly cheaper.

Damage (needs RBM Combat). Kicks and bashes deal real blunt damage based on the weight of the boot, shield or weapon, and heavier boots kick harder. A bash blocked by a shield, or a kick into a raised shield, does no real damage. Kicks and bashes do not wear down armor. Because the victim also loses posture and stamina in proportion to the damage, a kick or bash can break his posture.

Knockdown. A kick or bash that lands knocks the victim down for certain if he is still reeling from a posture break or posture tiredness, or if it breaks his posture. Otherwise there is a chance to knock him down that is higher for a kick, from behind, against a man kicked or bashed within the last second or so, and against a tired man, and lower against a man in heavy armor. A man already down is not knocked down again. These rules only cover an enemy's kick or bash, and they also apply to your own kicks and bashes.

Sieges

  • Attackers on the walls spread out and fire at will. Instead of walking along the wall to the gate, they charge a nearby enemy formation, or one that is shooting them up.
  • Shields. Attackers with a shield and a one-handed weapon keep their shield raised while not attacking.
  • Archers on the walls spread out along a wider front and keep shooting at men below the wall. They only draw a sidearm when an enemy is within about 3 m.
  • Archer positions. For many castles and towns, RBM ships its own set of defender archer positions on the walls, replacing the base game's.
  • Defender morale. Defenders do not lose morale when their comrades fall. With the setting Keep Battle (Last Stand) on, a heavily outnumbered garrison that is down to its last men loses heart quickly, so the survivors can fall back to the keep.
  • Siege weapons. Defenders keep manning their siege engines, and no side stops using its ranged siege weapons.

Your own orders

  • Charge. A plain Charge order sends a formation at the nearest sizeable enemy formation instead of at whoever is closest. If the formation's target disappears, it charges the next nearest one.
  • Advance stops infantry a few meters short of the enemy. Archers ordered to advance stop at a sensible shooting distance instead of at the edge of their maximum range.
  • Mounted archers under your Move or Stop order hold their places instead of breaking out at nearby enemies.
  • RBM's automatic arrangements and its charge, regroup and advance adjustments do not override formations you control.
  • There is no separate General's bodyguard formation; the general fights in the army's normal formations.

On screen

  • Formation markers use icons for infantry, archers, cavalry, horse archers and javelin cavalry, and follow the formation smoothly instead of jumping from soldier to soldier.
  • Slow motion (setting Slow Motion in Combat). When you kill or knock out an enemy, or break his posture, the game slows to a quarter speed for three quarters of a second. Needs RBM AI on.
  • Fast forward. Press Ctrl+V in battle to toggle fast-forward.
  • Frontline overlay. With the frontline system on, Ctrl+Shift+F toggles a debug overlay that shows the soldiers' frontline decisions.
  • Battle stats. With Developer Mode on, a text overlay in the bottom-left corner shows damage by troop type, kick and bash attempts, melee hits, and a counter for each kind of block and parry (chamber, weapon block or parry, shield block or parry, wrong-side shield). It is meant for testing, not normal play.

AI log

With AI Behavior Logging on, RBM writes each battle's tactics, formation behaviors and orders, second by second, to Documents\Mount and Blade II Bannerlord\Configs\RBM\logs\ai\. Only the newest 10 logs are kept.