Game Development Reference
In-Depth Information
A computer can be in various states. To keep it simple, we will list three main states.
These states are On , Off , and Active . The Off state is when the computer does
not have power running it, the On state is when the computer does have power run-
ning it, and the Active state is when someone is using the computer. Let's take a
further look into our computer finite state machine and explore the functions of each
of its states:
State
Functions
• Can be used by anyone
• Can turn off the computer
On
• Can turn on the computer
• Computer parts can be operated on
Off
• Can access the Internet and various programs
• Can communicate with other devices
• Can turn off the computer
Active
Each state has its own functions. Some of the functions of each state affect each
other, while some do not. The functions that do affect each other are the functions
that control what state the finite state machine is in. If you press the power button
on your computer, it will turn on and change the state of your computer to On . While
the state of your computer is On , you can use the Internet and possibly some other
programs, or communicate to other devices such as a router or printer. Doing so will
change the state of your computer to Active . When you are using the computer,
you can also turn off the computer by its software or by pressing the power button,
therefore changing the state to Off .
In video games, you can use a finite state machine to create AI with a simple logic.
You can also combine finite state machines with other types of AI systems to create
a unique and perhaps more complex AI system. In this chapter, we will be using fi-
nite state machines as well as what is known as a behavior tree .
Search WWH ::




Custom Search