Jump to content

Ragdolls!


fumanshoo
 Share

Recommended Posts

So I am just wondering where to start with ragdolls. I want to just understand how they work and the best way to implement them in Leadwerks. Is there a way to even do it with Lua? I've never made ragdolls before except in Blender where you make simple joints between objects, but i would like to know how you do it with a single mesh. Just want to know the basics and if anyone has a link to some good info on it, that would be much appreciated :)

Link to comment
Share on other sites

position pre-made physics bodies in the same position and orientation as the animation bones. Then connect them with joints and set their constraints the. Apply physics to those bodies and whalla you have Ragdoll.

 

That's the basic concept but it is very much a fiddly piece of work and a bit of a glossy thing that isn't necessary until you have gameplay.

  • Upvote 2

STS - Scarlet Thread Studios

AKA: Engineer Ken

 

Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now!

Link to comment
Share on other sites

Sounds simple enough, but what about activating and de-activating physics when the character collides with another object. Like for example, character 1 strikes character 2 to the ground and character 2 has ragdoll physics. How does one make him not get back up from that fall but in that case, de activating the ragdoll physics again. ( basically switching the physics on and off depending on the situation ) might there be some sort of physics switch function???

Link to comment
Share on other sites

If the bodies are parented to the bones then the bones have control. Therefore, the character can be animated. If the bones are parented to the bodies then the bodies have control and it will be ragdoll.

 

I would also play around with disabling gravity mode on the bodies when not in ragdoll and also changing their entity type so they don't collide with anything. However, because they are parented they should collide anyway.

  • Upvote 1

STS - Scarlet Thread Studios

AKA: Engineer Ken

 

Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now!

Link to comment
Share on other sites

I would manually update the bone positions and orientations because it will mess up the skinning if you start reparenting bones. Just create a physics skeleton using the same hierarchy as the model's bones.

  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

I would manually update the bone positions and orientations because it will mess up the skinning if you start reparenting bones. Just create a physics skeleton using the same hierarchy as the model's bones.

 

good point

STS - Scarlet Thread Studios

AKA: Engineer Ken

 

Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now!

Link to comment
Share on other sites

If / when you manage to get familiar with all LE's features as well as some important coding techniques you begin to be able to figure out a way to do just about anything. Whether it is the best way to do it or not is another story. However, I find there aren't too many rules in game development, if you come up with an idea of how something might work... try it.. you never know it might just work. If it fails not all is lost you will have learned something from the experience and will be better for it.

  • Upvote 2

STS - Scarlet Thread Studios

AKA: Engineer Ken

 

Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...