Documentation

Learn how to use NodeCanvas

State Machines

States

An FSM contains a finite number of states where the FSM can be at any given time. Each state performs a certain task or a number of Action Tasks for as long as it is active. While a state is active, all of its outgoing Transitions are evaluated either per-frame or once after the state is finished, and as soon as either of those conditions is true, that transition takes place and as a result, the current state is disabled and the new state is enabled. Only one transition can take place within one 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 hold true only after the state has 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 only once after the state is finished. The option to choose between one or the other 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
16 of 18 users found this section helpful
Suggest Edit

© Paradox Notion 2014-2024. All rights reserved.