Game Development Reference
In-Depth Information
Building a soldier animation state machine
Building the soldier's ASM is very similar to the weapon ASM, except that we have a lot
more animations to think about. In this case, we're only going to flush out the standing idle
and standing run poses of the soldier. A spoke-wheel-designed ASM can easily accomplish
each of the animation states with their corresponding transitions.
One large restriction to this simple design is that whenever an animation plays, we must re-
turn to the idle stand animation before being able to play another animation. In a fully con-
nected ASM, you can add additional transition animations to go from reload to fire imme-
diately, for example:
The soldier animation state machine
You should pay attention to where transitions exist as well as their blend durations, as this
will ultimately affect how reactive your agent will appear. As this design requires going
back to the idle_aim state for a minimum of the blend duration, there will always be a
slight delay before an agent can select another animation.
Another key idea to take away is that when we add a transition from the idle_aim state
to any other state, we want the idle_aim state to blend immediately with the next state.
Setting the blend window of these transitions to the full length of the idle_aim state's an-
imation will allow them to blend immediately, regardless of how far into the idle_aim
animation's length we are:
Sandbox.lua :
local weaponAsm;
local soliderAsm;
function Sandbox_Initialize(sandbox)
...
Search WWH ::




Custom Search