Mount & Blade II: Bannerlord Developer Blog - AI Melee Combat Overhaul

Following a bit of a break, we get a fresh developer blog for TaleWorlds Entertainment’s upcoming sandbox RPG Mount & Blade II: Bannerlord. This time around, we’re treated to a detailed look at the recently overhauled melee combat AI that should now pose a much greater challenge. To kick things off, here’s what the new AI looks like in action:

And here are the text bits:

Greetings warriors of Calradia!

After a short hiatus with the developer blogs, we are back today with another one to discuss an overhaul to individual melee combat AI that was recently introduced to the game, including the ongoing multiplayer beta!

So, what exactly are we talking about when we say individual AI? Well, in a previous blog, we discussed the three different levels of combat AI that work alongside each other during battles, which we refer to as individual, formation and tactics. For those that missed that blog, you can check it out in its entirety here. But as a quick recap, we can break it down to say that:
  • Tactics: Responsible for providing a battle plan for the entire army.
  • Formation: Decides how the formation should try to carry out the battle plan as best as it can while prioritising and reacting to unfolding events.
  • Individual: Controls the actions of each unit on the battlefield (independently of each other), such as attacking and blocking.
The recent AI melee combat overhaul that we will be taking a look at in this blog focussed specifically on the individual unit AI, i.e. the AI that controls the combat actions of bots on the battlefield. So, let’s jump into it, shall we?!

The individual AI in Bannerlord comes with its own combat/melee levels. This approach allows us to have a diverse range of fighters on the field of battle, with well-trained knights outperforming unskilled peasants, not just because of their equipment, but because of their proficiency in hand-to-hand combat.

However, it was apparent through our playtests that our previous individual melee AI was a little tame, appearing almost buggy and inactive at times with its actions by taking too long to make and act upon decisions, regardless of their combat level. It was clear that we needed to improve upon this to ensure that each encounter on the battlefield engages players in a way that feels more natural and challenging.

So, after many PvE duels to highlight the flaws with the old system, our AI team got to work on improving the individual AI! But, before we move along to discuss the changes that were made, let’s take a quick look at some of the different melee levels of the previous individual AI.

[...]

Clearly the AI was a bit lacking, even at the highest level. The decision making wasn’t as advanced as it needed to be, with the AI deciding to attack when it should be on the defensive, or falling for/failing to adjust to very simple attack feints.

In order to improve the performance of bots in combat, it was clear that the individual AI not only needed to be able to process and react to the constant stream of data being sent its way but should also consider additional factors when making a decision about what action to take.

So, to start, individual AI now considers its opponent’s blocking direction when deciding its own attack direction, and this applies at all melee levels. As the melee level begins to increase, the bot starts to have a greater understanding of the combat mechanics of the game and the fight which they are involved in. This includes stun durations, combat timings and enemy equipment, while also giving greater consideration to the orders issued to it by the formation AI that sits above the individual AI.

That all sounds well and good, but what does any of that actually mean? Well, allow us to give an example:

A bot has been told to hold in a shield wall formation, so it should act defensively and try to maintain its position. However, the defensive order given doesn’t affect how proficient the bot is in combat, i.e. it will still attack and defend according to its combat level, therefore, it should still try and exploit any opening that it gets and will attack if an opportunity arises. The formation order simply dictates that bot should play more conservatively/defensively.

The bot is then issued a charge order. The bot now decides to act in a more aggressive manner, pushing towards enemies to engage them rather than holding a position. During the fight, the bot is looking to see if there is a window for an attack, or whether they should defend an incoming attack. While making this decision, it is considering what their opponent is doing. If the enemy is holding an attack in place, the bot will respond with the correct block direction. If the bot successfully blocks the attack, it now knows that it has a window in which to reply with its own attack. However, while readying the attack the bot recognises that their opponent is blocking in the correct direction, and therefore decides to switch its own attack direction to avoid the attack being blocked (unless the enemy is holding a shield, in which case the bot will realise that switching their attack direction isn’t too important as the shield can block blows from different directions). Depending on the combat level of the AI, it will make and carry out these decisions in a quicker amount of time, albeit still with some slight variation to make it feel less robotic.

These changes definitely lead to more intense bot fights the higher the melee level gets, providing a much greater challenge experienced players. However, if all this sounds a bit scary to you, don’t worry too much as you will be able to change the combat skill of bots in the game options.

Rather than trying to explain it further, maybe it’s better if we just show you!