Over the course of the last few decades, the gaming industry has seen great leaps. From simple games like Pac-Man, Space Invaders, which offered players short recreational means to huge community titles like World of Warcraft and Halo. Artificial intelligence in gaming, or how computer-controller entities interact in the virtual environment, has always been a top priority for developers so that they could keep their products compelling and keep up with the booming frontier of technology. As time progresses, more and more players are interested in how new and advanced gaming resources can make computer characters behave more human-like.
1. The History Of Artificial Intelligence In video games
The use of Artificial Intelligence (A.I.) in gaming has come a long way since the 50s. The integration of A.I. in game design was to improve the game-player experience. In the earliest days of A.I. in gaming, this idea was largely realized in the form of graduated difficulty levels, movement patterns and in-game events determined by players’ input or scripts.
Game playing was an area of research in A.I. from its inception. One of the first examples of A.I. is the computerized game of Nim made in 1951 and published in 1952 (Wikipedia). Several computer programs for chess and checkers were also developed from the middle 50s to early 60s and culminated in the defeat of Garry Kasparov by I.B.M.’s Deep Blue computer in 1997. In the 1970s – the golden age of arcade games, Space Invaders, Speed Race and Qwak were among the very first titles to emerge with a single player mode with computer-controlled enemies. These games saw the incorporation of movement patterns that are also basically the setting stone for many games’ A.I. to come.
2. How A.I. is used in video games
Artificial intelligence in gaming is a very broad term. When addressing that type of A.I., we don’t really suggest any academic learning capability for machines, rather, the decision trees that A.I.m towards enhancing the player experience, fun challenges and making the most out of technological resources. In short, artificial intelligence (A.I.) is used to generate responsive, adaptive or intelligent behaviors primarily in non-player characters (N.P.C.s) to keep players engaged.
Seeing how A.I. is used in video games as mentioned above, it can be understood that A.I. in gaming doesn’t necessarily need to be a model that learns from players’ actions. In fact, it consists of emulating the behavior of other factors or characters from the game. The key principle is that the behavior is recreated as convincingly as possible. So A.I. for games is more “artificial” and less “intelligent” in reality.
3. Examples of artificial intelligence in video games
From around the early 90s, Formal A.I. computation models like Finite-state machine were used for the newly emerged video game then. With advanced genres like real-time strategy, A.I. was made with the ability to solve problems, make real-time decisions and plan based on the in-game economy.
Here we are going to demonstrate some applications of A.I. in various in-game scenarios, taken from some already known titles
3.1. Rules-Based Systems
Rules-based systems are the simplest method of A.I. programming in video games, it sets the first foundation for the term “artificial intelligence” in gaming. This system features a set of predetermined behaviors for each of the characters. The result is a variety of actions that are not too obvious to realize, but there is not much intelligence programming involved.
Pac-Man is the go-to example for this system. Each ghost in the games follows a simple rule set. One always goes left, one always goes right, another turns in a random direction and the last one goes strA.I.ght for the player. We can easily notice this pattern for each ghost individually, then devise a plan to avoid them. As a group, however, their movement appears to be a complex search party, although there’s only one true player-stalker in this case.
Additionally, variables such as aggression, planning, line of sight can all lead to more diverse sets of behaviors, even within a rules-based system. Despite being the simplest intelligence system, it’s still the foundation of A.I., so that more complex systems are built upon it and governed by a series of conditional rules.
3.2. Finite-state machine (F.S.M.)
Instead of solely learning how best to beat human players, A.I. in video games is designed to enhance human players’ gaming experience. The most common function for A.I. in games is controlling N.P.C.s (non-player characters). Designers often program these N.P.C.s to look intelligent to attract gamers. One of the most widely used methods is called the Finite State Machine (F.S.M.) algorithm, introduced to video game design in the 90s.
A designer would envision all possible scenarios that an A.I. could encounter, and then programs a specific response to each situation. Basically, a F.S.M. A.I. would promptly react to the human player’s action with its pre-programmed behavior.
Take Wolfenstein 3D (1992) as an example, the game uses the F.S.M. algorithm to create a list of all possible scenarios a bot can experience. The designers then assigned specific responses the bot would have to each situation, like how they would react upon seeing the mA.I.n character, how ambushes are made depending on the physical locations between the character and N.P.C.s, etc.
The predictability of F.S.M. design is an evident disadvantage. Because all N.P.C. behaviors are pre-programmed, a player’s interest in an FSM-based game may wane after a few plays. As a result, existing techniques like pathfinding and decision trees are frequently used in modern games to govern the behavior of N.P.C.s.
3.3. Monte Carlo tree search (M.C.T.S.)
The Monte Carlo Search Tree (M.C.S.T.) algorithm is a more advanced way for improving the personalized gaming experience. The method of employing random trials to solve a problem is embodied by M.C.S.T. Deep Blue, the first computer program to defeat a human chess champion in 1997, adopted this A.I. tactic.
Deep Blue would utilize the M.C.S.T. to analyze all of the possible moves it could make at each moment in the game, all of the possible human player actions in response, then all of its possible replying movements, and so on. All of the possible moves expand like the branches growing from a tree, hence the term “search tree”.
The A.I. would calculate the payback after many repetitions of this process and then choose the best branch to follow. Each time it makes a genuine move, the A.I. would rerun the search tree based on the still-possible possibilities. In video games, an A.I. with M.C.T.S. algorithm can calculate thousands of different actions and pick the best ones.. The game Total War: Rome II best describes this with its high level campA.I.gn A.I..
3.4. Adaptive A.I.
Adaptive A.I. is often employed in fighting games and strategy games, where the mechanics are complex and the gaming options are numerous. The A.I. must learn and adapt to give a continuing challenge for players without them eventually figuring out the best method to defeat the computer. One notable example of this is Killer’s Instinct’s Shadow A.I. system.
4. Other examples of A.I. programming
Besides variations of actions and behaviors, scripted events are also considered a type of A.I. in gaming. F.E.A.R., for example, features a mysterious little girl who follow players at times to emphasizes the horror element
Being a game well known for its highly engaging A.I., F.E.A.R. also brings out the best of itself with computer-controlled N.P.C.s that can adapt well to many combat situations. Players will most likely notice this with the constant communication between enemies when the first shots are fired or a single grenade thrown out of cover. In addition, Replica soldiers can flip tables, take advantage of corners, walls and many other things to avoid taking damage. They even know how to effectively coordinate flanking attacks on a higher difficulty.
4.2. Nemesis system (Shadow of Mordor, Shadow of War)
Developed by Monolith Productions who holds a patent for the Nemesis system. It’s a database formed by collecting information of every interaction the players make with in-game N.P.C. Actions like fleeing from a battle, finishing off a random character, healing your enemy have consequences all the way up to the game’s ending. Thus Nemesis can craft a quite epic, meaningful storyline by layering detA.I.ls to detA.I.ls, taken from the smallest encounter to the grandest battlefield.
For instance, if you let an enemy live, he could become a helpful ally for the final battle, or enemies will put a price on our hero’s head for killing their warlords. These games offer a unique respawning mechanic for certain scenarios, so that its story of conquest and vengeance with many casualties will not weaken what, at first sight, seems to be a one-time relationship between characters. That’s what makes it possible for Nemesis to create the most unexpected, full of surprises player experience.
4.3. Alien: Isolation
Those who had their hands on this game won’t be able to forget the thrill of being silently stalked by a threat from outer space, rendered completely vulnerable without a weapon to eliminate the Alien.
Alien: Isolation reverses the usual image of a hero combating opposing forces, making them the hunted prey. The programming allows the Alien to always be in the player’s vicinity, somehow possessing acute sensory abilities to track them down at the slightest footstep. As a result, it’s hard to predict the hunter’s behaviors, which leads to a suspenseful experience that would even make veterans go into hiding once in a short while.
4.4. A.I. Director (Left 4 Dead, Left 4 Dead 2)
Also known as the Director or A.I.D., this artificial intelligence determines the games’ pacing, difficulty and enemy placement. For example, instead of having predefined spawn sites for N.P.C.s and item pickups, the Director places them in various positions based on each player’s current health status, weapon and location, giving each play-through a unique experience. The Director also uses emotional cues like visual effects, dynamic music, and character dialog to generate suspense.
4.5. Shadow A.I. (Killer Instinct)
The Shadow game mode allows players to construct and fight A.I.-driven fighters that are designed to match one’s own capability. After three dojo trA.I.ning sessions, the Shadow A.I. can collect players’ data and map various strategic decisions. Once established, the A.I. can also be sent off to fight others online or used as a tool to expose flaws in fighting styles and help players reflect their strategies. Additional data can still be gathered in subsequent fights to improve this A.I. model.
4.6. Interactive characters (open world and story-oriented games)
Natural language processing (N.L.P.) is a form of A.I. computer that mimics written or spoken human communication — in other words, it writes or talks like a person (when combined with real-time speech synthesis).
N.L.P. in games would allow A.I.s to construct human-like conversational pieces and then speak them in a genuine manner, eliminating the requirement for pre-recorded lines of speech spoken by an actor. When combining these factors with A.I.-assisted character animation, which many studios are already employing to supplement motion capture and make characters more intuitively react to their surroundings, we could have N.P.C.s that walk and talk very realistically.
Although video games have received a dramatic improvement in terms of graphics, gameplay, and no doubt their N.P.C.s are capable of more tasks than ever. All the A.I. represented in gaming today still has its core aligned with many terms and examples discussed in the article however simple they may seem. It’s because developers are somewhat hesitant to build advanced A.I. into games in fear of losing the intended experience. Since then, the core principles in video game A.I. programming have still been effective and showing many potentials.