-
Notifications
You must be signed in to change notification settings - Fork 20
Penetration System
The penetration system is a way to make armour toughness and bullet power more realistic, to make low power bullets relatively useless on vehicles and such. To use this system, you must enable it in flansmod.cfg
using by changing the relevant line to B:UseNewPenetrationSystem=true
.
Guide values for penetration:
Armour | Power to fully penetrate | Power to do full damage |
---|---|---|
Naked player head or body | 1 | 0.7 |
Riot shield | 4 | ~ |
Jeep | 5 | 3.5 |
Light Tank | 10 | 7 |
Medium Tank | 20 | 14 |
When a bullet is fired, it is given a penetration value equal to the value set with the Penetration
config option in the BulletType file. This by default will be 1
and 0.7
if Penetrates
is set to False
.
Each thing the bullet passes through will take away its penetration resistance value from the bullets penetration value. When the bullet has 0 or less penetration, it will stop.
The mod differentiates between four cases where penetration loss can affect damage:
- When the bullet penetrates a player (PlayerPenetrationDamageEffect)
- When the bullet penetrates an entity (EntityPenetrationDamageEffect)
- When the bullet penetrates a block (BlockPenetrationDamageEffect)
- When the bullet loses penetration due to penetration decay (PenetrationDecayDamageEffect)
All modifiers work the same way in regards to their respective fields. The following example therefore applies to all damage modifiers equally. In this example, the 'BlockPenetrationDamageEffect' is used.
A bullet (penetration = 2) hits a penetrable block (hardness = 1) and its penetration is reduced by the hardness value of 1. That is a reduction of 50%.
- Scenario 1: BlockPenetrationDamageEffect = 0: Damage will not be reduced
- Scenario 2: BlockPenetrationDamageEffect = 1: Damage will be reduced by those 50% that the bullet lost in penetration
- Scenario 3: BlockPenetrationDamageEffect = 0.3: Those 50% penetration loss are now multiplied by 0.3 which results in a total damage loss of 15%
Damage drop-off after multiple penetrations:
In this example a bullet (penetration = 2) first hits a glass block (hardness = 0.5) and then a player (hardness = 1). This is a penetration reduction of 75%. In this example: BlockPenetrationDamageEffect = 1 and PlayerPenetrationDamageEffect = 0.4
- Reduction from glass = HARDNESS/TOTAL_PENETRAION * BlockPenetrationDamageEffect = 0.5/2 * 1 = 25%
- Reduction from player = PLAYER_HARDNESS/TOTAL_PENETRAION * PlayerPenetrationDamageEffect = 1/2 * 0.4 = 20%
The damage of the bullet will therefore be reduced by 45% in this example
Vehicle hitboxes by default have a penetration resistance of 5, you can change this with the SetupPart
config - the format is SetupPart partName health(int) x y z height width depth (penetration)
.
The head, body and legs+feet are handled separately. Their penetration resistance values add up to one in their group by default.
The default values when armour is not worn is as follows:
Head (1) = Helmet (1)
Body (1) = Chest (0.5) + Legs (0.35) + Feet (0.15)
Head (1) = Helmet (1)
Body (1) = Chest (1)
Legs+Feet (1) = Legs(0.65) + Boots(0.35)
Vanilla armour will not modify these values, this is an area for future improvement.
For each piece of Flansmod armour you can set the penetration resistance with the PenetrationResistance
keyword. This does not add to the naked/default values, it will set the value instead.
When a bullet intersects with a player or armour, if the bullet has a penetration value of more than 70% of the penetration resistance of the armour, it will do full damage. If less than this, the following damage will be done:
(bullet/(armour*0.7))^(5/2) * bulletDamage
This means, if the bullet does not have the power to penetrate 70% of the way, it will do exponentially less damage, the further it is away from 70%.
The graph shows (bullet/armour)
against the damage modifier.
Remember! The armour's defence will apply afterwards, as normal. To decrease the damage reduction from defence for bullets and keep melee behaviour the same, you can set in the armour config:
BulletDefence 0.1
OtherDefence 0.5
which gives much higher defence for non-bullet inflicted damage.
This replaces:
Defence 0.5