To understand why vanilla auto battles are flawed, we must first understand how is it calculated. Here is a simple breakdown of how "Send Troops" (simulation) in vanilla is:
- When two opposite parties meet on the world map to fight, it becomes an Event.
- For every several in-game minutes, the two sides fight a Session. You would notice AI vs AI battles lose soldiers every now and then (half an in-game hour), that is a Session.
- A Session is composed of multiple Rounds.
- In every Round, one random troop is selected on one side to Hit another randomly selected on the other side. The order of attacking is also random.
- The number of troops detemines the number of Rounds each side in a Session has. A side with N soldiers do N^0.6 attacking rounds.
- When oen troop is Hit, the Damage is a random number between 0 and 50 * Striker Power / Striked Power.
- And the Damage is compared to another random number between 0 and the striked max hitpoints (usually 100). If the Damage is higher, the striked instantly dies, and if it's lower, nothing happens.
- Then how is Power calculated? It's 0.02 * (2 + Tier) * (10 + Tier), and if the soldier is mounted, multiply the result by 1.2. The mounted bonus is applied even in sieges. That means, a Battania Horseman(2.52) is stronger than a Battania Fian (2.1). You know how they perform in field battles.
We can see there are at least three major flaws:
- It is a "duel" model, every troop fight on it's own, without the party fighting as a whole.
- The battle does not preserve states, mostly the remaining hitpoints of each troop, and how long the battle has been (how many arrow left for archers). Every troop is ether dead or at max hp. Every Session would be a fresh restart.
- The formula to calculate Power is too over-simplified.
And some minor but frustrating problems:
- The attacking order is totally random. If one side attacks first and kills several opposite soldiers, the returning fire will be weaker.
- Every attack has a chance to instantly kill anyone. Even you have 200 Tier 6 knights against 1 looter, if the looter gets the chance to attack first, he has 10% chance to instantly kill one knight.
Understanding the number of Rounds:
Let's take an example, a 1000 vs 100 battle, and both sides have the same type of soldier. You thought the size with 1000 soldier should crush the 100 side, but it is not that simple:
- The 1000 side do 1000^0.6=63 attacks every Session.
- The 1000 side do 100^0.6=16 attacks every Session.
So the attacking power of the 1000 side is not 10 times the 100 side, but only 4 times, or more precisely, 10^0.6=3.98 times. That means, even when one side outnumber the other side by 10 times, it is much less than 10 times stronger. The
^0.6 is the penalty to the side with more soldiers, so that it will not just steamroll the opposite.
With the ^0.6, the result seems still acceptable, as the side is still 4 times more powerful. But this is not the case if player is leading that side: if the player is involved in such battle, every side will do (1000+100)^0.6*3=200 Rounds per Session, they will have
EXACTLY SAME attacking power, or say, the opposite side becomes 4 times more powerful!
An example at extreme will be the player lead 200 knights against a lone looter. The player party can do 72 attacks, while one looter can also do 72 attacks! The attacking order is totally random, the looter may have the chance to do multiple attacks, and every attack from the looter has a moderate (~10%) chance to instantly kill one knight. Now understand why the player can some time lose tens of soldiers in a 200-men party against a handful of bandits, or hundres when leading an army against a much weaker party.
To overcome the flaw of vanilla simulation model,
SendAllTroop does the following:
- In each Session, both sides attack simutaneouly. No more random attacking order.
- In every Round, everyone attacks once. The total attacking power of one side is the sum of the attacking power of all troops.
- When attacked, the party take the hit as a whole. The incoming attacking is divided to everyone. Each troop takes a portion of the incoming attack, compare to thier respective defense to decide the damage.
- Upon taking damage, a troop loses corresponding hitpoints. If his hitpoints reach zero, he dies.
- After each Round, combat experience is shared among the whole party.
- The player is treated equally as AI and uses the same formula.
Breakdown of DetailedCombatModel:
This new model uses the troop's equipments to determine its strength. And it also tracks the battle progression.
- For every troop, the model searches his equipment sets to find wepaons, shields, armor and horse.
- A weapon's attacking power is determined by it's properties, including damage, speed, length, weight, etc. Weapons of multiple modes (like menavliaton) can have very different attacking power for different modes.
- Bows, crossbows and thrown weapons are limited by ammo. Every attack uses 1 ammo, and if the ammo runs out, the weapon cannot be used again. In siege battles ammo can be replenished.
- A unit can have multiple weapons, and will choose the best weapon for the current situation. For example, archers that run out of ammo will use backup melee weapons.
- The unit's attacking power is the weapon's attacking power multiplied by the unit's proficiency (0.6 + weapon skill level / 300 * 0.4).
- A unit's base defense is determined by the sum of his armor points.
- If he has a shield and not using two-handed weapon, he can use the shield, which slightly increase defense against melee attacks, and significantly against ranged attacks. The bonus depends on the properties of the shield.
- If he has a horse, the health, speed and manueuver of the horse and armor of saddle determineds the horse bonus. The bonus is applied to melee attacks, and doubled if he is using polearms designed for mounted combat. he also receives a bonus to defense, but attacks from polearms can negate the defense bonus.
- Mounted archers have high defense against melee attack. When they run out of ammo and start to melee they lose the defense bonus.
- If one runs on foot or it is a siege battle, the atheletics skill level is used to determine the attacking and defense bonus.
The new combat model also features a detailed combat progression:
- Every battle has a "distance", similar to the starting distant for field battles. Currently, the distance is 1 if the total number of combatant is less than 50, 2 if 50-100, 3 if more than 100, or 4 if it is a siege assult.
- Every weapon has it's range. Bows and crossbows have a range of 3, thrown weapons have 1, and melee weapons have 0. If the range is less than the distance, the weapon cannot be used until more time is passed. For every Session, the distance is closed by 1. The defending side in sieges receive +1 bonus range to ranged weapons because they have height advantage.
- In seiges, there's a penalty to the attacking power of the attacking side. Ranged attacks do reduced damage while melee attacks do very little damage. The defending side do increased ranged damage. The penalty and bonus depend on level of fortification (wall level), and siege towers reduces the penalty for melee.
- After some time, the main gate is breached, and the penalty is decreased. The time to breach the main gate depends on the number of siege engines built, and the battering ram is specialized in taking down the gate.
- Polearms behave badly in sieges because they easily get stuck.
Advanced Configuration items:
- Strength of Number: Controls the penalty applied to the side with more members. This is the same penalty described in "Understanding Number of Rounds". A higher value makes the side with more members stronger. Valid values are between 0.0 -1.0. In vanilla the value is 0.6. Earlier version of SendAllTroops has a value of 1.0. If you stick with the value of 0.6, set RandomDamage and RandomDeath to true, and set DetailedCombatModel to false, you will get very similar results to AI battles in unmoded base game.
- Siege Strength of Number: Controls the penalty applied to the side with more members in sieges. A lower value makes sieges more difficult.