Artificial intelligence (AI) in video games refers to the computational systems that control non-player characters (NPCs), generate dynamic game behavior, or simulate strategic decision-making. In practice, the term covers a broad range of techniques drawn from computer science, control theory, and robotics rather than "true" artificial intelligence. Moreover, academic AI—aimed at developing autonomous reasoning or learning—is distinct from game AI, whose goal is to deliver engaging, believable, and efficient behavior for players. The term CPU (central processing unit) in video games refers to the AI that control an NPC that could be a playable character in some other situations.

In general, game AI does not, as might be thought and sometimes is depicted to be the case, mean a realization of an artificial person corresponding to an NPC in the manner of the Turing test or an artificial general intelligence (AGI).

Overview

The term game AI is used to refer to a broad set of algorithms that also include techniques from control theory, robotics, computer graphics, and computer science in general. Therefore, video game AI may often not constitute "true AI" in that such techniques do not necessarily facilitate computer learning or other standard criteria, only constituting "automated computation" or a predetermined and limited set of responses to a predetermined and limited set of inputs.[1][2][3]

Some commentators in the video game industry have claimed that advances in game AI have transformed how players interact with digital systems more broadly. However, such claims remain disputed. Marketing discussions sometimes attribute human-like traits to game AI—such as personality or creative autonomy—but these are often scripted behaviors designed to mimic complexity rather than emergent cognition.[1][2][3][4][5][6]

History

Game playing has been an area of research in AI from its inception. One of the first examples of AI is the computerized strategy game Nim, made in 1940 and published in 1942. Despite being advanced technology in the year it was made, 20 years before Pong, the game took the form of a relatively small box and was able to regularly win games against highly skilled players.[7] In 1951, using the Ferranti Mark 1 machine of the University of Manchester, Christopher Strachey wrote a checkers program, and Dietrich Prinz wrote one for chess.[8] These were among the first computer programs ever written. Arthur Samuel's checkers program, developed in the mid-1950s and early-1960s, eventually achieved sufficient skill to challenge a respectable amateur.[9] Work on checkers and chess would culminate in the defeat of Garry Kasparov by IBM's Deep Blue computer in 1997.[10] The first video games developed in the 1960s and early 1970s, like Spacewar! (1962), Pong (1972),[11][12] and Gotcha (1973),[13] were games implemented on discrete logic and strictly based on the competition of two players, without AI.

Games that featured a single player mode with enemies started appearing in the 1970s. The first notable ones for the arcade were the Taito game Speed Race (racing video game) in 1974[14] and the Atari games Qwak (duck hunting light gun shooter) in 1974[15] and Pursuit (fighter aircraft dogfighting simulator) in 1975.[16] Two text-based computer games, Star Trek (1971)[17] and Hunt the Wumpus (1973),[18] also had enemies. Enemy movement was based on stored patterns. The incorporation of microprocessors would allow more computation and random elements overlaid into movement patterns.

Light cycle characters compete to be the last one riding in GLtron.

It was during the golden age of video arcade games that the idea of AI opponents was largely popularized, due to the success of Space Invaders (1978),[19] which sported an increasing difficulty level, distinct movement patterns, and in-game events dependent on hash functions based on the player's input.[20][21] Galaxian (1979)[19] added more complex and varied enemy movements, including maneuvers by individual enemies who break out of formation.[22] Pac-Man (1980) introduced AI patterns to maze games, with the added quirk of different personalities for each enemy. The ghosts also alternate between a "chase" mode, in which each pursues the player using its own targeting behavior, and a "scatter" mode, in which they retreat to their own corners of the maze, giving the player a short respite from the pursuit.[23][24] Karate Champ (1984) later introduced AI patterns to fighting games.[25][26] First Queen (1988) was a tactical action RPG (role-playing game) which featured characters that can be controlled by the computer's AI in following the leader.[27][28] The RPG Dragon Quest IV (1990) introduced a "Tactics" system, where the user can adjust the AI routines of non-player characters during battle,[29] a concept later introduced to the action RPG genre by Secret of Mana (1993).[30][31]

Games like Madden Football (1988), Earl Weaver Baseball (1987), and Tony La Russa Baseball (1991) used AI in an attempt to duplicate the coaching or managerial style of the selected celebrity. Madden, Weaver, and La Russa all worked with the game development teams to maximize the accuracy of the games.[32][33][34][35] Later sports titles allowed users to "tune" variables in the AI to produce a player-defined managerial or coaching strategy.[36][37]

The emergence of new game genres in the 1990s prompted the use of formal AI tools like finite-state machines. Real-time strategy games taxed the AI with many objects, incomplete information, pathfinding problems, real-time decisions, and economic planning, among other things.[38] The first games of the genre had notorious problems. Herzog Zwei (1989), for example, had almost broken pathfinding and very basic three-state state machines for unit control, and Dune II (1992) attacked the players' base in a beeline and used numerous cheats.[39] Later games in the genre exhibited more sophisticated AI.

Later games have used bottom-up AI methods, such as the emergent behavior and evaluation of player actions in games[40][41] like Creatures[42] or Black & White.[43] Façade was released in 2005 and used interactive multiple way dialogs and AI as the main aspect of game.[44][45]

A robot goes for the ball and competes in Robocup.
A robot goes for the ball and competes in Robocup.

Games have provided an environment for developing AI with potential applications beyond gameplay. Examples include Watson, a Jeopardy!-playing computer; and the RoboCup tournament, where robots are trained to compete in soccer.[46]

Views

Many experts[who?] complain that the "AI" in the term game AI overstates its worth, as game AI is not about intelligence, and shares few of the objectives of the academic field of AI. Whereas "real AI" addresses fields of machine learning, decision making based on arbitrary data input, and even the ultimate goal of strong AI that can reason, "game AI" often consists of a half-dozen rules of thumb, or heuristics, that are just enough to give a good gameplay experience.[citation needed] These rules are designed to create the illusion of intelligence and work off of three core principles: the player desiring to believe that there is human-level intelligence in the games they play, the human urge to anthropomorphize nonhuman entities, and finally the power of expectation enhancing the player experience. These principles are further enhanced in the quality and performance of the game AI, "selling the illusion" through animations that are fluid and not robotic, dialog that fits the situation, giving the AI a reason to exist and a personality beyond the player, and having the appropriate reaction to the situation and environment.[47] Historically, academic game-AI projects have been relatively separate from commercial products because the academic approaches tended to be simple and non-scalable. Commercial game AI has developed its own set of tools, which have been sufficient to give good performance in many cases.[48]

Developers

Game developers' increasing awareness of academic AI and a growing interest in computer games by the academic community is causing the definition of what counts as AI in a game to become less idiosyncratic. Nevertheless, significant differences between varied application domains of AI mean that game AI can still be viewed as a distinct subfield of AI. In particular, the ability to legitimately solve some AI problems in games by cheating creates an important distinction. For example, inferring the position of an unseen object from past observations can be a difficult problem when AI is applied to robotics, but in a computer game, an NPC can simply look up the position in the game's scene graph. Such cheating can lead to unrealistic behavior and so is not always desirable. But its possibility serves to distinguish game AI and leads to new problems to solve, such as when and how to cheat.[citation needed]

The major limitation to strong AI is the inherent depth of thinking and the extreme complexity of the decision-making process. This means that although it would be theoretically possible to make "smart" AI, the problem would take considerable processing power.[49]

Among developers, AI has been both widely adopted and controversial. In a 2025 report from the Game Developers Conference, 52% of 3,000 developers surveyed reported working at companies using GenAI. However, 30% of developers said they felt negatively about AI, compared to 18% the previous year.[50][51]

With the rise of GenAI use, there have also been instances of game developers being falsely accused of using GenAI and AI-generated images, such as Magic: The Gathering and Nintendo's Mario Kart World, respectively. Both have denied the claims.[52]

Gamers

Video game players (gamers) have had mixed views toward AI use in video games, with particular skepticism given to how and where AI is used. The most frequently cited issue is "fear of lower quality and a loss of uniqueness", with gamers being more accepting of AI "helping behind the scenes or making NPCs smarter" and less accepting of AI replacing artists in the areas of story writing, soundtrack composition, character voice acting, and the like.[53]

A report by MIDiA, published in December 2024, stated that "the majority of gamers – even daily players – are neutral about developers using GenAI".[54]

A 2025 survey of gamers by Quantic Foundry found that "85% of respondents [had] a below-neutral attitude towards the use of GenAI in video games, with a highly-skewed 63% who selected the most negative response option". The survey also found attitudes varied by gender and age, with female and non-binary gamers being more negative than male gamers, and younger gamers being more negative than older ones.[55]

In Bain & Company's 2026 gaming report, gamers' level of comfort with the game industry's use of AI in video games was questioned, with 14% saying they had become "significantly more comfortable" and 28% saying they had become "somewhat more comfortable".[56]

Usage

In computer simulations of board games

In modern video games

Game AI/heuristic algorithms are used in a wide variety of disparate fields inside a game. The most obvious is in the control of NPCs in a game, although "scripting" (decision tree) is a common means of control.[57] These handwritten decision trees often result in "artificial stupidity" such as repetitive behavior, loss of immersion, or abnormal behavior in situations the developers did not plan for.[58]

Pathfinding, another common use for AI, is widely seen in real-time strategy games. Pathfinding is the method for determining how to get an NPC from one point on a map to another, taking into consideration the terrain, obstacles, and possibly "fog of war".[59][60] Commercial video games often use fast and simple "grid-based pathfinding", wherein the terrain is mapped onto a rigid grid of uniform squares and a pathfinding algorithm, such as A* or IDA*, is applied to the grid.[61][62][63] Instead of just a rigid grid, some games use irregular polygons and assemble a navigation mesh out of the areas of the map that NPCs can walk to.[61][64] As a third method, it is sometimes convenient for developers to manually select "waypoints" that NPCs should use to navigate; the cost is that such waypoints can create unnatural-looking movement. Also, waypoints tend to perform worse than navigation meshes in complex environments.[65][66] Beyond static pathfinding, navigation is a sub-field of Game AI focusing on giving NPCs the capability to navigate in a dynamic environment, finding a path to a target while avoiding collisions with other entities (other NPC, players, etc.) or collaborating with them (group navigation).[citation needed][67] Navigation in dynamic strategy games with large numbers of units, such as Age of Empires (1997) or Civilization V (2010), often performs poorly, as units often get in the way of other units.[66]

Rather than improve the Game AI to properly solve a difficult problem in the virtual environment, it is often more cost-effective to modify the scenario to be more tractable. If pathfinding gets bogged down over a specific obstacle, a developer may end up moving or deleting the obstacle.[68] In Half-Life (1998), the pathfinding algorithm sometimes failed to find a reasonable way for all the NPCs to evade a thrown grenade; rather than allow the NPCs to attempt to bumble out of the way and risk appearing stupid, the developers instead scripted the NPCs to crouch down and cover in place in that situation.[69]

Video game combat AI

Many contemporary video games fall under the category of action, first-person shooter (FPS), or adventure. In most of these types of games, some level of combat takes place.[70] The AI's ability to be efficient in combat is important in these genres. A common goal today is to make the AI more human or at least appear so.[71]

One of the more positive and efficient features found in modern-day video game AI is the ability to hunt. AI originally reacted in a very black and white manner. If the player was in a specific area, then the AI would react in either a completely offensive or defensive manner. In recent years, the idea of "hunting" has been introduced; in this 'hunting' state, the AI will look for realistic markers, such as sounds made by the character or footprints they may have left behind.[72] These developments allow for a more complex form of play. With this feature, the player can actually consider how to approach or avoid an enemy. This is a feature that is particularly prevalent in the stealth genre.[73]

Another development in recent game AI has been the development of "survival instinct". In-game computers can recognize different objects in an environment and determine whether it is beneficial or detrimental to its survival. Like a user, the AI can look for cover in a firefight before taking actions that would leave it otherwise vulnerable, such as reloading a weapon or throwing a grenade.[74] There can be set markers that tell it when to react in a certain way. For example, if the AI is given a command to check its health throughout a game, then further commands can be set so it reacts a specific way at a certain percentage of health. If the health is below a certain threshold, then the AI can be set to run away from the player and avoid it until another function is triggered. Another example could be if the AI notices it is out of bullets, it will find a cover object and hide until it has reloaded. Actions like these make the AI seem more human. However, there is still a need for improvement in this area.[citation needed]

Another side-effect of combat AI occurs when two AI-controlled characters encounter each other; first popularized in the id Software game Doom, so-called 'monster infighting' can break out in certain situations. Specifically, AI agents that are programmed to respond to hostile attacks will sometimes attack each other if their cohort's attacks land too close to them.[citation needed] In the case of Doom, published gameplay manuals even suggest taking advantage of monster infighting to survive certain levels and difficulty settings.[75]

Procedural content generation

Procedural content generation (PCG) is an AI technique to autonomously create ingame content through algorithms with minimal input from designers.[76] PCG is typically used to dynamically generate game features such as levels, NPC dialogue, and sounds. Developers input specific parameters to guide the algorithms into making content for them. PCG offers numerous advantages from both a developmental and player experience standpoint. Game studios are able to spend less money on artists and save time on production.[77] Players are given a fresh, highly replayable experience as the game generates new content each time they play. PCG allows game content to adapt in real time to the player's actions.[78]

Procedurally generated levels

Generative algorithms (a rudimentary form of AI) have been used for level creation for decades. The 1980s dungeon crawler computer game Rogue is a foundational example.[79][80] Players are tasked with descending through the increasingly difficult levels of a dungeon to retrieve the Amulet of Yendor. The dungeon levels are algorithmically generated at the start of each game. The save file is deleted every time the player dies.[81][80] The algorithmic dungeon generation creates unique gameplay that would not otherwise be there as the goal of retrieving the amulet is the same each time. The roguelike video game genre, derived from Rogue, feature games that use some type of procedural generation to provide near infinite replayability.[82][80]

Opinions on total level generation, as seen in games like Rogue, vary. Some developers are skeptical of the quality of generated content and want to create a world with a more "human" feel, so they use PCG sparingly.[76] Consequently, they will only use PCG to generate specific components of an otherwise handcrafted level. An example of this is Ubisoft's 2017 tactical shooter Tom Clancy's Ghost Recon Wildlands. Developers used a pathfinding algorithm trained with a data set of real maps to create road networks that weaved through handcrafted villages within the game world.[78] This is an intelligent use of PCG, as the AI would have a large amount of real world data to work with and roads are straightforward to create. However, the AI would likely miss nuances and subtleties if it was tasked with creating a village where people live.

As AI has become more advanced, developer goals are shifting to create massive repositories of levels from data sets. In 2023, researchers from New York University and the University of the Witwatersrand trained a large language model (LLM) to generate levels in the style of the 1981 puzzle game Sokoban. They found that the LLM excelled at generating levels with specifically requested characteristics, such as difficulty level or layout.[76] However, current models like the one used in the study require large datasets of levels to be effective. They concluded that, while promising, the high data cost of LLMs currently outweighs the benefits for this application.[76] Continued advancements in the field will likely lead to more mainstream use in the future.

Procedurally generated music and sound

The musical score of a video game is an important expression of the emotional tone of a scene to the player. Sound effects, such as the noise of a weapon hitting an enemy, help indicate the effect of the player's actions. Generating these in real time creates an engaging experience for the player because the game is more responsive to their input.[76] An example is the 2013 adventure game Proteus, where an algorithm dynamically adapts the music based on the angle the player is viewing the ingame landscape from.[81]

Recent breakthroughs in AI have resulted in the creation of advanced tools that are capable of creating music and sound based on evolving factors with minimal developer input. One such example is the MetaComposure music generator, an evolutionary algorithm designed to generate original music compositions during real time gameplay to match the current mood of the environment.[83] The algorithm is able to assess the current mood of the game state through "mood tagging". Research indicates a significant positive statistical correlation regarding player rated game engagement and the dynamically generated musical compositions when they accurately match their current emotions.[84]

Large language and diffusion models

Generative tools similar to those used in LLMs and diffusion models, like Midjourney and DALL-E, have been used to generate in-game environments. Companies like Ubisoft have stated they are experimenting with using AI to generate basic dialogue.[85] Developers at Roblox are using AI to generate 3D objects for players dubbed Cube 3D, an open-source AI that generates 3D objects based on the methods of LLMs to generate words.[86]

Monte Carlo tree search method

Game AI often amounts to pathfinding and finite-state machines. Pathfinding gets the AI from point A to point B, usually in the most direct way possible. State machines permit transitioning between different behaviors. The Monte Carlo tree search (MCTS) method[87] provides a more engaging game experience by creating additional obstacles for the player to overcome. The MCTS consists of a tree diagram in which the AI essentially plays tic-tac-toe.[88][89] Depending on the outcome, it selects a pathway yielding the next obstacle for the player. In complex video games, these trees may have more branches, provided that the player can come up with several strategies to surpass the obstacle.[90]

Uses in games beyond NPCs

Academic AI may play a role within game AI, outside the traditional concern of controlling NPC behavior. Georgios N. Yannakakis highlighted four potential application areas:[48]

  1. Player-experience modeling: Discerning the ability and emotional state of the player, so as to tailor the game appropriately. This can include dynamic game difficulty balancing, which consists in adjusting the difficulty in a video game in real-time based on the player's ability. Game AI may also help deduce player intent (like gesture recognition).
  2. Procedural-content generation: Creating elements of the game environment like environmental conditions, levels, and music in an automated way. AI methods can generate new content or interactive stories.
  3. Data mining on user behavior: Game designers explore how people use the game, what parts they play most, and what causes them to stop playing, allowing developers to tune gameplay or improve monetization.
  4. Alternate approaches to NPCs: Changing the game set-up to enhance NPC believability and exploring social rather than individual NPC behavior.

Rather than procedural generation, some researchers have used generative adversarial networks (GANs) to create new content. In 2018, researchers at Cornwall University trained a GAN on 1,000 human-created levels for Doom; following training, the neural net prototype was able to design new playable levels on its own. Similarly, researchers at the University of California prototyped a GAN to generate levels for Super Mario.[91] In 2020, Nvidia displayed a GAN-created clone of Pac-Man; the GAN learned how to recreate the game by watching 50,000 (mostly bot-generated) playthroughs.[92]

Non-player characters (NPCs)

Non-player characters (NPCs) are entities within video games that are not controlled by players, but instead are managed by AI systems. NPCs contribute to the immersion, storytelling, and the mechanics of a game. They often serve as companions, quest-givers, merchants, and more.[93][94] Their realism has advanced significantly in the past few years, thanks to improvements in AI technologies.[95]

Narratives and gameplay roles

NPCs are essential in both narrative-driven as well as open-world games. They help convey the lore and context of the game, making them pivotal to world-building and narrative progression.[96] For instance, an NPC can provide critical information, offer quests, or simply populate the world to add a sense of realism to the game. Additionally, their role as quest-givers or merchants makes them integral to the gameplay loop, giving players access to resources, missions, or services that enable further progression.[97][98][94]

Additionally, NPCs can be designed to serve functional roles in games,[94][97] such as a merchant or to provide a service to the player. These characters are central to facilitating game mechanics by acting as intermediaries between the player and in-game systems. Interactions between players and NPCs are often designed to be straightforward but contextually relevant, ensuring that the player receives necessary feedback or resources for gameplay continuity.[citation needed]

Advancements in NPC artificial intelligence

Advances in AI for video games can increase the complexity, adaptability, and realism of NPCs. Traditional AI systems relied on pre-programmed behaviors,[99] making NPCs predictable and repetitive. AI systems now utilize sophisticated techniques, such as decision trees and state machines, to enhance NPC interactions and realism.[100] With more advanced AI, NPCs can become more adaptive and respond dynamically to players' actions. The integration of deep learning and reinforcement learning techniques can help NPCs adjust their behavior based on their interactions with players.[71]

One such development is the use of adaptive behavior models. These allow NPCs to analyze and learn from players' decisions in real time, making for a more engaging gaming experience. For example, 2012 research explored the use of complex neural networks to enable NPCs to learn and adapt their behavior based on player actions.[101] NPCs in modern video games can now react to player actions with increased sophistication, such as adjusting their tactics in combat or changing their dialogue based on past interactions. By using deep learning algorithms, these systems emulate human-like decisions-making, thus making NPCs feel more like real people rather than static game elements.[71][72]

Another advancement in NPC AI is the use of natural language processing (NLP), which allows NPCs to engage in more realistic conversations with players.[102] Before this, NPC dialogue was limited to a fixed set of responses.[103] NLP can improve NPC conversations, allowing them to respond more contextually to player inputs. This development has increased the depth and immersion of player-NPC interactions, as players can now engage in more complex dialogues that affect the storyline and gameplay outcomes.[102][104][103][105]

Also, deep learning models have allowed NPCs to become more capable of predicting players behaviors. Deep learning allows NPCs to process large amounts of data and adapt to player strategies, making interactions with them less predictable and more varied. This creates a more immersive experience, as NPCs are now able to "learn" from player behavior, which provides a greater sense of realism within the game.[citation needed]

Challenges in NPC development

Despite advancements in NPC AI, developers still face significant challenges in designing NPCs. They need to balance realism, functionally, and players expectations. The key challenge is to make sure that NPCs enhance the players experience, rather than disturb the gameplay. Overly realistic NPCs that behave unpredictably can frustrate players by hindering progression or breaking immersion.[106][107] Conversely, NPCs that are too predictable or simplistic may fail to engage players, reducing the overall effectiveness of the game's narrative and mechanics.[106]

Another factor is the computation cost of implementing advanced AI for NPCs. The use of these advanced AI techniques requires large amount of processing power, which can limit its usage.[108][109] Balancing the performance of AI-driven NPCs with the game's overall technical limitations is crucial for ensuring smooth gameplay.[106] Experts [who?] mentioned how developers must allocate resources efficiently to avoid overburdening the game's systems, particularly in large, open-world games where numerous NPCs must interact with the player simultaneously.[citation needed]

Finally, creating NPCs that can respond dynamically to a wide range of player behaviors remains a difficult task. NPCs must be able to handle both scripted interactions and unscripted scenarios where players may behave in unexpected ways. Designing NPCs capable of adapting to such variability requires complex AI models that can account for numerous possible interactions, which can be resource-intensive and time-consuming for developers.[106]

Cheating AI

In the context of AI in video games, cheating refers to the programmer giving agents actions and access to information that would be unavailable to the player in the same situation.[111] Believing that the Atari 8-bit could not compete against a human player, game designer Chris Crawford did not fix a bug in Eastern Front (1941) that benefited the computer-controlled Russian side.[112] Computer Gaming World in 1994 reported that "It is a well-known fact that many AIs 'cheat' (or, at least, 'fudge') in order to be able to keep up with human players".[113]

For example, if the agents want to know if the player is nearby, they can either be given complex, human-like sensors (seeing, hearing, etc.), or they can cheat by simply asking the game engine for the player's position. Common variations include giving AIs higher speeds in racing games to catch up to the player or spawning them in advantageous positions in first-person shooters. The use of cheating in AI shows the limitations of the "intelligence" achievable artificially; generally speaking, in games where strategic creativity is important, humans could easily beat the AI after a minimum of trial and error if it were not for this advantage. Cheating is often implemented for performance reasons where in many cases it may be considered acceptable as long as the effect is not obvious to the player. While cheating refers only to privileges given specifically to the AI—it does not include the inhuman swiftness and precision natural to a computer—a player might call the computer's inherent advantages "cheating" if they result in the agent acting unlike a human player.[111] Sid Meier said he omitted multiplayer alliances in Civilization because he found that the computer was almost as good as humans in using them, which caused players to think the computer was cheating.[114] Developers say that most game AIs are honest, but they dislike players erroneously complaining about "cheating" AI. In addition, humans use tactics against computers that they would not against other people.[112]

In short, cheating AI is when the game seems to break its own rules, producing impossible outcomes.[111] The opposite is dynamic game difficulty balancing, a structured adjustment of AI skill to maintain competition, respecting game mechanics.[115][116] Some games may have a blend of both of these systems at once.[117]