Jump to content

Ped Damage Overhaul 2.0 BETA 7

Script mod which adds and alters "NPC behaviors"
   (5 reviews)

1 Screenshot

This mod is a teamwork of @fitfondue and @HughJanus.

 

The beta version of Ped Damage Overhaul 2.0 has been released! It contains new features and major adjustments (described in the changelog), so we'd appreciate your feedback on any bugs and performance issues you encounter. When reporting performance issues, please post your system specs if you can!

Part of this beta are the "optional features" (which require LML to work). Those are separated in two files. One is responsible for longer reactions after dismemberment (not compatible with euphoria mods), the other increases the chances of arterial bleeding (e.g. for neck shots).

 

OVERVIEW

This mod tries to make gun fights more diverse, dynamic and interesting and keep them that way throughout the game.

You will find NPCs stumbling when trying to run with hurt legs, getting the wind knocked out of them when getting shot, squirming on the ground when fatally injured, moaning in pools of their own blood until they meet their end, clutching their wounds and stumbling around when hit, etc.

 

IMPORTANT KEYS (for toggling effects)

These are the standard keys, they can be modified via the ini file (as can everything else this mod adds to the game):

  • F9 - Toggling the mod on/off (the mod is enabled by default).
  • F8 - Toggling "Kill Wounded Mode" on/off (is disabled by default). This mod adds a feature called "Dying States" which makes NPCs go down when injured and still stay alive for some time (until they bleed out). If "Kill Wounded Mode" is activated, NPCs will die instead of entering the "Dying States".
  • F7 - Toggling "Longer Bleedouts Mode" on/off (is disabled by default). Per default this mod makes NPCs in "Dying States" bleed out within a maximum of 25 seconds (to not interfere with spawning waves of enemies during missions, which are only triggered when the first wave is dealt with). If "Longer Bleedouts Mode" is activated, NPCs will take longer to bleed out (more realistic, but also hindering during some missions).
  • F2 - Toggling "Friendly Fire" on/off (is disabled by default). "Friendly Fire" currently only works for the Dutch Van Der Linde gang.

 

FEATURES

Here is a quick overview of the most important features:

First off, almost all of the features and their characteristics are based on chance, so the behaviors won't be the same every time you encounter them - which should ensure more diverse fights and keep things interesting for longer than vanilla does... that was the idea, at least 🙂

Almost every feature can be enabled, disabled or tweaked in the ini (more information further down the page), so this is not only a mod, but also enables you to create your own experience.

This mod only alters behaviors and attributes of human NPCs - animals or anything else remain untouched.

 

Light version:

  • NPCs will react to where they are being shot (leg shots will make them stumble when trying to run, hand shots will disarm them, torso shots will stagger them, etc.).
  • When NPC's health decreases below a certain threshold, they fall over and don't get back up. Then they go through different stages of dying, each with its own randomized behavior. Eventually NPCs will die of blood loss.
  • NPCs will sometimes (based on chance) audibly react when in hopeless situation (panicking, begging, cursing, etc.).
  • There is a bleeding feature, which makes NPCs lose health after they have been fatally injured. It operates bassed on chance, so NPCs don't all bleed out in the same amount of time.
  • NPCs burn alive for longer when set on fire.
  • There is a chance of NPCs surviving a fire (although they won't be able to do much afterwards).
  • NPCs have a chance of staying on the ground for a random amount of time when shot (based on their health) - so you can now knock the breath out of your opponents.
  • For all included behaviors the movement and pain sounds have been adjusted (and also randomized) to hopefully make your experience more interesting.

 

Standard version:

  • The same features as in the light version apply as well as the following additions:
  • NPC health and player damage tweaked to offer a more satisfying experience (no more bullet sponges).
  • NPC damage tweaked to offer more challenge to the player (since NPCs don't eat bullets for breakfast anymore).
  • You can now feel the difference between weapons, their condition and ammo types in combat (shooting with a properly maintained, powerful weapon with special ammo now feels like it should).
  • NPCs are less accurate shots and their accuracy declines along with their health.
  • Arm and leg shots do less damage to NPCs.
  • All NPCs can be disarmed (yes, even lawmen).
  • Hogtying disarms NPCs, so if they manage to get loose, they can't shoot you - they might draw a hidden knife, though.

 

Overhaul version:

  • The same features as in the standard version apply as well as the following additions:
  • Core Drain (health, stamina, dead eye) has been moderately increased - now hunting and buying food become necessary options.
  • Cores will be fully drained after death.
  • Additional 25% of money lost after death.

 

We hope that you have as much fun with this mod as we have creating and improving it!

 

 

INSTALLATION

  1. Download Alexander Blade's ScriptHook: http://dev-c.com/rdr2/scripthookrdr2/
  2. Extract Dinput8.dll and ScriptHookRDR2.dll into the main directory of RDR 2 (where the .exe file is).
  3. If you want PDO's additional features, download Lenny's Mod Loader. If not, ignore steps 4, 5 and 8. https://www.rdr2mods.com/downloads/rdr2/tools/76-lennys-mod-loader-rdr/
  4. Extract the folder Mod Manager into the main directory of RDR 2 (the actual Mod Manager folder, not just its contents). Then go into the Mod Loader folder and extract only its contents into the main directory as well (not the actual folder, just its contents).
  5. In the Mod Manager folder, run the ModManager.UI.exe file to make sure Lenny's Mod Loader is properly installed in the RDR 2 directory.
  6. Download your preferred version of Ped Damage Overhaul, then open the zip and choose whether you prefer Light, Standard or Overhaul configurations (see mod description to understand the differences).
  7. Extract the contents of the chosen folder into the main directory. If you're using Lenny's Mod Loader, any files pertaining to it will be automatically placed in the correct folder.
  8. If you're using Lenny's Mod Loader, run ModManager.UI.exe to see if the optional files are showing as installed. If they are, you're good to go.
  9. Start the game and have fun!
  10. While in game, you can press F9 to check if the mod was loaded correctly (F9 once to disable, then F9 again to re-enable the mod).

 

 

TWEAKING

In general, every parameter in the ini has a description (including information on how to disable the feature). Feel free to play around.

There are already a lot of features enabled and tweaked for out-of-the-box use, yet there are some features left untouched which can be enabled in the ini. That said, if you just want to disable one or more features, set their respective values to 0 (or whatever value the description suggests).

Examples:

  • To turn off the bleeding feature: set BleedWhenDying to 0
  • To turn off the disarming when hogtying NPCs: set HogtyingDisarms to 0
  • To turn off the dying state features: set DyingStateChance to 0

 

If you want to disable a feature which is based on chance, just set the chance value to 0.

Examples:

  • To turn off the knocking the wind out of your opponents: set KnockbackChance to 0
  • To turn off the possibility of NPCs surviving fire: set FireSurvivalChance to 0
  • To turn off the chance of stumbling when shot in the leg: set StumbleChanceOneLeg and StumbleChanceBothLegs to 0

 

There are also many other features that can be activated in the ini - here are some examples:

  • LassoDisarms -> makes catching someone with your lasso disarm them (no hogtying necessary)
  • NPCWeaponModifier (and many other damage modifiers) -> makes NPCs do more or less damage, depending on what you set it to
  • BleedWhenShot -> enables a bleeding feature which triggers when an NPC gets shot (so not the usual "bleed out when under x health" but consistent bleeding which is applied after the first hit of a bullet - the bleeding chance and deducted health points can be set separately)

 

The ini is full of values for those wanting to experiment a little.

One word of warning to tweakers: If the NPCHealth is set too high, headshots might not be lethal anymore, unless they hit the actual brain of the NPC (so a shot in the jaw would do more damage than other body parts, but would not be an instant kill). Actual "brain-shots" are always one-shot-kills, no matter the health.

 

 

 

KNOWN "ISSUES" (they are not real issues)

  • The disarming feature can be exploited to slow down new waves of lawmen. The same is true for the dying state feature. If there are too many lawmen dying or fleeing around the player, new waves won't spawn in until the lawmen die or get enough distance (this feature can be turned of in the ini file, if that is a deal breaker to you).
  • When disarming is enabled, the dropped weapons may appear partly invisible. This is only optical, though, they can be picked up and used as usual.

 

 

The source code of Ped Damage Overhaul can be found here:

https://github.com/HJHughJanus/PedDamageOverhaulRDR2

 

 

If you are looking to enhance your experience by using an Euphoria Mod, please take a look at the work of @AnymYo.

C.E.R.R. is tweaked for cineastic reactions and designed to work with PDO:

 

Edited by HughJanus

What's New in Version 2.0 BETA 7   See changelog

Released

Changelog v2.0 BETA 7

 

  • Added an ini parameter to enable/disable the disarming of downed opponents
  • Added an ini parameter to disable the "longer bleedouts" feature in missions
  • Fixed a bug where NPCs in cover would sack down all of a sudden when using euphoria mods
  • Fixed a bug where health for npcs in vehicles would not be set correctly
  • Fixed a bug where health for "Other Story NPCs" would not be set correctly
  • Fixed a bug where damage multipliers would not be applied if they were set above 100%
  • Adjusted some values in case the ini is not found (due to not following the installation instructions, which is very common, it seems^^)
  • Like 34
  • Thanks 7
 Share

You may also like

  • Lenny's Mod Loader RDR
    By LMS
       2513732   749   6
  • RDR 2 Asi Loader
    By LMS
       1582509   160   5
  • Red Dead Offline
    By LMS
       811520   449   12
  • Improvements in Blood
    By Cazanu
       76501   8   0
  • Lenny's Simple Trainer
    By LMS
       1146086   1351   25
  • User Feedback

    Recommended Comments



    fitfondue

    Posted (edited)

    @HughJanusOh! I had misunderstood what KnockbackChance meant. I set the parameters to what you suggested and indeed NPCs do get back up after a random amount of time if you set it low enough. That's fantastic.

    One thing I've noticed is that the behaviour is different when facing armed enemies (or specifically lawmen when they're hunting you, that's where I've seen this issue the most). Shooting an unarmed NPC will cause them to stumble in the direction of the shot and fall over, which is perfect. However, if an enemy is actively shooting at you, they won't act that way when they're shot (unless it's an artery shot). They'll just stand there for a moment, arms down, as if they're processing the fact they've just been shot, and 2-3 seconds later they'll fall over. It looks like a shocked reaction, and interestingly, while that behaviour is active, they're unresponsive to bullets. The wounds will show up but they won't be pushed by the shots, they just stand upright for two or three seconds then fall over. This behaviour is overruled if they're moving fast or if you run into them, at which point they'll just stumble and fall. But if they're moving slow enough, they'll come to a stop when shot, stand there for 2-3 seconds, then fall over. This is, of course, when their health is below the threshold (either Dying or Knockback thresholds).

    I am utterly hopeless with coding, so the source code looks like sorcery to me (although I must compliment you on how well you comment your code). Do you think that "shocked" behaviour with armed enemies is caused by something in your code, or is it just a side effect of vanilla behaviour?

    If you want to replicate this potential bug, just get into a fight with lawmen with either KnockbackThreshold or DyingThreshold set to 499. You should see a difference between how the lawmen react to a knockback shot and how an unarmed NPC reacts. This may be a specific problem with lawmen, since some rules apply differently to them (they can't be fully disarmed, for instance, revolvers are pretty much glued to their hands). I wouldn't be surprised if this issue is currently unfixable. (EDIT: To clarify, I'm specifying lawmen because other kinds of armed enemies will often react normally to being shot, it really depends. As I said, this may be specific to lawmen, so it's worth testing it in shootouts against the law.)

    As ever, thanks so much for your replies and your work on this mod. You've really done an astounding job.

    Edited by fitfondue
    Link to comment
    Share on other sites

    it is possible to implement the disarming of every PED etc. Vanilla can only be successfully disarmed by civilians by firing on the weapon

    Link to comment
    Share on other sites

    This is my personal configuration for this great mod. Result: More realism with the same gore effects. Thanks for this great modification

     

    ;_________________________________________________________________
    ;
    ;
    ;!!!!!THE VALUES BELOW ARE INTEGER VALUES -> DONT USE COMMAS!!!!!
    ;
    ;_________________________________________________________________
    [PedDamageConfiguration]
    ;ToggleKey is the F-key you want to use to activate the mod (so 7 would set it to F7)
    ToggleKey=9
    ;EnableScriptByDefault can be set to 1 or 0, depending if you want to have to enable the script manually or it should be active by default
    EnableScriptByDefault=1
    ;Playerinvincibility is the setting for the player to be invincible (values: 0 or 1)
    PlayerInvincibility=0
    ;FireSurvivalChance is the percentage chance of an NPC surviving a fire if burning (values: integers between 0 and 100)
    FireSurvivalChance=20
    ;FireHealth is the health value an NPC gets when it is burning, if it is NOT supposed to survive the fire (if this value is set too high, the NPC might still survive the fire)
    FireHealth=80
    ;NPCHealth is the standard health for an NPC
    NPCHealth=150
    ;KnockbackThreshold is the health threshold under which an NPC can be knocked down
    KnockbackThreshold=80
    ;KnockbackChance is the percentage chance of a knockdown occuring when the NPCs health is under the KnockbackThreshold (values: integers between 0 and 100)
    KnockbackChance=10
    ;DyingThreshold is the health threshold under which NPCs wont be able to get back up again when knocked down
    DyingThreshold=40
    ;StumbleChance is the "percentage" chance of stumbling or falling when an NPC was hit in the leg (values: integers between 0 and 1000 (so it can be tweaked more precisely => so a value of 30 would equal 3%))
    StumbleChance=5
    ;SpecialWeaponModifier - since NPCs have more health, some weapons should do more damage - this is the modifier for weapon damage (shotguns, sniper rifles, dynamite arrows, improved arrows and tomahawks will be affected by this)
    SpecialWeaponModifier=1

    Link to comment
    Share on other sites

    I have already tried making them "disarm-able", but unfortunately there is no native function which lets them drop their weapon, I can just let them disappear completely. Disappearing weapons were kind of an immersion killer, so I cut that feature out (that was before the v1.0 release).

    As for the "weird" reactions of lawmen - yes, it has to do with my code. It happens when they should get knocked down or enter the dying mode. Lawmen seem to move more slowly during gunfights, which makes setting them to ragdoll a dice roll (if they move quick enough, it looks acceptable, if not, they look like being shocked). I tried to force push them when ragdolling NPCs, so that behavior didnt occur - but unfortunately it made the transition from not ragdoll to ragdoll look even more weird, so I removed that.

    Currently I have managed to implement bleed out timers and am once again trying to polish things a bit (but it is really hard).

    Link to comment
    Share on other sites

    fitfondue

    Posted (edited)

    @HughJanusI just tested the issue further and I think I figured out what the problem is: there's an anti-stagger behaviour applied to any enemy that's currently firing at you (not just lawmen). I tested this with vanilla. If you shoot an NPC who's in passive mode, they're programmed to stumble, fall and get back up. They don't shrug off the bullet. However, if they take out their gun and start firing at you, your bullets will not knock them down. They'll just shrug off the shots until their health is depleted. Exceptions to this are leg shots (they always cause a fall), artery shots and extreme circumstances (i.e. NPC is shot while dismounting a horse). I also managed to test this with the same NPC: I shot him in the torso while he was in passive mode, he fell, got back up, started firing at me, and from that point on, torso shots wouldn't knock him down.

    When you shoot an aggressive NPC in most parts of their body, they apparently go into a specific ragdoll behaviour that is designed to PREVENT a fall while still reacting to the impact of the bullet. The ragdoll quickly stabilizes the NPC again so that they can blend back into normal animation and keep firing at you. It takes a fraction of a second. If they happen to be moving extremely fast or they're tossed against scenery, this anti-stagger behaviour is overruled and they just fall. But in most cases, the behaviour works: they'll react to being shot but they'll stay upright and keep firing at you.

    I enabled the mod in order to test this further and, indeed, the circumstances in which the "shocked" behaviour kicks in are the exact same circumstances in which the anti-stagger behaviour would have kicked in. Artery shots, leg shots and headshots don't cause the "shocked" reaction, but any other kind of shot does.

     

    So if I had to guess, this is what's happening when your mod's enabled and you shoot an aggressive NPC: 1 - The NPC goes into anti-stagger ragdoll. 2 - Your mod prevents the NPC from blending back into normal animation, so the anti-stagger ragdoll is prolonged and does what it was designed to do: it brings the NPC to a complete standstill, stabilizing them. 3 - Wounded ragdoll kicks in shortly afterwards and the NPC falls over.

    I may be completely wrong here; as I said, I'm utterly hopeless at coding. 😄
     

    EDIT: This would also explain why they're completely unresponsive to bullet impacts while they are in the anti-stagger ragdoll. Makes stabilization easier.

     

     

     

    Edited by fitfondue
    • Like 1
    Link to comment
    Share on other sites

    Sounds plausible. Thanks for doing the research!

    I guess we have to wait for OpenIV to release to know the name or ID of this state (so I can do an if/else clause and circumvent the prolonging of this state).

    I dont have any other idea on how to solve this problem at this moment, since I cant check if the NPC is in this special ragdoll state.

    What I could check is if the NPC is hit in the torso or the arms, but then I would have to know the difference between an NPC which will try to stabilize itself and the rest.

    One thing that might help identifying which NPC is stabilizing is this method: IS_PED_WEAPON_READY_TO_SHOOT

    IS_PED_SHOOTING

    But then NPCs who are currently shooting or wanting to shoot cant be knocked back (at least not by shots in arms or torso) :/

     

    The cleanest way to do this would be to check if the NPC is currently in the stabilizing mode and if so, not apply the ragdoll prolonging. But currently we wont be able to do that :/

    Link to comment
    Share on other sites

    @HughJanusI figured as much, no worries. We're still in the early days. I actually wasn't expecting to see a mod like this for another several months. 🙂

    Speaking of the force push method, I took a closer look at the stumbling feature too. It works really, really well when the NPC is walking or running. Your code adds just enough of a forward push to make the NPC tip over in a way that looks natural. Problem is, that same push isn't enough to tip over an NPC who's standing still. Therefore, in those cases, the NPC will only jerk forward slightly, not enough to go into ragdoll.

     

    At default percentages, this causes a semi-frequent stutter in the NPC's animation. At higher percentages, that force push is applied constantly, and that will easily "lock" the NPC into a repetitive reaction animation that never allows them to walk or run, thus they can never build momentum and become perpetually locked. It does look quite funny, though.

    I figure this can't be fixed currently (not until an NPC's velocity can be checked) but as it turns out, the default percentage does have a believable frequency to it. The only problem is that NPCs will often recover mid-ragdoll and it always looks goofy. Is there a way to keep an NPC in ragdoll for a minimum amount of time, to guarantee that they will actually fall to the ground after stumbling?

    Link to comment
    Share on other sites

    I think I have fixed the stumbling. It should only occur now when they are running with a certain speed.

    I have also implemented bleeding timers.

    Try the attached .asi file and add the following to your config:

    ;BleedWhenDying can be set to either 1 or 0, if set to 1 an NPC will continuously lose health when under the DyingThreshold
    BleedWhenDying=1
    ;BleedWhenShot can be set to either 1 or 0, if set to 1 an NPC will continuously lose health when under the KnockbackThreshold
    BleedWhenShot=1
    ;BleedingValue is the value of health an NPC loses per script iteration (= every ~millisecond) when bleeding is enabled - the value 0.0000005 is multiplied with the BleedingValue and then deducted from an NPCs health
    BleedingValue=43

     

    This is only a beta (sort of) and not really tested yet.

    But I tried adding a believable bleedout timer and a fix for stumbling (by checking for the running speed).

    PedDamageOverhaul.asi

     

     

    Edit: Forgot to mention -> if the thing with the stumbling works, we have now figured out the running speed threshold. So we can now check, if under this threshold, the NPC is standing or walking slowly, then we could push a little harder to make it fall^^ Unfortunately I dont have that much time under the week and wont be able to use the whole weekend (only sunday is free this week). I hope I can get something done then.

    Thanks for your help! I like how this mod is becoming a collaboration 😄

    Edited by HughJanus
    Link to comment
    Share on other sites

    @HughJanusI'm delighted to be of help! I just tested the beta, and I can confirm that the bleed out timer works, but there's some issues. First, the BleedingValue seems to either deactivate the bleeding feature or activate it at a fixed time (which is 8-12 seconds at 500 health). Bleeding values under 31 deactivate it. From 31 upwards (I went up to 12000), it's 8-12 seconds roughly. So the value seems to be working more like a boolean as of right now. One can get around this by increasing the NPCs health and the thresholds. Doubling the health resulted in twice the bleedout time, so that bit's working properly. The rate of bleeding, however, remains the same.

     

    Another thing (and this may be fully intended) is that the bleedout is only active while the enemy is in a knockdown state, so if they get back up, the bleedout timer stops. So shooting an enemy whose health is below the KnockdownThreshold will not activate bleedout unless they're actually knocked down. This may very well be the intended design, I'm just letting you know in case it isn't. It can actually work as an interesting mechanic, since a knockdown costs an enemy a lot of health.

    And finally, the stumbling behaviour plays into the bleedout. Basically, if you shoot an enemy in the leg while they're below the KnockdownThreshold, that's an instant knockout and the bleedout timer begins to tick. Often the enemy will get back up before they run out of health, and at that point the bleedout timer stops. But with every little force push, it ticks away a bit more, because for a brief moment the enemy enters ragdoll. If a force push occurs below the DyingThreshold, they just fall over, don`t get back up again and bleed to death. So yes. A shot in the leg is an eventual death sentence now. 😄

     

    As for the stumbling, it's definitely improved. Now the NPCs can build up more speed before the force push happens, but as it turns out, it's still not enough speed for the force push to actually tip them over. Sometimes it happens, often it doesn't, so NPCs do still get "locked" into reaction animations. However, now they actually move forward considerably before the force push "resets" them. I think you can let them build a tad more speed before the force push happens, or you can make the force push stronger. Either way, seems like it's just a matter of tweaking now. It does look like you figured out the running speed threshold! It may be a good idea, perhaps, to try a stronger force push, because as I said in the earlier posts, enemies can still recover mid-ragdoll without actually falling, and it looks quite goofy.

    • Like 1
    Link to comment
    Share on other sites

    Thanks for testing!

    The knockout bleeding is intended to work this way, so the NPCs dont bleed out as fast as when dying. The bleedout value working this weird way, however, is not intended. I will have to debug that.

    I will also try tweaking the speed and force of pushing on the weekend.

    If we get these current things nailed, I guess we could release a v1.2 of the mod 🙂

    • Like 1
    Link to comment
    Share on other sites

    @HughJanusTake your time! I'd recommend adding PedVelocity and ForcePush (example names for the parameters) to the .ini so the user can tweak to their taste, even if it means a force push that looks kind of weird (in order to ensure the ped will actually fall down). It could also be fun to tweak ForcePush to 9000 and watch peds stumble themselves into orbit.

     

     

    Link to comment
    Share on other sites

    Hey @fitfondue, I couldnt debug the bleeding value in the short time I have right now, so I implemented a different logic (based on chance) and put the values into the ini.

    Attached you can find the new beta (ini is filled with arbitrary values for testing) - the following values are new:

     

    ;BleedingChanceShot is the "percentage" chance of bleeding per script iteration (= every ~millisecond) when NPC is under the KnockbackThreshold (values: integers between 0 and 1000 (so it can be tweaked more precisely => so a value of 30 would equal 3%))
    BleedingChanceShot=9

     

    ;BleedingChanceDying is the "percentage" chance of bleeding per script iteration (= every ~millisecond) when NPC is under the DyingThreshold (values: integers between 0 and 1000 (so it can be tweaked more precisely => so a value of 30 would equal 3%))
    BleedingChanceDying=40

     

    ;BleedingValue is the value of health an NPC loses when bleeding is applied (= one of the bleeding chances kicks in)
    BleedingValue=10

     

    ;RunningThreshold is the velocity of the NPC - if the NPC runs faster than this velocity, the stumble chance kicks in (stumbling can happen)
    RunningThreshold=3

     

    ;StumbleForcePush is the force with which stumbling occurs (stumbling is basically setting the NPC to ragdoll and pushing it lightly to make it fall over - this value represents the force of the push)
    StumbleForcePush=180

     

    ;PLayerHealth is the health value you want Arthur to have (if its set to 0, this feature is deactivated and Arthurs health remains untouched)
    PlayerHealth=0

     

    The chance values are calculated every millisecond (just like stumblechance), so I wouldnt go to high on them (or set bleedingvalue lower, so NPCs dont lose so much health).

    Maybe you have time sooner than me to test a bit. I would be extremely thankful for that!

    PedDamOv_Beta.zip

    Link to comment
    Share on other sites

    @HughJanusI installed the mod at your new default values in the .ini and goddamn, you NAILED the knockback chance value. This new value strikes a perfect balance of variety because it prolongs the anti-stagger reaction without necessarily causing the NPC to fall over. They'll often blend back into their normal animation before they fall, so basically, with your default value, enemies take longer to process that they have been shot (as one would, in real life) but they don't necessarily fall over. However, they still CAN fall over. Most shots will lead to a longer reaction before they can back to shooting at you, and a few will result in them actually falling. So it's a great balance. The only things that break immersion are not your mod's fault: the stand-up animation and the way they get back to shooting at you are way too spry for someone who's just been shot. But I feel that, in this respect, your mod does everything that can possibly be done at this moment.

     

    You've pretty much fixed the stumbling. I still get the occasional goofy-recovery-before-falling, but in most cases the enemy falls over and it looks convincingly like stumbling. An enemy that gets shot in the leg can no longer outrun you, and it looks extremely realistic most of the time. It's a fantastic feature. It could only possibly look better if the enemy were forced into a constant limping animation after being shot in the leg, but I understand this is undoable for now.

    As for bleedout, at the default values, I've seen it happen once in a 10-minute-long gunfight. What I saw was someone keel over after stumbling and not get back up again. So I changed the default values to these:

    BleedWhenDying=1
    BleedWhenShot=1
    BleedingChanceShot=999
    BleedingChanceDying=999
    BleedingValue=100

    Which should lead to them dying almost instantly upon knockback, but it doesn't. What happens is, every knockback shot drops them into a dying state, but they don't die. After tweaking those values further, I believe the BleedWhenDying boolean isn't working. They bleed from knockbacks, but once they get to the dying state, the bleeding stops and they remain alive. So those high values I set result in the enemy's health depleting near-instantly to the dying threshold, at which point they stop bleeding and remain permanently dying.

    But I did verify that BleedingChanceShot and Bleeding Value do have an effect on how quickly they go into the dying state. I was able to tweak it so that two knockbacks drop an enemy permanently into the dying state (on the second knockback). Those values are:

    BleedingChanceShot=60

    BleedingValue=15

     

    However, these values strongly affects the stumbling feature. Enemies will go into the dying state after the first stumble, so unless there is a way to differentiate between those states, one feature pretty much cancels out the other.

     

    The ideal version, I'd say, would be to fix BleedWhenDying and keep it activated by default on the .ini while BleedWhenShot remains deactivated by default, because it doesn't work well with the stumbling. BleedWhenDying is more stable and immersive, and it's just a matter of tweaking the DyingThreshold to decide how resilient enemies will be.

    As for the SpecialWeaponModifier parameter, 2 is a tad low. 5 strikes a better balance between ensuring high damage at close range (including one-shot dismemberment) but not being too effective at medium/long range.

    • Like 1
    Link to comment
    Share on other sites

    @HughJanusOh, an extra point about the stumbling: I played around with higher values and I noticed that the force push goes up instead of forward. Is there a way to tweak this? It may be more difficult for an enemy to recover their footing if the force push forces them forward.

    It also highlighted that your mod makes NPCs very resistant to falls, since I witnessed more than one NPC fall from 100 feet up and get back up again. But that's an inevitable effect of NPC health = 400, I guess 😄

    • Like 1
    Link to comment
    Share on other sites

    OK, I will see if I can get those changes (bleeding stuff) done tonight.

    As for the force push, I have an x, an y and a z value. Currently the x value is the one you can set and the y value is -40 by default, so it pulls the ped down (and z is 0). The x is relative, so it should be the direction in which the ped is facing (at least I thought it did during my tests before v1.0).

    I think x is like pulling the NPC on a string by its chest (90° from the chest), y would be pulling the NPC on the head upwards and z to the sides. At least thats what I thought it did when I tested with higher values.

    • Like 1
    Link to comment
    Share on other sites

    @HughJanusYeah, the configurable value seems to be affecting their y direction, and I also found out a bizarre glitch that will have NPCs stand up in mid-air if you set the force push to something like 500. I set it to a negative value and it also sent NPCs rocketing towards the sky, so yeah.  The fact that they're being pulled upwards may be what's causing that goofy glitch I mentioned, because being pulled upwards isn't as destabilizing as being pushed forward, therefore at the peak of the ascent Euphoria figures the character is on stable footing and triggers the recovery animation (or something to that effect). GTA 5 had a similar issue, actually. Without enough forward momentum, that's what happens. However, with the latest iteration of your mod, it happens far less. I found 300 to be a good balance in general, but 150 already works mostly. Still, it would be interesting to see if a forward push combined with a slight upward pull eliminates the problem entirely.

    Link to comment
    Share on other sites

    I'll add the y and z value as well in the config (only for you to test, i will remove all the pushing values for the release version).

     

    Edit: removed the bleedingwhenshot-stuff, fixed the bleedingwhendying (hopefully^^) and added config values for the forcepush. zip is attached. Hope this serves you well 🙂

    PedDamOv_Beta_v2.zip

    Edited by HughJanus
    Link to comment
    Share on other sites

    @HughJanusI'll have time to test more thoroughly in a few hours, but I took a quick look and first of all, y really was the right value for pushing NPCs forward. Or backwards, actually. Turns out negative values cause the whole thing to glitch out and skyrocket NPCs, but positive values work properly and they seem to always affect the direction an NPC is moving in, so if they're walking backwards, they'll stumble backwards. Y is what governs that, X pulls upward, Z I haven't tested which side it affects yet. Honestly, I'd keep X and Y in the .ini while clarifying which one does what in the commented sections, because tweaking does lead to significantly different results. Z may be useless, though, I'll determine that in a few hours.

     

    As for bleeding when dying, it's still inactive, although I intend to test it further soon. Two NPCs SEEMED to die from bleeding out early on, but this didn't happen again so I don't know if something else caused it. In every other case, NPCs would go into the dying state and not die. I set the parameters to make them die really quickly and they still didn't die. For now I have no clue as to why. I even set BleedWhenDying to 0 to see if the damn thing had been somehow inverted (far-fetched, I know) but nope, still didn't work.

    But yeah, stumbling seems fixed, it's just a matter of finding the sweet spot for the default .ini values. I'll do that on my next test run today. 🙂

    • Like 1
    Link to comment
    Share on other sites

    @lininopChecked it just now on the latest test version HughJanus posted here, and it's not happening on my end. Maybe you have another mod causing a conflict? Which version of this mod are you using?

    Link to comment
    Share on other sites

    @HughJanus Okay, I think I figured it out. NPCs ARE bleeding out but they don't die. I tested this by setting their health to 500 and DyingState to 499. I would shoot them once and they would go into the dying state indefinitely. However, if I shot them while they were in the dying state, they'd die instantly. If I disabled BleedWhenDying, one shot wouldn't be nearly enough to kill them in the dying state.

     

    Therefore what seems to be happening is this: NPCs enter the dying state, their health is depleted by the bleed-out feature, but for some reason, they don't die. They are killed by the slightest damage in that state, but they don't die from bleeding out alone.

     

    This may explain why some NPCs seemed to die from bleeding out when I first tested this. The stumbling feature actually causes incremental damage to peds. If you set their health low, stumbling 5-10 times will actually be enough to kill them, or drop them into the dying state if that's enabled. Therefore, ragdolling onto the ground chips away at health. So I guess that I shot the NPCs, the bleed-out feature led to their health depleting to near-zero before they hit the ground, at which point hitting the ground killed them.

     

    So that seems to be the bug with that feature. Now I'll see if I can find the ideal default values for the stumbling feature.

    • Like 1
    Link to comment
    Share on other sites

    @HughJanusOkay, I think I found the most realistic values for stumbling. Turns out I was wrong about x and z; it's the other way around. Z is upwards pull, X pulls to the right. Y remains forward, and apparently I was wrong about it having to do with the ped's current vector as well. While testing some higher values, I did see some NPCs lurch in the opposite direction they were headed in. But with the values below, that doesn't tend to happen:


    StumbleChance=80
    RunningThreshold=3
    StumbleForcePushX=0
    StumbleForcePushY=400
    StumbleForcePushZ=0

     

    Here's what happens when those values are active: NPCs that try to run immediately stumble and fall. It takes two or three steps for it to happen, so they literally can't run, which looks more realistic. Sometimes they recover their footing before they fall, but in a way that looks more believable than previously. Most times, they'll actually stumble and fall, and if they do it on a slope, they'll roll all the way down. They'll stumble so often that you can almost keep up with them by walking. So now, shooting an enemy in the leg does prevent them from running away from you, and the stumbling looks frantic and energetic. At lower health values, NPCs won't actually be capable of fleeing for long. The frequent stumbling will chip away at their health until they reach the dying state, at which point they can't move anymore. So this leads to an accidental (but very welcome) exhaustion feature.

     

    In gunfights, it also has a significant effect. Enemies can mostly stay on their feet unless they try to break into a run, at which point they will stumble. They can still move without falling, but not if they try to run. So shooting an enemy in the leg prevents them from quickly changing positions.

     

    I tried setting RunningThreshold to 2, but that causes glitches on aggressive enemies. They'll be moving backwards but suddenly lurch forward in a way that looks weird (and without going so far as to ragdoll). A value of 3 ensures that the stumbling only kicks in at running speed. And frankly, it's believable enough that they can remain on their feet as long as they're not trying to outright run away. Ideally, a shot on both legs should stop them from getting up at all, but this feature isn't possible for now.

     

    I figure this is as good as it gets for now. It doesn't look perfect all the time, but that's mostly down to Euphoria's overzealous blending. I feel that it decides to blend back into normal animation too soon, while there's still significant momentum to the ragdoll.

     

    Regardless, this is a MASSIVE improvement. I recommend leaving the options in the .ini. No such thing as too many options. I figure the only thing left to fix is the bleeding, then.

    • Like 1
    Link to comment
    Share on other sites

    Thanks for your great work! Thanks to you this mod is progressing much faster than it usually would.

     

    I just stood up early before work to check if I can quickly fix something.

    Concerning bleeding: I now check if the health is below 5 and if so, I set it to 0 (maybe it got a negative value which bugged it out when bleeding more health than was left)?

    Concerning running threshold: I made it so the ini value is divided by 10, so you can now be more precise (-> if you set the ini to 29, the runningthreshold in the script will be 2.9).

    Concerning pushing: there are two booleans in the method I use (which indicate if the force and direction should be relative or not) - I added them to the ini, so you can try them out (they can be set to 0 or 1).

     

    Actually I could make it so that when an NPC is shot in both legs, it wont be able to move, but it would take me some time (I currently only check the last damaged bone, and if its any leg bone, they get the stumble-status - i will have to add booleans for each leg and fill them to have something to check for).

    Or maybe you would want them to instantly stumble when both legs are damaged? If you come up with a stumbling value which you want to be set when both legs are hurt, we could do that too (so it would be visible that theyre trying to walk, but they cant^^).

     

    PedDamOv_Beta_v3.zip

    Edited by HughJanus
    • Like 1
    Link to comment
    Share on other sites

    @HughJanusIt's been a pleasure to help out! About the new values, I'll try to find time to test them tomorrow. I may only be able to do so late at night, but I'll test them as soon as I can. If the bleeding is fixed and nothing else is broken, I'd recommend releasing this version as the official 1.2 update. It's already quite a leap from the previous version and feels feature-complete.

     

    As for the stumbling thing, it's fantastic that you can check whether both legs have been damaged. Problem is, for now, we have few behaviours to choose from. The problem with the DyingState and the KnockbackState is that the behaviour for both is usually very inactive, as if the enemy is in shock. This is fitting for a dying state, but not so much for a breathless state (Knockback) or for a non-fatally injured state (Stumbling). An enemy who's been knocked back by a bullet should be rolling uncomfortably on the ground (as if trying to get their breath back, or getting used to the pain of the wound) and an enemy who's been shot in both legs should be very, very agitated.

    So if I understand the current situation with the natives correctly, all we can do is drop the NPC into the dying behaviour if both legs have been shot. And that doesn't look right.

    There may be two workarounds to this:

    1 - If the "on fire" ragdoll behaviour can be triggered WITHOUT the fire, we may be able to simulate an agitated state from being shot in both legs. So an NPC would repeatedly stumble when shot in one leg, and enter the "on fire" behaviour when shot in both legs.

    2 - I noticed that, though the dying behaviour is very inactive, enemies still respond realistically to forces. So if you push them by walking into them, they'll turn around while in "living" ragdoll. In fact, this is determined by what caused the enemy to ragdoll in the first place. If they enter the dying behaviour from being shot in the leg, the ragdoll will seem more active because the leg keeps twitching slightly. If they entered the dying behaviour due to stumbling, they'll go into a protective fetal position if pushed around. And if they enter the dying behaviour from being shot from the torso upwards, they'll be more inactive (but still visibly alive).

    So the workaround would be to apply a small, constant force to the NPC while they're in the dying behaviour. The fact that the ragdoll is still being simulated as alive will result in the NPC constantly (but slowly) rolling around and readjusting their limbs into whatever their new position is, so it MIGHT look like they're moving themselves around instead of being pushed by something. It would make them seem much more active than they really are. However, in order to look right, the force would need to be applied constantly for a few seconds, stop for a few seconds, then be applied again in the other direction. Otherwise the NPC will just roll slowly but indefinitely in the same direction.

    Is anything like that even possible right now?

    PS: These workarounds are good for passive NPCs, but for aggressive ones, what would make sense would be for them to keep shooting at you from the ground. And that behaviour doesn't even exist in RDR 2. You know where it did exist? RDR 1. Enemies shot in both legs would be unable to leave their kneeling position (but still fire at you) and there was even a "crawling away" behaviour for fatally wounded enemies. Those behaviours aren't in RDR 2 at all, so they may only be possible once OpenIV figures out the files.

    Anyway. I'll get back to you on the new values as soon as I can. 🙂

    • Like 1
    Link to comment
    Share on other sites

    So I took an hour for some testing and tweaked the values a bit. I deleted some values from the ini (but you can still add them if you know how theyre called and they will overwrite the default settings) and attached the release candidate to this post. Please dont play around in the ini at first and just try it as it is (I used your suggested values and tweaked them a little bit). This would be my suggestion for a 1.2 release.

     

    Concerning the fire animation - I havent yet tried to find out the animation hashes, but I could give that a try.

    As for the slight pushes when in dying mode - I think thats a good idea, if it works as you expect it to. But I will have a hard time fiddling around with the values so the push is not noticeable but hard enough to actually trigger some behavior. Lets put that on our list for 1.3.

     

    We should really start making a list^^

    What I had in mind for 1.3:

    • chance of surviving bleedout (so not everyone will bleed out eventually)
    • finding out some animation hashes (i saw some animations where NPC are holding their arm while walking and stuff - would like to find out how to do that, but currently dont have any idea how^^)
    • special behavior when shot in both legs (dont know which behavior yet, maybe force pushing consistently but very weakly so it looks like stumbling/limping?)
    • disarming NPCs when shot in the hand (lawmen are almost un-disarmable)

    PedDamOv_1.2rc.zip

    • Like 1
    Link to comment
    Share on other sites


    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    ×
    ×
    • Create New...