Armor

#1
How does armor works? I've noticed it's not a constant value that absorbs a set amount of damage since it seems to reduce different amounts of damage each time. The diving suit will rarely absorb a hit completely and there are times it seems to do very little to stop damage.

Re: Armor

#2
I recoded my server modifications armour as it has a very straightforward - but easilly awkward looking mechanic in default barotrauma.

How it works is per 1 armour, subtract 1 bleeding damage and 1 standard damage from anything that hits a limb.
if multiple limbs are hit at the same time however, the armour is counted from the same parts again (such as waist+torso) which easilly throws damage off for things like diving suits, which if hit in the right spots will instead of counting say 10, count 20 or 30 armour value on hit, which then subtracts 20 to 30 damage and 20 to 30 points of bleed damage looking like you take no damage at all.

Some areas of the diving suit, such as the feet or head regions seem to not even fully cover the limb despite it being 360 degree coverage, I'm not sure if this is the code not fully covering it or if its based off the sprite or what - but its possible to hit a limb that is covered and deal the full damage (Which is also often the case with diving suits)

Armour has a secondary value to define the degrees range armour covers, creatures like the crawler and moloch use this but I've never fully looked into how that works.

It's worth noting any documentation on how armor works is completely wrong, as it states the following:
Spoiler
armorsector: an armored sector between two angles (in degrees). For example,
-90,90 would make the front sector of the limb armored (0.0,0.0 by default)
armor: how effective the armor is: damage is divided by this value if an attack hits the
armored sector (1.0 by default)
Which is not the case.
Host of ARS (A Random Server)

Re: Armor

#3
Ah, it does a lot of sense now. I tried giving diving suits 30 points of armor to see how they fare against the 50 damage of a mantis. It would turn the suit nearly indestructible against a mantis but the mantis would rarely manage to hit and cause damage, like a lot of damage so I had to reduce it back and see if there was a way to do something about it.

Thanks again for the info, nilanthanimosus.

Re: Armor

#4
My way around this (For my server modification) was to change the way armour was handled into a power based formula, where every X points of armour you remove X % damage.

an example of this - every 10 armour remove 10% damage multiplicatively, so 30 armour would 0.9^0.9^0.9 for 72.9% regular damage).

While a molochs 100 armour would instead yield 10 reductions of 10% less damage, for 34.86% of regular damage. I find this method prevents total damage immunity and regardless of unusual behaviour of stacking-armour from one or multiple limbs and worn items on the same limb - Generally keeps damage more in-line.

Right now though armour could potentialy use a touch up as its quite odd, perhaps rewritten or thought out more as a suggestion, on my server it actually uses a series of separate direct-subtraction, simple multiplication and power-multiplication values to achieve a final result based on the server hosts preference, coupled in with commands to calculate the armour with a series of potential damage values and bleed values.
Host of ARS (A Random Server)