chance to kill = 0.019 x 1.2 ^ (melee - defense)

(melee - defense) is limited to the range -20 to +20.

anti-cav bonus for spearman is +1 melee and +4 defense
anti-cav bonus for pikeman is +2 melee and +6 defense
anti-cav bonus for polearm is +3 melee and +1 defense
armor piercing bonus to melee is (target armor - 2)/2

There are also shield, flanking, height, fatigue, formation, routing, charging, pushback, supporting ranks, camel vs horse and sword vs spear combat bonuses. Each man can strike once at an opponent in a combat animation cycle, but may have to defend more than once in that same cycle.