Game Development Reference
In-Depth Information
Direct animation control
The first approach we'll implement is direct control over the ASM, as it is the simplest ap-
proach to understand and implement. While the agent has a lot of advantages as it knows
exactly what animation is playing on its body, this technique tends to scale very poorly as
more and more animation states are introduced. Although scaling becomes a problem, this
approach allows for the lowest grain of control in terms of animation selection and re-
sponse times from the agent.
As the agent must be responsible for animation selection, we'll create some basic actions
that the agent can perform and represent as states:
DirectSoldierAgent.lua :
-- Supported soldier states.
local _soldierStates = {
DEATH = "DEATH",
FALLING = "FALLING",
IDLE = "IDLE",
MOVING = "MOVING",
SHOOTING = "SHOOTING"
}
Search WWH ::




Custom Search