July 1, 2017

The secrets of Artificial Intelligence in classic games

The old classic computer games were fun and often challenging because of the Artificial Intelligence that controlled the enemies. But how could the AI in those old computers be challenging? This will be a short description of how the AI in classic games was working and the tricks they used.
  • Warcraft. The AI was waiting for some fixed amount of time, and then started spawning a wave of units to attack you. It would spawn these units at the edge of the gray fog and not at the base as you first may have thought. It continued to spawn these units until your defenses were nearly overwhelmed - and then it would stop, leaving you to kill the remaining enemy units and win the fight. So the AI didn't have to worry about building buildings, saving money, or building units. 
  • Pac-Man. The AI had two states: normal, which is when the player is collecting dots, and another state when the player has eaten the power-up. In their normal state, each of the four ghosts moves in a straight line until they reach a junction. At a junction, they randomly choose a route to move to next. Each ghost chooses either to take the route that's in the direction of the player (calculated by using an offset, so no pathfinding), or to take a random route. The choice depends on the ghost: each has a different probability of doing one or the other. This sounds like stupid AI, but those who played the game thought the AI was smarter, arguing the ghosts tried to set a trap or group up to attack the player.
  • The Sims. This game put the intelligence in the world and not in the character. The objects in the world, like a fridge or a television, tell nearby sims what they offer, such as food or entertainment. The object will also tell the sims how to perform the action to get the offer. 
  • Starcraft. The game had several pathfinding problems. One of these problems was that the units who collected minerals jammed. The solution was: "whenever harvesters are on their way to get minerals, or when they're on the way back carrying those minerals, they ignore collisions with other units."

Sources

No comments:

Post a Comment