RimWorld

RimWorld

ExoticButts Sep 25, 2018 @ 12:06pm
How *exactly* does the "armour piercing" value work on projectiles?
Google and Steam searchbars have provided nothing. The wiki says that the armour ratings are reduced by the armour piercing value, but that makes no sense, considering e.g. shotguns have AP of 0.14.

Considering that equates to reducing the AP of a shotgun, I'm getting very mixed signals on how this system is meant to operate. There's no other projectiles in vanilla that touch the value for armour piercing that I can find (only Bombs and SuperBombs, according to the code) and Tynan hasn't put an explanation anywhere I can find.

Other mods I've looked into don't touch the values either, which I feel is an underutilisation of the mechanic that Tynan felt the need to incorporate. As I can't really find any info on it to properly explain how it works, I can't really fix my weapon mod up for B19 (now that I have time to).

Does anybody happen to know exactly how this armour piercing system works, and if so, can you please let me know? I'd rather actually use the system as opposed to just setting all my guns to pre-B19 values like a few other mods-and Tynan-have :/

To clarify what I mean; Tynan says weapons have a default 1.5% of piercing per point of damage they can inflict, but AP values are simply decimals, with no explanation of whether the above shotgun example means it increases the AR of armour by 14%, by 86%, or if it reduces the 1.5% piercing down to 14% of that. It's quite confusing to me, especially with the info vacuum I'm kinda stuck in.
< >
Showing 1-8 of 8 comments
Monoxide Sep 25, 2018 @ 12:20pm 
Ive done a whole 5 minutes or so of research, but what it 'looks' like is that the armor of the defender is reduced by the percentage of the weapon.

EDIT: I assume the decimals represent the percentage, as they are one and the same. 14% = 0.14 --- 14/100 = 0.14

In your example, the shotgun has 0.14, if the person being shot at is hit and has 100 armor for example, the damage calculation would be based on 86 armor 100 - 14% or 100 * (1 - 0.14).

From the wiki -
The remaining armor rating is then compared against a random number from 0 to 100:
If the random number is under half the armor rating, the damage deflects harmlessly.
If the random number is over half the armor rating, but not higher than the armor rating, the damage is mitigated.
If the random number is greater than the armor rating, the armor has no effect.

The way I interpret this, is that if the RNG comes up less than 43, then the attack is fully deflected. If its 43 to 86, the damage is reduced. If it is 87+ the pawn takes full damage.

Again - this is only quick searching and math - I could be WAY off base, but it seems to make sense to me.
Last edited by Monoxide; Sep 25, 2018 @ 12:22pm
ExoticButts Sep 25, 2018 @ 12:24pm 
Originally posted by Steve from Machete Squad:
Ive done a whole 5 minutes or so of research, but what it 'looks' like is that the armor of the defender is reduced by the percentage of the weapon.

EDIT: I assume the decimals represent the percentage, as they are one and the same. 14% = 0.14 --- 14/100 = 0.14

In your example, the shotgun has 0.14, if the person being shot at is hit and has 100 armor for example, they damage calculation would be based on 86 armor 100 - 14% or 100 * (1 - 0.14).

From the wiki -
The remaining armor rating is then compared against a random number from 0 to 100:
If the random number is under half the armor rating, the damage deflects harmlessly.
If the random number is over half the armor rating, but not higher than the armor rating, the damage is mitigated.
If the random number is greater than the armor rating, the armor has no effect.

The way I interpret this, is that if the RNG comes up less than 43, then the attack is fully deflected. If its 43 to 86, the damage is reduced. If it is 87+ the pawn takes full damage.

Again - this is only quick searching and math - I could be WAY off base, but it seems to make sense to me.
The confusing part is that weapons such as pistols don't have armour piercing in the code. Even sniper rifles and charge lances don't have piercing-but shotguns have that 0.14. I'm not sure, I've been looking into it for nearly two hours now and found nothing that's consistent in regards to armour piercing :/
Monoxide Sep 25, 2018 @ 12:29pm 
It could be that not all weapons have armor piercing implemented yet. I can see a pistol not actually having any AP, being that it is a low damage weapon, but I think a sniper rifle should. A shotgun seems to make sense because it has a buckshot style attack - the AP could represent this since the gun actually shoots only a single attack. If most guns do not have AP, then I would say this is still justified for shotguns. I havent really delved into which items do/do not have penetration.

I know on my current run I am using mostly melee weapons, and all of them have AP as far as I have noticed. Maybe AP is only for melee and select few ranged weapons? I would have to do more checking to speak on that, though.
Last edited by Monoxide; Sep 25, 2018 @ 12:30pm
ExoticButts Sep 25, 2018 @ 12:34pm 
Melee damage seems even stranger, with a bunch of curve-based variables (particularly on blunt weaponry) and the like, as well as a "forced internal" chance on Stab and Poke damage. I have heard that melee is way better in B19, though, as Tynan had to make a change so people stopped avoiding it due to its outright weakness pre-B19.

Following your earlier theory, Flame damage (i.e. ignition-causing burns) has 0 AP value, whereas Bombs have 0.1 and SuperBombs have 1.3, perhaps your theory is closer to the mark than expected, although due to the RNG system now in place I'm not sure if I can confirm it through simple trial/error testing.
ExoticButts Sep 25, 2018 @ 1:07pm 
Had a thought; perhaps Tynan didn't add AP values to weapons because of that default 1.5% per point of damage they have, so a sniper would by default actually have around 37-38% AP, and for whatever reason the shotgun gets an additional 14% on top of what would otherwise be 24% AP.

That or, perhaps, the value is used to set AP to be a value lower than what the damage would present, as 24% AP on a shotgun supposedly firing buckshot (even if Tynan makes said buckshot one functional projectile instead of, let's say, 12 for a 12-gauge shell) is ludicrous, although 14% is a bit better.

I feel like that's how it's operating, in which case I now feel slightly stupid at not having realised that earlier. If anyone else wants to throw ideas at me though, I'd certainly like to hear (well, read) them, as I could still be wrong.
KrysisMode Sep 25, 2018 @ 2:01pm 
I'd say he just winged it more often than not given how many weird things you see across the weapons and how much he fudged to make melee viable choices against power armor despite said melee weapons being antiques or even a pointy stick.

There's also the fact melee weapons throw most armor values out the window. If I recall right off the top of my head even power armor doesn't have a 100% resist against blunt weapons. And stuff below that is even worse. Every melee weapon in the game can one way or another deal blunt damage thanks to pommel strikes or other antics. I don't know if there's any ranged weapon that deals blunt damage in the game's vanilla arsenal. Pretty sure explosive weapons count as fire.

End result is basically everythings hilariously lethal except guns unless you use the very powerful ones. Meanwhile a wooden stick with a pointy metal bit can punch through space age materials and a stone club crumples it like a tin can in a frathouse.

It feels like he could of avoided that mess if more exotic melee weapons had been added. Glittertech worlds are made of BS magic tech basically, how much of a stretch would seeing them produce combat knives and even swords with thermal edges or something designed to cut through infantry armor in CQC? Blades made of pure diamond honed down to a molecular edge able to slice limbs off with ease and bite nice'n deep into power armor?

I get he wanted melee weaponry to be viable somehow but does it rustle my jimmies that somehow a wooden club can crush power armor from a glittertech world. There's only so far my disbelief can suspend man.
ExoticButts Sep 25, 2018 @ 2:17pm 
Originally posted by KrysisMode:
I'd say he just winged it more often than not given how many weird things you see across the weapons and how much he fudged to make melee viable choices against power armor despite said melee weapons being antiques or even a pointy stick.

There's also the fact melee weapons throw most armor values out the window. If I recall right off the top of my head even power armor doesn't have a 100% resist against blunt weapons. And stuff below that is even worse. Every melee weapon in the game can one way or another deal blunt damage thanks to pommel strikes or other antics. I don't know if there's any ranged weapon that deals blunt damage in the game's vanilla arsenal. Pretty sure explosive weapons count as fire.

End result is basically everythings hilariously lethal except guns unless you use the very powerful ones. Meanwhile a wooden stick with a pointy metal bit can punch through space age materials and a stone club crumples it like a tin can in a frathouse.

It feels like he could of avoided that mess if more exotic melee weapons had been added. Glittertech worlds are made of BS magic tech basically, how much of a stretch would seeing them produce combat knives and even swords with thermal edges or something designed to cut through infantry armor in CQC? Blades made of pure diamond honed down to a molecular edge able to slice limbs off with ease and bite nice'n deep into power armor?

I get he wanted melee weaponry to be viable somehow but does it rustle my jimmies that somehow a wooden club can crush power armor from a glittertech world. There's only so far my disbelief can suspend man.
Yeah, melee weapons don't really seem to have much in terms of defined armour piercing, it's just that the armour values are terrible for blunt damage. I feel the pain (pun intended) of the melee weapon change.

Explosions are all handled as unique forms of damage, and tend to follow the Sharp armour category for resistance (due to shrapnel, I guess). That much I can confirm from the code.

I would deign to make a mod to amplify vanilla armour values to actually resist melee, but I'm not sure I want to get pulled into that mess. Weapon code is cluttered enough as it is without diving into armour code.
AlexMBrennan Sep 25, 2018 @ 2:39pm 
A shotgun seems to make sense because it has a buckshot style attack - the AP could represent this since the gun actually shoots only a single attack
Do you honestly believe that a bunch of smaller projectiles (I don't think you know what buckshot means) have a higher chance of punching through steel plate armour than a single high velocity projectile?
By your logic we should be using submachine guns against tanks, because many small bullets = armour penetration in your alternative reality.
< >
Showing 1-8 of 8 comments
Per page: 1530 50

Date Posted: Sep 25, 2018 @ 12:06pm
Posts: 8