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 32
  • Thanks 7
 Share

You may also like

  • Lenny's Mod Loader RDR
    By LMS
       2076221   736   5
  • RDR 2 Asi Loader
    By LMS
       1350245   158   5
  • Lenny's Simple Trainer
    By LMS
       1072725   1348   25
  • Red Dead Offline
    By LMS
       691738   438   12
  • Improvements in Blood
    By Cazanu
       59312   6   0
  • User Feedback

    Recommended Comments



    @HughJanusI just tested a bit more, and turns out the fleeing bug is more complicated than that. So a few additions to the video above (and then I'm done for the day 😄)


    - The fleeing bug apparently has to do with pathfinding as well. Just now I managed to pursue three lawmen who were running away from me (without stumbling). All three stopped dead when they came across an obstacle, such as a rock, a tree or the edge of a cliff. They were apparently incapable of running around stuff, they could only run in a straight line. Grabbing them and letting them go wouldn't cause them to resume fleeing. However, shooting them (i.e. causing them to ragdoll) made them flee again in a different direction (until they came across another obstacle). This explains why lawmen can apparently flee forever while stumbling: the ragdoll reorients them for some reason, making them pick a new direction free of obstacles.

    - I pursued two other lawmen who, for some godforsaken reason, DID flee around obstacles (without stumbling), and kept fleeing until they were unreachable. They did not stop more lawmen from spawning in. Those two lawmen behaved exactly the way the mod wants them to behave. No idea why. I didn't disarm them in a different way from the other ones, yet they knew how to run around obstacles, and they never stopped running until they disappeared from the minimap. So your code DOES work as intended sometimes, but I don't know what the trigger is.

    - I now know why that bug occurred at 01:31 in the video above. RunningThresholdBothLegs is interacting poorly with the tackle mechanic. During the tackle itself, the NPC speed is apparently higher than 20 and even 30, so the stumble mechanic kicks in mid-tackle. If RunningThresholdBothLegs is set to 50, it makes this much rarer (you can tackle the NPC if they're just about to start running again). So unless you can disable the stumble mechanic during a tackle, we may be unable to keep the RunningThresholdBothLegs under 50, unfortunately. Not without sacrificing the player's ability to tackle.


    As for the other things you said:

     

    - shooting without weapon in hand - no idea how I can circumvent that, I dont even know how that can happen^^

     

    And I can't find a consistent trigger for it, so I guess for now we just live with it 😄

    - headshots not killing - headshots do kill everytime if you hit the actual brain. If not, and the health is set high, it will only do more damage, not kill

     

    Oh! I get it now. I hadn't accounted for the higher health.

    - stumbling although not shot in leg - the mod checks for a damaged leg, so if an NPC falls down and hurts its leg, that counts too

     

    That's what I figured. I think I like that feature. 😄

    - not fleeing after aggressive behavior and then being shot - that is the way it is now, the aggressive behavior is the standard behavior (which hits if the randomizer spits out a number above 74) - everything that happens here has nothing to do with the mod (except for the NPC being disarmed, which is not possible in vanilla)

     

    I mentioned it because of the health check you've coded, the one that compares the ped's current health with their health before being disarmed.  "*check if any NPCs health you wrote down is now less* if so *make NPC flee*" I take it this doesn't work if the randomizer hits the aggressive (vanilla) behaviour, then?

    NPC not being disarmed despite having been shot in the hand - I dont know the IDs of all hand bones yet - I only have two finger bones of the right hand and the forearm - I currently dont have more - if you hit one of the unknown bones, nothing will happen

     

    Ah, I see. That makes sense.

    • Like 1
    Link to comment
    Share on other sites

    58 minutes ago, fitfondue said:

    @HughJanusI just tested a bit more, and turns out the fleeing bug is more complicated than that. So a few additions to the video above (and then I'm done for the day 😄)


    - The fleeing bug apparently has to do with pathfinding as well. Just now I managed to pursue three lawmen who were running away from me (without stumbling). All three stopped dead when they came across an obstacle, such as a rock, a tree or the edge of a cliff. They were apparently incapable of running around stuff, they could only run in a straight line. Grabbing them and letting them go wouldn't cause them to resume fleeing. However, shooting them (i.e. causing them to ragdoll) made them flee again in a different direction (until they came across another obstacle). This explains why lawmen can apparently flee forever while stumbling: the ragdoll reorients them for some reason, making them pick a new direction free of obstacles.

    - I pursued two other lawmen who, for some godforsaken reason, DID flee around obstacles (without stumbling), and kept fleeing until they were unreachable. They did not stop more lawmen from spawning in. Those two lawmen behaved exactly the way the mod wants them to behave. No idea why. I didn't disarm them in a different way from the other ones, yet they knew how to run around obstacles, and they never stopped running until they disappeared from the minimap. So your code DOES work as intended sometimes, but I don't know what the trigger is.

    - I now know why that bug occurred at 01:31 in the video above. RunningThresholdBothLegs is interacting poorly with the tackle mechanic. During the tackle itself, the NPC speed is apparently higher than 20 and even 30, so the stumble mechanic kicks in mid-tackle. If RunningThresholdBothLegs is set to 50, it makes this much rarer (you can tackle the NPC if they're just about to start running again). So unless you can disable the stumble mechanic during a tackle, we may be unable to keep the RunningThresholdBothLegs under 50, unfortunately. Not without sacrificing the player's ability to tackle.

     

    I will try another method for the fleeing and see if anything changes.

    As for the tackling - does it only occur with both legs or with one leg also? Because in the one leg logic, I check if the NPC is running or sprinting (and is over the runningthreshold), in the bothlegs logic I only check for the runningthreshold (so they also stumble when walking faster).

    If it only happens for bothlegs, I guess I will add the running and sprinting check to this logic too.

     

    1 hour ago, fitfondue said:

    - not fleeing after aggressive behavior and then being shot - that is the way it is now, the aggressive behavior is the standard behavior (which hits if the randomizer spits out a number above 74) - everything that happens here has nothing to do with the mod (except for the NPC being disarmed, which is not possible in vanilla)

     

    I mentioned it because of the health check you've coded, the one that compares the ped's current health with their health before being disarmed.  "*check if any NPCs health you wrote down is now less* if so *make NPC flee*" I take it this doesn't work if the randomizer hits the aggressive (vanilla) behaviour, then?

     

    Thats correct. The fleeing when losing health only works for hands up and cowering :)

    • Like 1
    Link to comment
    Share on other sites

    9 minutes ago, HughJanus said:

    As for the tackling - does it only occur with both legs or with one leg also? Because in the one leg logic, I check if the NPC is running or sprinting (and is over the runningthreshold), in the bothlegs logic I only check for the runningthreshold (so they also stumble when walking faster).

    If it only happens for bothlegs, I guess I will add the running and sprinting check to this logic too.

     

    I just confirmed that with the one leg it doesn't happen, even if it has the same values as both legs. Your running and sprinting checks do indeed solve the problem, it seems 🙂

    • Like 1
    Link to comment
    Share on other sites

    Tried to fix the fleeing. Have only tested for ~10mins but couldnt reproduce the looping during that time.

    The chances are now as follows (kept cowering and hands up but set it to low chances, just for variety):

    • 5% chance of hands up happening -> if done more than 5 damage in that state, NPC will flee
    • 5% chance of cowering -> if done more than 5 damage in that state, NPC will flee
    • 45% chance of being aggressive (standard behavior) -> if done more than 40 damage in that state, NPC will flee (if you disarm the NPC a second time during decreasing the 40 health points (e.g. knife), the chances are again the same for every behavior as it was with the first disarming)
    • 45% chance NPC will flee instantly

     

    I have also added some checks to bothlegs damaged -> is running, is sprinting, is walking (not included in oneleg checks), is going for cover.

    The zvalue for the head bone I have set to be divided by 1000 -> so if you set it to 99 it will be 0,099 when checking in the code.

    PedDamOv_1.3a7.zip

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

    @HughJanus Coming to say again, thanks for the great mod! I was wondering if you would know anything about the following:

     

    1)Do you know/are you capable of removing the field of view 'zoom' that occurs when using iron sights? Is this something that can be removed?

    2)Would there be a possibility to enable a bleed-out timer on first bullet hit? not just when enemies have been downed? As far as I am aware this is not in but I may be wrong.

    Enjoy your Tuesday!

     

     

     

    Link to comment
    Share on other sites

    3 hours ago, k1ng.j3w said:

    @HughJanus Coming to say again, thanks for the great mod! I was wondering if you would know anything about the following:

     

    1)Do you know/are you capable of removing the field of view 'zoom' that occurs when using iron sights? Is this something that can be removed?

    2)Would there be a possibility to enable a bleed-out timer on first bullet hit? not just when enemies have been downed? As far as I am aware this is not in but I may be wrong.

    Enjoy your Tuesday!

     

    1) I dont really know what you mean 😕

    2) There is already a feature like that, but its not activated. You can add the parameter "BleedWhenShot" and "BleedingChanceShot" (see the changelog of v1.2 for more information).

    Link to comment
    Share on other sites

    Hi again Hugh,

    sorry I should have been more specific. I mean when you look down the sights in first person the camera zooms in, I am wondering if this can be removed. 🙂

    Link to comment
    Share on other sites

    fitfondue

    Posted (edited)

    @HughJanus I am very, very glad to report that you did it. Disarming works great now. Lawmen flee indefinitely and are appropriately despawned, so that new lawmen keep coming in naturally. And if a lawman decides to keep attacking you, disarming them again will often make them flee. The only outstanding bugs I've seen are the incomplete-looking guns that lawmen drop and (rarely) lawmen aiming invisible guns at you.

    Suggestions:

     

    - Removing cower behaviour to see if it fixes the invisible gun problem. It may be a result of the "cower" behaviour not being compatible with lawmen, so it malfunctions. I have yet to see a lawman cower (but they do put their hands up every now and then, so that is working properly).

     

    - Making dropped guns despawn after a minute or so, otherwise the minimap gets littered with gun icons, and they probably hurt the framerate over time.

     

    - Disabling knockdown states for the right arm and the gun. Right now, enemies will often go into the knockdown state and fall over after being disarmed. Not only does that look overdramatic given the wound, but it also makes the player wait in order to find out whether the enemy is going to flee or attack. Without the knockdown behaviour, the enemy instantly makes the decision, so you can disarm someone, instantly know whether or not they're still a threat, and move on to other enemies.

     

    As for the tackling bug: also fixed. You can tackle someone who's been shot in both legs now. Not always: if you screw up the timing, you can end up kicking them instead. But if you press F while they're not ragdolling, you'll tackle them with no problems. The only bugs: NPCs still "stumble" on horseback (yep, even with the checks in place. Apparently the game counts this as "running or sprinting") and RunningThresholdBothLegs=20 is still too low for gunfights. Somehow, enemies are still susceptible to that glitch I mentioned, the one where the force push makes them "twitch" (without ragdolling) while they're shuffling around firing at you. So my suggestions for this:

    - Checking to see if NPC is on horse and disabling stumbling entirely in that case

    - Maintaining a minimum of 30 for running thresholds to avoid the glitching.

     

    And finally, ZValueForHeadBone: still not working. At 0, it disables force push completely. At any positive OR negative value, it enables it completely. I tried a high range of values, from 1 to 350000 (both negative and positive). At no point was force push disabled. So that one's still a mystery.

    Regardless, amazing work! You pulled off an incredible feature that makes shootouts more complex and varied. 🙂

    EDIT: By the way, I accidentally discovered a really cool feature: you can grapple someone who's in a knockdown or dying state. If you holster your weapon, lock on to the NPC and press E, Arthur will grab them in the low grapple position, and he can pull them up into the standing grapple and perform all the usual interactions. If they ragdoll again, they'll stay down, but until they ragdoll, they'll behave normally. It works surprisingly smoothly.

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

    @HughJanus Three additional bugs I encountered:

    1 - Don't know if this is a bug or an intended feature, but melee damage is definitely altered. If NPCs have high health, melee fights will take very long, unless you pull the NPC into a low grapple and punch them repeatedly. The low grapple punch is hardcoded to knock out the enemy after a few punches, regardless of health. Otherwise, melee takes very long now. If the NPC health is set to vanilla 100, it works normally.

     

    2 - The game doesn't deal very well with having a lot of NPCs in dying states, since they're in active ragdoll so the game has to keep running physics simulations on everyone. It also leads to the interaction bug I mentioned above: the dying NPCs are still hostile to you but incapable of moving, so the game keeps you in "hostile" mode until those NPCs die. In that mode, interactions are disabled. Since the enemies never die, the problem doesn't go away. For the sake of performance, it might be a good idea to have bleed-out activated by default, at a value that takes 30 seconds to 2 minutes to kill an NPC. That way it ensures that NPCs will, at some point, despawn, avoiding bugs and framerate dips. The .ini could still have the option to disable bleed-out, but with a warning that it might kill performance and cause bugs in large firefights.

    3 - Minor bugs: some NPCs in knockdown/dying states will keep cocking their revolvers repeatedly, and will taunt you with the typical combat dialogue as if they're still up and shooting at you. Those bugs are not new nor do I consider them a priority, but they're worth mentioning.

    • Like 1
    Link to comment
    Share on other sites

    Dude, we might need a bugtracker lol

    Would it be better if disarmed enemies dont drop their guns, but they just disappear?

    Melee damage wasnt altered, but of course if their health is higher, they take longer to knock out with the same damage done by punches 🙂

    I could implement a parameter for melee damage (so you can set it the way you want).

    The taunting could maybe be helped, but I havent tried anything yet.

    The bleedout will be enabled, I just disable it, so I can check on different stuff without the NPCs dying.

    Checking for if NPC is on horse is a good idea.

    Disabling the knockdown states for disarming might be tricky - Ill have to see about that.

    Invisible guns dont come from cowering - I have tested the disarming feature before doing anything with the disarming behavior and they were partly invisible from the beginning (I think it has something to do with the guns parts - the ones you can modify seem to be invisible).

    Setting the running threshold to 30 at bothlegs hurts my heart, but I guess there wont be another option 😢

     

    Thanks for always testing so thoroughly!!

    I think we might have to extend our excel so we can write down all the bugs and tackle them one by one.

    • Like 1
    Link to comment
    Share on other sites

    Oh and concerning the first person zoom thing - I would have to take a look at that separately, but I wont have the time (I'll be working on the Ped Damage Overhaul).

    I suppose it is possible with the methods we already have (after doing a quick search), but to actually implement it and test it would take time I would rather spend on the Ped Damage Overhaul, since things are flowing so well currently.

    Sorry, guys. Maybe at a later point in time.

    Link to comment
    Share on other sites

    @HughJanusAddressing your points:

    Would it be better if disarmed enemies dont drop their guns, but they just disappear?

     

    Honestly, I prefer the guns still existing, even if they're missing parts. It makes the disarming more satisfying if the player sees something being shot out of the enemies' hands, and also it provides visual feedback. Makes it easier to tell that the enemy has been disarmed.

    Melee damage wasnt altered, but of course if their health is higher, they take longer to knock out with the same damage done by punches

     

    Oh! I thought melee damage was a separate thing. The disclaimer in this mod's description reads "DISCLAIMER: melee damage has not been altered, since fistfights will otherwise turn into an odyssey". That's why I mentioned it; I thought it wasn't intentional.

    Invisible guns dont come from cowering - I have tested the disarming feature before doing anything with the disarming behavior and they were partly invisible from the beginning (I think it has something to do with the guns parts - the ones you can modify seem to be invisible).

     

    Oh, what I call the "invisible gun bug" isn't the same as the guns missing parts: it's the NPCs behaving as if they have a gun without having a gun. Like, you disarm them and they keep acting as if they have a gun and are firing it at you, but there's no gun. That's what I think may be caused by a malfunction of the "cower" behaviour.

    Setting the running threshold to 30 at bothlegs hurts my heart, but I guess there wont be another option

     

    Yeah, I'd love it if the stumbling worked at walking speed, but more often than not it just causes glitches because there isn't enough momentum. The amount of force necessary to tip over an NPC who isn't running looks very unnatural.

    I think we might have to extend our excel so we can write down all the bugs and tackle
     them one by one.

     

    I did actually start listing the bugs for each feature on my comments today, but there are a few recurring bugs not mentioned there. I'll start a "Known Issues" column

    • Like 1
    Link to comment
    Share on other sites

    Thank you HughJanus for making such a great mod, and thank you for your continuous efforts, especially Fitfondue. Thank you for your contribution. 
    I have been looking forward to this mod update. 
    Allow me to talk about some problems I found today when I tested with 1.3a7. 
    q1   
    This question was mentioned by Fitfondue. When I was shooting with the police, some police officers did not have guns in their hands, but they still had guns. This feels a bit weird, can this be fixed?
     q2    
    When I hit a leg of the policeman with a gun, the policeman fell, then stood up and continued to shoot at me, and then I ran away. The policeman chased me or ran away. When the policeman ran after me or ran away, he fell down. and ran two or three steps and fell again, and then   repeat this all the time. I don't think this is very reasonable. I think it is possible to set the police to run a little longer and then fall, or how to set it to look more reasonable and more comfortable It would be great if it could be set up that the police slowly dragged their legs or chased me while holding their legs. 
    q3 
    The police will appear to want to fall but not really fall, which looks strange. Wondering if i can fix it.
    q4 
    When I hit the police's two legs, the police would fall, then stand up and continue shooting at me, then the problems mentioned in q3 above would occur. According to what you said before, after hitting two legs, the police will fall down and never stand up again. I wonder if this has something to do with the health value being set too high. 
    q5 
    When the police or npc falls, he will not stand up again (not really dead). Arthur cannot carry the police. At this time, if the police can be picked up directly, it can only be picked up after using a rope or after the police really die. I think this is possible? 
    Thank you so much for making this great mod, thank you.

    Link to comment
    Share on other sites

    New in this version:

    • removed chance for cowering in the disarming logic (replaced it with hands up, just for testing) -> so you can see if the invisible guns bug disappears
    • z-coord of head: altered the check to this: the z-coord of the left and right calf are checked against the z-coord of the head bone minus the value of the ini parameter. If the calves are lower than the z-coord of the head bone minus the ini parameter, dyingpush is triggered. In code: if ((vec_calf_left.z < (vec_head.z - ini_zvaluehead)) && (vec_calf_right.z < (vec_head.z - ini_zvaluehead))) then do stuff ----> has to be tweaked, i havent done nothing in the ini yet
    • tried to reduce the knockbackchance when disarming (dont know if I can do it further without having to touch the normal knockback feature)
    • if disarming-lasso is enabled, the disarmed NPCs should now also show the same behavior as when disarmed by gunshot
    • for the falling I have added an ini parameter -> falldamage -> the value which is set, will be deducted from the NPCs health for every script loop (every ~millisecond) while the NPC is falling - maybe this way we can let them take proper fall damage
    • disabled the stumbling when NPC is on mount

    the lasso will always disarm before reaching the NPC, because I can only check if an NPC is targeted and if the lasso was fired, but not if the lasso actually caught someone.

    I dont know how to make dropped guns disappear, unfortunately, so we either have to drop them and let them lie around or let them disappear on disarming.

     

    Coding took some time, so I didnt have time to test those things thoroughly 😕

     

    PedDamOv_1.3a8.zip

    • Like 1
    Link to comment
    Share on other sites

    3 minutes ago, HughJanus said:

    Coding took some time, so I didnt have time to test those things thoroughly 😕

     

    Will test right now! Feedback will come shortly

    Link to comment
    Share on other sites

    @lufanlun

    q1   
    This question was mentioned by Fitfondue. When I was shooting with the police, some police officers did not have guns in their hands, but they still had guns. This feels a bit weird, can this be fixed?

    I tried to fix it using the suggestion by fitfondue. We will see if this helped.


     q2    
    When I hit a leg of the policeman with a gun, the policeman fell, then stood up and continued to shoot at me, and then I ran away. The policeman chased me or ran away. When the policeman ran after me or ran away, he fell down. and ran two or three steps and fell again, and then   repeat this all the time. I don't think this is very reasonable. I think it is possible to set the police to run a little longer and then fall, or how to set it to look more reasonable and more comfortable It would be great if it could be set up that the police slowly dragged their legs or chased me while holding their legs. 

    Unfortunately we cant assign animations yet, because the current version of OpenIV is not yet compatible with RDR 2, so we cant take a look at the animations. Stumbling and falling is the best we can do for now.


    q3 
    The police will appear to want to fall but not really fall, which looks strange. Wondering if i can fix it.

    Set the runningthreshold for both legs from 20 to 30 in the ini, this should fix it.


    q4 
    When I hit the police's two legs, the police would fall, then stand up and continue shooting at me, then the problems mentioned in q3 above would occur. According to what you said before, after hitting two legs, the police will fall down and never stand up again. I wonder if this has something to do with the health value being set too high. 

    no, if someone is hit in both legs they will stumble more frequently. NPCs only stay down if under dyingthreshold.


    q5 
    When the police or npc falls, he will not stand up again (not really dead). Arthur cannot carry the police. At this time, if the police can be picked up directly, it can only be picked up after using a rope or after the police really die. I think this is possible?
     

    What is possible?

    The status you are describing is the dyingthreshold and is known to behave this way. There is no way around that, unfortunately. If we want the NPC to ragdoll, we cant pick it up.
     

    Link to comment
    Share on other sites

    @HughJanus

     

    removed chance for cowering in the disarming logic (replaced it with hands up, just for testing) -> so you can see if the invisible guns bug disappears

     

    The bug is still there, but now I understand it better. It only happens if the NPC is disarmed while still having a revolver in the holster. Here's what happens: 1 - The NPC is disarmed. 2 - The NPC decides to keep attacking. 3 - Instead of drawing their revolver, they "fire" an invisible gun. 4 - If that NPC makes it to cover, they'll draw their actual revolver and start firing real bullets. 5 - If there's no cover nearby, NPC will indefinitely "fire" an invisible gun. If you shoot them again, they're likely to flee.

     

    This doesn't happen in every occasion. Many times, an NPC will draw their actual revolver right away. But sometimes they'll do what I described above. It doesn't seem related to the knockback ragdoll. I disabled it entirely as a test and the bug kept happening. The hands-up animation also appeared normally every now and then, but it may be contributing to the bug somehow.

     

    My recommendation? We should debug the hands-up animation, just to be safe. If you remove it from the next build, I'll test to see if the bug is gone. If it's still there, we'll know for sure the conflict is somewhere else.


    z-coord of head: altered the check to this: the z-coord of the left and right calf are checked against the z-coord of the head bone minus the value of the ini parameter. If the calves are lower than the z-coord of the head bone minus the ini parameter, dyingpush is triggered. In code: if ((vec_calf_left.z < (vec_head.z - ini_zvaluehead)) && (vec_calf_right.z < (vec_head.z - ini_zvaluehead))) then do stuff ----> has to be tweaked, i havent done nothing in the ini yet

     

    Not working,  in fact it's actually worse than before. ZValueForHeadBone somehow disables forcepush entirely, regardless of value. Positive, negative, 0, it's just fully disabled no matter what the value is. So yeah, in this version of the mod, there's just no force push. 😄 At this point I feel I should reiterate that the force push "twitching" is a fairly minor issue (most times it's not even noticeable), so if this is too much of a headache for now, I'm okay with not fixing it yet. We can temporarily ignore it.

    tried to reduce the knockbackchance when disarming (dont know if I can do it further without having to touch the normal knockback feature)

     

    This one's hard to judge. It SEEMS to be happening less frequently, but it's still happening quite frequently. For gameplay and pacing purposes, I think it would be best if knockback never happened when disarming, so in my opinion it's worth reworking the logic to make that happen. But you're the one doing the actual coding, so of course, it's up to you 🙂

    if disarming-lasso is enabled, the disarmed NPCs should now also show the same behavior as when disarmed by gunshot

     

    Can confirm, it's working.

     

    disabled the stumbling when NPC is on mount

     

    Can confirm, it's working.

    for the falling I have added an ini parameter -> falldamage -> the value which is set, will be deducted from the NPCs health for every script loop (every ~millisecond) while the NPC is falling - maybe this way we can let them take proper fall damage

     

    The trigger is working, but may I suggest a different approach? Because this incremental damage while falling is likely to kill the NPC before they even hit the ground. So how about this: if NPC health > 100 when they fall, lower it to 100. And if it is already 100 or less, do nothing. That way you always ensure that the fall damage will behave like in vanilla, regardless of how high the player sets NPC health.

    • Like 1
    Link to comment
    Share on other sites

    @HughJanus Correction: lasso disarms have new problems and aren't quite equivalent to bullet disarms yet. The most serious problem:

     

    - Fleeing lawmen don't despawn like in the bullet disarms. In fact, they seem to stop fleeing and turn back to hostility, however by the time they do it, they're so far from the player that they just stay still and prevent more lawmen from spawning in. If you open up the map, you'll see the lawmen standing still. If you go up to them, they'll attack you bare-fisted once they see you.

     

    And the minor bugs:


    - NPCs don't seem to pull out knives. They do sometimes attack bare-fisted.

     

    - There was one case in which a lawman did not let go of his revolver. But that seems quite rare.

    • Like 1
    Link to comment
    Share on other sites

    12 hours ago, HughJanus said:

    Oh and concerning the first person zoom thing - I would have to take a look at that separately, but I wont have the time (I'll be working on the Ped Damage Overhaul).

    I suppose it is possible with the methods we already have (after doing a quick search), but to actually implement it and test it would take time I would rather spend on the Ped Damage Overhaul, since things are flowing so well currently.

    Sorry, guys. Maybe at a later point in time.

    No problem 🙂 thought i'd mention it, might have a play around when openIV gets updated 

     

    Thanks for the great work!

    Link to comment
    Share on other sites

    The lasso fleeing behavior is weird, because I use exactly the same native to make them flee 😮

    I will try your version of fall damage in the next version, but I dont know if it already counts as falling if an NPC is being shot and falling to the ground (thats why I chose the approach of decreasing health).

    Concerning the z-coords - I guess we just let it the way it is now (before the last two updates) and look at that topic again later.

    For making it impossible for disarming to trigger the knockback, I will have to do some work. I'll see how fast I can come up with that.

    For the next version I will also remove the hands up behavior for testing (but I dont suppose this is gonna solve it). I have an idea why this bug occurs: lawmen are usually hard to disarm when holding rifles and impossible to disarm when holding guns. When I force the disarming of a rifle, although it would not normally disarm, maybe the NPC still "thinks" it is holding a weapon..? (because maybe when disarmed with rifle, it automatically gets the gun) But thats just a guess into the blue^^

    • Like 1
    Link to comment
    Share on other sites

    @HughJanus 

     

    The lasso fleeing behavior is weird, because I use exactly the same native to make them flee

     

    Yeah, it's weird, for some reason the fleeing state just cancels out after a while and the NPC reverts to hostility. 

     

    I will try your version of fall damage in the next version, but I dont know if it already counts as falling if an NPC is being shot and falling to the ground (thats why I chose the approach of decreasing health).

     

    The game seems to draw a distinction. The situation is tipically this: I set DyingThreshold so high the enemy dies in one shot. Let's say I shoot an enemy who's on a rooftop, and they stagger off the edge and fall. They're under the DyingThreshold, so after falling, they shouldn't be able to stand up again. But they do stand up. And this seems to be because the game goes "oh, he's straight up falling now, let's switch to the proper ragdoll behaviour". And this jolts the NPC out of your mod's ragdoll behaviour, much like grappling them on the ground does. They have to ragdoll again in order to stay down.

    Making fall damage the same regardless of health is a very good tweak to the code overall, but that "dying state cancel" bug (as I call it) may require a different solution to counteract it. Falls would have to be accounted for so your code can enforce the ragdoll after the dying state. But honestly, this is a very minor bug, and not worth dealing with right now in my opinion (unless it's an easy fix).

    Concerning the z-coords - I guess we just let it the way it is now (before the last two updates) and look at that topic again later.

     

    I agree. Actually, on 1.3a7 the force push was fine, so only the last update introduced problems.

     

    For making it impossible for disarming to trigger the knockback, I will have to do some work. I'll see how fast I can come up with that.

     

    No worries, take your time 🙂

    For the next version I will 
    also remove the hands up behavior for testing (but I dont suppose this is gonna solve it). I have an idea why this bug occurs: lawmen are usually hard to disarm when holding rifles and impossible to disarm when holding guns. When I force the disarming of a rifle, although it would not normally disarm, maybe the NPC still "thinks" it is holding a weapon..? (because maybe when disarmed with rifle, it automatically gets the gun) But thats just a guess into the blue^^

     

    I don't think removing "hands up" is gonna solve it either, but it's worth checking, and at the very least it'll make it easier to test the problem. And hey, your suggestion makes a lot of sense: what if it's the BONE that leads to the disarm? I think your code is more "generous" with how many bones lead to a disarm, so the problem may be caused by a specific bone being hit. I'll test that possibility on the next version. There's a complicating factor, which is that the NPC DOES draw a revolver when they get to cover. In that situation, the game goes "whoops, NPC isn't holding a gun". But it doesn't realize that until the NPC goes into cover.
     

    • Like 1
    Link to comment
    Share on other sites

    @HughJanus I tested a bug someone else pointed out on Nexus, and yep, it exists. PlayerHealth makes the player invincible at any value except 0. At 0, you can make the player take damage normally, but you can't make the player die with less damage. It's either vanilla health or invincibility. This is true for negative values also.

     

    Another thing about the lasso disarm: you could also consider it a very minor bug, because it occurs with lawmen, and there's very few reasons to lasso a lawman, especially during a firefight with the law. In order to make the bug happen, I had to lasso several lawmen during a firefight and let them flee. If a player is playing without invincibility on, lassoing lawmen during a firefight will get you killed in seconds. So it's an edge case. If you don't find an easy fix, I'd say it's not worth spending too much effort on it right now.

    • 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...