Jump to content
Sign in to follow this  
tpw

TPW FALL: realistic infantry falling system

Recommended Posts

That's a good mod, I started to use it with the jump addon :)

One suggestion though, since there's a fall each time a bullet hit you, could you add a subtle fade to black to simulate surprise and pain ? because as of now, when you go deathmatch you fall often and that's the main feedback.

On the animation side, it's a little shame that only right or left fall are possible... I imagine it would be so much better with front and back fall.

Anyway, thanks for the addon !

Thanks NikoTeen. Unfortunately the only animations I have to work with are left and right falls. Patiently waiting for a ragdoll command...

I'm hesitant to add a fade to black when hit, since the engine already does some post processing, blurry red etc. And TPW FALL already adds a shout when hit as additional feedback. One thing I've learned from TPWCAS is that there is no way to simulate fear/shock/pain etc that pleases everyone!

Share this post


Link to post
Share on other sites

I seen an enemy fall to his side and could have sworn he fired from that side prone position -was it my imagination? Twas awesome :)

Share this post


Link to post
Share on other sites
I seen an enemy fall to his side and could have sworn he fired from that side prone position -was it my imagination? Twas awesome :)

Not your imagination, I see it too and think it looks cool also!

Share this post


Link to post
Share on other sites

Yeah I saw that too. Looks absolutely great although maybe a bit too precise when it comes to AI. Would've been great if their precision lowered to minimum while they fall before they are back on their feet. That would make AI look as if they are squeezing the trigger out of pain / in panic when getting hit and falling.

Share this post


Link to post
Share on other sites
Yeah I saw that too. Looks absolutely great although maybe a bit too precise when it comes to AI. Would've been great if their precision lowered to minimum while they fall before they are back on their feet. That would make AI look as if they are squeezing the trigger out of pain / in panic when getting hit and falling.

Excellent idea mate, I will implement it ASAP!

Share this post


Link to post
Share on other sites

Just to let you know that I think I have managed to knock together a (hackish) ragdoll implementation. When a unit is hit:

1 - The unit's speed, direction, position and unit type are determined

2 - A "dummy" unit is created with the parameters above

3 - The original unit is hidden

4 - The dummy is killed with setdamage 1 and ragdolls to the ground

5 - The rough direction of the dummy on the ground is determined

6 - The dummy is removed and the original unit is unhidden on the ground in roughly the same orientation as the dummy.

7 - The original then plays a getup animation and returns to whatever it was doing

This can't be anything other than a crude hack because:

a - there is no smooth transition to/from the ragdoll position.

b - the dummy is blood stained (setdamage 1)

In preliminary testing though it certainly looks OK, especially from a distance, and gives a lot more variety to the fall than the left/right animations I've been using.

I will put a testing script version up shortly if anyone is interested in helping me improve this.

Share this post


Link to post
Share on other sites

TWP FALL v1.08: https://dl.dropboxusercontent.com/u/481663/TPW_FALL_108.zip

Changes:

  • Ragdoll emulation on live units when hit by bullets/explosions.
  • Hit units will randomly fall either using builtin animations or ragdoll.
  • Skills are reduced for the duration of a fall.

This is a test version, not released on the 1st post yet. Please test it out and let me know if it's working for you.

Please be aware that the ragdolling really is a bit of a hack, and the transitions to/from ragdoll state are not smooth and seamless (and probably never will be).

For those interested in the ragdoll emulation function

//RAGDOLL EMULATION FALL
_tpw_fall_fnc_ragdoll =
{
private ["_skill","_pos","_dir","_speed","_desc","_typ","_grp","_body","_eyepos","_ang"];
//REDUCE SKILL
_skill = skill _unit;
_unit setskill 0.01;

//GET INFO ABOUT HIT UNIT
_pos = getposasl _unit; // position
_dir = direction _unit; // direction
_speed = velocity _unit; //speed
_desc = getdescription _unit;
_typ = _desc select 0; // type of unit

// CREATE DUMMY
_grp = creategroup west;
_body = _grp createUnit [_typ, [0,0,0], [], 0, ""];
_body setposasl _pos;
_body setvelocity _speed;
_body setdir _dir;

// HIDE UNIT
_unit hideobject true;
_unit setvelocity [0,0,0];
_unit enablesimulation false;

// KILL DUMMY
_body setdamage 1;
sleep 3 + random 5;

// GET ROUGH DIRECTION OF DUMMY ON GROUND
_pos = getposasl _body;
_eyepos = eyepos _body;
_ang = ((((_eyepos select 0) - (_pos select 0)) atan2 ((_eyepos select 1) - (_pos select 1))) + 360) % 360;

//REMOVE DUMMY
deletevehicle _body;

// SHOW UNIT IN ROUGHLY SAME DIRECTION AS DUMMY, GETTING UP
_unit enablesimulation true;
_unit switchmove "AmovPpneMstpSnonWnonDnon_AmovPercMstpSnonWnonDnon";
_unit setposasl _pos;
_unit setdir (_ang);
_unit hideobject false;

//RESTORE SKILL
_unit setskill _skill;	
};

Share this post


Link to post
Share on other sites
Not your imagination, I see it too and think it looks cool also!

Oh yes I've seen it too. Fantastic!

Share this post


Link to post
Share on other sites
Yes. The system is slightly probabilistic, in that a 2m fall might be interpreted at between 1.8-2.2m. If you set sensitivity to 50% then the system will interpret a 2m fall as 0.9-1.1m.

The fact is, the default engine allows you to run around Agia charging off the edge of the 2m canals with no penalty. With TPW FALL at its default settings you can't do that without falling. If that doesn't suit you then you can either adjust sensitivity (and don't quibble my wording), or not use it. Getting on here and unapologetically telling the author who volunteered this mod that you don't like his work and find it unrealistic without even having explored the configuration options is pretty much a guaranteed way to piss said author off.

Sorry, i have to correct myself. With a sensitivity of 50, it feels better for me. Falls from around 2m will result in a "fall" animation, falls from around 0.5-2m will result in a kneel.

To defend my point, you gotta admit, that the description of the sensitivity is a bit vague.

I hope you are still open for some feedback.

-There seems to be a small randomized delay between a fall and the crouch animation. About with a probability of around 20-30% that delay is quiet short (i'd say 0.2 seconds) and not really noticeable. But the other 70-80% this delay increases to around 0.5-0.8 (hard to say) and this hurts the immersion a little bit. Maybe you could get rid of this delay or generally shorten it?

-If you fall to the ground (side prone stance animation) and you press or hold the "walk/run forward" key (default W) before the stand up animation is complete, the soldier will go through several different stance before standing up completely. Like: "He falls down to the right prone stance then falls over to the left prone stance, stands up, goes crouch, lies down and stands up completely". Is this intended to "prevent" a fast stand up? Otherwise i'd advise you, to look into this "bug".

Share this post


Link to post
Share on other sites

I think the delay is most likely process time, on my mission when you first start out it is super quick but later as it starts lagging do to ragdolls and stuff it gets a bit slow and delayed.

and lol Predator. I think you have discovered a breakdance bug.

Share this post


Link to post
Share on other sites

with 1.08 after getting shot and ragdolled to the ground soldiers sometimes have their rifle put on the back which they need to waste time getting into their hands again

Another issue - if a soldier is prone, when shot he immediately stands up and then the ragdoll starts happening which doesn't look good

Share this post


Link to post
Share on other sites
with 1.08 after getting shot and ragdolled to the ground soldiers sometimes have their rifle put on the back which they need to waste time getting into their hands again

Another issue - if a soldier is prone, when shot he immediately stands up and then the ragdoll starts happening which doesn't look good

Getting these too.

Share this post


Link to post
Share on other sites

Thanks for all the useful feedback everyone, it's very much appreciated.

@Predator: The delay between landing and kneeling is because I had to change from using switchmove (which plays immediately) to playmove (which finishes the previous animation first) with recent dev builds, which wouldn't play the kneeling animations at all using switchmove. I keep checking if this has changed back, but not so far. The "breakdance" bug is most likely because with your reduced sensitivity you have to jump from higher to fall prone, which means the engine is probably registering the fall as a hit, which in turn means that it is playing fall animations for both the fall itself, and the "hit" of the fall. I'll see if I can add some kind of exclusion.

@metalcraze, @petek: the weapon on back thing is just because for the test build I used a "one size fits all" unarmed get back up animation. Today's coding goal is to replace it with weapon specific ones. Unfortunately the animation choices are a bit limited. This all gets back to my caveat that ragdoll transitions are always going to be a bit rough. Prone units shouldn't ragdoll, I made not being prone one of the conditions of ragdolling. I will investigate further.

Thanks again. OK, off to Notepad++ I go....

Share this post


Link to post
Share on other sites
Thanks for all the useful feedback everyone, it's very much appreciated.

@Predator: The delay between landing and kneeling is because I had to change from using switchmove (which plays immediately) to playmove (which finishes the previous animation first) with recent dev builds, which wouldn't play the kneeling animations at all using switchmove. I keep checking if this has changed back, but not so far. The "breakdance" bug is most likely because with your reduced sensitivity you have to jump from higher to fall prone, which means the engine is probably registering the fall as a hit, which in turn means that it is playing fall animations for both the fall itself, and the "hit" of the fall. I'll see if I can add some kind of exclusion.

@metalcraze, @petek: the weapon on back thing is just because for the test build I used a "one size fits all" unarmed get back up animation. Today's coding goal is to replace it with weapon specific ones. Unfortunately the animation choices are a bit limited. This all gets back to my caveat that ragdoll transitions are always going to be a bit rough. Prone units shouldn't ragdoll, I made not being prone one of the conditions of ragdolling. I will investigate further.

Thanks again. OK, off to Notepad++ I go....

Once again Sir you are a star! I don't think I can ever go back to playing vanilla. I can't cope when I see a unit get shot and "twitch" anymore;-)

Thanks again

Share this post


Link to post
Share on other sites

TPW FALL v1.08 test 2: https://dl.dropboxusercontent.com/u/481663/TPW_FALL_108.zip

Changes:

  • High falls will no longer trigger hit falling animations.
  • Weapon specific transitions from ragdoll.
  • Ragdoll is dependent on damage to better represent the shock of taking a hit from a larger calibre projectile or big explosion. Unit hit by a pistol or silenced round probably won't ragdoll.
  • Ragdoll does not apply to player.

I can't replicate the ragdoll when hit from prone thing.

@petek: thanks mate, I really appreciate it. Every mod maker's ambition is to hear someone say "I can't play the game without your mod".

Edited by tpw

Share this post


Link to post
Share on other sites

AI seem to stop shooting at ragdolled enemies. Thinking they are dead? Because in CQB that often ends in AIs getting shot by enemies that get up a second later.

Share this post


Link to post
Share on other sites
AI seem to stop shooting at ragdolled enemies. Thinking they are dead? Because in CQB that often ends in AIs getting shot by enemies that get up a second later.

Sucks to be them...

Ragdolls are actually dead, so the enemy won't shoot them. The original unit is still around but hidden, so won't evoke a response from enemy AI. I'll have to think further on this one.

Share this post


Link to post
Share on other sites

quite enjoying this now with the ragdoll.

3 recommendations:

1. It becomes quite predictable that every shot takes down a AI and then they stand up about the same time later. A little randomisation or vairation here to mix things up a bit. Perhaps some AI could be tough mothers who dont go down when hit, while some can be more weak on their legs?

2. Some AI could choose not to stand up afterwards but rather fire from where they are lying down? or crouch.

3. Like metalcraze said - ragdoll makes other AI think a stunned unit is dead when it aint. (although pretending to be dead would be a good tactic for a small percentage of AI against humans).

Share this post


Link to post
Share on other sites
quite enjoying this now with the ragdoll.

3 recommendations:

1. It becomes quite predictable that every shot takes down a AI and then they stand up about the same time later. A little randomisation or vairation here to mix things up a bit. Perhaps some AI could be tough mothers who dont go down when hit, while some can be more weak on their legs?

2. Some AI could choose not to stand up afterwards but rather fire from where they are lying down? or crouch.

3. Like metalcraze said - ragdoll makes other AI think a stunned unit is dead when it aint. (although pretending to be dead would be a good tactic for a small percentage of AI against humans).

1 - AI stay down for a random time between 2-10 seconds when hit. I could randomise it further so that not every shot takes down an AI, but I'd still prefer that 90% or more of the time they go down when shot. Seeing a guy take a 5.56 centre mass and just twitch is highly unrealistic.

2 - AI already fire from prone after an animated fall, with reduced skills. I prefer to let the engine handle the AI behaviour much past that. It will force them to crouch etc without too much intervention from me. Or other AI scripts like ASR. This was not meant to be a behaviour modification system per se, just a way to get AI to hit the deck after a fall or being shot.

3 - And like I said, this is a limitation of emulating ragdoll on live units by replacing them with dead ones temporarily. I nearly had a cerebral haemorrhage thinking how to get ragdoll happening in the first place! What I'll try to do is transition back to the prone live unit sooner, which should then make it fair game (Geneva convention be damned).

Share this post


Link to post
Share on other sites

Also I would suggest for you to add a config option that disables ragdoll perhaps? Like using "old" system.

Because after some more testing I think I prefer AI falling down on a side more. But that also has to do with a lack of polish (and quite probably in-game animations) for transitions between ragdoll and normal state and it doesn't look smooth and fluid like it is with mocapped falling and getting up.

Share this post


Link to post
Share on other sites
Also I would suggest for you to add a config option that disables ragdoll perhaps? Like using "old" system.

Because after some more testing I think I prefer AI falling down on a side more. But that also has to do with a lack of polish (and quite probably in-game animations) for transitions between ragdoll and normal state and it doesn't look smooth and fluid like it is with mocapped falling and getting up.

I agree with you, the full mocapped animations look far better, precisely because there are smooth transitions between them. But everyone seems to want ragdolls ragdolls ragdolls so I've tried to accommodate them even though it's a hack solution with no possible way to get smooth transitions to/from ragdoll. Config is the perfect compromise.

Share this post


Link to post
Share on other sites
I agree with you, the full mocapped animations look far better, precisely because there are smooth transitions between them. But everyone seems to want ragdolls ragdolls ragdolls so I've tried to accommodate them even though it's a hack solution with no possible way to get smooth transitions to/from ragdoll. Config is the perfect compromise.

I agree - think the config option for ragdoll or not would be great.

Share this post


Link to post
Share on other sites

TPW FALL v1.08 test 3: https://dl.dropboxusercontent.com/u/481663/TPW_FALL_108.zip

Changes:

  • Ragdoll is now optional - make sure you use the new config
  • Ragdoll transitions have been refined but are still not seamless. Disable ragdoll if they annoy you too much because there's not much else I can do.
  • Ragdoll units are only considered "dead" by enemy AI for the 0.5 - 1 sec they are falling. Once on the ground, they are fair game again.

Just to state it again: I am not going to make changes to shot units' health or behaviour beyond the few seconds they are prone. I prefer to let the engine and/or decent AI behaviour scripts take over beyond this point.

Barring any show stoppers, I will make this an official release tomorrow.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×