Reader small image

You're reading from  Learning Game AI Programming with Lua

Product typeBook
Published inNov 2014
Reading LevelBeginner
PublisherPackt
ISBN-139781783281336
Edition1st Edition
Languages
Right arrow
Author (1)
David Young
David Young
Right arrow

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 return to the idle stand animation before being able to play another animation. In a fully connected ASM, you can add additional transition animations to go from reload to fire immediately, 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...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Learning Game AI Programming with Lua
Published in: Nov 2014Publisher: PacktISBN-13: 9781783281336

Author (1)