Game Development Reference
In-Depth Information
The pursue state
As pursuing an enemy generates new paths during each update call, our agent doesn't need
another state to handle movements.
The soldier's FSM pursue state
In this case, the only thing our agent cares about while pursuing an enemy is to flee in or-
der to prevent death, shoot the enemy when it comes within range, or idle if the enemy is
no longer valid. As there are limited transitions from pursuit, our agent will sometimes
need to jump through another state to find a valid action, such as reload. Even though cases
like these exist, very little noticeable latency is introduced, and the finite state machine is
less complex because of the reduced number of transitions:
SoldierLogic.lua :
function SoldierLogic_FiniteStateMachine(userData)
...
-- pursue action
fsm:AddTransition(
"pursue", "die", SoldierEvaluators_IsNotAlive);
fsm:AddTransition(
Search WWH ::




Custom Search