skip to content

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 pageshow

explore

questions

page 2 of 2

A 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?

level: seniorimportance: should knowfreq 45%

basics

~20 s

Place 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.

open as a page

A boss's state machine needs Stunned and Dead reachable from every combat state; how does a hierarchical state machine avoid duplicating those transitions?

level: seniorimportance: should knowfreq 52%

basics

~10 s

A 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.

open as a page

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?

level: seniorimportance: should knowfreq 56%

basics

~20 s

State 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.

open as a page

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?

level: seniorimportance: should knowfreq 34%

basics

~20 s

The 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.

open as a page

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?

level: seniorimportance: should knowfreq 58%

basics

~20 s

Zig-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.

open as a page

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?

level: seniorimportance: should knowfreq 60%

basics

~20 s

Reject 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.

open as a page

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?

level: seniorimportance: should knowfreq 50%

basics

~20 s

Generate 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.

open as a page

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?

level: seniorimportance: should knowfreq 50%

basics

~20 s

Check 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.

open as a page

How does an HTN planner decompose a villager's compound task such as gathering firewood, and how does that differ from GOAP's search?

level: seniorimportance: should knowfreq 46%

basics

~20 s

An 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.

open as a page

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?

level: seniorimportance: should knowfreq 45%

basics

~20 s

Weighted 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.

open as a page

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?

level: seniorimportance: should knowfreq 48%

basics

~20 s

ORCA 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.

open as a page

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?

level: principalimportance: should knowfreq 28%

basics

~20 s

Default 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.

open as a page

As AI lead on a large streamed open world, how would you choose the navigation stack: representation, hierarchy, dynamic obstacles, agent sizes and the per-frame budget?

level: principalimportance: should knowfreq 35%

basics

~20 s

Standardise on navmesh tiles that stream with the world, a coarse tile graph for long routes, a policy per obstacle type (rebuild, toggle links, or leave to avoidance), few agent size classes, and a time-sliced queue with cheaper paths far away.

open as a page

As AI lead, how do you decide where NPCs may cheat with knowledge they could not have sensed, and where perception must stay honest?

level: principalimportance: should knowfreq 35%

basics

~20 s

Keep 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.

open as a page

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?

level: principalimportance: should knowfreq 42%

basics

~20 s

Choose 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.

open as a page

How should a stealth guard's detection meter work so a crouched player in shadow at the edge of vision is noticed gradually?

level: middleimportance: nice to knowfreq 42%

basics

~20 s

The 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.

open as a page

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?

level: seniorimportance: nice to knowfreq 22%

basics

~20 s

The 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.

open as a page

showing 31–47 of 47