
Of course, the behavior of a game agent is usually much more complex
than a lightbulb (thank goodness!). Here are some examples of how finite
state machines have been used in games.
n
The ghosts’ behavior in Pac-Man is implemented as a finite state
machine. There is one Evade state, which is the same for all ghosts,
and then each ghost has its own Chase state, the actions of which are
implemented differently for each ghost. The input of the player eat
-
ing one of the power pills is the condition for the transition from
Chase to Evade. The input of a timer running down is the condition
for the transition from Evade to Chase.
n
Quake-style bots are implemented ...