Idea: new armor system

I think our current system is quite non-obvious, with lots of side effects (like PTRD being more effective vs heavy armor). So I’m proposing a new one, entirely lua-based. All the armor stats will be in the customParams, no script recompile will be necessary if some of them change.

Each unit’s armor will be represented by 6 pairs of numbers. Each pair specifies min and max armor thickness for the given side. So we’ll have front, rear, left, right (maybe just side instead of those two, not sure any units have asymmetric side armor), top and bottom (to protect against mines) armor. Each weapon will have a penetration value, separate and independent from damage.
When a projectile hits the unit, the following happens.

  1. Hit direction is determined from relative positions of attacker and target units (lua callin receives ids of both). This is then used to figure which of the armor values to use.
  2. A random value between min and max armor for the given direction is tested against projectile penetration modified by distance traveled.
  3. If penetration>=armor, normal weapon damage is dealt.
  4. If penetration<armor, two effects take place.
    First, the target receives some ‘paralization’ damage, based on how close the armor was to being penetrated (so if penetration is just a litlle bit lower that armor, unit takes say 10% of full HP in paralization, and if penetration is close to 0, then no damage, scaled linearly). This is to represent crew being shocked by the impact. That way even heavy tanks can be disabled by repeated hits from medium-caliber weapons.
    Second, if the shell was HE type, it explodes on the armor. This causes some damage to the unit (from external bits like antennas and weapon sights being blown off and tracks/wheels/etc being damaged). How exactly this damage should be determined I don’t yet know, it shouldn’t be the weapon damage for sure. Maybe just apply simple damage reduction based on armor thickness (damage - armorsome_coeff or damage/(armorsome_coeff)).
    Lua side of this looks simple enough, and armor/penetration stats can be quite easily found for most of WW2 stuff.

From here:

Looks just like the thing we’ll need. If next engine release also fixes unit-circling-around-point problem, then I’ll be happy :slight_smile:

That’s great news, it will make things quite a bit simpler. Currently I have it rigged so that the weapon does 1 damage and the real damage is applied through Lua.