A ghost chases you through a maze. Chomp that energy pill, Pac-Man! Whew, the ghost ran off. How do ghosts in “Pac-Man” and other game characters know when to chase and when to flee? They’re smart! Well, no, but they do have a form of artificial intelligence (AI). A programmer wrote computer code, or a set of rules, to act as their brains.
Game AI code tells characters where to go and what to do based on what’s happening in the game. These characters have to act smart—but the game also has to be fun. When developers find just the right mix of fun and brains, you get game heaven.
Ready, Set, Change State!
AI programmers use many different methods to bring game characters to life. A finite state machine…
