Guard AI u0026 NPC Behaviors Quiz Quiz

Explore essential mechanics behind guard AI and NPC behaviors, focusing on patrol, alert states, pathfinding, and decision-making logic. This quiz is ideal for those interested in interactive AI patterns within games and simulations, providing insights into detection, responses, and realistic NPC design.

  1. Patrol Logic

    In a typical NPC guard patrol behavior, which movement pattern best enables the guard to efficiently detect intruders in multiple locations along a corridor?

    1. D. Aggressively chasing the first detected person regardless of their actions
    2. C. Staying stationary at the entrance of the corridor
    3. A. Following a looping predefined route with periodic pauses at key points
    4. B. Moving in random directions without any set path

    Explanation: A looping predefined route with pauses allows thorough coverage of multiple places and maximizes the chance to spot intruders. Random movement may miss some areas or create blind spots. Remaining stationary limits the guard’s observation area and reduces overall detection effectiveness. Immediately chasing any detected person is a reaction rather than a patrol pattern and may neglect other potential intruders.

  2. Stealth Detection

    Which sensory input is most commonly used by a guard AI to detect a sneaking player hiding behind furniture in a stealth game scenario?

    1. B. Scent tracking
    2. C. Telepathy
    3. A. Vision (line of sight)
    4. D. Inventory checking

    Explanation: Vision, often implemented as a line of sight check, is the most standard way for guard AI to detect sneaking players, especially if they step into the guard’s view. While scent tracking is rarely used and typically requires specialized scenarios, telepathy is not a feature of standard guard AI behaviors. Inventory checking is not related to detecting player presence.

  3. Alert State Transitions

    When an NPC guard hears suspicious noise but cannot see the source, what is a common immediate behavior transition in its state machine?

    1. A. Transition from Idle to Investigating state
    2. D. Entering a Dialogue state to ask for help
    3. C. Returning to Patrol state without any change
    4. B. Skipping directly to Combat state

    Explanation: Transitioning to an Investigating state lets the guard actively search for the noise source, modeling realistic alertness. Immediately starting combat would be an overreaction without visible evidence. Complete disregard (returning to patrol) ignores the suspicious cue. A dialogue state would not typically be triggered just by a noise, as guards usually investigate on their own.

  4. Pathfinding Algorithms

    Which algorithm is most commonly used by guard AI to find the shortest path around obstacles during pursuit in a grid-based environment?

    1. D. Brute force enumeration
    2. C. Random walk pattern
    3. B. Binary search
    4. A. A* (A-star) algorithm

    Explanation: A* is specifically designed for pathfinding and efficiently identifies the shortest route avoiding obstacles. Binary search is used for searching ordered data, not path navigation. Random walk produces unpredictable and inefficient movement. Brute force examination is computationally expensive and impractical for real-time navigation.

  5. Behavior Trees vs. Finite State Machines

    Which statement best distinguishes a behavior tree from a finite state machine in the context of guard NPC logic?

    1. D. Finite state machines dynamically generate new behaviors at runtime
    2. B. Finite state machines can operate with non-deterministic probability trees
    3. A. Behavior trees allow hierarchical and flexible action selection based on conditions
    4. C. Behavior trees restrict guards to a maximum of three behaviors

    Explanation: Behavior trees provide a structured, hierarchical approach that lets guard NPCs prioritize and switch between actions based on context, which improves flexibility. Finite state machines are usually simpler and less adaptive, not based on probabilistic trees. Behavior trees are not restricted in the number of actions, and FSMs do not inherently create new states or behaviors during runtime.