Combat

Combat is the art of using units to kill or rout enemy units during battle. In the context of this article, it's determining accuracy and damage of units in combat - just what does Melee Attack, Defense etc. do?

''Much of this article is possible thanks to ferriswheel9ndam9 on Reddit.

Accuracy
Accuracy or chance to hit is determined by the following calculation (attacker's attack skill vs. target's melee defense):
 * Chance to hit = 35% + (Icon stat attack.png Melee attack - Icon stat defence.png Melee defense)

Each unit has a minimum 8% chance to hit after applying modifiers and a maximum of 90% (or 10% chance to miss). Stats are modified by fatigue levels before the calculation.


 * In short: A higher attack skill makes units more likely to hit, while a higher defense makes them more difficult for the enemy to hit. However, since pure random number generation is used, it's entirely possible to have a string of hits or misses. Higher skills levels merely reduce the chance of that occurring.

Damage
So, the units hit each other and deal damage. What happens? They deal damage to one another.


 * The base damage value is fixed according to the weapon equipped:
 * Total damage = 1 + Icon stat damage.png Damage + Modifier_icon_armour_piercing.png Armour-piercing damage


 * Units charging the enemy will also deal impact damage, calculated according to their speed and mass. The resulting damage is 70% armor piercing, though it's largely academic as impact damage ignores any armor.
 * Armour reduces incoming non-impact damage. It is a randomized percentage-based reduction, where the minimum value of damage reduction is determined by the armour_roll_lower_cap value (0.5 by default):
 * Max damage reduction = Icon stat damage.png Damage * (1 - Icon stat armour.png Armour * random(0.5, 1)%)


 * Shields provide a flat percentage chance to deflect missiles, but do not affect armor values.


 * A word of note: Attack intervals matter. The 3.8  intervals common to most units are the baseline. Units with larger intervals, such as Great Weapons variants of units and cavalry formations, will have reduced damage outputs despite having superior stats. To determine the effective damage, divide their interval by 3.8. (this is incorrect, the attack intervals are a way of 'balancing' different animations. Those units with higher interval, are actually faster/better at attacking, so by increase the time, brings it into line with other animations. Those with 3.8 don't actually attack at 3.8, as the animation MAX speed is around the 6 second mark, so setting faster does nothing.

Takeaway

 * Melee attack and defense are responsible for accuracy and increasing them according to the units' purpose (more defense for tanks, meat shields, and tar pits, more attack for those who are supposed to take down the enemy) is generally a good idea.
 * Armour is essentially capped at 200, providing the maximum (near 100%) damage reduction against regular attacks. As such, AP is strictly necessary.