Making non-player characters act believably. Finite state machines for simple, readable behavior, behavior trees for scalable decision logic, A* pathfinding to navigate a level, steering behaviors for smooth movement and flocking, decision-making with decision trees and utility, and adversarial search (minimax, alpha-beta, MCTS) for board-game opponents.
Before you start
Comfort with code and basic data structures helps — the Data Structures & Algorithms course (trees, graphs, A*) pairs especially well with pathfinding and adversarial search. Examples are in Python.
Finite State Machines
The workhorse of game AI: an agent is always in one state (patrol, chase, attack) and switches on events. FSMs are simple, readable, and power the majority of enemy behavior in shipped games.
Behavior Trees
When FSMs get tangled, behavior trees scale. Behavior is a tree of composable nodes — sequences, selectors, and leaves — evaluated each tick. They power the AI in most modern action games.
Pathfinding with A*
Getting an agent from A to B around obstacles is pathfinding. A* is the standard algorithm — it finds the shortest path efficiently by combining actual cost with a heuristic estimate of remaining distance.
Steering & Movement
Pathfinding says where to go; steering makes the movement smooth and lifelike. Learn seek, flee, and arrive behaviors, and how combining simple rules produces flocking and crowds.
Decision Making
Beyond states and trees, agents choose actions with decision trees, utility scoring, and goal-oriented planning. Learn approaches for AI that weighs options and reacts intelligently to the situation.
Adversarial AI
For turn-based and board games, the AI must play against a thinking opponent. Learn minimax, alpha-beta pruning, and Monte Carlo Tree Search — the algorithms behind chess, Go, and strategy AI.