I AM AI
Interactive Agent Modeling for introducing Artificial Intelligence
Finite State Machine Prototype
Finite state machines are a simple and commonly-used approach to modeling non-player-characters (NPCs) where their behaviour is based on sets of state-action pairs indicating what action should be taken in each possible state. Due to their simple nature, finite state machines often do not provide NPCs with complex inner structures, explicit goals, memory, or learning capabilities.
Example:
As seen in figure 1, a finite state machine is composed of a series of states with transitions in between them. For an example of this, imagine a person waking up in the morning. Below is a series of states and transitions. In order to get from State 1 to State 2, the person must first go through transition 2. However, the person can stay in state 1 by choosing transition 1. This is illustrated in figure 2.
State 1: Laying in bed
State 2: Walking around room
Transition 1: Press snooze on alarm
Transition 2: Get out of bed
Prototype Overview:
We used a functionality of Unreal Engine 4 that supports a finite state machine in order to implement a demonstration of a finite state machine. In the demonstration, a human stands in front of the player. When z key is hit, a message that bashes him displays, and the human gets angry. When y key is hit, a message that flatters him displays, and the human gets happy. When x key is hit, a message that tells him that is a joke displays, and the human’s attitude goes back to be idle.
The images below display the agent in each of his possible states and show a sample of the blueprint programming system that Unreal Engine uses in conjunction with C++.
*Figure 1 - http://www.oracle.com/technetwork/systems/fsm-156381.html
*Figure 2 - Team created
![]() Blueprint of FSM used | ![]() Idle state | ![]() Angry State |
---|---|---|
![]() Happy State |

