Mount & Blade II: Bannerlord

File information

Last updated

Original upload

Created by

ukie and MajikalExplosions

Uploaded by

GreybackFenrir

Virus scan

Safe to use

About this mod

The mod aims to improve battle simulations (both players Send troops and AI battles between each other) by removing most of the RNG from damage calculation, and adding damage and defense modifiers based on Party Leaders Leadership and Tactics skill. The mod also adds extra modifiers by introducing tactics for each formation. (Inspired by CK2)

Permissions and credits
Changelogs
We're back! Updated by MajikalExplosions, with permission.
I no longer have time to maintain this mod; if anyone wants to pick it up, please feel free to do so.
For those of you who want something similar, maybe consider this mod.
The description is still being updated, so it may not reflect the most recent version of the mod. There's a stickied post (by me) that you should probably read, but that's up to you, I guess.

About
The mod adds each of the parties troops into it's own list of soldiers, while splitting them up by formations. A series of modifiers decide how much the attackers damage and defenders defense are changed. 
What happens in vanilla, is a random troop from each party is selected, and one attacks, while other defends. The calculation is very simplified, and damage is mostly decided by RNG. This mod aims to remove the randomness.

Vanilla Formula
Spoiler:  
Show

attackerPower and defenderPower - values are calculated using troop tier, and gives 50% bonus to Heroes, or 20% bonus if the troop is mounted.

strikerAdvantage - value is based on the battle type, settlement (if siege, and uses the wall level), and the party leader tactics skill (that's calculated by DefaultSkillEffects.TacticsAdvantage.PrimaryBonus * (tactics skill / 100) )

damage = 50 * (attackerPower / defenderPower) * strikerAdvantage


Mod Formula (Pre-1.3.0)
Spoiler:  
Show


strikerAdvantage - (numbers are unchanged from vanilla) value is based on the battle type, settlement (if siege, and uses the wall level), and the party leader tactics skill (that's calculated by DefaultSkillEffects.TacticsAdvantage.PrimaryBonus * (tactics skill / 100) )

troopNumbersAdvantage - calculated by dividing attacker troop count by defender troop count. Numbers are capped by NumbersAdvantageModifier HighCap and LowCap

attackerPower - value is calculated using troop tier, and gives 50% bonus to Heroes, or 20% bonus if the troop is mounted. Extra 5% per troop tier is added.

attackerTacticModifier - AttackBonus from current tactics selected by the troops formation

attackerSiegeModifier - AttackBonus added from SiegeDefendersModifiers  if the troop is a siege defender

attackerExtraPowerFromLeaderPerks - Extra power from Tactics perks such as Tactical Superiority, or Ambush Specialist.

attackerLeaderAttackModifier - AttackBonuses from Leader Leadership and Tactics skill levels.  Formula is 1 +  (LeadershipSkillLevel * (AttackBonus - 1) / 100+ (TacticsSkillLevel * (AttackBonus - 1) / 100)

makesSenseToAttackUnitModifier - If it doesn't make sense to attack troop, damage is reduced by 90% (modifier set to 0.1)

finalAttackerPower = attackerPower * attackerTacticModifier * attackerSiegeModifier * attackerExtraPowerFromLeaderPerks * attackerLeaderAttackModifier * makesSenseToAttackUnitModifier
defenderPower - value is calculated using troop tier, and gives 50% bonus to Heroes, or 20% bonus if the troop is mounted. Extra 5% per troop tier is added.

defenderTacticModifier - DefenseBonus from current tactics selected by the troops formation

defenderSiegeModifier - DefenseBonus added from SiegeDefendersModifiers  if the troop is a siege defender

defenderLeaderDefenseModifier - DefenseBonuses from Leader Leadership and Tactics skill levels. Formula is 1 +  (LeadershipSkillLevel * (DefenseBonus - 1) / 100) + (TacticsSkillLevel * (DefenseBonus - 1) / 100.

finalDefenderPower = defenderPower * defenderTacticModifier * defenderSiegeModifier * defenderLeaderDefenseModifier
damage = 50 * (finalAttackerPower / finalDefenderPower) * strikerAdvantage * troopNumbersAdvantage


Compatibility
The mod should be compatible with most other mods out there. The Harmony patches are only used to run some code on the side and don't change any of the vanilla code, except replacing a single method that actually calculates simulated damage. The only mods that might screw with this one are ones that patch 'ApplySimulationDamageToSelectedTroop'.
Exception: Troop overhauls are the only category that may break this mod - use them at your own risk. If there is one that is incompatible, feel free to add it to the bugs tab, along with details (name of troop overhaul mod, details about the error and what you were doing, and so on). I will try, but I may or may not be able to fix it.

Modifiers
Please note that most of these numbers are arbitrary and are subject to change. In future versions, the values will be made configurable, and more tactics will be added. 

Spoiler:  
Show

Tactics
Tactics are randomly selected by party leader (if one exists) at the start of each Simulation Round. RNG decides how many formations will change the tactic, and then random tactic will be selected.
Check config.json for tactics breakdown. You may edit, and/or add new tactics, if you want.

Party Leader
Some leader skill also affect the simulation
  • Leadership: 5%  attack and defense per 100 skill points (For example: 50 skill points will give 2.5%)
  • Tactics: 5%  attack and defense per 100 skill points (For example: 50 skill points will give 2.5%)

Pre-1.3.0 Perks
Most of the simulation perks from Tactics skill tree are implemented (except the "Ambush Specialist" perk, which will be implemented as soon as I figure out how to get the Terrain Type of the battle):
  • Tactical Superiority: +5% damage to all troops
  • Hammer And Anvil: cavalry units get +50% damage against archers
  • Phalanx: infantry units get +50% damage against cavalry and (currently) horse archers
  • Ambush Specialist: ranged troops get +60% damage to all enemies if the battle is in forest terrain 

1.3.0+ Perks
All relevant Tactics and Scouting perks have been implemented. This mod also fixes bugs from the base game's implementations of these perks.

Troop Tiers
Each troop tier adds 5% to base power of the troop. It should work fine with other mods adding higher tier troops than vanilla (tier 7+) as long as CharacterObject.Tier is set correctly.

Other
Modifiers that reduce attackers damage by 90% (meaning that it doesn't make any sense that the selected attacker could get to the defender and attack them on the battlefield):
  • Infantry troop trying to attack an Archer that is in Skirmish Tactic, while the enemy still has infantry that archers can cower behind
  • More might be added later...

Troop number advantage is calculated, which means that outnumbered troops deal less damage (capped at -60%), while troops that outnumber their enemy deal extra damage (capped at +50%).


Source
Check out the source code (pre-1.3.0) here: bannerlord-advanced-autoresolve
The source code for 1.3.0+ can be found here.

Notes
The mod doesn't aim to buff auto resolve to make it easier for the player. Instead, the mod tries to add more complexity to the simulation, so that the results make more sense.

To install, drop the files into your Modules/ folder, and don't forget to Unblock the .dll files inside AdvancedAutoResolve/bin/Win64_Shipping_Client

Config with some options available in AdvancedAutoResolve/bin/Win64_Shipping_Client/config.json