Ragdolls & fun with motion controllers

I’ll probably figure it out eventually :stuck_out_tongue: And then I’ll probably facepalm because it was something obvious xD

Still I’ll keep my eye on this thread and download the files just in case. :wink:

I made some improvement in running, so here is a small update

Nice to see that you are already playing around with it, the baseball bat should not be too difficult. I plan to use this setup to swing around with a greatsword eventually.

Remove the “OB” prefixes in the object names in the scripts and change the names of some of the mathutils functions (some have changed from 2.49 to 2.5) and it should work on 2.5. Use the errors in the command prompt to see which function names have to be changed.
Maybe the 2.5 version could also solve the problem of john_tgh.

At the moment I stick to 2.49b as there is still a problem with the rigid body joint menu in 2.53. When that is fixed I will probably switch.

Сlearly, I tried to do but I did not succeed. If a remake, I’ll be happy =)

I have played around with it and it is indeed more difficult :eek::
-remove “OB” prefixes in scripts
-Mathutils = > mathutils (no capital)
-changed functions, see here
-follow all bugs in command prompt (rotation matrices require capital axes now, so only “Z” instead of “z” or “Z”)
-the quat order has changed from x,y,z, angle => angle,x,y,z
-convert everything to radians…:spin:, here I stopped halfway so turning is messed up
-also Eulers have changed, apperently no longer accepts 3 parameters :confused:

At least trying it out was a good test case as it revealed all potential problems I will face in converting


Version253.blend (884 KB)

Wraaah,I myself have also done)
The head is the same problem, we must do something …

I got a bit further,everything needs to be tuned again but normal walking seems OK for the simple parts. Obstackles can still give difficulties

For short:
-Quaternions in 2.5 are apparently (z,y,x,angle) instead of (angle,x,y,z) in 2.49b
-The angles of rotation matrices are inverted so put an extra minus sign in
-There was a bug in the Cont.Rot module


Version253v2.blend (896 KB)

Wraaah, Better, but still has bugs:(

This is really impressive even though its in its early stages. Its something Ive been thinking about since Euphoria came about, and especially how masterfully it was used in GTAIV.

One of the features I think would be awesome is the ability to be knocked over (in a ragdoll mode) and then the figure picks himself back up. To do this you could have him knocked down however, and then whichever way he falls he rolls onto his front and uses his hands to push up his chest, followed by pulling up his legs towards his chest to get a centered purchase on the ground before standing back up completely.

Also once you get the walking/ running sorted out id suggest cleaning up the arms a bit, they look really wierd sticking out, and even weirder when hes holding the gun. Makes him look like a spastic :smiley:
Id have them down by his sides when stationary, then in the proper swinging walking pose when hes walking. Check out some videos of walkcycles people have done to get a good idea of how the arms operate during a walkcycle.

Looks like you have it under control tho, very excited to see this develop!

Edit Standing up like in this video, at 2:07 http://www.youtube.com/watch?v=uWVvwkGv2Zw

:D, I made the ragdoll fall over when the weight is no longer balanced between the feet, now it only needs to pick itself up…

And this already seems like the proper order

To do this you could have him knocked down however, and then whichever way he falls he rolls onto his front and uses his hands to push up his chest, followed by pulling up his legs towards his chest to get a centered purchase on the ground before standing back up completely.

And added some extra moves: strafing, crouching. Guess I only have to add jumping and fix the running to get the movement part OK, and also add some extra checks to prevent some unwanted steps and bugs.

I will wait with the jumping till I get a good idea for that though… (have plenty to do anyways :spin:)

that is very nice, congratulations, this ll be hugely usefull! so far I m very impressed,I ll be waiting for the final version, when you finish it and it get usefull for us all, why dont you make an article and put it on a blender s magazine? this ll be good for your name as an artist and a coder and ll help people to understand how to use your script and what they can achieve.
There is the http://blenderart.org/ that allways need cool articles.
Well, thanks for share and good luck to finish it

Wow, it’s awesome! continue works! :smiley:

My vacation is over so updates will be a bit slower, and I try to avoid posting if there is not much progress to show.

Updates (blend file: paste all site /blend/3468, don’t know why blenderartist blocks the link http://www.********.org/blend/3468 ):

-Adjusted the gravity to the correct value (98). I use 10 units = 1 meter (approximately) to get accurate collisions, also for the smaller limbs. Of course changing the gravity messed up all tuning really good :frowning: but I managed to fix most of it again :D.
-Torso swings to keep the centre of mass between the feet.
-Arms swing depending on the foot displacement.
-Neck orientates between torso and head rotation.

I will have to see how far I get (but maybe I get to the point of writing an article :eyebrowlift:), here are the main challanges I expect:

-Robustness (you don’t want your character to get stuck in complex corners or at stairs when the feet are mixed up again)

-Frame rate, I try to keep the code as simple and efficient as possible but with 5 ragdolls walking around I already got a framerate of 35 (mainly by logic). So it will depend on this how wide you can use this system. (Any tips on efficient coding is welcome, so what functions take the least computational power etc. And maybe if I can get it compiled into C it might also go faster. But I don’t know anything about C compiling :mad:)

-Time, it is a lot of work and at the moment my spare time is a bit limited…

-Other stuff that is bound to show up

But I am still optimistic to get this system finished in working order eventually.

I also got another idea that it would be great to have a character rigged to the ragdoll. I have to much to do already getting the system running but if someone wants to help me with this it would be great to show all the potential of ragdolls. And rigging a character model can be done seperately from working on the controls. A character would also make a nice icon for the system :cool:. So please let me know if you have some modeling skills and are interested in helping with this!

Made a dozen or so bug fixed.

And anyone interrested in making a rigged character model for the ragdoll system to show off some extra possibilities with ragdolls? (I myself wonder how ragdoll hair, a cloak or flappy clothing will look like :D) I unfortunately don’t have the time to make a nice character model.

I make it for you, but you ll have to explain me how to use it, tell me if i need something specific for your ragdoll system, and i can make it

Thank you, it would be great if you can help me with this. Basically I want to show cloth like action with simplified ragdoll physics that can be resolved in real time (cloak, long hair, bouncy clothes). So the model should have those features.

As an example I made these additions to the ragdoll and made a thick bellied wizard with long beard, cloak and sleeves :cool:. (Still needs some tuning as the addititions are plainly added with rigid body joints without active control). But if you come up with a different model with similar features it is fine by me. I would want to leave the actual model to the artist.

The bone structure of the armature will copy exactly all the ragdoll objects. I made a script for this somewhere in the resource forum. When I have some time I can add the bones to the .blend. There will be room for additional bones for facial expressions and finger movements but that is probably for somewhere in the future.

Preferable the model would not be too high poly (simple) and have a simple texture on it :smiley: (attention to detail like textures always makes a model much more complete).


Thick_belly_wizard.blend (883 KB)

i have a character that have a long hair and a tanga i dont know the word in english, i ll sculpt it a little and after that i ll send you the model, then you can make the preparations for the ragdoll. just wait

here is what the model look like, i made it on a tutorial long ago and now i remake it as a low poly character take a look

The model looks pretty detailed already, although I would prefer some more wide clothes or something. The only thing that would be bouncing along around right now would be the long hair. I could add a cloak but that would be a bit of an artificial add-on to the character. Maybe you could add a skirt or a long sleeve trailing along the floor, and a shawl would be a great test as well.

Do you also have some texture or face painting for the character?

For the proportions I have to check if they fit my ragdoll a bit. It is not a lot of work to change the base orientation of the legs and arms for skinning the character. But really changing the proportions of the ragdoll might mess up some things a bit.

And I also added the armature to the ragdoll so it is ready for skinning. And made a simple skinned cloak so you can see how it will look like.


Thick_belly_wizard_with_armature.blend (942 KB)

I love the faked-IK ground-tracker. Have you done this with a script or in some other way?

Love to see this in a blender-game later on!

i didnt start to texturize it, i ll when i finish the modelling part, i really have some things to do so i ll not take too mutch of my time for make a lot of modelling, i ll increase the size of her tanga and try to think about something else. i ll send the result soon