There might also be a chance to be hit smaller then 1 (100%) for smaller or more agile units. That would represent luck and avoidance though avoiding an arrow for example is quite impossible when you are in a battle facing an enemy in melee combat.
A chance to block may be added depending on the equipment. Peasants and archers have no close combat weapon or shield so they have 0 chance to block anything (though they may have a little higher chance to avoid attacks like 10%). Units carrying close combat weapons like swords, clubs/maces or axes may have a chance to block melee attacks of 10%. Swords are indeed designed to block melee attacks and so may have even 20%. Shields are designed to block both, melee and ranged attacks so they could give lets say 30% chance to block melee and 20% chance to block non-siege ranged attack. Units wearing spears or polearms could deal higher charge damage instead. Javelins get the bonus for the shield if present and can use their weapon for both, ranged and melee attacks, but don't get a block chance for their weapon.
The reason why I like the 'normal' system is that something like blocking/evading can be added by simple mechanisms that are understandable for the player and can be displayed to him properly and consistent.
A short list of example equipment with block modifier for the more detailed part below:
- Helm, chest/leg/other Armor: Adds armor as it is now, no block (perhaps lower chance of evade but evade is not that important IMO as stated above)
- Sword/saber: ~20% chance to block melee attacks (melee block 2) and of cause enables the unit to deal damage (as it is now)
- Club/Mace/Axe: ~10% chance to block melee attacks (melee block 1) and of cause enables the unit to deal damage (as it is now, perhaps a little higher to balance the block)
- Javelin: No block, grants an ranged and melee attack (as it is now), can hold a shield as well.
- Spears or other two-handed weapons: No block, enables the unit to attack at melee range and deals high (charge) damage. Some of them may be able to attack above 1 tile. Since such a unit can't hold a shield it has no block at all. Those units should get attack bonus versus cavalry IMO.
- Shield: ~30% chance to block melee (melee block 3) and ~20% chance to block ranged (ranged block 2) but adds no armor! Block values may differ type dependent.
- Bow/arrow: No block, for balance reason (and realism) they may get higher range.
Getting more detailed: In the code it may be useful to work with exponential functions to make sure no unit has 0 chance to hit a specific other unit. The chance to hit can be then calculated by 0.9^n where n is the sum of all 'melee/ranged block' values of the targeted units equipment. If a unit for example has a sword and a shield (somehow the maximum block to get) it has a chance to get hit in melee combat of 0.9^5 = 0.59049 and in ranged 0.9^2 = 0.81. The rounded values than can be shown in the gui:
41% chance to block melee (1 - 0.9^5 = 0.40951)
19% chance to block ranged (1 - 0.9^2 = 0.19)
This hast the additional advantage that moders may add raising block values and the chance to get hit will never reach 0.
With an attack/defense value system the chance to hit/get hit/block depends on the pair of units fighting and so cannot be displayed directly. Instead some values are displayed that doesn't tell the player much about the strength of the unit when he doesn't know the formula (and even then he will rather know due to gathered experience then actual calculation).
To randomize attack damage units could have a minimum and a maximum damage and the actual damage is randomly chosen out of this range. Indeed only a maximum damage would do (and actual damage = random number between 0 and the maximum damage).
As it is now is the armor just the value subtracted by the incoming attacks damage? Because that has to be kept in mind when randomizing damage. IMO an attacked unit should at least loose 1 health/structure point if hit.
Edited by FeXoR, 24 March 2012 - 09:05 AM.