O'Reilly logo

Behavioral Mathematics for Game AI by Dave Mark

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Numbers to Select

The finite state machine (FSM) depicted in Figure 3.1 is an example of something that is often seen in games. This sort of linearity of action is evident—and even common—in the most rudimentary game AI. For instance, an enemy in a first-person shooter (FPS) or a role-playing game (RPG) may start out in an idle state. Once a criteria is established, such as the player entering a certain radius, the enemy changes to an approach state. This is similar to the transition from state A to state B in Figure 3.1. There is no other option. If the player doesn’t approach, state B is never entered. Continuing on, once the player is within range, the enemy may switch to state C, attack. If it never reaches the player, there is no ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required