Artificial Intelligence For Games

The use of artificial intelligence in game applications has a long history because games provide a good environment for problem solving (which humans like to do). The problems are introduced in a defined domain and the results are easy to evaluate. Many games, such as card/board/puzzle games like Go-Moku and the Nine Men’s Morris, have recently been solved using AI techniques. IBM’s Deep Blue victory over Kasparov was another milestone event.

What is Artificial Intelligence?

Artificial Intelligence can mean many things to many people. So much confusion arises that the word is not very well defined. The phrase is so broad that some people have found it useful to divide AI into two classes: strong AI and weak AI. Strong AI makes the bold claim that computers can be made to think on a level (at least) equal to humans. Weak AI simply states that some “thinking-like” features can be added to computers to make them more useful tools. This has already started to happen with witness expert systems, drive-by-wire cars, and speech recognition software.

The Human Thinking Process

When humans play a game, we depend on a brain search through an enormous number of positions and strategies. We cannot use methods that depend on the possibility of executing a billion instructions a second; the neurons in our brain fire at a millionth of that rate. Because our brains operate so slowly, serial methods to solve problems are generally ineffective for us, especially when we multiply large numbers. We also commonly use them to solve puzzles, such as Rubik’s cube, and brainteasers.

Although we are capable of applying reasoning to solve brainteasers, the reasoning itself seems very unnatural because we typically give up on parallel methods, and instead search through the possible combinations. For artificial intelligence, this method is referred to as “puzzle mode” reasoning. Machines are good at it, because their hardware is designed for it, but humans are not. And unlike the human brain, which is stuck where it is, computers can improve their game-solving ability with faster hardware and more efficient programs.

The most important question when judging a game’s intelligence is the goal-directed component. The method followed in many of today’s computer games is to use pre-determined behavioral patterns. This is normally done using simple if-then rules. When using more sophisticated approaches such as neural networks, behavior becomes adaptive, but the purely reactive property has still not been overcome.

The New Video Game Intelligence

Now things are changing. Artificial Intelligence is a high-priority feature in the fast-growing, multi-billion-dollar electronic video game market. The revenue from PC games software alone, is already as big as that of big box office movies! The success of many game programs can mainly be attributed to the vast increase in computing power, which uses exhaustive-search and knowledge-base methods. Modern computer games are infinitely more complex than traditional games. They are usually played in real time, and they allow very complex player interaction with a rich and dynamic virtual environment. The new “gamers” increasingly expect more game intelligence as they progress in order to keep their interest. Some games feature real time, full motion, first person 3D combat simulation; life-like character models simulated in real time using unique dynamic physics; integrated full motion video providing visual realism: unique team members for each mission based on individual skills; digital stereo soundtracks, sound effects with 3D Audio, and original music score all of which totally immerses you in the adventure.

Many people are looking for games that are real, lifelike, alive, and which take us to a new reality. Game Developers are striving to create an illusion of life, of which Artificial Intelligence is a major component, and they often use very interesting techniques to capture your attention, and more importantly, your reality. They concentrate equally on intelligence, personality, interactivity, and re-activeness, especially with strategic games, in order to make the games more interesting and challenging. Characters that can watch you, smell you, hear you, track you, and provide different reactions from game to game. Characters that are smart enough to run from a fight that they’re losing, and to get reinforcements; Squads of enemy soldiers that actually move in formation, with covering fire and fallback positions; Characters that use flanking moves, that will sneak up behind you, and which will lure you into traps and ambushes.

Intelligence Programming

The brain of the new game character comes from hundreds of hours of internal play by the developers; every time a particularly nasty trick or sneak attack by one of the players worked out, it is incorporated by the designers into the character’s AI database. With strategic battle games, the computer knows certain strategies that are common, including things like frontal assaults. When you play for the first time, the game is even. The developers program the characters to retain information about the game. They remember where you attacked them, or how they attacked you, etc. The characters remember your general playing tendencies so that they can improve playing against you.

Tactical and Strategic AI

Optimal strategic game play should allow you to experiment and get creative with your solutions. The strategic AI working in tandem with the individuality of the tactical AI creates a dynamic, responsive, and improvisational opponent with quite a few tricks up its sleeve. Tactical AI gives characters their individual personality and intelligence. It tells them how, when, and whether to perform advanced behaviors like finding cover, taking hostages, etc. Strategic AI is the player’s true opponent. If you’re playing a game, then the Strategic AI controls the characters. Ideally, Strategic AI should be good enough to make you feel like you’re playing against a human opponent who acts and reacts dynamically.

Advanced Game Intelligence

The ideal situation is that the gamers will see no difference between playing the computer, verses other humans. Advanced game intelligence enables non-player characters to behave spontaneously based upon their built-in personalities, abilities, and their perception of the environment. Thus, not only do different characters react differently under nearly identical conditions, but, the same character can react differently each time you replay a specific mission. Of more interest perhaps is the plan of providing full and total access to the AI to players. There are features that allow more advanced users to write scripts (instructions) that provide unparalleled levels of game play. The AI can be built as a dynamically loadable .DLL file and the interface spec made public, thus allowing budding AI developers to write their own AIs if they want to improve the game.

AI Game Technology

Fuzzy logic is generally applied to the highest level of tactical game intelligence. Consider this scenario: when fired upon, the programming of the character calls for the character to respond. The character may have several behaviors to choose from: Flee, Take cover, Shoot back, or Shoot a hostage. Each character has a predefined “personality” consisting of mental characteristics such as: Aggression, Courage, Intelligence, and Cooperation. The character’s response depends upon its personality, but with a slight random element to increase interest and realism. Triggered by an event in the character’s immediate environment, the game sends the character’s personality traits through a set of simple rules like “If Aggression is high and Courage is high, shoot back” and “If Courage is low, flee.”. Fuzzy logic systems consider hundreds of variables through dozens of formulas, eventually coming down to a probability of a particular action that a character will perform.

There are also real-time strategy games that implement a real-time learning neural network (NN). Rather than use a pre-determined set of choices in reaction to what a player might do, it will watch what the player does, and learn from past actions. Character behavior based on player’s actions moment by moment: Characters might advance only when it makes sense to. They assess how much health the player may have, where the player is heading, how many of their own kind are left in a room, and whether they have enough health themselves to fight. Such conditions and others dictate whether a character will chase, attack, or retreat. While in other game characters are basically suicide squads.

Some of the games are sophisticated enough to learn each player’s playing style, and to be able to mimic them if they leave. The characters possess more sophistication having personality stats with the senses of pain, sight, hearing, and smell, using this ability to track players and lead other characters to where the players are hiding. Some games use both squad and flocking behavior to give its characters more life-like responses. Adversaries can make a threat assessment, recruit others and then plan a coordinated attack against the player, similar to the flocking behavior of animals such as birds and fish. Schedules of behavior tell the character what it should be doing. Plus, there is a form of AI called Non-Stationary Entropic Reduction Mapping (NERM) where characters adapt to the environment without the player’s intervention or assistance.

Other games use genetic algorithms to guide the computer opponent play. They come pre-stocked with ‘DNA’ strands, which are rules governing the behavior of the computer opponents. As each DNA strand plays it tracks how well it did in every battle. Between battles, the user can allow the DNA strands to compete against each other (and/or the player’s DNA strand) in a series of tournaments, which allow each DNA strand to evolve. There are a number of governing rules for DNA strand mutation, success, etc., and the user can edit a given strands’ DNA ruleset if so desired.

Blackboard technology guides both the player and computer squads throughout the game, and it is a cooperative AI technology, in which a problem is made open to a group of AIs (which can be neural networks, genetic algorithms, whatever) and each AI contributes towards solving a piece of the problem.

AI Game Development Issues

The biggest problem is the balancing of the artificial intelligence engine. Months and months of work go into getting appropriate behavior for any given set of circumstances. Often this just involved adding more parameters to the engine to account for the new circumstance, but several times it requires an adjustment to the current values, putting more emphasis on one or more parameters, which then causes other behaviors to get out of whack given slightly different circumstances.

Also, most AI cannot be written to be effective until late in the development cycle because it needs a functional game environment to see the effects of the AI. Then the developer is faced with a choice of spending several more months to get the AI right, or to release a fully functioning game with limited AI capability. Most choose the latter.


There are many forms of artificial intelligence technology being used for electronic video games, and developers are striving to bridge the gap between the game, and reality. Increased computing power and spectacular visual graphics have made these games incredibly realistic, and it is only going to get better. Plus, gaming technology is merging with motion picture technology, and soon you will be able to play inside a movie. We are moving closer to the day when it will be difficult to distinguish between what is real, and what is part of the game. We don’t seem to have much choice about this because the development is moving faster than it can be stopped, but the technology is so compelling and it is difficult to try.

Author: David Jurus