Ragdoll physics - no DLLs required

Community Forums/Showcase/Ragdoll physics - no DLLs required

Al Mackey(Posted 2003) [#1]
Now, I'm not going to pretend that my code is the answer to all your physics needs, but I've written a ragdoll physics system that seems to work "good enough" in the space of two days.

I tried Halo's ragdoll system, but I couldn't find a good way to attach an actual 3D model to it. From what I could tell (admittedly there wasn't much of his code I could understand), he wasn't completely tracking the angles at each node, which makes it fine for the OrbMan there, but not too good for a full 3D model. Bouncer's ragdoll system was even worse suited for the job, since it couldn't constrain the joint angles at all.

My ragdoll demo includes source (no extortion required), a full 3D model with constrained and angled joints, a simple environment, and the ability for a user to click and drag on any node.

Download here: http://www.almackey.com/Drunk.zip


CyBeRGoth(Posted 2003) [#2]
Thats cool

A drunk skunk that we can smack about and throw into furniture is good in my book :)


Rob(Posted 2003) [#3]
Quite cool... Very close to Hitman's body stuff.


Red Ocktober(Posted 2003) [#4]
no extortion required....LOL, good one Al :)

nice code too.

--Mike


Al Mackey(Posted 2003) [#5]
None required, but always appriciated. :)


Falelorn(Posted 2003) [#6]
OMG I love it. Thats actually kinda fun in a very SICK way.

Now if you could drop the skunk on a spear or at the top of a conveyer belt and have it keep falling in different ways that would be hillarious


JoshK(Posted 2003) [#7]
Looks great. I hope you continue improving this.


Robert(Posted 2003) [#8]
Good, the only problem is that sometimes limes flail around really fast, almost as if the code cannot decide where they should be, so they flicker around between the two. There needs to be something to restrict speed of movement.


Ruz(Posted 2003) [#9]
great fun, nice one.


Space_guy(Posted 2003) [#10]
looks good :)


Al Mackey(Posted 2003) [#11]
Yes, AtomicX.. Joints were jumping between the low and high constraints. I did fix it by storing the current angle as a variable, instead of re-rading it from the entity each frame where it can jump +/-360 degrees.. but doing that seemed to make other problems more pronounced. More work to be done.


Zephar123(Posted 2003) [#12]
Good work al mackey and thanx for nto trying to sound like god :-). Although I love how you nicely threw in what i thought all along that Bouncer's ragdoll system was even worse. ;)


Robert(Posted 2003) [#13]
@Al

Is it possible to track the movement of each point and interpolate or ignore the movement if it is too dramatic - or would that be too expensive in terms of CPU time?


Litobyte(Posted 2003) [#14]
It looks marvelous !!!

[quote]Looks great. I hope you continue improving this.[\quote] Hey!
Halo I think this can be taken as an opensource thing as he provided the source, you can start now make your modification, and post it here, if we make all so, we can easily improove this to a stable easy to use thing for all.

[quote]My ragdoll demo includes source (no extortion required), a full 3D model with constrained and angled joints, a simple environment, and the ability for a user to click and drag on any node. [\quote]

LOL@ no extortion required


Al Mackey(Posted 2003) [#15]
Update, update!!

http://www.almackey.com/Drunk2.zip

This update has a completely retooled engine that is much better at keeping limbs in their constraints, and allowing for different kinds of lag which can make the body look a little more fluid. It also has a new body model, and a new environment (room and basement with connecting stairwell).


John-Robin(Posted 2003) [#16]
Wow, it looks really good!! The update is indeed much better, but perhaps the stretching of the limbs when picking up is too exaggerated for humans :) Looks wonderful though, could become a new national sport :)

John-Robin


rhuk(Posted 2003) [#17]
This is really awesome stuff! I can't believe how little code is behind this demo, truely amazing. I would also be interested in turning off the limb stretching, but from my initial look through the code, I didn't see where it was being done :(


Al Mackey(Posted 2003) [#18]
The worst of the stretching is caused by the way the model is dragged when you click on it.. it forces whatever part you dragged to the mouse's position, the the rest are left to follow at their own pace.

You can adjust how "tight" the bones are with some of the global variables defined at the top, especially with "AngularRigidness" and "BoneRigidness", but if BoneRigidness is set too high, it may cause the body to twitch violently to compensate for small changes.


elias_t(Posted 2003) [#19]
Very nice man !

The "drag-effect" is better then on Hitman I believe.


Bouncer(Posted 2003) [#20]
It's not hitman yet... it's very good though. You really need to make the collisions better... and the body is not behaving properly. Otherwise good stuff.


Al Mackey(Posted 2003) [#21]
To be honest, I haven't played Hitman yet so I don't have a point of reference. But yes, it's still far from perfect, but it's much better than it was last week. I think the most annoying bug now is that collisions between points aren't checked, so a foot can get stuck on the other side of a thin wall (like the one in the middle of the stairwell) from the rest of the body.


Tranz(Posted 2003) [#22]
Wow, that is nice!

The models are nice as well, you make those yourself?


Al Mackey(Posted 2003) [#23]
Yes. These are actually models from another project I did in LightWave a year or two ago, but they were very well-suited for this, so I converted them to B3D format.


bradford6(Posted 2003) [#24]
wow, keep up the good work, truly outstanding stuff.


Bot Builder(Posted 2003) [#25]
woah! I never really looked at this yet. Top stuff. physics are a little buggy as far as rapid twitches go, but heck, the main cool thing is the rotation of the bones. I tried making somthing similar to this, but at that time I didn't have much experience with bones. I did somthing very similar to halos, but instead of releasing it in ball form, I did it straight into an animated mesh, I realized they needed rotation, but there wasn't much of a way to do it.