This mod intends to add various weapons from all around the globe to Misery mod, weapons of every stalker's dream. Suggestions, Feedbacks and points of view are very welcomed ! Have fun with these new toys !

Forum Thread
  Posts  
Armor/Bullet damage system implementation (Games : S.T.A.L.K.E.R.: Call of Pripyat : Mods : The Armed Zone : Forum : questions : Armor/Bullet damage system implementation) Locked
Thread Options
Jul 13 2019 Anchor

Hi! I am curious to know how the armor/damage model is implemented.

I think that unless bullet penetrates the armor the damage is decreased by the armor stats (blunt trauma). The bullet delivers its full tissue damage otherwise.
I would like to play a bit with this system a bit but whenever I asked someone nobody knew the exact answer. Could you explain the details and also give me the names of the script files where this system is implemented ( the one where the game compares the parameters of bullet and the armor and make all the subsequent calculations ).


I would really appreciate it!

P.S. Is your armor/damage model different from the vanilla misery?

Jul 13 2019 Anchor

Hi, I didn't work on damage system, it was Kuba's doing, he'll get to you with the answers some other time when he's free :)

Jul 13 2019 Anchor

Hi, the current armor penetration and damage system is a kinda patchwork solution made up of workarounds to simulate real life physics, which is sadly not perfect - there's no way to overcome the engine and I had to work on what we have. The shortest explanation is that the damage to NPC is base value decreased by armor value and multiplied by penetration value of bullet. This can be either few percent decrease or almost 100% decrease, for example when it's level V plate vs .22LR bullet. It's pretty late now but I'll try to make a complete description when I'll have some spare time, together with examples and tutorial on how to edit values to your liking or futher modding. Will notify you.

Jul 14 2019 Anchor

Hi, the current armor penetration and damage system is a kinda patchwork solution made up of workarounds to simulate real life physics, which is sadly not perfect - there's no way to overcome the engine and I had to work on what we have. The shortest explanation is that the damage to NPC is base value decreased by armor value and multiplied by penetration value of bullet. This can be either few percent decrease or almost 100% decrease, for example when it's level V plate vs .22LR bullet. It's pretty late now but I'll try to make a complete description when I'll have some spare time, together with examples and tutorial on how to edit values to your liking or futher modding. Will notify you.

Thanks! That would be awesome!

Jul 15 2019 Anchor

Current armor/penetration system is basically a multiplier to how much damage will the bullet deal to the target in the end.

The armor value is in damages.ltx file. Every body part of NPC is different area there, each have their own line. This works as both bodypart damage config and armor config - that's why limbs for example have higher value than torso, even though most protection is usually on torso. The higher the value the better the protection and the higher the damage reduction is. Currently the values vary from 1.0 (center of mass unprotected by clothes - not actually in game since all characters in game use thick clothing, which *does* provide slight protection IRL) to 2.2 (arm of stalker wearing exoskeleton).
That's it for armor.

The thing that defeats the armor in real world is the bullet's rigid core. In game, it's the k_ap value.
Logic would suggest that the k_ap value should be higher than bodypart's armor value for penetration to be achieved, and therefore 100% of damage to be dealt... but STALKER engine is not logical. Instead, the higher the value, the higher the damage of bullet. Yeah. This is not a real penetration system, but rather an offset ability to simulate an illusion of realism.
After hundreds of hours of tests I found that the best values to have a somewhat realistic outcome is to set it like this:
FMJ bullets of handgun cartridges, eg. 9x19 - 0.5-0.6
FMJ bullets of intermediate rifle cartridges, eg 7.62x39 - 0.8
FMJ bullets of full-size rifle cartridges, eg 7.62x51 - 0.975
Hollow-point/soft point of handgun cartridges - 0.4-0.6
Hollow-point/soft point of rifle cartridges - 0.1-0.3
Typical AP rounds - anywhere from 1.3 to 2.0. Depends on cartridge and damage. The interval here is small, but think of it as of available scale. 1.3-1.5 is usually "classic" type AP rounds with hardened steel core, 1.7-2.0+ are bigger or more modern AP rounds, like for example modern rounds with tungsten core penetrator, eg 7.62x51 or 6.8 AP rounds. But still, this is a modifier value, not a rigid base value, you should NOT scale the values according to real world penetration performance, the values are and must be arbitrally adjusted. Again, this is nothing more than a glorified damage modifier.

The value that controls how much damage the NPC will receive if bullet doesn't penetrate (or is not close to penetrate) is hit_fraction_npc. 1.0 makes NPC recieve 100% of damage, 0.0 - 0% (NPC will be unkillable unless using ammo that penetrates completely)

Because of how the values are set, almost all bullets except for the weakest ones in hard armor penetration (like .22LR) will deal *some*, usually low, damage, even if they don't penetrate (as you know there is no "real" penetration in game mechanics, but I will use this word, meaning the case when bullet deals 100% of it's intended damage) - this is true to real world, as even without actual penetration the bullets do cause damage to body (this can be everything from big bruise to life-threatening internal bleeding) - this is called blunt trauma damage. Additionally, armor plates do get damaged and lose their effectiveness - so after multiple hits it will no longer protect the wearer. So ability to kill an enemy with big amount of non-penetrating hits is therefore intentional. Obviously, the heavier and sturdier the armor the less trauma damage/armor damage the NPC will receive. For example when fighting an enemy in lvlIV body armor with 9x19mm FMJ, you will deal like 5-7% damage, which requires you to put a lot of hits into him to bring him down if you cheap out on AP ammo.

The one ammo type that relies on blunt trauma damage IRL to kill enemies in body armor is shotgun slug. The logical choice would be to increase the damage and use existing blunt trauma mechanism that is in game, but I found that simply giving it AP value makes for much more reliable and balanced outcome. So it has pretty high AP value, even though it shouldn't;)

As said before, the higher the k_ap value the higher the damage. This is why you shouldn't exceed the current values, unless you also edit the bones(bodyparts) armor values, as you will end up buffing damage above 100% of base damage.
This problem can be however ignored in weapons of very high power, like anti-materiel 50cal rifles, as they're usually killing in one shot anyway, so you can increase the k_ap to guarantee the one-shot kill on enemies in heavy armor.



How to edit the values:
1. Armor system. Go to gamedata/configs/creatures, find damages.ltx. Open with notepad++ and edit the bodyparts values to your liking.
2. Ammo config. Go to gamedata/configs/weapons, find weapons.ltx. Open with notepad++. Find ammunition's section, for example [ammo_5.56x45_ss190]. Edit values to your liking. The weapons.ltx file has a short description (line 450) of how the system works and how to edit the values - check it out for better understanding.
3. The damage values in weapons.ltx are modifiers to weapons' damage stats. They're in config files and sections of given weapon. For example if you want to edit AKMS damage, open w_akms.ltx. The base damage is controlled by hit_power value, and then multiplied by ammo stats.



Alright, it's late, I'm pretty sleepy and my sciatica is killing me, so sorry if there are some mistakes or the post is hard to understand in some places. If you have any questions then just ask away and I'll try my best to answer. Have fun!

Edited by: czwarty_

Jul 16 2019 Anchor

If you're going about editing body parts on NPCs for damage, don't forget mutants.

Why mutants?

Well, selecting which ammo & caliber to use on them isn't as straightforward as I thought. Mutants have their own little variety of stat factors which make up the brunt of their protections. Over the years of playing & tinkering with mods that edit the mutants, I've noticed that beyond their usual immunities values ("fire_wound_immunity" is the bullet resistance in particular), there's also two other values in their files which make a significant difference in the amount punishment they can take.

One is "skin_armor". And unless it's a value that's simply not used, I'm guessing it's exactly what it suggests - certain mutants have natural armor values to simulate the toughness of their hide & bones. For example in Misery, a boar only has a skin_armor of 0.15. Virtually any hollow points should be high enough to match or bypass this low of a value. But Chimeras and Pseudogiants have skin_armor values of 0.54 & 0.55, respectively. That's pretty high, making me wonder if AP rounds might be the better call there. I've got a lot of testing to do in this regard.

But the other factor's the bigger deal of the two: "hit_fraction_monster". If I'm correct, this stat is dead simple - it dictates how much of the damage the mutant takes or ignores by a flat percentage. Remember how tanky Izlom/Fractures used to be in past mods? Especially in SoC? I'm sure people complained about them all the time. I recalled their hit_fraction_monster value being rather low at times in the past. Now in Misery they have a skin_armor of 0 and a hit_fraction_monster of 1.0. Thus, they're taking full immunities value damage with zero armor to mitigate it. In other words, they're too weak - people forgot that they're basically zombies with vastly increased bone density. Meanwhile, Chimeras have a hit_fraction_monster value of 0.66 - they're only taking 66% of any incoming damage. I assume this is factored in last in the calculations, tallying up the bullet damage & k_ap values vs their skin_armor & fire_wound_immunity, and then chopping that final damage result by a whole 1/3rd further. Pseudogiants are oddly softer with a hit_fraction_monster value of 0.75, so they're only shrugging off 25% of all final damage.

But the real be-all, end-all in regards to the foundation of damage resistance from gunfire is still the "fire_wound_immunity" value. That's because NPCs (thus, Stalkers in general) outside of a few scripted events have "fire_wound_immunity" values of 1.0, ensuring that NPCs have zero protection against bullets before armor is factored in (in contrast, a "fire_wound_immunity" of 0.0 would mean complete invulnerability from gunshots). By comparison, a Chimera has a value of 0.05. I believe this basically means that a Chimera only takes 5% of the damage an NPC would receive from the same gunshot, and that's before skin_armor & hit_fraction_monster is factored in.

This whole damage system gets really deep, doesn't it?

So, regarding mutants with the system of bullet damage values, there are 3 things to consider per mutant type:

1. fire_wound_immunity, which is innate bullet resistance to start off.

2. skin_armor, which if high enough might hinder the effectiveness of lesser caliber hollow/soft point ammo with low penetration values. However...

3. hit_fraction_monster is further flat-out damage reduction, shrinking already tiny numbers from AP ammo. Intermediate & even many Full Size Rifle rounds have a much greater damage disparity between their AP & Soft Point variants than pistol rounds. Using 5.56 AP ammo, for instance, to ensure you bypass the skin_armor of the toughest mutants is likely far from worth it, as you're slashing your initial damage right out of the gun by as much as ~75% compared to Soft Points & Match ammo damage. Certain smaller caliber AP variants lose much less damage and might be an exception - 9x19/9x21 AP ammo might be just enough to fully defeat the toughest skin_armor values while only losing 12% weapon damage. Beyond that, common sense probably wins out here - bigger guns to hunt bigger game, just save their APs for mankind.

Jul 18 2019 Anchor

I tested it and to be honest so far I didn't notice much difference between damage received by chimera or pseudogiant and other mutants. Soft point and hollow point rounds (with 0.1-0.3 pen) seem to deal equal amount of damage to them. Which is actually wrong and should be fixed, as according to lore pseudogiants have very thick skin and bones. However I never had time to actually tackle the mutants' resilience so it stays as it was in vanilla.


There's one thing I forgot to mention, it's hit_fraction_npc value - this is main thing that controls the simplified blunt trauma damage in NPCs. Every NPC damage set has it's own hit_fraction_npc. Setting it at 1.0 will basically make NPC receive 100% of damage that doesn't penetrate, effectivelly negating armor system. Setting it at 0.0 will make bullets not deal damage unless they penetrate (or are close to penetrate) - not recommended since there's no plates deterioration system in game. Currently it's 0.4 to 0.13 depending on NPC.

Edited by: czwarty_

Jul 19 2019 Anchor

Ahh, so that's the value that controls that for NPCs. I should have known there was a similar value system set up for NPCs in general. Thanks a good bit for pointing that out. That one value alone will make a huge difference in how effective armor is for NPC in all mods past & future (besides the player, anyways). I think back to weapon "realism" mod attempts where I'm gunning everyone down with center-mass double-taps with a PB no matter what they wore - the only exception were Exos, and they only lasted 4 more shots.

I've already altered Pseudogiants in my game to be more hardy.....allegedly. For now I simply tweaked their hit_fraction_monster to 0.45. But I just ran into a pair of them in Jupiter, and the difference didn't seem readily apparent. Granted, I used explosives, which they're probably vulnerable to. A few F1s, with two of them being almost dead-on detonations. 3 was enough to take one out and get one limping, which lasted all of 3 shotgun slugs longer. Slugs in most Stalker mods are hella underpowered, but they're real nasty business in TAZ against pretty much anything. They'll never have decent accuracy, but they're still a solid step up from buckshot.

Now what's notable is that last time I found some Pseudogiants (before I altered them, so vanilla stats), they were stuck walking in place. Sitting ducks, so I thought I'd see what it'd take for them to die. Pulled out a Bizon to use the weakest rounds I had, plain 9x18s. I should have paid more attention, but each one went from unharmed to dead in about between 70-90 rounds each. That's......crazy pathetic. I'm also pretty sure every Pseudogiant I've seen so far has been this weak, because I sometimes find dead pairs of them whenever there's Chimeras or a few NPCs about. Think about that - NPCs have no problems killing these things anymore. I know it's TAZ, but still. This is likely because I suspect that their ground slam doesn't actually hurt NPCs or other mutants, sort of the same way a Controller never bothers doing the brain blast against anyone but the player - it boils down to getting close enough to melee. Naturally, Chimeras don't suffer this issue - they don't rely on special gimmicks to assault their prey, and they're tough enough to get there.

Key bits of lore keep ringing in my mind about Pseudos...stuff like Stalkers leaving PDA alerts to passerbys to stay away from areas where they roam, unloading all their shotgun ammo only to run out and run away. Tales describing a massive mutant "the size of a small house" (granted, I bet houses out there can get pretty tiny). Bones as hard as steel. A massive skull several centimeters thick. They allegedly gained a scripted attack in CoP like the Bloodsucker grab, but I've never seen it. Apparently in CS, Pseudogiants had the ability to make huge leaps to catch up to their prey, which got cut from the final release. Kinda sounds like what it needs.

EDIT: Another freshly dead Pseudogiant. What got it this time? A squad.....of 7 snorks. There's something comical about this....

While I tried & failed to find any footage of the scripted attack (was it cut?), I did happen upon a CoC mod in progress which is altering some mutants, and is possibly working on the Pseudo leap next.

Moddb.com

It seems Fractures also had a cut scripted attack? Now THAT'S an Izlom that seems capable.

Edited by: Servalion

Jul 19 2019 Anchor

Thanks for the comprehensive answer! Rarely you can find people in the modding community both so competent and willing to share the knowledge. I will go through the files and play a bit with the configs this weekend.

Jul 19 2019 Anchor

Servalion
When Pseudogiants fight with NPC characters they usually go very close to them and then NPCs use melee attack. The NPC's melee attack in Misery is often insta-kill to mutants. On one hand, it's weird and sometimes pathetic that powerful mutants go down to rifle butt smash... but on the other hand in vanilla NPCs were extremely vulnerable to mutants, they almost never won vs mutants stronger than boars. Current melee gives them some edge, but also nerfs pseudogiants heavily since their tactic, beside stomps, is getting close to victim and biting without moving at all. When this happens they're basically dead. I personally would also edit the mutants' relations and make Pseudos neutral to other mutants.

You're right about controller. I think this should be fixed, I think NPCs don't take psionic damage anyway but maybe adding physical damage to current psi-attack would make them viable vs NPCs? I think Burers actually use their gravity blasts vs NPCs with success. Balance wouldn't be an issue since one psi-blast from controller is usually insta-death anyway.

About Izloms, lore says they're actually peaceful, maybe even cowardly creatures, they're keeping to their hidings and attack only when they don't have route of escape. So them being so weak in game is actually right IMO.

Jul 19 2019 Anchor

Burer blasts definitely work against others. They seem to enjoy lifting things a bit much though. It can certainly be effective, but it also kinda depends on what they're lifting. Big things with mass like metal barrels will definitely work, but throwing guns at me doesn't work at this point. Also, it seems like simply touching whatever they're lifting counts as a hit - one once killed me by simply starting to lift a metal barrel that I was right up against.

Altering the Controller blast to have different damage properties might be a start, but they might also simply not be programmed to use it against anything else. Not a single mod I've ever seen has them blasting anyone else. There are those in the works like Gunslinger that make them go into the whole Topol crew "It's inside me, NOOOOoooooo" state of panic - one even ended with a poor guy shooting himself to escape the torment. It'd be a funny & terrible thing if they could psi-blast other NPCs as well as the player. The AI could probably never figure out a way to get close enough, and certainly wouldn't manage to take cover or break line of sight, so everyone would just end up dead, which doesn't actually sound at all different from how well they're feared in game. On the other hand, they can only blast one target at a time, so multiple NPCs might still stand a chance if they light it up hard.

As for Izloms, I wouldn't think cowardice necessarily means they lack strength. Maybe it's part of whatever shred of humanity they had left. Like they know how freakish they are and/or that they can't reproduce, so their days are numbered. A bit strange considering that they were all prisoners for one reason or another. But for them to be weak to me doesn't quite add up. While they're certainly faster than other zombies and have more range, they hit slower. Plus in older games & mods where they were brought back, the boneyness of them were a bit more illustrated - They seemed like sentient wood. You'd shoot them, and the impact would sound like you were shooting floorboards. Even the relevant bullet puff off of wooden material would appear from them. These things are limping husks of mainly dense, extremely calcified material. Obviously not to a Pseudogiant's extent, but maybe to the point that the human form would allow.

I could imagine them in Stalker 2, with solid strong hits on them creating loud, chilling, literal bone-cracking crunches. Breaking their brittle body down until they finally die. Actual. Fractures.

Jul 21 2019 Anchor
Servalion wrote:

Ahh, so that's the value that controls that for NPCs. I should have known there was a similar value system set up for NPCs in general. Thanks a good bit for pointing that out. That one value alone will make a huge difference in how effective armor is for NPC in all mods past & future (besides the player, anyways). I think back to weapon "realism" mod attempts where I'm gunning everyone down with center-mass double-taps with a PB no matter what they wore - the only exception were Exos, and they only lasted 4 more


I was looking for that too. Shooting down people in exosuits with little to no effort with 9x18/buckshot just pisses me off.
Will try to tune hit_fraction_npc a bit.

Still did not play this mode through though. Do not know how it feels like here


Jul 23 2019 Anchor

In TAZ shooting enemy in exo or hi-end military suit (expert rating) with low-pen handgun round like the 9x18mm will bring down his health down by 4-8%, so I think current settings should be satisfying to you already.

At the same time, full-size rifle rounds (eg. 7.62x51) are more effective vs enemies in body armor (when shooting in torso you should be able to one-shot anybody except for enemies wearing lvl IV armor) so the "bullet sponge" issue, where enemies require multiple hits no matter what weapon you use, is not present here.

As for testing it's best to use spawner and test values on NPCs. It's best to use military faction NPCs as base for tests since they don't attack you even if you shoot them

Edited by: czwarty_

Jul 24 2019 Anchor

niick is hit_fraction_npc dynamic for the player? It is quite high for the [stalker_hero_1].

Jul 24 2019 Anchor

What do you mean? Dynamic as if it changes with suits? I think yes, judging from practice, but I didn't play around with it, so never gotten to hard data on it

Jul 24 2019 Anchor

As far as I know, suits and headgear differ when it comes to damage protection, attachments like Kevlar plate lowers damage taken as well. I believe there is nothing dynamic about these, each item has a fixed protection value for the player and NPCs.

Jul 25 2019 Anchor

But do Kevlar/Carbon plates affect neck/headshot damage to the player? If I put even one Carbon plate on me in a decked out Exo, I can shrug off all but the biggest most exotic AP rounds. MAYBE 7.62x51/54 AP gives me some trouble. Basically, they have to hit me above the shoulders to send me running to repair.

I always thought it was curious how no helmet can be made more durable or protective, despite the Sphere 12 stating that it has slots for protective plates. Maybe if Helmets had their own attachment slots.

Jul 25 2019 Anchor

niick

I would like to modify hit_fraction_npc for all the stalker_XYZ (supposed to wear different outfits). However, I am not sure how is the stalker_hero hit_fraction_npc is scaled after you put on various outfits? Is hit_fracti is the value for the naked player?

Jul 25 2019 Anchor

No Servalion, plates don't protect your neck or head. Even when I'm wearing a Berill with two kevlar plates I do sometimes get a critical shot once in a while, must be some hardcore shooter landing a well placed shot. Shots to my mass body are usually hardly noticeable. Only NPCs that worry me are those using high caliber with AP rounds, their shots are quite hard to swallow. As for helmets, I think I'm using Sphere M12, quite a handy helmet when it comes to combat.

Jul 25 2019 Anchor

mp5lng hit_fraction is the function that controls the damage that is done even when when rounds don't penetrate, so it's something else than normal armor value. For example in NPCs this function makes it so that if you set it at 1.0 then you don't need penetration at all and even if armor has very high value it means absolutely nothing. Player has set 0.74 (iirc) which is very high (NPCs have about 0.1-0.4 iirc) and if it worked by itself, without changes from other modifiers then it would mean the player should take 75% of damage he receives even if he has the strongest possible armor and attachments - which is clearly not true, so some other functions must be at play here.

Kirk1944 No idea really. I think yeah, that is value for "naked" player but how it is calculated and what changes it at all, I have no idea.

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.