Pac-Man is one of the most popular and best-selling arcade games of all time and is simple to follow. The player is placed in a maze filled with food (depicted as pellets or dots) and needs to eat all of it to advance to the next level. This task is made difficult by four ghosts that pursue Pac-Man through the maze. If Pac-Man contacts any of the ghosts, the player loses a life. After all three lives are lost, the game’s over. In the making of Ms. Pac-Man, in order to increase the difficulty, the creators added in a few new mazes and decided to make the fruit, a high point item, and more of a challenge to collect by making it move across the field. Also, instead of having a set time when the ghosts switch between scatter and chase mode, they completely randomized it.
The ghosts in Pac-Man are always in one of three possible modes: Chase, Scatter, or Frightened. This is when the ghosts pursue Pac-Man, avoid Pac-Man, or turn blue and can be eaten by Pac-Man. In order to be successful in Pac-man, you must understand ghost behavior. The key to understanding ghost behavior is the concept of a target tile. Most of the time, each ghost has a specific tile that it is trying to reach, and its behavior revolves around trying to get to that tile from its current one. When approaching “intersection” tiles, which is indicated in green in the picture, the choice of which direction to turn is made based on which tile adjoining the intersection will put the ghost nearest to its target tile, measured in a straight line. The ghost will choose the path with the shorter straight line. However, this can result in the ghosts selecting the “wrong” turn when the initial choice places them closer, but the overall path is longer. Note that target tiles are only used in chase and scatter mode. In frightened mode, the ghosts pseudorandomly decide which turns to make at every intersection.
The ghosts’ AI is very simple, which makes the complex behavior of the ghosts even more impressive. Ghosts only ever plan one step into the future as they move about the maze. Whenever a ghost enters a new tile, it looks ahead to the next tile that it will reach and decides which direction it will turn when it gets there.
With the ghost’s behavior being more random in Ms. Pac-Man, Microsoft’s AI, the player, had to rely on assigning every object on the maze a priority which then influenced the player’s behavior as it moved throughout the maze. For example, the player knew how to avoid the ghost because of the huge priority it had the closer it got to it. When the ghost turned to frighten mode and could be eaten, the priority then flipped and the player knew to follow after it. With the use of priorities and a heat map of the game.
The AI was able to navigate through every level of the game while avoiding all of the ghosts and eating all of the food on each maze. This led to the AI being the first player to ever beat Ms. Pac-Man with a perfect score of 999990. However, because this wasn’t an actual person, the actual world record is held by a player who obtained a score of 933580 themselves.