Game AI
How game characters decide, move and compete: state machines, behavior trees, planners, navmesh pathfinding, steering and game-tree search. Gameplay-AI interview loops draw on it.
on this pageshowhide
explore
- Finite State Machines6 questions
- Behavior Trees5 questions
- Planning and Utility AI6 questions
- Pathfinding and Navmeshes6 questions
- Steering and Crowd Movement6 questions
- Perception and Tactical Reasoning6 questions
- Adversarial Search6 questions
- Machine Learning in Games6 questions
questions
page 2 of 2A squad soldier's behavior tree keeps finishing a reload while a grenade lands beside him; how do you make the tree interrupt the running reload?
basics
~20 sPlace the grenade branch above the reload and make sure something re-checks its guard while the reload runs: a reactive root re-walked each tick, or, in an event-driven tree, a lower-priority abort observing the grenade key.
A boss's state machine needs Stunned and Dead reachable from every combat state; how does a hierarchical state machine avoid duplicating those transitions?
basics
~10 sA hierarchical state machine nests states in superstates, and a transition declared on a superstate applies from every state inside it. One Combat-to-Stunned and one Alive-to-Dead transition replace a copy on each combat state.
A town guard's state machine has grown to twenty states with tangled transitions; what causes this state explosion, and how would you restructure it?
basics
~20 sState explosion comes from multiplying independent concerns, such as alertness, weapon and activity, into one flat machine whose transitions grow with the square of its states. Restructure: concurrent machines per concern, hierarchy, a stack for interruptions, data for variants.
Racing drivers trained by reinforcement learning cut lap times by clipping through a wall via a collision bug; how do you find and fix this reward hacking?
basics
~20 sThe agent found a path the reward pays for that designers never intended. Detect it with replays, trajectory plots and per-step invariants; fix the collision bug, pay only in-order on-track progress, and retrain from a clean checkpoint.
A soldier's navmesh path zig-zags between polygon edge midpoints across an open floor, then scrapes along wall corners; what causes each, and how do you fix them?
basics
~20 sZig-zag means waypoints sit at polygon centres or edge midpoints; string-pull the polygon corridor with the funnel algorithm. Scraping means the taut path touches vertices of a mesh not eroded by the agent's radius; erode at build time.
In a strategy game where two hundred units request grid paths across a large map through chokepoints, how do you keep pathfinding inside the frame budget?
basics
~20 sReject unreachable goals with precomputed connected-region labels, queue requests and time-slice them under a per-frame expansion budget, share routes, and shrink each search: Jump Point Search on uniform-cost grids, HPA* clusters for long routes, a weighted heuristic for low-priority units.
In a firefight, several NPCs run to the same cover spot and some pick cover that leaves them exposed; how should tactical cover selection score positions?
basics
~20 sGenerate candidate points, discard any that fail hard tests such as unreachable, already claimed or not shielded from the current threat, score the rest on weighted preferences like distance, firing angle and danger, then claim the winner so others pick elsewhere.
A GOAP NPC walking to fetch a key finds the player has taken it; how should it detect the broken plan, replan, and keep replanning affordable across fifty NPCs?
basics
~20 sCheck the next action's preconditions, including procedural ones, before and while running it, and replan when one fails or the goal changes. Keep it affordable by replanning only on relevant changes, capping search size and spreading requests across frames.
How does an HTN planner decompose a villager's compound task such as gathering firewood, and how does that differ from GOAP's search?
basics
~20 sAn HTN planner replaces a compound task with the subtasks of the first method whose condition holds, recursively, until only primitive actions remain, simulating state forward. GOAP instead searches a flat action set for any chain reaching goal facts.
A drone summing weighted seek and obstacle-avoidance forces stalls in front of a pillar or jitters beside it; why, and how do priority arbitration or context steering fix it?
basics
~20 sWeighted blending adds vectors, so avoidance pointing back against seek cancels it and the drone stalls, or the sum flips as avoidance grows. Priority arbitration lets the most urgent behaviour win; context steering chooses among directions before building one vector.
Agents using ORCA local avoidance jam and stand still at a stadium's single exit gate; why does reciprocal avoidance deadlock there, and how would you fix it?
basics
~20 sORCA targets collision avoidance, not progress: each agent takes the allowed velocity nearest its preferred one, and a dense, symmetric press at one gate leaves only near-zero options. Break symmetry, spread goals across the gate, shorten the horizon.
As an AI lead, how do you decide whether a game's opponents should be authored, learned or a hybrid, and what does that choice commit the team to?
basics
~20 sDefault to authored opponents where designers must tune, debug and reproduce behaviour; use learning where a simulator and clear objective exist and hand-authoring fails, such as physics control or test bots, and budget for retraining, determinism and inference cost.
As AI lead, how do you decide where NPCs may cheat with knowledge they could not have sensed, and where perception must stay honest?
basics
~20 sKeep perception honest wherever players can test it, above all first detection in stealth; allow only cheats players cannot see that make NPCs look smarter, like briefly tracking a target after losing sight, each declared in one reviewed place.
As AI lead, how would you choose between behavior trees, a GOAP or HTN planner and utility scoring as the standard decision architecture for a game with combat NPCs and simulated villagers?
basics
~20 sChoose by the behaviour each cast needs and who will author and debug it: behavior trees for authored, predictable reactions, planners for multi-step goals that must adapt, and utility scoring for many competing needs. Large games often standardise a layered hybrid.
How should a stealth guard's detection meter work so a crouched player in shadow at the edge of vision is noticed gradually?
basics
~20 sThe meter fills each tick at a base rate multiplied by factors for distance, angle from the gaze, light, stance, movement and visible body fraction, drains when the player is unseen, and crosses thresholds that raise the guard's alert level.
In a self-play board-game engine, how do learned policy and value networks change Monte Carlo tree search compared with plain UCT and random playouts?
basics
~20 sThe policy network supplies move priors that steer selection toward promising moves, and the value network scores new leaves instead of random playouts; self-play then trains the policy toward search visit counts and the value toward game results.
showing 31–47 of 47