November 2018
Beginner
246 pages
5h 23m
English
We discussed FSM in Chapter 2, Finite State Machines, using both simple switch statements and the FSM framework. The decision to choose which state to execute was purely based on the true or false value of a given condition. Cast your mind back to the following FSM of our AI-controlled tank entity:

To make the AI more interesting, and a little bit unpredictable, we can give our tank entity some options to choose from, instead of doing the same thing whenever a certain condition is met. For example, in our earlier FSM, our AI tank would always chase the player tank once the player was in its line of sight. ...
Read now
Unlock full access