Talks And Demos: State Trees and Smart Objects: Data-Driven State Machine Workflows for Open World AI Designs | Unreal Fest 2023

Since the launch of Unreal Engine 5, a lot of work has been put into the State Tree and Smart Objects technology as a more flexible way to manage different parts of your AI workflows than Behavior Trees, with data-binding capabilities that allow for easily passing data around between different states.

Join us as we discuss the evolution of the State Tree technology, and showcase a few examples of building simple behaviors, as well as debugging them with the new State Tree Debugger. We’ll also provide a sneak peek at where we want to take the Smart Objects workflows in the near future to make them that much more flexible for designers, artists, and animators alike.

https://dev.epicgames.com/community/learning/talks-and-demos/mox7/unreal-engine-state-trees-and-smart-objects-data-driven-state-machine-workflows-for-open-world-ai-designs-unreal-fest-2023

2 Likes

Are the files somewhere available to download?
Would like to know how the synching is set up and where you enable/disable the slot.

Edit: I figured a lot of stuff out.
For toggling the slot I just now found that there is a STE Additional Slot Toggle.
I’ll keep looking at the code see how the syncing works

Hey, sorry, the files are not available publicly, and will NOT be available yet in the 5.4 release. Stay tuned later this year, as it’s still the plan to make a version of this available at some point. However everything you see in there is available in the gameplay interactions and Contextual Animation plugins!

1 Like

By far the best and in my opinion the only Useful guide out there, thanks for this. I wish some of the other features had more coverage like this.

Note: I do wish he would have had time to go over the Player State Tree Setup process as well though. I don’t know why but my characters will walk up to the Bench and stand there, the State Tree that the Smart Object has been assigned simply never fires.

Update: You have to use the Interaction version of Move To and Use Smart Object

After doing that though, the Contextual Animation is throwing these errors in the Log:

LogContextualAnim: Warning: FContextualAnimSceneBindings::BindActorToRole. Failed to bind Actor: 'BP_NPC_Friendly_C_0' to Role: 'char_a'. Reason: SO_Bench_C_1 already bound
LogStateTree: Warning: UStateTreeTask_PlayContextualAnim_InstanceData::StartContextualAnim Failed. Reason: Failed to bind SecondaryActor
LogStateTree: Warning: UStateTreeTask_PlayContextualAnim_InstanceData::OnEnterState Failed. Reason: Failed to play the interaction

So for some reason my Smart Object Bench Blueprint is being Bound to the char_a role even though I am setting it as the Primary.

Update 2: So I didn’t realize I did this but I assigned char_a to the Primary Role inside of the Contextual Animation asset.

Hello!

You mentioned wanting more tutorials/guides like this for other features. Would you be willing to share what other features you are wanting to see?

-James

Well obviously one of the most interesting ones with little documentation would be the Motion Matching (Motion Trajectory I believe the plugin is called). However, there are others too that have almost no coverage and have very little documentation on YouTube or in the Documentation and one of those is Common UI. I’ve somewhat stumbled my way through learning how to do things with it that I was unable to find any information on.

I know the Motion Matching one is going to be a bit difficult to do since it requires specialized animations, and it’s under heavy development as well. (Slight Correction, I did recently notice they added a fairly extensive documentation entry on this subject I have not had the time to go over)

There are a few videos somewhat covering things like what they are doing in Lyra but I feel like the more advanced stuff like in relation to On Initial Update, On Become Relevant, On Update…are poorly understood and would benefit from some extra coverage.

On a last note though I will say that as good as this video was, there are so many moving parts when it comes to State Trees and Smart Objects and Contextual Animations and I would most like to see more videos on this given the depth of this workflow.

Just as an example, I have managed to get an entire Intro/Loop/Outro working on a bench but during the looping on the Bench when the looping animation wraps back around the character momentarily begins blending into the idle pose and for some reason my Dependent Slot does not Activate and I can’t figure out why lol.

Edit: I want to add that there are a lot of things that aren’t very clear in regards to Smart Objects, such as how do you get a reference to another slot on the object? I thought maybe I was supposed to manually enable that Dependent slot and tried to figure out how to get a reference to a slot based on tag but It seems I am only able to get a slot reference by searching spatially for one.
If I’m doing this from a State Tree linked to the Smart Object I would intuitively think that I could just search it for the slot with the matching Gameplay Tag I am after so that I can manually enable or disable it if needed.

Actually I did find a feature in Unreal that I am interested in but have no clue what it even is or how it works and I’ve never heard any mention of it and that’s the Anim Next plugin

Thought I would update you guys. It took me nearly 2 weeks but I did manage to solve all the problems I came up against and released a full guide to recreating it using the bench and animations from the Matrix Demo (Although I couldn’t figure out how to use the root motion as they had it, so I did modify the root motion to be more like a traditional root motion animation)

Hope you don’t mind me sharing this here but this is the playlist to that series:

I did struggle with Slot Entrances and Enabling ‘Disabled Slots’ but later I discover the solutions to them and end up having to upgrade to 5.4 so that I could Enable disabled slots.

1 Like

Hey!

First, it is awesome that you managed to figure this out and get a working tutorial running! You are welcome to post it here as a comment, and I would encourage you to post it as a Community Tutorial on the Epic Dev Community so other users could find it more easily.

I spoke with one of my colleagues around the animation areas you had mentioned wanting more in-depth content to help get started with practically using the tools. Motion Matching is brand new in the engine and we realize it is incredibly difficult to work with unless you happen to have been the ones working on it. There is the motion matching sample project which we are working to release which will include a large animation set, and we have an article for the Epic Dev Community in progress to help demystify motion matching as well.

Contextual Animation is in a half-finished state that we plan to get back to active work on eventually. It is used as part of the Gameplay Interactions plugin (which combines Contextual Animation, Smart Objects, and StateTree), and our team is beginning to get ramped up on the work needed for that plugin. As the Gameplay Interactions plugin gets closer to the state and functionality we want, we will start to work on more content around what it does and how to use it. Since it is experimental, we expect to see data breaking changes and system changes, and we do not want to have bad documentation out or try to keep it updated as the system is in flux.

The Anim Next plugin is currently not in a usable state and what we would consider as pre-experimental. We are planning to turn it into the new animation system of the engine, but it will be some time before it is ready to even experiment with for projects.

-James