Advanced Topics

Trigger Event policies

Remember the Trigger Event node? We still have to discuss the five advanced policies that were briefly introduced in the Working with an FSM section. The policies can be used to tweak the effect of the Trigger Event node. Each policy can be specified either in the Details panel of the node or as a pin in the node itself. Moreover, at the bottom of the Trigger Event node itself, graphical icons reminds you about the different policies selected for the node.


Advanced debugging

We already saw that when you debug an FSM in the blueprint editor, the active state is clearly identified with a red balloon. There are two more balloons you might see:

  • a yellow balloon will list the events that have been queued and deferred by the current state. The age of the event and whether they have expired or not, will also be shown.
  • if the state has an implementation class, the class may override the GetDebugInfo function. During debugging only, that function will be invoked every frame while the the state is active. If the function returns a non-null string, it will be displayed inside a green balloon above the state node.

Visual Logger

GC FSM sends events to the Visual Logger that is built-in in the Unreal editor. This can be extremely useful to debug FSM when timing is crucial. You can find a description of the Visual Logger in the dedicated documentation page on the Unreal website. GC FSM logs the following events on the logger:

  • Log level:
    • An FSM is started/stopped
    • A state is entered/exited
  • Verbose level:
    • An event causes a transition
    • An event is deferred
    • An event is processed by an internal event handler
  • VeryVerbose level:
    • An event is queued
    • An event is discarded: this case occurs when the event is received, but either the active state does not handle it or the queue policy is “Unique Event: Keep First” and there’s already a matching event in the queue
    • An event is abandoned: this case occurs when an event is initially deferred and inserted in the queue, then the FSM makes a transition to a state that does not handle the event