ABSTRACT

Writing artificial intelligence systems for games has become complicated as console gamers demand more from their purchases. At the same time, smaller games for mobile platforms have burst onto the scene, making it important for an artificial intelligence (AI) programmer to know how to get the best behavior out of a short frame time. Finite-state machines (FSMs) are the most common behavioral modeling algorithm used in game AI programming. FSMs are conceptually simple and quick to code, resulting in a powerful and flexible AI structure with little overhead. Every game AI programmer should be comfortable working with FSMs and be aware of their strengths and weaknesses. FSMs are a useful tool, but they do have weaknesses. Adding the second, third, or fourth state to an nonplayable character’s FSM is usually structurally trivial, as all that’s needed is to hook up transitions to the few existing required states.