Animate legs and torso independantly, then merge together

Hi,

I remember in Quake 3 how the legs and the torso of characters was kind of independant, in that the legs animated to be running in the direction you were moving using the WSAD keys, while the torso was swivelling depending on where the mouse was looking.

I assume this means animating the torso and legs of a model independantly, then merging them together.

Get direction of movement => m
Rotate legs animation by m => m’
Get direction of mouse look => l
Rotate torso animation by l => t’

final animation = t’ merged with m’

Am I on the right track? I hope there is something in Unity3D that makes this easy to do.

Thanks

The legs were quite likely not independent from the torso in Quake 3 - I’m sure you couldn’t rotate the torso 360 degrees around while the legs stood still. :slight_smile:

They probably had different animations for running forward / left / right / backwards, and the legs were animated in some nice looking way for each.

You can do the same in Unity. For example, have a look at the Locomotion System example project, where there’s a guy who can walk in one direction while looking in another:

Rune

Quake3 used the MD3 format where the models are broken up into three different parts which are anchored to each other. They are anchored axis-wise by a single triangle called a tag. The models were split into head, torso and legs regions so that each part could animate independently for the sake of blending and reducing number of permutations. I licensed the tech on an FPS in a former life and had to end up writing a bone-based system. Ahhh the memories…

But yeah, OP should check out Rune’s animation extension and take a look at the scene where the alien can run and fire the weapon at the same time.

Ok, thanks for educating me. :slight_smile: Still, the torso couldn’t turn 360 degrees relative to the legs, could it? That would be weird!

Haha, what alien? We know the character model is not of the best quality but I still think he mostly looks kinda like a human. :stuck_out_tongue:

Rune

LOL thanks guys :slight_smile:

The locomotion system that seems really complicated. I will look at it though.

So if I create ‘run forward/forward-left/forward-right/backward/backward-left/backward-right’ animations, I can combine those with any torso animation I need right? The thought of animating shooting/running/casting for every direction the character could move is quite horrifying…

Definitely no 360, at the end of the day an animator makes the character move and sets the max frames a look would cover. The mouse look would just basically drive the interpolation (mouse look up at 50% would loop on the half-way point of the look up animation) If an artist allowed some crazy ass rotations, I’m sure Carmack would have had him for lunch.

ahhh…hell…sorry man. Let’s just “assume” I’m drunk. I think I got confused with the robot in this tutorial which demonstrates the blending as well:

http://unity3d.com/support/resources/example-projects/character-animation

1 Like

There’s basically two ways to have a character run all directions while aiming independently - sidestep animations or swivel the torso. Rotating the torso saves animation and avoids a few other problems, so it’s not a bad approach.

Like GhostDog mentioned, Quake 3’s method was to literally detach the torso and rotate it like a turret on a tank, and have independent animations playing on the legs and upper body. Crude but effective for the time, since MD3 was all vertex and animation blending wasn’t possible.

The trick is that you have a forwards and backwards running animation, that means you never have a 360 turn, you’re only ever turning 90 degrees either direction off the original axis.

A more flexible (ha ha) technique I’ve used which might suit Unity better is to have full body animations (a run forwards aiming dead ahead and a run backwards aiming dead ahead) and then procedurally rotate the spine to aim where you need it to go. So the character is always aligned to the movement, playing the running forwards or running backwards depending on the angle difference, then you just adjust the spine rotation to the amount the aim differs from the movement direction. (as long as the run forwards/backwards animation is dead on, the final aim will be pretty good)

The snag is 90 degrees is still a big twist, at your extreme your character will look pretty unnatural, even if you have a few spine bones and distribute the rotation accordingly. On one PS2 game we spread the twist all the way up to the clavicle and upper arm and had different settings for one handed and two handed guns and ended up with some pretty nice results while still keeping the aim fully procedural.

1 Like

This seems to be the way Rune turns the head of the toon in the Locomotion demo he mentioned.

I like. But how about this to fix the 90 degree issue: don’t rotate the spine for 90 degrees, only something like 60 degrees. After that, have a ‘strafing left’ / ‘strafing right’ animation, and instead play that and twist the spine in the other direction.

Or maybe blend the strafing / running animations in the correct ratios, if you know what I mean, depending on where the toon is looking/moving?

Would that work?

Thanks

Isn’t this close?
http://unity3d.com/support/resources/unity-extensions/head-look-controller

Yes. And the head look controller can be setup to work for the entire spine too. (The head look controller on this page: http://unity3d.com/support/resources/unity-extensions/head-look-controller)

Yes, it works. The Locomotion System I mentioned ( http://unity3d.com/support/resources/unity-extensions/locomotion-ik ) automatically blends forward, left, backwards, and right animations (or however many you specify) in the correct ratios to enable the character to take step in any direction. So you can even have walking direction independent from looking direction without any head or spine twisting at all.

However, you can get even better realism if you do combine it with head and spine twisting. We’ll release a new example project soon to demonstrate this, based on a talk Paulius and I did at Unite '09.

Rune

I’m actually trying to mimic the system used in DDO (Dungeons and Dragons Online).

There are only 8 directions of movement, but the toon can actually look in any direction freely using mouse-look, and it’s all blended together. Another interesting point is that when moving backwards, the head turns to ‘look behind’. I don’t think this animation is baked in, from what I can see the neck is actually programiatically controlled to do that.

But I think I have enough now to get something done.

Thanks for the help.