In computer simulations of board games •
Computer chess •
Computer shogi •
Computer Go •
Computer checkers •
Computer Othello •
Computer poker players •
Akinator •
Computer Arimaa •
Logistello, which plays
Reversi •
Rog-O-Matic, which plays
Rogue •
Computer players of Scrabble • A variety of board games in the
Computer Olympiad •
General game playing •
Solved games have a computer strategy which is guaranteed to be optimal, and in some cases force a win or draw.
In modern video games Game AI/heuristic algorithms are used in a wide variety of quite disparate fields inside a game. The most obvious is in the control of any NPCs in the game, although "scripting" (
decision tree) is currently the most common means of control. 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.
Pathfinding, another common use for AI, is widely seen in
real-time strategy games. Pathfinding is the method for determining how to get a NPC from one point on a map to another, taking into consideration the terrain, obstacles and possibly "
fog of war". Commercial videogames 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. 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. 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. In addition, waypoints tend to perform worse than navigation meshes in complex environments. 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...) or collaborating with them (group navigation). Navigation in dynamic strategy games with large numbers of units, such as
Age of Empires (1997) or
Civilization V (2010), often performs poorly; units often get in the way of other units. 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.
Video game combat AI Many contemporary video games fall under the category of action,
first-person shooter, or adventure. In most of these types of games, there is some level of combat that takes place. 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. 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 were in a specific area then the AI would react in either a complete offensive manner or be entirely defensive. 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. These developments ultimately 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. 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. 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 that 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 behind it until it has reloaded. Actions like these make the AI seem more human. However, there is still a need for improvement in this area. 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. In the case of
Doom, published gameplay manuals even suggest taking advantage of monster infighting in order to survive certain levels and difficulty settings.
Procedural content generation Procedural content generation (PCG) is an AI technique to autonomously create ingame content through
algorithms with minimal input from designers. 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. 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.
Procedurally generated levels Generative algorithms (a rudimentary form of AI) have been used for level creation for decades. The iconic 1980
dungeon crawler computer game
Rogue is a foundational example. 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. 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. Opinions on total level generation as seen in games like
Rogue can vary. Some developers can be skeptical of the quality of generated content and desire to create a world with a more "human" feel so they will use PCG more sparingly. The algorithm is able to assess the current mood of the game state through "mood tagging". Research indicates that there is a significant
positive statistical correlation regarding player rated game engagement and the dynamically generated musical compositions when they accurately match their current emotions.
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, and companies like Ubisoft have stated that they are experimenting with using AI to generate basic dialogue. 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.
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 method 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. 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.
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: 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. == Non-player characters (NPCs) ==