Ever wanted good interaction of your character with the environment or other characters, e.g. running into walls, dropping off cliffs or being tackled… Well I do and I figured that pre-animated characters will never succeed at this so I started animating ragdolls, which resulted in this system I share here.
The ragdoll control scheme is best compared with a marionette. Invisible forces push & pull the ragdoll limbs around to follow invisible controller/driver objects. These objects are moved around using python scripts. Walking around covers a large part of the scripting since it includes obstacle detection and where best to place the feet, e.g. walking up stairs.
My ultimate goal is to make a sword-fighting game with realistic attacks, parries and counter-attacks. I also want to make the system general so that if it all really works I can build a complete adventure around it with pit-traps, rope swinging and all… (just day-dreaming for now ;)).
So below is the current status, then some tips and tricks and also a progress overview since the first outlines of the system in my fencing game.
Knight_update17_6_2012.blend (7.29 MB)
Improved the movement system
-Synchronized head orientation with movement
-Improved combat strafing
-Added running. Leaning into corners really looks nice, starting and stopping needs more work to get perfect.
-And FOOTSTEP SOUNDS are back (did not pack them however… :evilgrin:)
Basics: Numpad (movement) & arrow keys (looking) or 2 axis gamepad
Change movement mode: left alt
Running or lunge: left shift
Sword poses: numbers 1 trough 7
Cameras: F1 - F8
zombie pose O
drop items F
drop dead hold space
crouch left control
Target AI L
Stand up B
Tips & Tricks
Games are about faking so it looks real (just like my marionette system is not build around muscles)
-Increasing the mass of the hands & feet will give them more control/stability
-Add an additional force upon impact with anything if the response is not strong enough
-Do not think you get rid of pre-defined animations (but definitely with more freedom/interaction). Each walk cycle, evasion, jump or other action needs to be programmed, it is not that your ragdoll gets smart and knows on its own how to react on any event. If I implement the system correctly however each action will only need to be programmed once and can then be copied for other characters with little tuning
-Do not try to lift 20-40 kg (maybe this is no problem for you), the ragdoll is not tuned for this (hard to have a large stable control region), and such heavy objects will never make effective weapons to swing around
For tuning tips on the ragdolls you have 4 parameters in the ragdoll_init.py script, just play around with different settings to get a feel of what does what
-First I determine a target speed for my limb. This speed is proportional (v_prop) to the distance between limb and controller/driver. So the target speed also slows down before you are in position, this is very important for stability. The target speed is capped at a set maximum (v_max).
-Secondly the force is calculated. This is proportional (f_prop) to the difference in the current limb velocity and the target velocity. The force is also capped at a maximum (f_max).
Same goes for rotation. And a mayor part is off course placing and moving the controllers/drivers around.
If you want to apply this setup to your own character:
-Use a scale of 1 Blender Unit is 10 cm, make sure you increase the gravity and soundspeed by a factor 10 in the world and scene panels. My experience is that Blender does not have accurate collisions for objects smaller than ~0.1 BU.
-USE BRIK, it is easy and takes the pain out of creating rigged ragdolls. I build the whole setup for spawning ragdolls around the BRIK add-on, no way to go without it. BRIK addon files including my patch
9 April 2012: Ragdoll abuse with traps
Works best in 2.61 (camera tracking was weird in 2.62, and also 1 matrix calculation was inverted/needs a minus sign)
-Removed the flapping shoulders & toes
-A bit more stable movement
-Simple AI followers
-Updated movement control
-More stabilized head camera
-Some fun with traps :evilgrin:
28 Januari 2012: Ragdoll spawning
Just combined my set-up with the BRIK add-on to get spawning of ragdoll group working. Also works for linking
15 October 2011: General update… feature overview
19 June 2011: Some first tuning results in the 2.5 series
20 November 2010: Last 2.49b update: rope swinging
Strafe left Z
Strage right C
Strange mix E
Crouch toggle Left Ctrl
Turn left A
Turn right D
Jump (while running) Left Shift
Sword poses numbers 1 through 7
Camera F1 through F8
Grab rope K
Ragdoll fun Numpad 4, 6, 2 and 8
Get up from ground B
11 August 2010: boxy ragdolls (not yet rigged and skinnen with armature)
1 March 2010: Last real update on my Fencing game. With this game I realized that the the core of the game will be its biggest limit, so from here I started working on a universal ragdoll system
And how I started this as my first blender project