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.
In a typical NPC guard patrol behavior, which movement pattern best enables the guard to efficiently detect intruders in multiple locations along a corridor?
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.
Which sensory input is most commonly used by a guard AI to detect a sneaking player hiding behind furniture in a stealth game scenario?
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.
When an NPC guard hears suspicious noise but cannot see the source, what is a common immediate behavior transition in its state machine?
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.
Which algorithm is most commonly used by guard AI to find the shortest path around obstacles during pursuit in a grid-based environment?
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.
Which statement best distinguishes a behavior tree from a finite state machine in the context of guard NPC logic?
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.