Allow the creation and usage of State Machines outside animation

It would be great if we could create and use FSMs for more things than just animation. Say I have a complex UI that has many states and possible transitions, having an FSM enforce valid transitions would be great. This is just one use case, FSMs have many uses, the editor is there so why not extend it so generic FSMs can be created to control whatever developers need and decide FSMs are the best choice to tackle their problem?

I’m currently considering switching over from Unity, so far Unreal Engine comes built in with everything I use that exists in the Unity ecosystem, but I’m a fan of State Machines. Unity doesn’t have a built in generic State Machine editor, but I use an extension called Playmaker and it’s great. I know we can always code an FSM in C++ but having an editor to create and debug it is invaluable.

I second that! Kinda like StateMachineBehaviours in Unity

Great idea!

we really need: State Machines integrated with Behaviour Sub-Trees (Unreal built-in) and integrated with Blueprints Visual Scripting (of course!)… like: NodeCanvas [for unity]
https://.assetstore.unity3d.com/en/#!/content/14914

Hmm… Last week I built exactly this for a project.
I made a plugin which generates a custom actor component attached to pawn/character/whatever. the component is a State Machine where I can add/set/remove/tick states with name and machine IDs.
Each State can have function bindings and they can fire OnBeginState, OnUpdateState and OnExitState, and from there I execute the functions I want for when character enters a different state, etc.
It is also exposed to Animation blueprint, and linked to Behavior Tree editor so I can set/add/remove states from Behavior Trees directly…
If Epic consider make a little change in source code someday, then I can also link it to AnimGraph machine states as well.

I could share someday, if I find time to document how to use the custom actor component.

BrUnito:

  1. Could you share (with me) the plugin as a BETA-tester (WITHOUT documentation) while you put it on the marketplace…

  2. Your plugin can call 1 Sub-Behaviour Tree FROM 1 FSM-State ? (i.e. mean: 1 FSM-State can NEST to 1 Sub-Behaviour Tree?)

There’s already docs for it, Epic is already evaluating the Plugin to see if it is quality work to be published; 's a link for a guide on Wiki: A new, community-hosted Unreal Engine Wiki - Announcements - Epic Developer Community Forums

You can do it that way if you want. One BT can control the whole FSM Component or you can make one BT blueprint for each State you have in the FSM Component.

I think we can all agree we could use something like PlayMaker in UE4.

's PlayMaker:

While many use PlayMaker for visual scripting what I want is a visual state machine editor.

No, not everybody agrees that’s we need anything like PlayMaker in UE4.
It’s inferior, functionality is very limited, it’s primitive tool if you compare it to blueprints.

Of course it would be nice to have to state machine for general use. But often you can use blueprint as workaround. Use Tick and switch on your custom enum (which is controlling loop). Just don’t add any other code to the script which would interfere with you flow controlled by Tick.