Explore key concepts and practical applications of finite state machines (FSMs) in game artificial intelligence. This quiz covers FSM architecture, state transitions, and common design strategies used in game AI development for robust and adaptive behaviors.
Which element in a finite state machine determines what action to take when a character's health drops below 20%, as in a game scenario where the enemy starts fleeing?
Explanation: In an FSM, a transition is triggered by a specific condition or input, such as the character's health dropping below 20%. Transitions move the FSM from one state to another, enabling behavior changes like fleeing. 'State' refers to the current mode or behavior, not the condition for change. 'Event' is a broad term and often triggers transitions but isn't the decision itself. 'Process' is unrelated to FSM's specific mechanics.
In an enemy AI that can patrol, chase, and attack, which part of the FSM directly represents the 'chase' phase?
Explanation: Each identifiable behavior, like 'chase', is modeled as a state within a finite state machine. The FSM will switch between these states as the game requires. 'Context' might hold data but does not directly equate to behavior. 'Event' helps trigger transitions but is not a state itself. 'Flow' is a generic term not specific to FSM structure.
Which is a common limitation of using finite state machines in complex game AI, especially in games with numerous character behaviors?
Explanation: State explosion occurs when the number of states grows rapidly as behaviors and conditions increase, making the FSM unwieldy. Infinite looping is not typical if transitions are designed properly. Low memory usage is actually an advantage, not a limitation. FSMs are generally predictable, not prone to unpredictable outcomes unless designed improperly.
In an FSM-based AI, what typically triggers a state transition from 'Idle' to 'Alert' when a player character enters a guard's line of sight?
Explanation: A sensor event, such as detecting the player entering the line of sight, triggers the FSM to transition from 'Idle' to 'Alert'. 'Transition process' describes the mechanism rather than the actual trigger. 'Continuous loop' is unrelated to specific state changes. 'Static assignment' does not account for dynamic reactions and is not a trigger method.
Compared to behavior trees, what is a defining characteristic of finite state machines in the context of game AI logic?
Explanation: Finite state machines rely on clearly defined transitions that move the AI between states based on inputs or conditions. Behavior trees are designed for hierarchical decision-making, which is not a primary feature of FSMs. FSMs do not natively support randomized selection or data-driven learning; those techniques are found in other architectures or may be layered on top of FSMs.