Documentation

Learn how to use NodeCanvas

Download PDF Version

State Machines

States

Every node but a few in an FSM is a State. A state will do some actions as soon as it Enters, while it is Running and as soon as it Exits. Within an FSM, only one state can be active at any given frame. While a state is active, all of its outgoing Transitions are evaluated per-frame and as soon as either of them returns True, that transition takes place and as a result, the current state Exits while the new state Enters. No more than one transition can take place within a single frame.

Transitions

Every State in an FSM can have outgoing Transitions. In NodeCanvas, transitions are condition-based which means that each transition evaluation is based on one or more Condition Tasks that can be assigned to that transition. Alternatively, a transition without any conditions assigned is what is called an “OnFinish” transition, which as the name implies, will only take place as soon as the parent state is Finished. When you have multiple outgoing transitions in a state, you can prioritize the order in which they are evaluated through the state’s Inspector GUI. This is obviously important since only one transition can ever take place at once.

By default, transitions are evaluated per-frame, but there is also an option to only evaluate transitions after the state is finished. The option to choose between one or the other behaviour can be found in the state’s inspector GUI, respectively named “Check Continuously” (the default) and “Check After State Finished”.

Further Reading

Here are some interesting links on the net regarding State Machines:
TutsPlus

Yes No Suggest edit
6 of 8 users found this section helpful
Suggest Edit