Sample questions
Game Ai PathfindingDifficulty 1
What is a state machine in the context of NPC AI?
- aA system that stores the exact 3D coordinates of every object in the game world
- bThe NPC is in one fixed state at a time, moving between states via defined conditions✓
- cA rendering technique that determines how many polygons an NPC model uses
- dA network protocol used to synchronize NPC positions between server and clients
Explanation:A state machine models an NPC as being in exactly one of a fixed set of named states (e.g., Idle, Patrol, Chase) at a time, moving between them via defined transition conditions. It has nothing to do with storing world coordinates (a), polygon/rendering detail (c), or network synchronization (d) — those are separate systems entirely.
Game Ai PathfindingDifficulty 1
Which of these is a simple, valid example of state-machine-based NPC logic?
- aPatrol becomes Chase on player detection, reverts once they leave✓
- bThe NPC's health bar color changes gradually as damage accumulates
- cThe NPC model's texture resolution changes based on distance from the camera
- dThe NPC's animation frame rate is capped to match the game's fixed timestep
Explanation:This is a textbook two-state machine: a named state (Patrol) with a condition (player detected) that transitions to another named state (Chase), and a condition to transition back. The other options describe gradual visual effects (b), level-of-detail rendering (c), and animation timing (d) — none involve discrete named behavior states with transitions.
Game Ai PathfindingDifficulty 2
What is the main practical drawback of a state machine as more states and transitions are added?
- aIt cannot represent more than two states at once
- bIt requires a network connection to evaluate transitions
- cIt always runs slower than any other decision-making approach, regardless of state count
- dTransitions grow fast as states multiply, making the logic hard to read and extend✓
Explanation:As states multiply, the transitions between them tend to grow combinatorially, so the web of conditions becomes tangled and error-prone to extend. State machines aren't limited to two states (a), don't need networking to evaluate (b), and aren't inherently slower — the problem is maintainability, not raw runtime cost (c).
Game Ai PathfindingDifficulty 2
A designer wants NPC logic where: Idle -> hears a noise -> Investigate -> sees no threat -> back to Idle; sees the player -> Attack. This is best described as what kind of logic structure?
- aA tree-based decision structure with priority branches
- bA physics simulation with rigid body constraints
- cA finite set of named states linked by transitions✓
- dA pure random number generator choosing actions each frame
Explanation:Idle, Investigate, and Attack are discrete named states, and each arrow is a condition-driven transition — the definition of a state machine. It is not described as a prioritized tree of behaviors (a), has nothing to do with physics constraints (b), and is fully deterministic given the conditions, not random (d).
Game Ai PathfindingDifficulty 2
What does a tree-based decision structure (an alternative to a plain state machine) typically let designers do more easily?
- aSkip the need for any conditions when deciding NPC actions
- bReuse sub-behaviors and reorder priorities easily✓
- cGuarantee the NPC never changes behavior once the game starts
- dStore NPC position data more compactly in memory
Explanation:A tree-based structure organizes behaviors hierarchically by priority, so designers can reuse sub-trees and reorder branches without touching a web of state-to-state transitions. It still needs conditions (a), doesn't freeze NPC behavior (c), and isn't about memory layout of positions (d).
Game Ai PathfindingDifficulty 1
Pathfinding, at its core, is the process of...
- adetermining how many textures to load for a level
- bdeciding which NPC animation clip should play next
- ccalculating the exact frame rate the game should target
- dfinding the lowest-cost route between two points✓
Explanation:Pathfinding is fundamentally about computing a valid, usually lowest-cost route from a start point to a goal while respecting obstacles. It is unrelated to texture streaming (a), animation selection (b), or frame-rate targets (c).