RimWorld

RimWorld

Hardened Armor
SirProok  [developer] 2 Jul @ 5:42pm
What does this mod do and how does it do it?
The Process

Two variables:
Armor Hardening - 1.3
Weapon Hardening - 1.1

First, when a hit is registered, the attack is calculated as normal and the armor value is recreated.

This allows the mod to be compatible with new damage types, new variables from other mods, and with anything new that is cooked up in the base game. Deflection and diminishment is also checked here as it forces a lower damage number using this method. This also allows the mod to work alongside other combat mods that may edit methods as their methods are estimated via the calculated armor value.

My understanding is that this mod must be loaded after those mods to behave as intended, but testing has been very limited. (I threw it in my modded game successfully).

Second, it takes the weapon's AP * weapon hardening, the reverse engineered armor protecting the hit part as well as any natural armor (genes, implants, ect) * armor hardening to come up with new armor and new AP.

Third, it runs damage calculations with the new values. Using effectiveness to lower the damage to a minimum of 10% of the original (potentially diminished) damage.


The result against armored targets: Sharp attacks are far less likely to pierce armor for high damage, blunt attacks become better options against high sharp armor targets, heat damage is greatly reduced by proper armor (due to its 0 AP).

The result against unarmored targets: Sharp attacks go through clothing easier, blunt functions near identical to base game, and heat does base game damage to exposed body parts.

In both cases though, once lit on fire, damage treats armor as 0.

The Processing

This happens in one tick corresponding to damage. Nothing is stored in memory. No checks are run outside of damage. The result is that there should be minimal to no impact on game performance.

Compatibillity

As detailed above, I strove to avoid hard coding anything I felt I didn't need to so that this could work with as many other mods as possible. This has caused it to have a bit of variance versus directly pulling exact values, but in my testing I didn't notice anything immersion breaking.

The variables are tied to sliders, so if you play mods that are wildly overpowered, I encourage you to tweak a bit until something feels right. Generally speaking, I think the 1.3 AH and 1.1 WH works well for most circumstances.

If playing with Greivous Wounds, the interactions result in more blunt force trauma and less piercing damage. The extra armor will also resist injuries spreading as far due to each (external) overflow checking armor.

1.5
Version 1.5 works but the logging was left in a beta format when 1.6 became available to me. Logs there are misleading.