HALF-LIFE ANIMATION
...an overview
As you should be fully aware by now, Half-Life uses a 'Skeleton' to deform the
model's mesh, enabling the game to blend between two or more different
animations, thus giving the model a far greater range of expression than has
been seen in FPS games up until now. The game engine is able to blend the legs
from the walk, run or idle animations with the upper torso from any one of the
shoot or aim animations. Furthermore, it then blends between an extreme 'up' aim/fire
position and an extreme 'down' aim/fire position, so that the model aims it's
weapon exactly where the player's mouse is pointing, giving more of a visual cue
onscreen to team mates and opponents alike.
To this end, all of these animations must be included; Walk, run, jump, swim etc
etc plus up and down aim and fire animations for all weapons, and then again for
crouching. They total 106 animation files.
Once again, I must give the usual disclaimer: This tutorial will not teach you
how to be a great animator. Indeed it may not even teach you how to animate,
however I hope to at least explain the principles behind Half Life animation, so
that you might figure it out for yourselves. Also note, that the various methods,
tips and tricks I am about to show you are not arbitrarily the way to
animate, they are simply the way I animate. I am not an animator, though
I am capable of animating, at least to the level required for FPS games anyway,
so this tutorial might have genuine animators champing at the bit or burying
their head in their hands with dispair. If so, please PLEASE, write a better
tutorial.
IDLE
..or 'Look out, Gordon it's behind you!
Allright then, let's start with something simple. A nice idle
animation that features the model breathing and looking around, nothing too
taxing so that you can get used to the controls.
First you need to open Milkshape and open your base skeleton.
NOTE: If you have made a custom skeleton, ie: You have changed the Gordon
skeleton to any signifigant degree (or added joints to it), then you will need
to open that skeleton and use it to animate.
NOTE: Your animation files do not need to have the model mesh in it. Only the
Reference SMD needs the mesh. However, it can be handy to have the mesh attached
to the skeleton just so that you can see how it deforms when the animations work.
Now with your Base skeleton open, we are going to create an animation loop. A
loop or cycle is an animation that shows the model ending in the same position
as it started, thus an animation can be repeated infinitley and there are no
jumps or twitches.
The first thing we need to do is to set the ammount of frames we need for the
animation.
Frames are the segments which an animation is divided into. You will almost
certainly be familiar with conventional cartoon animation, where a series of
images (up to 24 per second) are flashed in front of your eyes giving the
impression of movement. Imagine that each of those still images is a 'Frame'. In
Milkshape the principle is the same.
The animation we are going to make is an idle animation. As far as I am aware,
it isn't important to get the ammount of frames right for Half-Life as the game
will use a cycle no matter what the size. Some weapon 'idle' animations use over
a hundred frames whilst average idle sequences on players is 30 frames. At the
moment we are making an 'idle' animation for a player model and so we will use
30 frames.
Click the 'Anim' button in the bottom right to activate animation mode:

Now you will see two fields lit, just left of the button.

The field on the right sets the ammount of frames. The field on the left not
only indicates which frame you are on, but also allows you to manually enter
which frame you wish to work on. In this example, we can see that the left field
is set to 1.0 and so we are currently at frame 1. The field on the right reads
15, so the animation is 15 frames long. Change the 15 to a 30, like so:

We now have an animation of 30 frames.
The next thing we need to do is create a set of starting keys.
KEYS:
Keys or 'KeyFrames' are points in an animation cycle that tell objects where
they should be at what time and what position they should be in. Not every
single frame has a key, though they can if needs be. The idea is that at three
or four main points in an animation, the skeleton needs to be in a certain
position. All you need to do as an animator is set the keys for those positions
at their relevant frames and Milkshape will calculate where the model should be
in the frames in between.
What we are about to do is set keys at the start and finish of the animation
cycle so that no matter what you do in between, the model will come to rest at
the same place it started.
Click the 'Anim' button, if it is not allready, to activate animation mode:
.gif)
Now position your model in the stance you want for it's idle animation. This
will be a weaponless idle animation, so you can do whatever you want with the
hands. Have them by his sides, in his pockets, on his head, whatever. Don't try
to be too adventurous just yet, by his sides will do for now.
NOTE: Make sure you have the animation button activated or any repositioning of
the skeleton you make will not be recorded and it will reset if you move off the
frame or close the file.
Select the whole skeleton and go to 'Animate' in the top menus and select 'Set
Keyframe in All joints'.

You have now told Milkshape that all joints must be in that position at that
frame. Now repeat the process at the final frame...
Slide the frame slider along to the final frame, 30. The Frame slider is at the
bottom of the screen and looks like this:

by positioning the mouse over the slider and holding down the left mouse button,
you can drag the slider along. Each of the black marker notches represent one
frame. The marker on the extreme left is frame one (where the slider is in the
example). The marker on the extreme right is the final frame. The ammount of
markers will change depending on how many frames you have set. The actual frame
you are currently on is indicated in the left hand field next to the, 'Animate'
button.
Move the slider along to the final frame, select the whole skeleton and set a
key in all joints, as you just did with frame one.
What have we done? Well, now you've told Milkshape that all joints MUST
be in this position in the final frame. Provided the joints haven't moved
between the first and last frame, the skeleton will now end up in exactly the
same position as when it starts, allowing you to smoothly loop the animation
over and over again, no matter what the skeleton does from frame 2 to 29.
Now we are going to make the skeleton breathe. You might notice if you observe
Half Life player models closely enough, that when they are idle, they seem to
sway slightly as if they are breathing. We shall do the same.
Make sure that the animation button is activated and move the slider to frame
15, about half way along. Now select each of the spine joints in turn. To do
this, you need to have the 'Select' button active and the 'Joint' option active
too, like so:

Once you have selected each joint, use the rotate command and, rotate them just
a tiny ammount. Once you have done that, go to the 'Animate' menu and select
'Set Keyframe' or press CTRL+K. This will record the position of the joint. Note
that all that joint's 'children' will reposition themselves to suit where the
parent joint is now positioned to. For this reason, it is probably adviseable to
start with the parent spine joint (the lowest one) and work your way up.
That's it. Slide the slider bar all the way to the left. Now click the 'Play'
button in the bottom right:

Notice your model seems to breathe as the chest segments move from their
original position to the newly rotated position at frame 15 and then back the
original position again at frame 30. It's ALIVE! It's ALIVE! =)
Your end product should look a little like this:

That's it. That's animation in a nutshell. You can build upon this now, have the
shoulders move and the head. Maybe the arms and hands can do something
interesting.
To the best of my knowledge, the game positions the skeleton using the bone,
'Bip01', so leg animations are restricted by the fact that the model can't
really step around. Don't be too concerned with this anyway, this is just the
first step. Have some fun and practice before we continue, get used to what you
have just learned so that we can build on it in the next stage.
Tutorial created by Scarecrow,
THANK YOU !!!
©
http://www.Planetfortress.com/TF2Models
TF2 is trademark of Valve
Software and of Sierra Online.
© 2000 TF2 MODELS - Hosted by Planetfortress
Web designer/Webmaster : IXNAY