AI in video games is a collection of techniques that decide how enemies and characters behave, generate levels and assets, and automate testing, ranging from hand-authored state machines to trained machine-learning agents. The same two letters cover a ghost cornering Pac-Man and a chatbot improvising a shopkeeper's lines, and players and developers rarely mean the same thing by them.
What AI in video games means
AI in video games is the software that makes a game react to the player: it picks what an enemy does next, routes characters around a level, builds content and plays early builds to find bugs. Most of it runs on rules a designer wrote, from the Namco ghosts in Pac-Man to the enemy logic in a Unity or Unreal Engine project. A smaller share uses models trained on data.
Three different things travel under that one label:
- Classic game AI
- Rule-based logic that controls non-player characters (NPCs): finite state machines (FSM), behavior trees, utility scoring and pathfinding. It is predictable by design, which lets a studio tune and debug it.
- Machine-learning AI
- Agents that learn a behavior through training, such as agents trained with Unity ML-Agents. Training happens during development, and the game runs the result.
- Generative AI
- Models that produce art, text, audio or video, from image generators to large language models (LLMs) of the kind behind ChatGPT. Steam's disclosure rules from Valve target this category, and most of the controversy is about it.
Most shipped enemy AI is still the first kind. That is a reading of how games are built, not a measured statistic, and it shapes the honest answer to the common question. Nearly every game uses AI, usually in a sense that has nothing to do with ChatGPT.
Classic game AI: state machines, behavior trees and pathfinding
Classic game AI rests on four families of technique. Finite state machines give a character a fixed set of states, such as patrol, chase or flee, plus rules for switching between them. Behavior trees arrange decisions as a tree of tasks and conditions that the character re-checks as the situation changes. Utility AI scores every available action and picks the best. Pathfinding, usually a graph search such as A* or Dijkstra's algorithm, works out the route.

| Technique | What it controls | Named example |
|---|---|---|
| Finite state machine | Switching between a fixed set of modes | Pac-Man ghosts alternating chase and scatter modes, per the Pac-Man Dossier |
| Behavior tree | Choosing the next task from conditions and priorities | Halo 2, in Damian Isla's GDC talk; Unreal Engine Behavior Trees with a Blackboard |
| Utility AI | Ranking competing actions by a score | A design pattern studios build themselves, with scoring rules set by the designer |
| Navigation mesh pathfinding | Movement across walkable surfaces | Unity NavMesh with agents, obstacles and links, per the AI Navigation package docs |
Pac-Man shows how little machinery a convincing enemy needs. The Pac-Man Dossier, published by Game Developer when the site was called Gamasutra, explains that chase and scatter differ only in where a ghost's target tile sits. The pathfinding logic stays the same, and a ghost looks only one tile ahead when choosing a turn.
Engines package these ideas as tools. Epic Games documents Behavior Tree assets as the way to create AI for non-player characters in Unreal Engine, each tree relying on a Blackboard asset that holds the Keys it decides on. Unity Technologies' AI Navigation package builds a navigation mesh (NavMesh) at edit time in the Unity Editor or at runtime, with dynamic obstacles and links for actions such as jumping. In Unity's navigation system, a NavMesh Agent avoids other agents and obstacles, a NavMesh Obstacle with Carve enabled cuts a hole in the NavMesh when it stops moving so agents reroute, and a NavMesh Link connects areas the walkable surface cannot, such as a gap to jump. Those are Unity's terms. Godot and Unreal build the pieces differently, and a comparison of how the major engines differ sets their tooling side by side.
Some apparent intelligence is a deliberate cheat. Racing rivals that rubber-band to stay close and strategy opponents that see through the fog of war are a designer's choice to keep a match tense. Game AI is built to be fun to beat.
How enemies and NPCs decide what to do
Game AI for enemies and NPCs usually runs the same loop on every update:
- Perceive. The character checks what it can see or hear, such as the player's position or a noise.
- Remember. It writes those facts to memory, which in Unreal Engine is the Blackboard described in Epic's behavior tree documentation.
- Decide. A state machine, behavior tree or utility score picks the next action.
- Act. The character moves along a path, fires or takes cover, and the loop starts again.
The craft sits in the details: a reaction delay, imperfect aim, a shouted line that warns the player what an enemy will do next. Those touches make a guard read as a person instead of a turret, and a separate guide covers how developers make non-player characters behave more convincingly with AI.
Some systems run the whole match instead of one character. Left 4 Dead's AI Director, which Valve's Mike Booth described in The AI Systems of Left 4 Dead, controls pacing by deciding when and where the infected appear, building pressure and then giving the survivors room to recover. That is adaptive difficulty aimed at drama. Adaptive difficulty can also be as small as loosening enemy aim after repeated player deaths, and the research term for the family is dynamic difficulty adjustment.
Large language models add an option for characters that talk. NVIDIA's ACE for Games page describes NVIDIA ACE as a suite of digital human technologies for autonomous game characters. An LLM-driven character can answer questions nobody scripted, which is also its weakness: the studio no longer knows every line it will say.

Worlds and content: procedural generation and generative AI
AI in video games also builds the places players explore. Procedural content generation (PCG) produces levels, terrain, items or quests from rules and randomness, giving a game more variety than a team could build by hand. Newer methods learn from examples or generate assets outright.
- Rule-based techniques. Perlin noise, named for Ken Perlin, shapes terrain; L-systems grow plants from grammar rules; Wave Function Collapse, Maxim Gumin's algorithm, assembles tile maps from adjacency rules.
- Rule-based games. Rogue gave the roguelike its name, Elite generated its star systems, Diablo from Blizzard Entertainment randomized its dungeons, Minecraft from Mojang generates block worlds, Spelunky by Derek Yu stitches levels from hand-made rooms, and No Man's Sky from Hello Games generates whole planets.
- Learned generation. The PCGML survey on arXiv defines procedural content generation via machine learning as generating game content with models trained on existing content, from Markov chains to neural networks such as long short-term memory (LSTM) networks and autoencoders.
- Generative AI for assets. Image models such as Stable Diffusion, Midjourney and OpenAI's GPT Image produce concept art, LLMs draft dialog, and video models such as Google's Veo and Runway produce footage.
- Procedural production tools. SideFX's Houdini builds environments from node-based rules that artists can re-run when a design changes.
Rule-based PCG is the safer choice for shipped content, because its output stays inside limits a designer wrote. Learned and generative systems trade some of that control for range, and products that blend the two are compared in a roundup of tools that generate levels and worlds procedurally with AI.
Generative AI reaches cutscenes and trailers as well, where a studio can use a video model for previsualization or marketing footage. The explainer on how text-to-video generation models work covers the mechanics behind tools like Veo and Runway.
Machine-learning agents in engines: Unity ML-Agents and Unreal Learning Agents
Machine-learning agents bring AI in video games closest to AI research. The Unity ML-Agents documentation treats games and simulations as environments for training intelligent agents through reinforcement learning (RL), imitation learning, neuroevolution or other methods. Unity says trained agents can control NPC behavior, run automated testing of game builds and help evaluate design decisions before release.
The ML-Agents Toolkit traces back to Unity: A General Platform for Intelligent Agents, a 2018 arXiv paper with Arthur Juliani as lead author. Its open-source repository pairs the Unity side with Python trainers built on PyTorch.
| Stage | What happens | When |
|---|---|---|
| Environment | Developers define what the agent observes, which actions it can take and what earns a reward | During development, in the Unity Editor |
| Training | The agent learns through reinforcement learning, imitation learning or neuroevolution | During development, in Python trainers |
| What ships | A trained policy that maps observations to actions, or conventional logic if training was only for testing | In the final game |
The learning happens before release. A game that ships a trained agent runs a fixed policy that does not keep learning from players, and a team can use training only to test a level and ship hand-written logic. Unreal Engine has a counterpart in Learning Agents, an experimental Epic Games plugin whose training module includes imitation-learning and PPO reinforcement-learning trainers.
These game agents differ from the LLM agents in AI news coverage. An agent trained with Unity ML-Agents learns one narrow skill from rewards, such as steering a vehicle. An LLM agent uses a language model and tools to plan open-ended tasks, and the explainer on how autonomous AI agents work covers that second kind.
AI behind the scenes: playtesting, QA and production
Some of the most practical game AI never reaches the player, because it runs in the studio's QA pipeline. Automated playtesting puts bots into a build to play it the way a tester would, for longer than a human team can, and logs what breaks:
- Scripted bots run the basics. Bots follow set routes and inputs and check for crashes, often in continuous integration (CI) runs on each new build.
- Trained agents explore. The arXiv paper Augmenting Automated Game Testing with Deep Reinforcement Learning, by Joakim Bergdahl, Camilo Gordillo, Konrad Tollmar and Linus Gisslén, adds a self-learning mechanism based on deep reinforcement learning to a game testing framework so agents can explore and exploit game mechanics.
- Engine toolkits package the approach. The ML-Agents documentation lists automated testing of game builds among the uses for trained agents.
- Humans triage. Testers and designers review what the bots flag and separate real bugs from design questions.
An agent rewarded for progress will find routes no designer intended, which is exactly what a tester wants surfaced before players find it. Studios rarely publish how much of their QA relies on automated playtesting, so the techniques are clearer than the adoption.
A short history of AI in video games
The history of AI in video games is mostly a story of simple rules made to feel alive, with machine learning arriving late:
- Fixed patterns. Early arcade enemies, such as the marching aliens of Space Invaders, moved in set formations.
- Puck-Man becomes Pac-Man. Namco's ghosts got the English names Blinky, Pinky, Inky and Clyde with Midway's release, when Puck-Man was renamed Pac-Man, per the Pac-Man Dossier.
- Halo 2. Bungie's shooter became a reference point for behavior trees through Damian Isla's GDC Vault talk, Managing Complexity in the Halo 2 AI System, whose written version describes the system as a behavior tree.
- Left 4 Dead. Valve's AI Director moved the focus from single enemies to the pacing of a whole match, per Mike Booth's presentation.
- Unity ML-Agents. The 2018 arXiv platform paper set out Unity as an environment for training agents.
- Generative AI disclosure. Valve added AI-content disclosure to Steam submissions, separating pre-generated from live-generated content.
Limits, risks and the industry debate
Every kind of AI in video games trades control for something, and the risks grow as a system becomes less hand-authored:
- Hand-authored logic is predictable. A designer can read a behavior tree or FSM and know why an enemy acted; its limit is that it covers only situations someone anticipated.
- Learned behavior is harder to steer. A trained policy can do something odd at the edge of its training, and there is no single rule to edit.
- Live-generated content needs guardrails. Valve's Steamworks Content Survey asks developers whose games generate AI content while running to describe the guardrails that keep it from producing illegal content.
- Review still applies. In its AI Content on Steam post, Valve says it evaluates AI output like other content, including whether a game matches its marketing and avoids illegal or infringing material.
- Disclosure shapes trust. Steam shows the AI disclosure on the store page, so it becomes part of how a game is presented to buyers.
Live-generated dialog carries the plainest form of these risks. A character driven by an LLM can state something false with confidence or break character, for the reasons set out in the explainer on why generative models make things up. In a game, a hallucination is a quest giver sending the player to a dungeon that does not exist.
The jobs and quality debate is contested, and no published figure settles it. Critics focus on generated art, writing and voices replacing commissioned work; supporters point to tools that remove repetitive production tasks. Valve's rules follow the same fault line, disclosing what players consume and leaving development tools outside the survey's focus.
How to tell whether a game uses AI
The quickest way to tell whether a game uses generative AI is to read what the developer disclosed, since nearly every game uses classic game AI and that kind is never labeled:
- Check the Steam store page. Valve displays the developer's AI disclosure there, drawn from the Steamworks Content Survey.
- Read which type is disclosed. Pre-Generated covers AI-made content created during development, such as art, sound, narrative or localization; Live-Generated covers content the AI creates while the game runs.
- Scan the credits. Credits can name AI tools or voice-synthesis vendors alongside human contributors.
- Read patch notes and developer interviews. These are where a studio is most likely to explain how an asset was made, or why it was replaced.
Disclosure covers content shipped to players, not every use of AI. Valve says the survey's generative-AI section does not focus on efficiency gains from AI-powered tools used during development, so a game built with coding assistants or testing bots can carry no label at all. That is the position as of October 2026, per Valve's Steamworks Content Survey page.
The building blocks of the next phase already sit in vendor documentation: NVIDIA's tooling for autonomous characters, Unity's agent training in ML-Agents and Valve's disclosure rules for generated content. Which of them reach the games people buy depends on how much generated content players accept, and how plainly studios label it.
Further reading
Frequently Asked Questions
How can I tell if a game uses generative AI?
Check the game's Steam store page, where Valve shows the developer's AI disclosure, and then read the credits and patch notes. Steam's Content Survey asks developers to describe AI-generated content that ships with the game, split into pre-generated content such as art, sound or narrative and live-generated content created while the game runs. The survey says efficiency gains from AI tools used during development are not its focus, so a game can use AI in production without carrying a label (as of October 2026, per Valve's Steamworks documentation).
Does Steam ban games that use AI?
No, Steam allows AI-generated content but requires developers to disclose it in the Content Survey. The one exception is Adult Only sexual content generated live by AI, which Valve does not ship. Valve says its prerelease review evaluates AI output the same way as non-AI content, including whether the game matches its marketing and avoids illegal or infringing material. Games with live-generated content must also describe the guardrails that keep the AI from producing illegal content (as of October 2026, per Valve's Steamworks documentation).
Is enemy AI in games machine learning?
Usually not, because most enemy behavior is still authored by hand with state machines, behavior trees and pathfinding rather than trained models. Epic documents behavior trees as an asset for building AI for non-player characters, and Unity documents NavMesh pathfinding for moving them through levels. Machine-learning agents, such as those trained with Unity ML-Agents, are an additional option for controlling NPC behavior, not the default.
Can AI be used to test video games?
Yes, trained agents can play a game to find problems that scripted tests miss. Unity describes ML-Agents as usable for automated testing of game builds and for evaluating design decisions before release. A 2021 arXiv paper by Bergdahl, Gordillo, Tollmar and Gisslén describes adding deep reinforcement learning to an automated game testing framework so agents can explore a game's mechanics.
Is AI hurting the gaming industry?
The effects are contested and depend on the use, so no single answer holds. The sharpest disputes concern AI-made content that ships to players, which is why Steam requires disclosure of it, while tools that only speed up development are treated differently. Player trust, disclosure and quality control matter more to the debate than the technology itself.









