[1.58] Found some damage calculation bugs |
I've found some bugs occuring with damage resistance and the penetration percent in DamageTypes.txt while doing some tests for my mod. Does anybody know more about them (or similar bugs)?
-----------------------------
1. Bug (or probably feature):
-----------------------------
The Damage from "Armor Type X Penetration Percent" does not go to structure or the next armor level. Instead it counts for the next armor plate of the same type.
Example:
Number of Armor Types := 1
Armor Type 1 Name := Normal Armor
Armor Type 1 Penetration Percent := 20
Armor Type 1 Damage Percent := 80
Now we have 2 Ships. Both will get 100 Dmg of the type above. First ship has one armor plate. Second has two.
First ship will get 80 Dmg to armor and 20 to internals. => Total 100 Dmg
Second ship will get 80 Dmg to armor 1 and 18 Dmg to armor 2 (98 Dmg total to armor) and 2 Dmg to internals => Total 100 Dmg
Perhaps thats a feature...
but now comes the really strange stuff:
-------
2. Bug:
-------
Same example as above. But now the armor provides 10 Points damage resistance.
Ship 1 will get 57 Dmg to armor (thats nearly (100*0.8 - 10)*0.8 => the Penetration Percent is added twice!) and 18 Dmg to internals (thats (100-10)*0.2 and seems correct). => total 75 Dmg
Ship 2 will get about 57 Dmg to armor 1 and about 5 Dmg to armor 2 (total of 62 Dmg to armor) and 1 Dmg to internals. => total 58 Dmg
That's maybe te following callculation:
Armor 1: (100*0.8 - 10)*0.8 = 56
Armor 2: ((100-10)*0.2 - 10) * 0.8 = 6.4
=> 62 Dmg to armor
Internals: ((100-10)*0.2 - 10) * 0.2 = 1.6
And thats defenitly a bug. Either in the mod documentation or, and for me more obvious, in the code calculating the damage amounts.



