Finite State Machines (FSMs) in Game AI Quiz Quiz

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.

  1. FSM Structure

    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?

    1. State
    2. Event
    3. Transition
    4. Process

    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.

  2. FSM Application

    In an enemy AI that can patrol, chase, and attack, which part of the FSM directly represents the 'chase' phase?

    1. Context
    2. State
    3. Event
    4. Flow

    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.

  3. FSM Limitations

    Which is a common limitation of using finite state machines in complex game AI, especially in games with numerous character behaviors?

    1. Infinite looping
    2. Low memory usage
    3. State explosion
    4. Unpredictable outcomes

    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.

  4. FSM Transitions

    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?

    1. Transition process
    2. Sensor event
    3. Static assignment
    4. Continuous loop

    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.

  5. FSM vs Other Architectures

    Compared to behavior trees, what is a defining characteristic of finite state machines in the context of game AI logic?

    1. Hierarchical decision-making
    2. Randomized behavior selection
    3. Explicit transitions between states
    4. Data-driven learning

    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.