About Store Forum Documentation Contact



Post Reply 
Crazy ragdoll
Author Message
Harry Offline
Member

Post: #1
Crazy ragdoll
Is it normal that ragdolls are so crazy in current version of Engine? I remember in the past they were more stable.

Attached gif is created from Game Basics/Ragdoll tutorial. I only added dot which shows character position.

By the way skel.pos() seems to return the same position even if I set root bone to Warrior skeleton. Is it a bug or my bad understanding?
02-15-2020 08:57 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #2
RE: Crazy ragdoll
Hi, I've been further inspecting ragdolls and found issue in Chr class.

The ragdollEnable() function first deactivates actor and then activates ragdoll. The order of execution seems to be wrong because actor deactivation puts it to sleep and sleep() function clears linear and angular velocity. Velocity, which is later passed to ragdoll.fromSkel(). Because of that ragdoll always has the velocity equals to zero.
02-16-2020 08:49 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: Crazy ragdoll
I've committed a change to deactivate controller after setting ragdoll.

Ragdoll stability perhaps changed after updating PhysX to a newer version.
You could try tweaking codes for:
Ragdoll
https://github.com/Esenthel/EsenthelEngi...agdoll.cpp
Joints
https://github.com/Esenthel/EsenthelEngi.../Joint.cpp
02-18-2020 06:07 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Crazy ragdoll
Quote:By the way skel.pos() seems to return the same position even if I set root bone to Warrior skeleton. Is it a bug or my bad understanding?
I don't understand.

using this code:
Code:
void Draw()
{
   Renderer(Render);
                     D.text(0, 0.9, "Press WSAD keys to move, 1/2 to pick up/drop item, Alt to grab");
   if(Players.elms())D.text(0, 0.8, S+"Items in inventory : "+Players[0].items.elms());
   if(Players.elms())
   {
      SetMatrix();
      Players[0].skel.pos().draw(RED);
   }
}

in
UID(1053171485, 1309531958, 4017451414, 3813904741) /* Apps\14 - Game Basics\03 - World with Character */
tutorial, works fine

skel.pos() is not changed due to ragdoll.
Only its bones (sub-elements) are changed.
02-18-2020 06:10 AM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #5
RE: Crazy ragdoll
Hi Greg,

Thanks for fixing ragdoll velocity.

Regarding ragdoll stability - for time being - I override ragdollValidate() function and set custom ragdoll density. It is not perfect but still better. I'll play with other attributes later.

And finally regarding skeleton position, sorry for being inaccurate. Let me explain my question more detailed. It is not related to ragdolls at all. When drawing skeleton position, it is always pointed between test Warrior feet. AnimatedSkeleton.pos() returns postion of root bone. But what exactly is a root bone here? AnimatedSkeleton.create() initialize just bones and slots containers. Root seems to be just a dummy bone for keeping some "central" AnimatedSkeleton matrix and does not have its counterpart in Skeleton.

Initially I thought this root bone is somehow related to Root dropdown in Editor (see attached pic) but it seems it's not. I miss there description (or I could not find it) of this dropdown. What is it purpose and is it related to the default Esenthel skeleton only like bone type (Spine 0:0 and so on) visible only when bone has specific name? I see not all bones are listed there as well.


Attached File(s) Image(s)
   
02-18-2020 08:16 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: Crazy ragdoll
On the picture selecting root affects root animation key frames when importing animations.
Root bone is always Matrix Identity (Vec 0,0,0 position) in object space.
02-19-2020 02:00 AM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #7
RE: Crazy ragdoll
Thank you for the explanation.
02-19-2020 10:21 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply