#gameplay-ai
1 messages · Page 85 of 1
Yeah my experience is with games with heavy AI, animation, navigation etc. "proper" npc's
Zombies are, without a doubt, by far, my main area of interest for AI 🤣
Project Zomboxxigar when
It's in the works. But I have other projects to tend to first
:D
Like, I'm not even kidding either, lol
I make so many zombie game/prototypes and talk about so many ideas - it is a running joke in my gamedev circle
So pretty much every game has some kind of zombie in it
Even conjured up a zombie dating sim game 🤣
Mainly as a joke, but still
That sounds like it could be a hit
You should definitely Game Jam that...
Common AI Behaviors plugin is shaping nicely
In this session, Roland Geraerts of uCrowds explores the core design ideas of the TerraCrowds engine, including its integration with Unreal Engine components like MetaHumans and MassAI.
This session covers memory-oriented design, crowd logic for controlling characters, and the Explicit Corridor Map for efficient pathfinding. Other topics inclu...
does anyone know why breakpoints on state tree in blueprint dont work?
I feel like im missing something obvious
It works but will be after IDE, BP graph breakpoints
Be sure the breakpoint can actually be triggered
Tick aggregation, vblanco trick, significance manager, multithreaded anims and somehow making montages not bottleneck cpu helps you reach ~50 on PS4 hardware i think
wdym
I know that the tree runs those states from breakpoints in cpp
Weird
also i see that my state tree completely ignores an event lol
doesnt even evaluate it
Show setup and give context
theres nothing crazy going on
it usually cycles the last 3 states
and goes back to root
I know that this runs
I guess i can try tacing what it does with the event in cpp
We use all those tricks (+some more) but not the VBlanco trick. No idea what is that
Do you have the state tree debugger open for the tree? Breakpoints for state trees only work if the state tree debugger is active
ah that would explain it
Does state tree have debug info for events?
I dont really know what its doing with the event i sent it
Check debugger
Very nice one
Is it supposed to pop up in the debugger that event failed?
i dont see anything
Play your game and pause/stop when the event should of been triggered
Playback in state tree debugger to see if it got tried
hmmm it doesnt show me anything
Ok i just figured im dumb
i was supposed to force transition from states in root
cant just expect the tree to transition because i sent it an event'
So... I need context. Where is that function supposed to be called?
I imagine you are discussing something in the thread but not sure what / with who. Also do you have the original source of info? Who is VBlanco?
It does what MoveComponentImpl of UPrimitiveComponent but skipping all the unnecessary steps
Instead of moving something with a movement component which calls MoveComponentImpl, so use that static function to update the location manually
~2.6x faster on megafunk's tests
for example, that MoveComponentImpl is beyond disgusting yet it runs for a niagara particle
a particle which has no collision does not require any of the things that function is doing
Ok so this is not for characters but for other things withiut physx no?
for components that does not require the steps MoveComponentImpl doing, so its for components characters using
but probably not for the capsulecomponent
it could still work for capsulecomponent if you dont need how it slides you once you collide with a wall etc.
unity-like basic movement
biggest problem is marking render state dirty cant be threaded
if you can achieve that vblanco trick can run on other threads
vblanco is an engineer that implemented this to pubg iirc
he shared the code with us through megafunk
he was quite active in early days here
Is that anywhere around I can check? Github?
I don't know what megafunk is
Aaaah I see ok ok
Thanks a lot for this.
Ah wait hahaha this is Vori's repo!
We worked together for a bit in the se company
I talked about this with him but never checked the repo
Nice
ah yeah, mega and vori authoring the repo together 😄
I have seen Siggi mention the term property binding functions a bunch -- can someone explain what that means exactly? I'm looking for a way to bind functions in state tree nodes (primarily conditions) so I don't need to sync duplicate state (e.g. I don't want to bind to a bIsVulnerable, I want to bind to a bool IsVulnerable() const), I'm wondering if this is what he's referring to and if so how do I do this?
how do you make enemy ai? i’m specifically confused about state tree tasks but really any ai in general
likely yeah
it exists in anim BPs but not on state trees
i dont know what is the technical reason it didnt exist at the first place or was it a design decision but it'll improve things a lot
check the pinned messages
there are many inspiring resources to get you started
Hi all! I was wondering if someone could help me figure out the Move To Actor Or Location node, I want to use the actor goal and have my ai follow a toy ball as the continuous goal. But when I use an actor and the ai is within the acceptable radius, it isn’t firing off the finished event.
So I swapped to see what would be different if I used the Location of the toy ball actor as a goal instead, and it fires off the finished event just fine, but of course the ball would not be in the location the ai went to (because the ball is rolling around). This is why I wanted to use the Actor goal instead and get notified when the ai has reached the ball (and then kick it).
Any suggestions appreciated! I tried explaining the best I could ^_^
yes you can bind to a function like that, its exactly what binding functions are for 🙂 There are a few that ship with the framework you can look at for reference on how to make your own (its easy!).
Heyop - any idea why the EQS appears to work differently run time. The test pawn shows the 0 score on where the character is at and two green ones in the flank. In the in-game view, the character (BP_Valkyrie) moves to one but the point scoring appears to ignore the Distance to Querier filter. 😩
(Test pawn in the first image has the same valkyrie model. The context is player start in editor - and the player in game)
task handles arent unique across multiple state trees ?
two state trees on two different AIs will return the state state handle for the same executed state
I'm not sure about this but isn't the handle a way to identify a state in a tree to grab its Execution data?
Probably, but it seems it can be deterministic
If 2 AIs runs the same events with same runtime data
Handles are incremental from 0 (not valid) to N. If they run the same in the same order...
my AI Moveto isn't working even though i set a location and what happenes on success. Can i Get help? (Yes, I have navmesh)
how do i check vislogger?
This is great, thanks! Just so I'm sure I understand, let's say I have a UHealthComponent which is part of my tree's context. I have a function bool UHealthComponent::IsVulnerable() const --> in order to use this function via binding, I basically need to create a wrapper where I define InstanceData that has a member UHealthComponent* HealthComponent, then I define a struct that inherits from FStateTreePropertyFunctionCommonBase and the override its Execute function where I'd do InstanceData.Result = HealthComponent->IsVulnerable() ?
the binding function gets the context, and through that you can just grab the health component directly. Pretty much can do whatever you want 🙂
so its just like in the anim graph, right?
Does anyone know how to mitigate delayed animation montage section playing on clients? I have a state tree triggering a gameplay ability on my AI that is a serveronly ability and is supposed to play an animation montage section that is to melee attack. On the Listen Server it's fine, but when I switch to client it lags at the start of the animation and then finishes the animation and calls my OnMontageCompleted function. I tried making a Multicast function on my pawn that is called by the GA to play the animation on the clients, but there is still a lag
Im not familiar enough to answer that 🙂 but pretty sure its not the same tech, afaik we only use our property binding in state tree and smart objects
Are there any plans to add bindings to the utility weight parameter in nodes in the future?
Телеграм канал!!! - https://t.me/chE_pUhaaa
Дискорд сервер!!! - https://discord.gg/AWdYDgjBbN
Підтримати Хеквіза(і чєпуху!) - https://donatello.to/HackWhiz
Підпишись і постав лайк, не будь чєпухою...
Таймкоди:
00:00 - Вступ
01:15 - Яке завда...
i'm trying to disable RVO collision after an enemy dies, so that other enemies don't yoink around the corpse and will just run through it, but nothing seems to work. I've tried a few recommendations from around the internet:
- detach from controller pending destroy
- un possess
- updating avoidance group mask
- changing movement modes
but none of them seem to work. I'm 99% sure its not a collision thing, because disabling RVO entirely prevents the behavior. it just seems that disabling it when they die has no effect
This is more of theoretical than something more concrete. For enemy AI design using a ticket system, how do you guys handle using different moves that may have different range requirements with tickets?
Haven't looked at RVO in unreal for ages but... What does it take into account to avoid and what's the function in its logic that calculates what does the AI need to do to avoid things?
If you figure out those two, you will learn how to disable it
There should be a function (probably in the movement component or the AI Controller) where it looks to nearby agents to calculate the velocity
Hello, i have a really weird bug where my state tree execute 4 or 5 times for one controller. I have a state tree ai component on my ai controller, i disabled the start automatically and just called start logic in the possess event. When i play in editor, with one player, i have 4 execution lines in the debugger of the state tree. I created a task that is executed on the root node and that juste print string for one frame, and the print is appearing 5 times. I testes with the ai being spawner as well as being places in the world but i have this bug in both cases. Does anyone have any clue about this ? I am using 5.5
I have an evalutor where i print string that is called only once
The state trees code have a thing that is a bit unsettling: a while loop with a 5 loops limit that will run taks up to 5 times to ensure all the transitions trigger. Which causes sometimes to get your debug and logs 5 times. I always found that difficult to explain and justify. Check the code in Execution Context where the transitions are evaluated.
So it is a normal behavior ? That's so weird
That means my tasks are executed multiple times one the same frame it feels like a bug more than a feature
Yep. I agree. Sounds like a bad hack
Can you telle me where you saw the code of the while loop i'll try to check as well to understand
If memory doesn't fail, State Tree Execution Context class, in its tick, there's a function to evaluate transitions
Ctrl+F "while (" and you should find it
I'm in a car in a road trip so no way I can check
Not currently. What is your use case here?
Okay thanks i will check that !
Ahah no worries, thank you !
The loop uses a variable Calle MaxIterations iirc
Aaah it's not a while, it's a for
Oh yeah i just saw that, this is a really weird behavior, all tasks will be executed 5 times wtf. I guess i will create my function directly inside the ai controller
But it is weird that on the debugger itself there's 4 executions lines, i think it is a different problem
Using weights as scores and having nodes as goals that can dynamically score theirselves. Another task on the parent node might update bound parameters based on world state to influence the selection
Right now my custom AI system does everything state tree does minus the editor. Each goal returns an array of score struct and utility component does the calculation based on the data it received to select the most important goal. Only missing feature right now to carry this to ST is dynamic weights/scores
Why not use considerations to represent the changing world state? Thats what they are for, but we have some work left to make them better (like multiplying considerations together)
I didnt know about considerations! will check it out asap
alright, I completely missed we can even add float inputs
appearently what I was looking for already existed for a long time
anyone knows from where is the stimuli debug trace sphere and age drawn ?
cant find it, thought the perception comp/system still had an dead stimuli but Perceptual Data is empty
so idk where it comes from
If you want to really dive into utility AI, I really recommend one of Dave Mark's GDC talks 🙂 for example "Building a better centaur" is good!
did you check Vislogger or Rewind debugger?
could also be in gameplay debugger 🙂 (yes, we are working on consolidating it all)
looked into it, it draws data to screen on HUD, but no debug draw in worlds (at least nothing with "age" in it)
stimuli is part of perception yeah, you seeing entries you dont know where are coming from?
Hey siggi, while you are here im wondering if you know about the function binding layout bug ?
https://media.discordapp.net/attachments/221798778208780288/1424505446210736220/statetreefuncbug.gif?ex=68ee14d4&is=68ecc354&hm=7c24f8d64f81721237abd8bc0ce6108bc3864fd0fa33e4dc5c6a366dc9917e78&=&width=1697&height=1224
w/e i try i ALWAYS get this when i try to repro
#gameplay-ai message
gif is low fps but basically it spams the collapse/uncollapse so nothing is usable
there is a debug draw of a sight perception, it ages forever (which is expected since my AISense Sight uses NotifyType = EAISenseNotifyType::OnEveryPerception which doesnt run the aging system of UE, or at least doesnt call the Forgotten delegate)
but after the MaxAge, i dont see the stimuli anymore on the perception comp & system, but its still drawn
you looking specifically for the code where the debug drawing is happening yeah?
@hallow compass I guess you've already seen UAISenseConfig_Sight::DescribeSelfToGameplayDebugger() ?
hmm, so my final mental struggle is - in my current system each goal scores itself and a component that manages all scoring system just calls Goal->Score(...);, while in ST its more "top-down", as in, it looks like scoring and considerations only happen through the state tree graph. but it makes a lot of sense since collection of systems form a behavior in the graph instead of tasks creating monolithic behaviors through OOP. Composition over OOP i guess
so if I have a tree that has a sequence of nodes that links two assets: "slide towards enemy (one asset) and shoot enemy (one asset)", that always has a requirement of a same specific condition to get a higher score everytime, I'd need to put that consideration everytime I link the state tree asset combining two behaviors because there is no way for ST to receive this info from the asset itself
am I right or is there any workflow to make this easier 🤔
The scoring is run as a state selector, and yes you have to have those states pre-authored. We are looking into ways to expand on this in the future, for example to score multiple targets (like ranged attack 10 different targets, and score them on distance, hp remainin etc).
For runtime composition, you might be able to have "slots" for activities in your authored tree that you override at runtime (using tags) with external assets if you want to re-use specific states across multiple trees or selector nodes.
Having to score each action separately is a cornerstone of utility scoring, and the re-usable pieces are the considerations (like distance, or remaining health on target).
UAIPerceptionComponent::DescribeSelfToGameplayDebugger() is handling the stimulus
thanks!
anyone know if you need to add nav data collision to a mesh in order for AI to jump on top of it? Or is there an actor or reusable thing to use you can just drag out and it will add it for you?
Any primitive with a collision and nav enabled can do the job
Quick question, I'm trying to use AI StateTree schema with my StateTree Asset on my Enemy AI Controller class as a component. I know about the "Context" use in StateTree task variables to get the State Tree context actor as a State Tree built-in feature, however this is my first time using the* AI State Tree schema* and I've assigned the Context Actor Class to to be MyChracterClass and my AIController Class to be MyAIControllerCustomClass however, even though in the StateTree Editor UI there's mentioning of both, in one of my tasks if I try to create a "Context" variable of type MyAIControllerCustomClass it's still invalid. Is there a proper way of initialising the AI Controller Context variable in State Tree Tasks when using the AI StateTree schema with StateTree assets on AI Controller classes?
I've attached some quick screenshots to better explain. I know there's the option of using the Context Actor class instead, but I was hoping to use the StateTree asset by attaching a StateTree component onto my AI Controller rather than the Character class. Does anyone have any experience with this? I tried googling and looking for YT tutorials but everyone just seems to use the Actor Class as Context instead 🤔
Has anyone tried to train an Open LLM onto the Unreal Engine 5 source code to create an actually useful, correct code helper for "vibe coding"? ChatGPT and others just hallucinate the shit out of everything. And provide at best 70% correct solutions.
Anyone know why my navmesh works in editor but not when packaged?
There's the AI assistant that is available on both Web and editor in 5.7. It also generates code.
I would avoid "vibe coding" since it's an euphemism for "let's skip the learning process and produce really bad code"
https://dev.epicgames.com/community/assistant/unreal-engine
Multiple reasons.
What's your nav configuration?
Your euphemism implies inexperience. I'm looking for an accurate replacement for all the Unreal documentation that has been wiped out. Basically asking for code snippets, etc. But thanks for the link - I had no idea Epic did this
Not sure what documentation has been wiped out. If you mean the old wiki people maintained, that's still available. We tested several Comercial solutions at work and they all trip most of the time as soon as you try to do anything complex
So far, chatgpt5 (lates model) yields the best results and it's still veeeeeery far from good
I've had more success with Manus (https://manus.im/) actually. But eventually, the context just falls apart and it starts making up functions. And it gets very annoyingly apologetic.
hello, I need a bit of help with my behaviour tree
I plan to just have a simple perception system with the use of sight
I have already got my AI to do a simple idle and walk to a random location behaviour however I have issues when trying to get my AI to move to a specific object
I'll post some helpful screenshots
Yes and it was still bad
Just learn the engine
In the first screenshot, I have my behaviour tree, the second screenshot shows how the AI itself works, and the last screenshot shows how the AI is spawned
the issue I have is, this specific branch of the tree is failing, which is the perception part and it causes the whole tree to fail
I believe I have the correct stimuli set up as well as my config file
and since my AI is spawning I have set the setting in the pawn to have the behaviour tree control the AI when it is spawned
I'm just unsure where I might be going wrong
if anyone has any idea I really do appreciate the help you can provide!
I would start by checking the gameplay debugger and see if your AI is actually perceiving the thing or not. It usually opens with the comma operator in game IIRC (I have it remapped always so not super sure)
well this is the state of the blackboard keys
ok so I've found out two things
when an AI can't see the object as it isn't in it's line of sight, the tree fails
when the AI can see the object, the tree does run, but it still doesn't move because the move to function is called for a split second then immediately goes back to the wait condition
so I think if it is in the line of sight, it does percieve it, but I'm confused why the tree itself fails when it isn't in the line of sight
been playing around and I'm still not getting anywhere
for whatever reason it looks like my AI behaviour tree, if the AI can't percieve the object, it does go into the second branch
but the second branch doesn't call the service, which should set a key called idleorrun to be 1 or 2
instead the key remains as a value of 0
and I don't get why, because this service should be running independent from the AI tree
A service will run if:
- the service is on a running task
- the service is on a composite node (selector / sequence) and a task within the composite node (or a children of it) is running
The selector on the left will only run if the task below it runs, and that's not happening because the decorator prevents it
I'm assuming this is the random service on the left
If you set breakpoints in the BT you should have a better image of what's going on
I was trying to use breakpoints but they didn't really activate
though now I think I realise that it just was because the service wasn't being called
I mean breakpoints in the BT nodes within the BT editor
I've changed my tree and I solved the issue with the service
I still need to investigate the actual perception part though
something interesting I found
it seems that because the stimuli are static, the AI doesn't seem to walk to them
but when I move the location of the stimuli during gameplay, the AI is then more interested to walk to it
Hi ! Is there a dedicated channel for State trees ? Is this in Mass ?
This is AI in general, #mass is mass
You can ask ST related things here
something I also just wanted to know
how could I make my AI stop a certain distance from an object
so if say they were walking towards it they stop within a radius of 10 units
If you set acceptance radius on MoveTo to the number of units, does that not do it?
👍
Does anyone have an idea what the "cluster links" in recast are? It seems they are used for hierarchical pathfinding, but i can't find any documentation on these anywhere..
hi does anyone know the node that does this: it finds the nearest reachable point on a navmesh from the given location
I'm realised that is why my AI is failing
Ignore them. Some attempt was made and it all points to the fact that they are not being used at all. There might be someone somewhere using them but so far... Nothing
#gameplay-ai message
You can project a point onto the nav using a extension (how far form the point you want to look for nav).
so just a scalar value?
look for the node Project point on navigation and you will se what I mean
hmm I tried using it but my location ended up being 0,0,0
how exactly is it meant to work?
You pass a location and a extension (x, y, z) and the system will look for the closest nav point withing that extent (if any)
Let's say your location is 1, 1, 10. Your extent needs to be at least 10 on the Z axis or it will never find nav
Ok, is there a particular reason why AI StateTree component start even though I unchecked the "Start Logic Automatically"
Oh they went from it never starting automatically even if you have it checked to always starting even if you don't have it checked?
if only spline metadata was nicer to use ... i wouldnt have to have an ugly array to sync with the splie points
The AI StateTree (not the regular StateTree component) is driving me insane.. I even reported a bug with the AI Controller context binding not working
This article from last week shows new methods of avoiding tick in State Tree in 5.6. It explicitly mentions, and shows, a version of Run EQS Query that fires a delegate when results are ready. Is it just me, or does that task not exist in 5.6? I can make my own but the article showing me the exact thing I want gives me pause -- am I missing something?
Ah I see the article was mentioned here, maybe you can clear this up for me Siggi?
Hey ! I have a question regarding meta properties on ST Tasks etc.... If we create a linked asset and we expose a variable from a task being processed in this asset. Then when used in another ST all meta specifiers linked to the property exposed seems not to be propagated correctly. Is this expected/known ?
Example: Let's say I have a task with a float that I want to cap to 0 - If I promote this variable as a global parameter of my tree I can now set a value below 0. Solution I found is to have the instance data wrapping another struct so that it works as expected but it's far from being a great solution as it create other issue
Context: I am investigating composition of ST and how we can reuse them easily (I am on 5.5 BTW)
question all I am having trouble getting world partitioned nav mesh to work, i been following the docs https://dev.epicgames.com/documentation/en-us/unreal-engine/world-partitioned-navigation-mesh, i have the chunks generated but its not loding them if anyone can help that would be appreciated
some people said disable is worldpartitionednavmesh, i did that and no luck
Hey everyone,
I'm looking to learn more about StateTree's - is there any good written books/documentation on it?
Check the pin messages. There's good stuff there
If this is anything similar to the old system with sub levels, check if you have a recast object in the game when you play
With sub levels you need to add a nav bounds volume to the persistent to ensure the recast object is generated there, so nav chunks can be added/removed at all times
yea i have the recast obect when I play
if this is what you mean then yea
Attached 0 tiles to NavMesh
weird I got this in the logs
but my chunk actors exist
thank you - I'll review the pinned messages 🙂
yea @slow bobcat the tiles attach in editor its pie
when i build LogNavigation: Verbose: pos: V(X=-64000.00, Y=-89600.00, Z=9650.00) ext: V(X=12799.00, Y=12799.00, Z=3011.00) LogNavigation: Verbose: URecastNavMeshDataChunk::AttachTiles Attaching to NavMesh - RecastNavMesh_UAID_5811228C0404AA9802-Default LogNavigation: Verbose: Attached 169 tiles to NavMesh - RecastNavMesh_UAID_5811228C0404AA9802-Default LogNavigation: Verbose: [NavigationDataChunkActor_UAID_5811228C0404BC9802_1504567100] ANavigationDataChunkActor::AddNavigationDataChunkInEditor LogNavigation: Verbose: pos: V(X=-89600.00, Y=-64000.00, Z=7200.00) ext: V(X=12799.00, Y=12799.00, Z=1741.00) LogNavigation: Verbose: URecastNavMeshDataChunk::AttachTiles Attaching to NavMesh - RecastNavMesh_UAID_5811228C0404AA9802-Default LogNavigation: Verbose: Attached 169 tiles to NavMesh - RecastNavMesh_UAID_5811228C0404AA9802-Default LogNavigation: Verbose: [NavigationDataChunkActor_UAID_5811228C0404BC9802_1504558095] ANavigationDataChunkActor::AddNavigationDataChunkInEditor LogNavigation: Verbose: pos: V(X=-89600.00, Y=-89600.00, Z=9735.00) ext: V(X=12799.00, Y=12799.00, Z=2426.00) LogNavigation: Verbose: URecastNavMeshDataChunk::AttachTiles Attaching to NavMesh - RecastNavMesh_UAID_5811228C0404AA9802-Default LogNavigation: Verbose: Attached 169 tiles to NavMesh - RecastNavMesh_UAID_5811228C0404AA9802-Default LogUObjectHash: Compacting FUObjectHashTables data took 1.60ms
when i play in pie
so my conclusion is that they are not getting serialized
Maybe some kind of dump question regarding StateTree, but how do I avoid that there is an infinite loop happening from root to idle and idle to root?
While ActorState.TaskState is idle it will loop infinitly instead of staying in the idle state and thus call STT_Idle all the time even though the idle animation is already looping.
Any tip?
(in 5.5 this was not a problem btw, guess they changed sth in 5.6 in that regard?)
is there a better way to solve this except introducing an empty state?
If the condition to enter idle fails, doesn't it evaluate the walk and the carry?
If all of them fail their conditions, you are pretty much trapped in root indeed
default needs to be at the end of the state list
yeah
If you want you can add default for clarity (we have the same, we call it dummy state), but gives you nothing aside understanding the tree better when reading it. It's fine if you are just in root until something happens
yeah I think I work with this default / dummy state for now
moved the default state to the very end of the state list, otherwise it will never evaluate the other states if default state is at the start obviously 😄
Found a better way. Since 5.6 this is toggable and then doesnt go further if completed
But that has nothing to do with conditions to enter a state or not. That's for when the transition should trigger: sometimes you want the first task to finish to trigger the transition, others you want all of them to finish before the transition triggers
yeah for more complex stiuations that might be not sufficient
Hello everyone. I'm experimenting with State Trees for a project of mine. And have been stuck with an issue that I can't seem to fix, probably due to a lack of understanding. I've read a lot of the pinned post hoping to find a solution, but haven't been able to find something that explains what I'm experiencing.
This is my state tree. I am using it in conjunction with smart objects' gameplay behaivours and it runs on a AI character. The character is able to roam, look for work, start working, re-evaluate and change just fine.
Roam - [OnCompleted] -> Next State :
Move to Random Location - 1st Task: Get Random Location (does not affect); 2nd Task MoveTo (affects completion); [OnCompleted] -> Next State
Wait
Look for work - 1st task: Search for smart objects (does no affect completion); 2nd Task: claim smart object (does not affect completion); 3rd Task: Move to smart object location (affects completion); [OnSucceded] -> Work; [OnFailed] -> Root
Start working - uses the smart object (runs the gameplay behavior)
Reevaluate - search for smart objects with higher priority than the current one
Change work - stops current and switches to new smart object in case it finds one.
When performing one of the jobs (which is to carry an object from point A to point B), while waiting for the Event to trigger in the "Work" state (which should only trigger when move to + playing an animation on arrival finishes), it jumps right into Roam State for some reason, before the event is even triggered, all while playing the deliver animation.
Does anyone have any idea of what I could be doing wrong?
This article created a custom EQS task that inherited the EQS task as an example, I know the article has been updated recently to point that out.
We will most likely update our tasks in the near future, but we are working out a few more things regarding async task patterns first.
the "interface" to linked assets should be tree parameters, so you expose and bind your tasks to those and then where you link/run parallell your sub tree you bind to inputs there.
hard to say without seeing more of your setup, but my guess is you have tasks on that state with signal complete and that is triggering a completion. In the tasks section there are control whether a state completes when ALL or ANY tasks signal complete, and you can also toggle this per task.
Thanks for your answer ! Yep that's what I did but the issue is that meta spécifiers are not propagated. Let's say I create a ST asset and want to expose a param of a task as an input of my tree i.e tree parameters. When promoting the variable from my task to a tree parameters all meta spécifiers (Like ClampMin/ClampMax etc..) are not propagated.
So if I write a state tree task which take a float parameters with ClampMin = 0 for example I could technically set a négative value after promoting this variable to a tree parameter , same issue with gameplay tag filtering etc....
Is there a way to share data from sub state trees to the main tree? Outside of sending events
That might be a bit confusing, but its because they are different parameters. You bind your task input to a tree parameter and you cannot place those input param restrictions on the tree parameter, since another task can also bind to it (and that one can have its own meta specifiers).
You should be able to use property references, but they are a bit of an advanced topic. We are working on some new data binding patterns that might help.
What is your use case? You want sub tree to update a value that is then read by the main tree? or changes on a parent tree value to propagate to linked one?
Yeah update a value on the main tree. This works for behaviour trees because the blackboard is a decoupled component.
An example could be a subtree that ticks down on a timer used in the main tree, but there's many more.
Subtree here is meant as the version that takes its own asset, you can't pass properties to those I think
You can bind to the sub tree parameters yeah, but I dont think Ive tested declareing those as property references (and that works for C++ only)
I see indeed but is there any plan to expose task, Condition, etc param as a tree parameters (Or another category that is tweakable from parent ST) so that it can only be bind to this task and we can propagate spécifiers ?
Because without it, It break a bit the "data validation" assumption we can do using spécifiers.
Or is there a better way of achieving what I want to do i.e create small reusable trees that have input param with restricted value ?
Again thanks for taking time to answer this is really appreciated
Theoretically, with the same AI behavior implemented with Behavior tree and State tree. Do they have any differences in performance when scaling?
ST better afaik
You can have more controlled ticking, or completely event based state tree
BTs needs to tick to run a state
is it normal that the move to fails here ?
im allowing partial path, but it fails to project the location (gizmo here) on the navmesh
Ah right it does create property bindings to the sub-tree parameters - So you're saying if I made those property references I could also write to them from the subtree? I'll have to give that a try..
hey folks how does one simply make tick work in state trees, my global task and my regular tasks refuse to tick for whatever reason
Yes, quite a lot but it depends on usage (like what your tasks do).
Matrix demo had tens of thousands of State Trees running, and recently we introduced a tick free patterns that scales even further. I have not tested though how far it could scale or how it compares directly to a similar behavior in BT.
You can create a task that clamps the value in the subtree? Now using a propertyref in the task to mutate the parameter, and in 5.6 you'll have a new thing where a task output parameter can bind to/reference a tree parameter to do the same.
so I'm actually unsure how this would be possible. I'm not sure I can add the property reference in the property bag of the tree via cpp, if I add it via the state tree editor I don't have the option to bind it to anything
Did you use FStateTreePropertyRef ?
The only thing available in editor is the FBlueprintStateTreePropertyRef. If I make the property a normal property, then bind to it via a property ref in the subtree, im not sure how id propagate to the parent tree, as the subtree state type doesnt allow me to add any tasks
unless I can create a property ref that binds to a property ref?
As I mentioned, this is difficult with BPs 🙂 it needs to be done in C++. Thats part of the reason why we are working on something better for this pattern
But no, I have not tested this with subtrees
I'm happy to write this in cpp, I don't think it's possible to create the state tree global property bag in cpp though
And that's the only thing shared between the sub state tree and the state tree calling it
good point, my head was still in tasks which is where I've used this
that wouldnt work anyway, since you cant reference the parent tree's properties. The parent tree would have to be the one pushing a reference into the parameters
@final prism actually, it might sorta work? I could setup the bindings at least. Just remember to set the underlying type of the property in order to reference it
This is on 5.7 fyi
i like the new ST icon
oh hold up, Im on 5.6, but this may actually work, I think i cant bind to anything because my test tree doesnt have any other properties..
I was able to bind the ref to a tree parameter, state parameters etc. I didnt check if the value goes through or can be changed. Im interested to hear if it will work
I would still need to be able to create a task with a property ref that binds to this property ref, not sure that would work
I was able to create a state parameter in the subtree that bound to it, so cant see why not
yeah Ill give it a try.. exciting
Does the state tree debugger have a way of inspecting data state? It seems to only show running states
Guess I have to start learning the state tree
The one very neat thing about ST's is that you can run multiple on the same actor at the same time if I remember correctly
Eg. you can have a character be controlled by an ST, and it can interact with a smart object, which in turn has logic via a state tree to control the character for the interaction
I've not tried it though so maybe someone can confirm how well it works :) I know in theory the scenario I described is possible with behavior trees too, but in practice it's pretty clunky because it will always restart the character's original BT from zero after using the SO's BT
Probably gonna look at these more complex behaviors with ST's and stuff more when I get around to overhauling the AI logic in my game which is something I'll probably have to do at some point. It's all BT's now and has a few rough edges lol
This above is correct, and State Trees are used for more things than just AI behaviors! Quest systems, dialogs, encounters and even whole minigames have been implemented using State Trees.
Looks like that actually worked! nice
There's also a really odd bug with binding to float parameter types, it seems theres multiple types specified as float? (it seems to be double or single precision but im not actually sure, its very odd)
Yeah due to legacy reasons floats are messy in BP's now. It used to be float, but it's now double, and if you have a float, it's... also a float in BP's. The distinction in BP's iirc is that if you hover over it, then it will tell you it's a float or a float (double)
The issue is the property reference type in state trees, I can only specify "float" i think, but it seems arbitrary, sometimes it can bind me to the double precision, sometimes to the single precision type, but never both
Why is the new default for float double precision anyway? Why not have float and double types?
Wait do i have to bind to double in the property reference then? This is so confusing haha
I guess they thought it would be simpler to just have a single float type in blueprints so it wouln't confuse people who aren't necessarily programmers
even though it's actually two float types and it's actually confusing now.. :D
Just Unreal things I guess
It seems making it a double property reference works
not a huge fan of having to use doubles in code, but at least it works..
Because UE uses large world coordinates now by default. So doubles all around. What zomg said is correct. They did think just making the BP float as a double would be less confusing. It hasn't worked out that way in practice. BP has some really great decisions and some really big head scratchers 😅
I think if they removed float in favor of double, it would've been at least a bit less confusing, since double in code would actually be the same as double in blueprint
Why would a state go to the Root, if there are no transitions in the state or any child state to move there?
Is this the default behaviour for when all child states of another state under Root complete?
I've tried this and it works. One small caveat: if you run the state tree on the smart object actor then you won't be able to re-use tasks that assume that the context actor is the character interacting with the smart object
So one of the built in decorators is called Gameplay Tag Condition and claims that it can check if the specified actor has a gameplay tag or not. But I don't see any option to add gameplay tags to an actor in the first place, only tags you can add to them are FNames
Your actor must implement IGameplayTagAssetInterface for those to work
I'm working on enemy hit reaction logic but I'm running into an issue. When an enemy gets hit, it plays a hit montage. During this montage I want to prevent the enemy from walking. I have a bIsStunned BB variable which I set to true when the enemy takes damage and false after the hit montage is done playing. In the BT I have two IsNotStunned decorators to prevent any movement or actions (e.g. attacking) while the enemy is stunned.
However, I noticed that the enemy still moves forward sometimes. In the video after the 2nd time it gets knocked back, it moves forward while the montage is still playing. Why is that?
The following code gets called OnTakeDamage and in the hit montage blend out delegate
void AMWEnemyAIController::UpdateBlackboardIsStunned(bool bNewIsStunned)
{
Blackboard->SetValueAsBool("bIsStunned", bNewIsStunned);
}
hm im not sure why the enemy is still moving but perhaps you could consider stopping the brain (or pausing it) while you play the stun reaction. then reactivate it
I feel like that's overdoing it a bit though. There will be things that need to run in the background, even when stunned. I only want to prevent it from moving and certain actions
SetMovementMode won't work either as that prevents knockback which I implemented using LaunchCharacter
hm from your video it seems when it is stunned none of your bt branches are executed (which makes sense given your decorators). is maybe the move logic somewhere else?
Yes, the first time it gets knocked back it doesn't execute any of the branches, which makes sense. But for some reason the 2nd time it gets knocked back, it still runs the MoveTo with the IsInCombat decorator in the middle of the bt
The IsNotStunned decorator details panel can be seen in the screenshot. Don't think it's related to that
Ah yes I see. Hm it seems the isstunned flag is not set then. Did you check it remains applied during the stun?
Perhaps there is some flickering (apply/remove) behavior somewhere
Nice combat feel btw
It looks like if I hit the enemy while it is still in the hit state, it stays on false and doesn't set the variable to true again. Thought it was related to the bt but I guess not. Thanks, atleast I know where to look now
I don't see that interface in the list of interfaces I can add
It can only be implemented in C++. If you don't use C++, you will need to add a gameplay tag container variable to your BP, and a custom BT decorator that can read it (f.ex. via your own BP-implementable interface)
Turns out I didn't fix it. It seems to be a race-condition. Very rarely,BTT_MeleeAttack in my BT gets triggered a split second before the enemy enters a hit state (plays hit montage, sets bIsStunned to true, etc.). This is probably because the enemy gets close enough to the player to attack, but then gets hit right after.
On the 3rd hit in the video, you can see MeleeAttack getting triggered in the output log, OnTakeDamage being called, and montage ending immediately after getting hit. Any tips on how to fix this?
OnTakeDamage removes the attack state, invoking UMWAttackState::OnExit
void AMWEnemyCharacter::OnTakeDamage(AActor* Weapon, float InDamage, EDamageTypes DamageType, UMWAttackConfig* AttackConfig)
{
CharacterStateManager->RemoveState(EMWCharacterStateType::ATTACK);
CharacterStateManager->AddState(EMWCharacterStateType::HIT);
EnemyController->UpdateBlackboardIsStunned(true);
UE_LOG(LogTemp, Error, TEXT("Take damage"));
}
void AMWEnemyCharacter::PlayHitAnimation()
{
AnimInstance->Montage_Play(HitReaction);
HitBlendingOut.BindLambda([this](UAnimMontage* Montage, bool bInterrupted)
{
EnemyController->UpdateBlackboardIsStunned(false);
CharacterStateManager->RemoveState(EMWCharacterStateType::HIT);
UE_LOG(LogTemp, Error, TEXT("Hit animation ended"));
});
AnimInstance->Montage_SetBlendingOutDelegate(HitBlendingOut, HitReaction);
}
The attack state below is entered at the start of MeleeAttack
void UMWAttackState::OnEnter(TObjectPtr<ACharacter> InOwningCharacter)
{
EnemyCharacter->bIsAttacking = true;
EnemyCharacter->EnemyController->UpdateBlackboardIsStunned(true);
}
void UMWAttackState::OnExit()
{
EnemyCharacter->AnimInstance->StopAllMontages(0.1f);
EnemyCharacter->EnemyController->UpdateBlackboardIsStunned(false);
EnemyCharacter->bIsAttacking = false;
}
hello all im trying to bake the navigation mesh using the build paths, I followed the docs and did everything they did, its visible and exists in editor, with nav chunks etc, but in PIE its not there, everything exists in the world but the data isnt getting serialized for the new scene if anyone can help that would be appreciated thanks
these were the docs https://dev.epicgames.com/documentation/en-us/unreal-engine/world-partitioned-navigation-mesh?application_version=5.3
im using 5.4.4
has anyone experienced this issue?
are there other ways to bake the nav?
There were important changes for nav in 5.5 and 5.6. Any chance you can upgrade?
The other thing would be to check the tiles loading, see if their nav chunks contain information. If they do, check where the nav chunks are added/removed from the recast nav data, debug that in code to see if anything is missing
anyone ever have a sub bt not working?
as you can see is going into the roam sub tree
but in there
*crickets
try change them place
up/down left/right
and see what going on
I also changed the sub tree and still has the same effect
sorry Its gonna be a moment
I now have an issue with cpath volume throwing wrong end location
for now I put that aside
seems like the state tree property picker doesnt take into account public BlueprintGetters for wraper protected properties
i have "Should State Change on Reselect" set to false and i still have Enter/Exit called when my task is reselected from parent
FStateTreeExecutionContext& Context
...
Context.ForEachEvent([&](const FStateTreeSharedEvent& Event) -> EStateTreeLoopEvents
I wonder why this lamda is invalid. 
Remove the return type. Not sure but I think that's not a valid sintax in a for each statement
The for each will run the lambda for each element, makes little sense to return things from the lambda
I might be wrong, but it's worth trying
FStateTreeEventQueue require lamda with return value.
/**
* Iterates over all events.
* @param Function a lambda which takes const FStateTreeSharedEvent& Event, and returns EStateTreeLoopEvents.
*/
template<typename TFunc>
void ForEachEvent(TFunc&& Function) const
{
for (TArray<FStateTreeSharedEvent>::TConstIterator It(SharedEvents); It; ++It)
{
const EStateTreeLoopEvents Result = Function(*It);
if (Result == EStateTreeLoopEvents::Break)
{
break;
}
if (Result == EStateTreeLoopEvents::Consume)
{
It.RemoveCurrent();
}
}
}
Yeah but doesn't it mean to call "return yourState" in the lambda without the -> to indicate the return type? Like you would do with any of the Algo:: functions
My implement is like:
Context.ForEachEvent([&](const FStateTreeSharedEvent& Event) -> EStateTreeLoopEvents
{
if (...)
return EStateTreeLoopEvents::Consume;
});
I remove -> EStateTreeLoopEvents it is still same error.
Maybe this syntax has issue.
template<typename TFunc>
typename TEnableIf<TIsInvocable<TFunc, FStateTreeSharedEvent>::Value, void>::Type ForEachEvent(TFunc&& Function) const
{
if (!EventQueue)
{
return;
}
EventQueue->template ForEachEvent(Function);
}
Ah ummm
Wonder if you can pass a lambda as a universal reference. My c++ is bit limited when it comes to types in templates
It's seems you can indeed.
What's the error you get?
It's weird that I can't find any usages for that foreach either
StateTreeExecutionContext.h(227): error C2187: syntax error: 'template' was unexpected here
StateTreeExecutionContext.h(227): note: the template instantiation context (the oldest one first) is
I found the issue, Seem the guys write this code never test it. LOL.
Ah... It might not be an issue with your lambda but with the template definition
Yep....
Remove the template and cost will make it work.
Yeah but then it will not be a templated function resolved at compilation time
All template is resolve at compile time. If I remember correctly. 
Yehq what I mean is that "if you remove the template" from it.
You mean from the Epic's function definition no?
Here
I mean that remove template keyword in this line:
EventQueue->template ForEachEvent(Function);
and the cost in FStateTreeEventQueue::ForEachEvent
The you will be calling the implementation of the function that is not a template (I guess it has one?), or even worse, think that "<xxxx" is a "smaller than" and not compile
Where is that? I can't find it in my code (5.6.1)
Oh it is fixed in 5.6. My project still at 5.5
I believe that function is broken. Unreal doesn't use it anywhere, so the linker errors only pop up when you start using it.
Hey, is there a way to debug and see the cone or the radius of how far the AI that has AIPerception component has?
I know the gameplaydebugger has nice utility for it but it shows spheres on my player character when I was heard or seen but I want to be able to see the NPCs line of sight etc before they notice me.
Thanks!
press 4 (not on the numpad)
you will see a circle (the radius of the sight) and some lines (the cone)
no way! it was so big I havent noticed the radius! Thanks!
Has anyone added turning angle to Unreals pathfinding before? Something like reaching a target location while facing in a specific direction requires a modified pathfinder I would think
I did only on 2D surfaces. 3D ones require a math skill beyond my comprehension

What I do is to get the path returned by the engine and then, in the path following component, check if the path has an angle ahead (easily check comparing the dot product between the current and the next path segment). Of that happens, I calculate a Catmull Rom spline curve between the two paths and make the AI follow said curve points until the curve is done
What if its mostly vertical line though
catmull rom acts weird when it happens
we have stairs and inclined ramps etc. All good there. Shouldn't be a problem if it's a very stepped angle
Shitty drawing of the curve in blue, but on the left a very common case for us, on the right what you are describing. It will just work
The main issues for me with Catmull are:
- even though it has several params to tweak, we can only use a very specific set of values to actually get a decent curve, otherwise you end up with things resembling a zig-zag
- I had to add some math to evenly distribute the points alongside the curve because the original formula (the one in the wikipedia article) doesn't have even distribution. It concentrates points at the beginning and sparse them at the end
appearently I used CubicCRSplineInterp
beware, old and dumb code
and it runs on tick instead of manipulating the path for some reason 
Hey guys, quick question. I was watching some Unreal talks about state tree and I see that the task UI is different from my UI. Is this something that they custom in their engine?
UI changed quite a lot between 5.5 and 5.6. Talk is probably in older engine versions
Ah yeah, makes sense, I watch another clip in 5.3, they have the same UI as above.
Also can I ask what's the different between Global Task and Task that is assigned in the Root state? I'm assuming that putting task in root state act like global task but it will eventually call Enter and Exit anytime that the tree is re-evaluate?
anyone here ever use the cpathfiniding plugin?
the 3d pathfinding plugin basically
It is great !
Do you had some resources to do that ? I think I will try something like that in my free time one day
the mathematical part doesn't really scare me but deep dive into the recast implementation in Unreal do 😅
#gameplay-ai message
also see Bruno's message
you dont need to dive into recast for this
just manipulate the direction of the movement like I do or manipulate the path array
Do dynamic sub-state trees exist yet?
In state trees, if there is a condition or event that should stop execution of any state and transition directly to a specific state, what is the best way to go about it?
Should there be a event transition on every single state (child and parent states)?
Or should the tree logic be forcibly restarted after the condition is set (perhaps outside of state tree logic)?
I'm trying to replace the default Hearing sense implementation, the "config" class have an "TSubClass Implementation" member, with the config specifier. But if I set my custom implementation class as default in DefaultGame.ini the property is unset in editor instead of using my class.
This happened to anyone before?
Global task will evaluate every tick and you should never call finish taks unless you want to terminate your tree.
A root task will run when the root state evaluates, which is not neccesarelly every frame. Also a task in the root state will influence in when/how should that state transition to another
Yes. They are called linked trees and since 5.6 you can change them at runtime I believe. The documentation and code should have some info about it (I don't use linked trees so kit super sure how it works)
Is it not supported in 5.5?
I do this adding the transition event to the root node to the jump from there to where I need
I believe they are broken in 5.5, though I haven't found a way to change them dynamically, will investigate further..
Linked yes, not so sure about runtime changes
Why not change this directly in the Perception component instead? That's where I do it and it works. Not saying your way is wrong but not sure if there are hidden implications
But I can still setup all of the linked tree before start logic, so it should be fine right?
hmmm I'm not sure what do you mean by change it in PerceptionComponent. I want to set the default class to my own custom one to avoid possible human errors due to designers setting the wrong class when prototyping new classes
Ah nice thres a property for it
If you look in the Perception component in your controller, you will see you have the senses there and you can set which config class to use
Aaah sorry I completely missed the second image!
Ooook yeah. Not sure why that shows up as none
Maybe you can set a data breakpoint in the implementation?
I see you have 2 examples, one with your own class and another using the default from the engine. Does the defualt work?
yup, that one works, that is in BaseGame.ini
Only I could think of are:
- the path to your class is not set right and soemthing is missing
- or maybe your class implementation is not right? You can always copy paste the engine file in a different folder and see if you can make that one work as if it was yours
yeah I think it could be related to the path. Is there a way to actually run any kind of validation over the implementation of a class and prevent it to be a default value of a config variable? because I can manually set it in the editor panel, it just doesn't work when I try to set it as a default class 🤔
anyways, thanks for your time, I just wanted to see if this happened before to somebody else, for what I know could even be a bug in the engine 🤷🏻♂️
is it possible to increase nav accuracy to encompass this better?
see nav radius on recast mesh actor
That's the wrong place. If you modify it there you'll lose the changes as soon as you regenerate navigation. You need to modify it in project settings.
This looks pretty good to me, you want it to be more rounded or what?
it worked
actually changing it in project settings didnt do much
idk something with nav settings is fucked i feel like
some settings work some dont
well i have pretty small agents
hi, In the state tree, I want to place a task that gradually slows down the AI's speed. However, the task blueprint does not support the 'tick' event, so what is the solution?
Yeah make sure the agent radius is set correctly. Having a gap between the edge of the mesh and your geometry is normal, the edge of the navmesh is calculated from the origin of your agent. Also, if you modified it in project settings and it did nothing, you may need to delete the navmesh actor and regenerate. Modifying the actor directly may cause you to lose your settings when regenerating the navmesh
What is the best way to retrieve the AIController inside a custom task in C++?
I read that if you're using StateTreeAIComponent (using the AISchema), it would guarantee the AIController for me. But I don't quite sure how to get that. I can retrieve the schema but I see no function to retreive the AIController
Typically you would add a variable for it into your instancedata, eg. UPROPERTY(EditAnywhere, Category=Context) TObjectPtr<AAIController> Controller
If you're using the AI schema, this should automatically connect it to the Controller context value from the schema (assuming it was named Controller, I forget)
what's Category=Context do? It will auto connect? I only know 3 categories (Input, Output, Parameter)
Context will automatically connect things to the schema's context values
As long as their names and types match
That's explain
Also can I ask, usually how can you bind to dynamic delegate in a custom task? Because the task is a struct so it won't have the UFUNCTION macro to be able to bind.
This is one way to do it: https://zomgmoz.tv/unreal/State-Tree/StateTree-InstanceData#class-based-instancedata
I don't know if there's a better way in 5.6 though, I'm a bit out of date on the details of that :)
If you're unsure about using this, you should check the builtin tasks if any of them have dynamic delegate bindings and see how they do it
I'm using 5.5 btw. And yeah, the first thing when I changed from struct to class UObject is the engine crashes from the start, saying something corrupted. I have to delete my state tree and it won't crash again.
Delegate is supported in 5.6.
I wonder if a finnish person took that screenshot. Parameters.Lurppa sounds finnish even though Lurppa doesn't mean anything lol
oh actually Lurppa is Droopy's finnish name, so I'm like 99% a finnish person took that screenshot
hi folks, i'm having problems with a character going around a higher cost nav area, it slows down and kinda jitters while taking a corner. there are no collisions or anything. Im issuing the move command using the MoveTo task node in behaviour tree
I also tried creating a kind of straight "hallway" with a thin normal cost line surrounded with high cost areas on both sides, depending on where i click in the space at the end of that hallway, for example if i click on the left side, the character walks through normally but if i click on the right side, it goes supper slow and jitters like crazy.
im not really sure whats even the cause or what to change, if anyone has any idea that would be a huge help!
Helloooo, hope you're doing well !
Was wondering if there is a State Tree repository with examples, best practices etc.
If there is something using GAS as well, that would be nice!
Like Tranek's, Narxim's, Laura's etc ... (we have them pinned in #gameplay-ability-system )
I went over the pins, but didn't see to have one.
Thanks for your notes @misty wharf 🙂
tbh state tree is kinda
do whatever you want
theres no forced workflow
epic docs are sufficient I think
Alright!
We'll just migrate our behavior tasks to state tree ones and that's it
just think of it like graph nodes
No. We don't need our hand held
How do you guys manage to handle this guy ? He's the bane of our existence on Gameplay.
By shitposting more aggressively
i mean whats good with ST is that it has a decent amount of abstraction
so you can make all your GAS async stuff just fine
Yeah, I am really not worried about it
it's more about having premade tasks (just avoid to recreate them myself if someone already did), and having some examples
didnt yet used GAS with STs so i havent made ones in my utils plugin
I'll definitely have to create those different use cases (I wanna attack, and I need the actor close enough, and my attack not in CD etc)
etc etc etc
You could argue that there is 100 different ways of doing it (like in a BT too).
If, if, there was a repo with examples showing one "good practice" one 😉
Thanks for the feedback!
hi, is it possible that when creating StateTreeAIComponent in the AIController cpp, even when exposed to BPs, its properties can't be modified?
I tried every possible specifier on the UPROPERTY but no matter what i can't modify its internal state tree (or other properties) when selecting it in the components window in my BP AIC that derives from this cpp AIC
https://dev.epicgames.com/community/learning/tutorials/z3km/unreal-engine-tickless-statetree-changes
Might want to pin that ... New stuff in 5.6
That's odd. Should be enough to have it as public or protected with an EditAnywhere specifier
Yes, frustrating. I tried also regenerating project files and restarting the editor after compilation and still it didn't work.
When adding a state Tree Component via cpp it did let me modify the properties in the BP, but then I noticed that I need state tree Ai component because my state tree using the Ai schema..
Changing the component to state tree Ai broke that properties visibility/edit ability
But from what I understand from you, it should show correct? What I encounter isn't the intended behavior?
I will check once I'm back to the pc in a bit, but I think I just do that
As I remembered, nothing special.
- Our AIStateTreeComponent inherits from AIStateTreeComponent and nothing special to it
class OUR_API UOurAIStateTreeComponent : public UStateTreeAIComponent```
- we add it to the AI Controller as any other component (it's a protected member in our AI Controller)
```/** component handling the interactions of this actor with State Trees*/
UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
class UOutAIStateTreeComponent* StateTreeComponent;```
- the only "weird" thing we have is the meta AllowPrivateAccess because of a bug we had were we couldn't bind to it in the ST's
```Adding "meta = (AllowPrivateAccess = "true")" to AITargetSystemComponent and StateTreeComponent in the BaseAiController so that state trees can bind to it```
hey, is there a way to make a replicated state tree task or do i need to trigger the RPC in the ai character directly. I just want to have a task that play an anim montage but it is not replicated
Not really a mp expert, but don't AI Controllers only run on the server, so a state tree can't really replicate as a result?
Yeah that's what i was realising
I will call an rpc on the caracter directly
Yeah that sounds reasonable. #multiplayer is probably the best place for mp-related questions since they're a bit more specialized I guess :)
Yeah, my question was more state tree related but yeah i might ask there next time
after searching the entire internet and not finding anything, i just started testing random shit. and im pretty sure its the CrowdMovementComponent that's causing the issue, not sure how to fix it yet
Pretty hard to tell what's up with that. Have you looked at the Visual Logger? I think you should be able to see the path that gets generated using it, which should at least tell you whether the path itself is wrong or something else. F.ex. if it was the crowd avoidance, the path should still be correct since afaik avoidance is applied separately from pathing
ye the pathing is fine, havent used visual logger before ill check it out.
the right one is with crowd movement disabled, and thats the behaviour i want, ill check in the code to see what are my options with it, since i still want the avoidance for other characters
The first one isn't playing, but if the crowd avoidance is really affecting it, the only thing that comes to mind is that maybe your character is trying to avoid itself, since it doesn't look like there's any other crowd agents in there 🤔
But having it avoid itself sounds kinda strange. Either way, maybe it's worth trying to unregister it from the crowd system so it doesn't count as something to avoid
Maybe it'll put you one step closer to finding out what's happening
Also, If you have RVO avoidance and crowd avoidance both enabled, iirc they may conflict
Hey guys, what factor to determine a stimulus is newly added among sensed stimuli? I can't rely on age because if the AI perceives 2 entities, the age variables will always be zero (until it cannot perceive anymore). So I cannot figured out which one is old or new.
Can you not use the event which gives you the stimulus that triggered it? On target perception updated or whatever it was called
It should be OnTargetPerceptionUpdated from the PerceptionComponent
Hey ! Is there a way for a ST Event to live across multiple frames ? From what I understand the EventQueue is stored in the InstancedData of the component and is getting reset on tick (When we trigger transition) so if I am correct that is no possible right ?
Context: Let's say I have a running State that perform a GA and under certain condition I trigger a ST Event. I would like to wait for my current task to finish go back to root and check if I received some ST event to trigger a specific behavior.
Ideally if it could have a life time that could be useful as well. But maybe I should just create a dedicated system that handle this kind of logic and only have a dedicated enter conditions.
I haven't used it, but my research yesterday showed this:
StateTree Delegates Give Another Way To Limit Work Done Until Data Is Ready
In addition to the changes for scheduling ticks, StateTree has added delegate listeners that can be used by tasks and transitions to respond to a certain bound delegate dispatchers. The transition is intuitively called On Delegate and allows for binding which delegate dispatcher to use much like binding any other property in StateTree.
https://dev.epicgames.com/community/learning/tutorials/z3km/unreal-engine-tickless-statetree-changes
Thanks ! Yeah right now I am on 5.5 not 5.6 yet so I will definitely give this a try asap. I guess I could solve my problem with this but I am not sure this is what I exacly want (Will see ^^)
I want to use State Tree LinkedAsset states to run trees from my main tree to perform specific behaviours (like Patrol). However it looks like LinkedAsset state type requires that the chosen tree asset have the same schema as the "parent" tree. I was hoping it would accept a subclass of the parent tree's schema but it doesn't look like that's the case ☹️ . Does anyone know if there's a way around this? Maybe this functionality will be added in a future version?
Is there a restrictive check in code like "IsA<>"?
Hello guys, I made an enemy AI which follows the player if the player is in the sight of the enem. If there's Nothing in the enemy sight, then it moves randomly.
But when my enemy detects the player it just stops Moving, and i Don't understand why. Random movement works well. does anyone had a similar problem in the past ?
This is the BP of the enemy chasing action
Chrkc visual logger, see why the movement stops
how are you setting the black board key "target Actor"
also, you can use a print/breakpoint in your BT task to check if the AIMoveTo is called
Thank you!
Thank you! I tested and my AIMoveTo is called "every frame" when the player gets inside the sight of the enemy, so it wierder.
did you checked its actually called
well here you are close so it makes sense
what is printed if you are far enough from the AI but seen ?
It does the same 🙁
but actually i think i have a clue !
I will try to solve it Thank you!
My Target Actor is set here, the code is inside this blueprint
But I think I forgot to assign this BP on my Enemy, maybe that's why it's not working
ouch I was wrong I cancel what I said
My target actor is well assigned, it's a problem of movement
weird indeed
Yup... I think I will restart from new to see where it starts bugging. But thanks for your help!
Check in visual logger. Chances are you are not projecting the location and its not on nav, canceling the movement...
it does seem like its the movemenet faults, you need to debug with the visual logger if the target is correct
Do you have nav mesh? That could be the other reason
this wont call sucess ?
thats the weird part for me
Nope. Calls failure because can't find the end goal location on the nav
If you can't move it fails
well on the screens you can see "Success" being called
Ah wait, I missed that image. One sec
Ah... Ummmmm
Weird
Visual logger for the win then
I somehow managed to start visual logger, but I didn't understand what i can do with it (first time using it)
Yes I have navMesh and it works well for random point movement
Stops moving only when it comes to chasing the player
right click there -> dissable all but this
and yoiu should see entries there just for the nav. One of them should draw the path calculated. Let's see it
could it be you are setting the AI to reach itself?
Maybe TargetActor bbk is set to the wrong actor?
if yoiu look at your BB while running the game and the movement stops, what is the value in your BBK?
well you have it here too
is that the player?
one thing you can do is to grab the BBK actor location just before passing it to the IAMoveTo node and draw debug a spwhere. See where is it
OMG you're right the debug cube is on the enemy and not on the player
So is this code in the enemy is reaching the wrong destination ?
this one here
add a debug draw to the actor location before setting it to the BBK in both cases (perceived and not perceived)
I wounder if the AI is detecting itself or you are passing a nullptr because the BBK is not set and, somehow the move to picks the current location as a safe option
you might be setting the bbk in two places or something like that too
Really wierd. The code seems to detect well the player's location, yet the destination assigned to the enemy is its own location
the blue cube means that target actor bbk is well assigned and green cube means that target actor bbk wasn't well assigned
in state tree, can I communicate between tasks with non blueprintable data types?
In C++ - sure. But it can only happen in C++.
The bringer of bad news
Having a hard time understanding state tree flow and transitions. I've read unreal documentation and some of the links posted hear. The behavior I'm expecting is not happening, for sure I'm missing something.
I have this State Tree I've been working on (posted here before, it's a little bit different now), and it is getting stuck on root.
After it enters "Scared/ Act scared" state, if "IsScared" bool changes to false again, it does not go in "Search for Work" state. Based on my tree and it's transitions, shouldn't it though? I can provide more info if needed
Had to force an event transition for it to work. But still confused why it simply does not continue normal execution with the boolean change.
Yeah but how can I access it in C++. From other task?
Can you show your transition? Is it an "on tick" transition?
Which one specifically?
The failing one from act scared to root
They are all default, except for "Look for Work"
You'd have to get a reference to the task somehow. Not a route I'd go personally. But where there is a will, there is a way.
I guess I just gonna wrap the variable into a blueprint wrapper
That's the thing. If you don't set a transition that checks a value in tick, or reacts to an event, the state will only transition when a task finishes (or the last, depends on your setup). If you want the state to be interrupted, you either have an event that will force another state (ie: an event transition in root) or you have a transition checkign on tick some value in your state (ie: if X bool is false, go to root)
In your example, you don't have any transitions in the image. You are waiting for the tasks to finish and then go to root
Nothing there handles interruption
But once it goes back to root, isn't it supposed to try and enter each child state again? At least that was my understanding, since the tree is not resolved or concluded.
I guess this is what I ended up doing, in the root state. Added a transition based on an event that also checks the boolean as a condition.
How can other task or transition listen for the value changed to trigger the transition logic? For example: I would like other tasks / transitions to listen the PerceptionInfo output changes, then it could react and transition to the correct state. Like Observer in behavior tree.
I guess like Bruno was explaining to me before, you could add an "On Tick" transition that checks for that specific value?
I'm looking for an event driven method though. Like blackboard, they have a delegate to signal when a parameter is changed.
you can use "On Event" as well, I'm using it right now, and it can also check a condition before transitioning.
Make the task a root task or a global task.
Have the task listen to w/e from the perception component.
Broadcast one of the new delegates for state trees added in 5.6
Have other tasks bind to that broadcast
The "observer" concept from BTs did not transfer over to STs. You have to build it yourself.
For Perception I'm using a state tree evaluator and on "OnTreeStart" and on "OnTreeEnd" I am binding and unbinding custom events that handle perception stuff like sight and hearing. not sure if that is what you were looking for
Note: haven't fully tested it though
Yeah. Root should re-evaluate but, if it doesn't, something is wrong in the tree. Use the state tree debugger and see what happens, why is it stuck in root
Need to learn a little bit better how to use it. It was just showing being stuck on root. Thank you for the replies, I appreciate the help
Feel free to post what the st debugger shows. Maybe we can help unraveling the mystery
Anyone know why my AI would move toward the player if I load directly into the level within the editor, but the AI will not move if you load into the level from another level (i.e. pressing start on the main menu)
State tree for reference
Additional details, the AI moving toward the player is the intended behavior. Basically, it works correctly if I play the level directly from the editor, but doesn't work if I start the game from the main menu.
IsA would be good bc it'd allow for child schemas -- I'm guessing there's a schema class == somewhere. I could hack around it for sure but I'm wondering if A. I'm thinking about the intended use of schemas incorrectly, or B. child schemas will be supported for subtrees in the future. It just seems like a very restrictive design making it harder to make my trees modular. I really don't want all my trees to need to share a giant megascehma when my e.g. Patrol subtree should be the only tree that cares about my PatrolComponent context object.
Still trying to work out this issue, I initially thought it might have something to do with load order but that does not seem to be the issue. I've tried delaying activation of the state tree, spawning enemies in based on player distance to the spawn point, etc. Does not seem to fix the issue. Visual logger is not being very useful in this case, only error it's showing me is that the NPC failed to navigate to the player. It's a weird issue, everything works just fine if I play the level directly from PIE.
Does anyone have like a base enemy ai blueprint that isn’t the one in the combat template? I’m specifically running into errors with the state tree tasks because I stupidly tried to just duplicate all the template ai ones so I need to start from scratch but all the tutorials are either outdated or hard to understand.
The collision of the box in the level is what makes the AI work or not
Thanks I fixed it, rebuilt the navigation paths in the level (from the build menu) and it worked.
Have anyone tried this in 5.5? Does this node work?
Hi everyone! Duplicating question from #cpp here, as it's probably more appropriate place to ask about state trees.
I want to use StateTrees for my quest system, as it sounds ideal for my purposes. However, I'm not sure about a few things:
- Are there currently any ways to run state tree other than from UStateTreeComponent (or reimplementing state tree running logic based on this component's logic myself)? It would be ideal If I could run them from game instance subsystem, as I'll have multiple maps, and quests must persist on map changes. Of course I can just make some QuestRunnerActor, spawn it on map open and add a component for each active quest, so it's not that big issue, however the approach with subsystem would be cleaner.
- Can I persist internal state of running state tree? I have a simple save/load system, and I want be able to store/restore quest state transparently, without some ugly workarounds. If I understand correctly, the component stores running state in FStateTreeInstanceData InstanceData, and the documentation says I can serialize it. So, would it be enough to restore state tree's state on game load?
Reading posts in unreal forum, looks like it hasn't been working for quite a few iterations of UE5 including 5.5. Haven't used it though. You could try using "SendStateTreeEvent" if what you want is to force a transition to a particular state, and add the transtion "OnEvent" in the root state or something.
Works in 5.6 apparently
https://forums.unrealengine.com/t/is-state-tree-request-transition-broken-in-5-4/1887469
Yeah I've read that
Hi, How do I interrupt a state tree to run a specific task/function, and then resume execution from the point of interruption?
Anyone else have issues with state tree event transitions? I have an event transition on my root, sending the tree event, and then nothing happens 🤔
can you see the request in the ST debugger ?
I was having some issues on 5.6 with some cherry picks from main. Was going to retest in latest.
Setup was just a simple transition in a parent leaf to transition such as this ^^
you should see something like "Root -> Transitions -> Your event"
in the tree
Yeah - that ain't happenin
even if it failed
how are you sending the event

Is that an "oh the answer is obvious" or an "oh no that should work" XD
I'm still experimenting with state trees, however I was having some issues not with an on root event transition, but some other state, and it was mostly due to being stuck somewhere else, so that transition would never be triggered. Could that be happening to you? (Just brainstorming here)
its a "fuck idk"
I had some problems with certain child states and event dispatchers in a similar way. Might be best to try a global task just to see if it can work without fear of the state getting wiped.

@slow bobcat Did you ever figure out a good workflow with dealing with State Tree tasks in C++ and binding to a delegate from an object in your instance data?
I hear that UE5.6 support delegate and async task. I wonder how it is implement with struct.
Yeah, I use those in BP. But I'm talking about when you are binding to a delegate from another object. It needs a UFUNCTION, but structs can't have those.
Right now, I'm just kind of copying what the EQS task does and relying on a lambda.
So you should you UObject for task instance data.
I don't think you can. The instance data needs to be a struct. If you're saying just do like BTs did with the AI Tasks, then sure. But I'm curious to know if there is a different approach others have found.
IIRC, Instance data can be UObject. I see it some where in source code. Let me find it..
Please do. Because the GetInstanceDataType function returns a UStruct*
StateTreeTask_PlayContextualAnim.h
UCLASS()
class UStateTreeTask_PlayContextualAnim_InstanceData : public UObject
{
GENERATED_BODY()
};
UClass is extend from UStruct so it will fit.
Oh yeah - you're right. I forgot about that.
Is that in the smart object plugin or something?
I can't find it and I am guessing because Rider doesn't have it indexed
Engine\Plugins\Runtime\GameplayInteractions\Source\GameplayInteractionsModule\Private\StateTree\StateTreeTask_PlayContextualAnim.h
Fullpath here.
Would need to check. Can't remember now if I ended up using data as a UObject or not. How urgent is this?
Not very
yeah this is how we do it as well. Make instancedata a uobject and put the delegate bindings in there
Hey,
I'm trying to build "rooms" at runtime.
My logic works fine, so I want to go to the next stept, to make my characters look alive.
I want to add at runtime NavModifierVolumes. Which works so far.
What does not work is, that the NavigationSystemV1 will acknowledge the spawned obstacles on runtime and block navigation.
I've built a tiny map to see, if my code works generally and it does.
I've built a tiny square of NavModifiers and assigned the correct AreaClass.
My Characters won't move out of the square and I can see in purple, that there is a modifier.
On my other map, where i build everything randomally, I cannot see the modifiers and the Characters move out of their area.
Since I can see the nav mesh, I guess, I setup the runtime gernation of my navMesh correctly to Dynamic.
What am I missing? Is adding Modifiers at runtime not supposed to work?
could invokers not fix that issue for you?
I guess you mean NavigationInvokers?
My Characters have NavigationInvokerComponents on them.
I'm not sure If I know, what I should do "to fix it" 😕
there is settings you need to enable in your config to make use of the invoker system
Generate around invoker
That's active. But I still need a navMesh for that, I figured
this although with the standard pathfinding system will cause for some pathfinding to fail, if the target is not close to the navmesh
yea true, you need a nav mesh volume
there has to be a way to get rid of that, but i have not yet found a solution to this problem
I also managed to break my setup, so I no longer see a color for my AreaClass 😮💨
Ok, reset helped. I can see my NavAreas on static gernerated content, but not when spawned at runtime. Also the AI behaves like that
I'm not quite sure I understand what you're trying to achieve - If you want to spawn actors that block navmesh you can use the dynamic obstacle component or the navmodifier component to have them block navmesh properly. Just make sure the navmesh is dynamic or navmodifier only
I am spawning NavModifier at runtime, but I can neither see them nor they seem to be used on navigation.
When they are statically added to the level, the affect navigation.
Navigation is set to dynamic. I already said it AND I can see the nav mesh in my level when playing in editor
Ok, the missing piece was, that you can not use a NavModifierVolume at runtime, because it does not have a NavModifierComponent.
I need to create a duplicate of this actor and add the Component myself.
When spawning the duplicated Actor, I can see the Modifiers at runtime and my Characters behave as expected
My next problem is, that I don't know how to update a FStateTreePropertyRef with the WeakExecutionContext.
I'm adding a listener to PerceptionComponent->OnTargetPerceptionUpdated But I don't get a reference to the Property's value:
const FStateTreeStrongExecutionContext StrongContext = GetWeakExecutionContext().MakeStrongExecutionContext();
FGameplayTag* GameplayTag = Motivation.GetPtrFromStrongExecutionContext<FGameplayTag>(StrongContext);
GameplayTag is nullptr
Hi everyone, I have this problem where I have 2 states for my enemy AI, passive and combat, and basically I have a key just to switch between them for me to see how they switch, but whenever I press it (it is in passive by default), it says on the bahaviour tree that it transitions into the combat sequence, but the actual actions of the enemy tell me otherwise as he's still doing patrol, it's been a day already that I've been trying to figure this out, anyone?
I am wondering, why I can't bind my evaluators output variables in an enter condition. I can see the variable on the left marked as output, but can't bind it. I'm using the blueprint base classes in c++
Guys, does anyone understand the golden rule for smoothly transitioning between statuses without problems?
It seems confusing between parent and child statuses and the Selection Behavior options
Update - I changed nothing and now it works. Thank you for coming to my Ted Talk.
CC: @hallow compass
I have task that have bool input variable, Is there any way to make condition as input. For example, I want to check if length of array output of other task and assign to that bool.
Similar with MVVM plugin, that allow convert type.
Confirmed: I use UObject for all our instanced data classes. Most of our use cases are listening to tags being added/removed, and for that we cache the Ability System Component and subscribe to its tag delegates
And if that function is supposed to be what finishes the task? How do you handle that?
Because it is the dynamic delegate that allows you to pass additional arbitrary args. But you need access to the ST execution context to finish a task.
So some delegates just won't let it happen to my knowledge.
Change a bool in the Instanced Data and then, in your Task tick, read the bool to call finish task. Good old tick based taks. But I believe that since tasks now support delegates you can do this in a better way?
- on enter subscribe to delegate with your instanced data function
- On Callback (within your instanced data), change bool bTaskDone to true
- on tick check a bool "bTaskDone". If true call FinishTask
- On End un-subscribe from the delegate
I believe there was a thing to bind to functions instead of variables, but I have never used it
It is property function, Look like I have to write one.
Transitions in the State Tree are very complicated , has anyone managed to understand them??
I have been stuck on this problem for over a week.
https://streamable.com/gz5div
Switched the NPCs in the Arena Shooter variant over to a struct health system and hit scanning. In the Move to Roam Location state, their movement is doing tiny steps to the target location. And ONLY when the game is running smooth, they act normal when frames chop.
They're fairly straight forward. What issue do you actually have?
I feel you. Still trying to understand them myself. Although I've been managing to make it work
@harsh storm @reef trellis
For example here, state A does not transition to state B , what’s the reason?
Show the transitions and the tasks
Didn't debug text never call finish?
state A does not transition to state B
what happens if you remove the transition from root, and put it select children in order?
Definitely an odd setup. I'm not sure if putting tasks on the root is a good idea. Additionally, try enter won't select children, I'm not sure you can transition directly to children of states with the "try enter" type. Try setting all of them to "try select children in order" and see what happens
Having tasks on the root is fine. Same with transitions on the root.
And yes, the debug text task never actually "finishes". However, the Delay task should.
And what does the debugger say?
Are you even in state a?
@reef trellis @final prism
"Try Select Children in Order" runs all the children at once.
This means I can’t take advantage of transitions or set a delay for one of the states
It selects the first leaf node in the state tree. This is supposed to be a hfsm, you're supposed to select multiple hierarchies of states
Try select children in order will not run all children at once, it will select the first child in order, then run the next child once that one completes
should't it select one after the other?
It's important to understand the hierarchy at play. If it selects A as a child of Root, it will have selected both root and child, as they are a hierarchy, thus it will run the tasks of the entire hierarchy at once, i.e. both root and a
will it do the same once it runs "b" state? so both tasks from root and "b"?
Yes
Tasks on root should be seen as always running if the tree is active pretty much
does that mean it will also run enter conditions and transitions on root or any parent state? every time a new child is selected I mean
I believe there is an option for that on the state tree enter condition
@final prism
I understood a little, but I’m still confused.
For example, in the image , why can’t I transition from the root directly to state B?
The system is forcing me to go through state A !
Yeah that's what I mean. I think debug text task never calls finish task internally, so your state will forever stuck. Try making your own state tree task to print something and then call finish task
The Delay task does and they have the task completion requirement set to "any".
Because it works top down. Set an enter condition to prevent from going into A
Ah ok ok. Missed that part
I think it's because you are setting "Try Select Children in Order" so it will always go through A. In that case you probably want "Try Transition"
@slow bobcat @harsh storm @reef trellis
I’m starting to understand a little, whenever a parent state runs, it must activate all of its child states at the same time and without delay.
Each of those states has its own transitions that only work once its assigned task is completed.
Also, you cannot transition between sibling states if their parent is not in Try Select Children in Order mode.
That mode shouldn't have any dictation on how a state transitions.
The state itself has its transition rules.
But if the mode is set to Try Enter, it will behave like my first problem and the transition won’t work.
Then Moritz told me that I should use Try Select Children in Order to solve the problem
The state's transition logic will allow it to jump to another state. That is a huge reason behind state machines in general. The fact that you can go from state to state.
When a state is selected, it will try to evaluate other states to see if they can be entered as well
The child states of the state that is being selected that is
You’re right, it works even if it’s in Try Enter mode.
Hmm, from what I understand, Selection Behavior works in one way, and Transitions work in a different way. This is what causes confusion, and sometimes they end up working at the same time
I'd advise you to just leave the selection behavior on the default until you understand more about how the ST works in general.
Baby steps.
How can i enable that debug view?
I cannot find the keybinding. I have qwertz layout
select the NPC and push apostraphe during play
yea, that's not working for me, that's why I'm asking for the keybind option
You pushing the one next to the enter key? I was dumb and pushed the top left one when I was first told about it. Beyond that idk.
for me it's the # key
left from enter
Maybe you can check your editor settings and see if you can find the key bound to any option.
You should be able to search for the key
went through editor and project settings and couldn't find anything bound to the key
I only found out it was even a thing 2 days ago
shiiii...
I really need this, because I witness strange senses.
Feels like my vision is tilted to left
I'm not doing too much better. I can't even get NPCs to move to a target location unless the frames are chopping.
Posted in #blueprint , but forwarding to here since this is happening in a state tree task 😅
I'm at a loss
trying to stop "move to" tasks when entering a specific state.
Digging more into the C++ side of the state tree delegates. Looks like you still use a lamba anyway. So - not what I was hoping for.
In order to broadcast the delegates, you need the execution context.
Old World /InGameMission/UEDPIE_0_TestMissionLevel.TestMissionLevel not cleaned up by GC! Object BP_Enemy_EtherealGuardian_C /InGameMission/UEDPIE_0_TestMissionLevel.TestMissionLevel:PersistentLevel.BP_Enemy_EtherealGuardian_C_0 is being referenced by StateTree /InGameMission/Missions/ST_SpawnMobAndWaitForDeath.ST_SpawnMobAndWaitForDeath:
(standalone) StateTree /InGameMission/Missions/ST_SpawnMobAndWaitForDeath.ST_SpawnMobAndWaitForDeath
-> StateTree /InGameMission/Missions/ST_SpawnMobAndWaitForDeath.ST_SpawnMobAndWaitForDeath::AddReferencedObjects((Garbage) BP_Enemy_EtherealGuardian_C /InGameMission/UEDPIE_0_TestMissionLevel.TestMissionLevel:PersistentLevel.BP_Enemy_EtherealGuardian_C_0)
^ UE::ReferenceChainSearch::FReferenceInfoSearch::HandleObjectReference() [Source\Runtime\CoreUObject\Private\UObject\ReferenceChainSearch.cpp:1106]
^ UE::ReferenceChainSearch::TReferenceSearchBase<UE::ReferenceChainSearch::FReferenceInfoSearch>::FCollector<1>::HandleObjectReference() [Source\Runtime\CoreUObject\Private\UObject\ReferenceChainSearch.cpp:284]
^ FInstancedStructContainer::AddStructReferencedObjects() [Source\Runtime\CoreUObject\Private\StructUtils\InstancedStructContainer.cpp:442]
^ FStateTreeInstanceStorage::AddStructReferencedObjects() [Plugins\Runtime\StateTree\Source\StateTreeModule\Private\StateTreeInstanceData.cpp:257]
^ UStateTree::AddReferencedObjects() [Plugins\Runtime\StateTree\Source\StateTreeModule\Private\StateTree.cpp:404]
^ This reference is preventing the old World from being GC'd ^
-> UObject* UObject::Outer = (Garbage) Level /InGameMission/UEDPIE_0_TestMissionLevel.TestMissionLevel:PersistentLevel
-> UObject* UObject::Outer = (Garbage) World /InGameMission/UEDPIE_0_TestMissionLevel.TestMissionLevel
I am getting this error, when spawn actor from task and cache in UObject instance data. Any idea to resolve it, although I clear ref when exit task
when exit task? is that early enough to be before the cleanup?
Yeah, I checked ExistState, it is called before the error.
what does the UStateTree have for the PerThreadSharedInstanceData?
after you supposedly clean it out
hmm... it should nuke this in ResetLinked
I am not sure what it is.
you can use your IDE to look at the UStateTree object and inspect its member properties
I am reading UStateTree::AddReferencedObjects
Look like instance data of property function keep the ref.
then I guess you didn't clean it out
I'm not really sure what callback to use here
But property function does not have clean function.
I mean there is no way to reset it.
If there's a more statetree specific thing I am probably missing it
edit: I am wrong, this is an editor-only function!
It is instance data of FStateTreePropertyFunctionCommonBase
Could be bug of StateTree as instance data of task does not have this issue.
can you obtain it from UStateTree::GetSharedInstanceData?
yeah it's possible
I'm confused why exiting the state isn't cleaning this out
does one of them add instance data and just leave it around?
I've only really made one simple state tree thingy so I might be asking a weird question
@slow bobcat Okay, so I think I have somethin' here that you might even be able to use. No more need for tick based bool check if you don't want to. But you pretty much just BindUObject to your instance data. Then give a payload of FStateTreeWeakExecutionContext. Then the first thing you do in the bound method is make it a FStateTreeStrongExecutionContext.
Then from there you can call FinishTask. I haven't dug too much into the dangers of this approach yet though. But this is how I'm doing it with the lambda approach. And I kind of copied it from Epic's EQS task.
One drawback that I know is that payloads can't be references. And the struct is like 48 bytes.
You may not even need to make a strong execution context honestly. But overall, that's the gist. You will need it if you need access to the instance data though. So, probably more useful in a lambda than the instance data itself 😅
I workaround this by change to WeakObject instead.
Damn, ST variable does not support weak object.
So basically capturing the execution context in the lambda?
Yeah. That's how the EQS task does it.
And you can use that same idea when it comes to binding to a uobject really
But isn't that super dangerous? The execution context is created anew every tick of the tree. I don't get how is that supposed to work.
- the state tree tick creates an execution context
- the execution context tick is the thing actually ticking the tree (global tasks, events, transitions, conditions and tasks in that order if memory doesn't fail me)
If you cache that context, aren't you keeping a ref to a temporary object of undefine lifetime? Or do you capture it by value (a copy)? But if by value... The context will be incorrect next tick no? When a new context is created.
@chilly nebula i could really use your insights here if you have the time please.
I'm still confusing about the usage of State Tree for other purposes beside AI. I hear that State Tree can be used for Quest system or door / chest. But I don't understand in what cases it could help. Seems like it's overkill for something with simple states.
its a tool that abstracts transitions in a way where you can do utility selection, prioritization or state machines and you get to have a nice way to marshall data to your tasks from the editor since it has property binding system
whats normally a complex sphagetti code in a scripting language becomes a structured graph system in ST
I know, that's what Unreal advertised, I can see it strength when implementing for AI. But for simple chest (with < 3 states) or quest system. I don't know how state tree can help. Especially quest system, I haven't seen a quest system implementation that using state tree or someone could enlighten me :D.
I'd do a chest in blueprints tbh
https://github.com/MothCocoon/FlowGraph/wiki/Getting-Started and quests in flowgraph
In the end, as everything in unreal (or game dev for that matter), things are good ad they are useful for you. If your quests are simple, it's probably overkill. In my case we have very complicated quests, so we need a system like ST's. There's also things like controlling the world state in persisten environments where it's very useful
Can you give me an example of your complicated quest that need the use of ST? Just wondering.
We don't use ST's because we have a plugin to control with nodes all the steps needed in a quest. Most of our quest have branching paths that will be decided based on how you play, outcomes of battles etc. Also based on player level. To that, add dialogs for npc' s and areas that will be accesible or not.
But, at hearth, our plugin is a state machine
We use that because the dialog support was very good
But ST's were second in line
Maybe this could be the use for ST for a quest system. Found it on the internet.
We now have both weak and strong contexts, you should be able to store a pointer if you use those correctly.
Yeah, but if you look at the weak context, it explicity mentions that it can be used for async operations. So it is absolutely designed for having the context across frames. Which, confuses me as well, because the context isn't supposed to be done that way. But - idk. This is how the EQS task does it. So, they probably bolted it on later on down the road because they needed it as well.
I'm assuming the EQS task is using them correctly? Because that's where I copied this pattern from. And the make weak context just creates a struct. No pointer shenanigans there. Maybe under the hood?
So it is expected that you can pass the context around using Context.MakeWeakExecutionContext()
And that is the "safe" way of doing it?
Echoing what others have already said. The decision to use a ST would fall in line with the decision to use a full blown state machine really. You don't necessarily always reach for one, because sometimes, just operating off a simple bool or enum is sufficient enough.
That said - there is nothing preventing you from using it as the main driver of say, your main menu. Because those can be thought of as "states" as well. Or as the overall game's flow. Those can also be "states". It really depends on what type of game you're making.
I used it instead of Flow Graph, for example, in a small prototype my wife and I were doing. It served as the overall game manager.
Does anyone have an idea why this AsyncTask reference isn't valid during this state tree task execution, but showing as valid in the character tick?
Can you briefly explain the differences? Maybe some example of usage too? That would be super helpful. Thanks Siggi
What I mean by differences is how is each type handled. Is one created when the tree starts and updated at some point? And the weak is the one passed around created on each tick?
Tick still creates a whole new context
I only caught this late last night, so I wasn't able to follow the code with the weak/strong context all that well
I'm off today but I will take a look into this tomorrow. Haven't dig in state trees source much since we upgraded to 5.6 and I completely missed this
I plan on digging into it more tonight to try and reason about.
Or hopefully Siggi explains before 🙏
Yes, if you are on recent code it should be the right pattenr.
Yeah, I'm on 5.6
I think it is just a bit confusing to us because the ExecutionContext explicitly says that it shouldn't exist across multiple frames.
But by doing this - we kind of are. Even if superficially.
more changes coming in 5.7 and 5.8 regarding instance data storage, and yes I agree its not easy to understand or use atm
Yeah, I'm just going under the assumption that as long as you make a weak context, you can pass around the context. Then need to check if it is valid before using it elsewhere.
best way to transition from an A state to a B state, state tree events, state tree delegates? what you guys use?
it depends™
but can you give us a high-level explanation on how the two are handled and what's the expected lifecycle?
Is it also working on 5.5 ? I tried something but it did not work. I promoted a state tree property ref as a ST parameter and linked it to one of my parent tree but it seems not to have worked 🙁
I probably missed something. Context: I wanna modify parent params from a child tree. What I tried is to promote a boolean property ref as a parameter of my child ST and bind it in my parent tree to a parent parameter but this flow seems not to work I did not debug yet
There are a few different types of instance data, most of which exists while the state is active. We've been adding new ones recently that allow you to persist data longer.
is there a recommended place or way to figure out the following?
- which types are there (name of classes and/or structs)
- when are they created / destroyed
- recommended / intended usage of each type
Sounds like a crucial piece of information to know when dealing with state trees
I'll see if our devrel guys can get something together, they have been working on tutorial/doc improvements for State Tree.
it would be fantastic if we could get some good info about. I miss the days where we get graphs like The Actor Life Cycle.
TY
That graph still gives me PTSD
The biggest struggle atm I find is the state lifecycle eg.
In 5.6 event dispatchers in a parent state appear to get destroyed/cleanedup and as a user coming in you're never sure if it's intended or an inprogress piece.
But also massive kudos keen for STs future
But I guess alot of this stems from the flexibility of it atm, how do you wanna handle transitions, event/requestTransitions/delegates/enter conditions/etc
event dispatchers in a parent state appear to get destroyed/cleanedup and as a user coming in you're never sure if it's intended or an inprogress piece.
Can you elaborate here a bit? When a state gets disabled then everything belonging to it will get destroyed. Is the confusion about when you re-enter the same state, when things get persisted vs destroy+re-created?
yes, but we need to do a better job of it being intuitive to understand 🙂
I've done a cherrypick so maybe my engines just cursed but take this setup.
I previously had a simple OnDamaged binding in the initialize thinking of it as a ParentState, but it appears when I then enter the combat state the binding or the state "instance" is gone somehow
I've used global tasks/evaluators to start offsetting this but I love the mental model of that parent leaf of the tree allowing bindings/setup in this way, although may just be a lack of understanding the workflows for now
thats pretty much what makes hierarchical/nested state machines great. Its how it should work, so Im not sure whats broken in your case. Did you check the debugger to make sure you aren't temporarily exiting Initialize briefly and going back to root for example?
Yeh I believe the debugger showed up clean, given the entire binding was prone to disappearing I thought it may be intentional sort of cleanup, like there's only allowed to be 1 truly 'active' state?
To clarify, what type of binding are you referring to? A standard property binding where the Combat state refers to something in the Init state?
I have a Vitality component that calls OnDamaged, then I'd bind to that in Initialize to try push into the combat state, but that binding that existed via a Task that was within Initialize would get cleared somehjow'
Sec I'll open it up and can grab any screenshots of use, but my expectation was those kind of things could exist in the tree instead of global task/eval side, again may just be a weird setup though. I am always using a dedicated server with Steam that might be playing odd
A binding to an external component delegate? You need to use a weak context for that afaik. See what the EQS task is doing in latest version of that code
There's the theoretical setup, whether Delegate or StateTreeEvent that TestEvent was either Unbinding or the State that contained it "Initialize" was getting cleared somehow.
I'm getting the ropes of C++ and starting to dig into the code though so will check that EQS example out
Have found workarounds but this is the underlying research problem I'm looking to understand as a user atm, if find anything as dig my way through C++ will share but imagine it's likely a lack of knowledge or attempting to use it incorrectly at this point. Appreciate the time and info though 
Let me know what you find, its possible we are missing something on the BP side. The inner workings of the component can sometimes be a bit opaque and we need to make it easier to "do the right thing" 🙂
This feature is ace and y'all cooking please keep it going 🙏 idk it'd help but have just punched through 2 weeks of rigorous onboarding for it, would be happy to write up a pretty lightweight doc on that experience if it helps the feature/devs. In the lense of a mainly BP dev with basic C++ to look/tweak but not really fully ingest new systems like this easily.
That would be amazing 🙂 I hope you are on UE 5.6?
Keen for the days StateTree just outright supplements BPs akin to FlowGraph etc.
Yeh 5.6 with the cherrypick to dodge crashes for Setting StateTree refs at runtime, think that doesn't pollute much, was gonna poke 5.7 but might just hit up ue5-main since seems there's a bunch there. Added you as a friend to DM *** that through in couple days or so if that's fine 🫡
love seeing Mass and State Tree getting together
They have always been friends 🙂 City Sample was made with Mass-based State Trees
all the "external data" thing is a bit opaque though, how are the structs are queried ?
UAF as well if I'm not mistaken 
because it feels like each task runs for a single entity, is it the mass manager or a mass fragment/processor who links an entity to a state tree ?
UAF was used in the Witcher demo we did with CDPR, but didnt exist in the days of City Sample 🙂
That demo made it look like the intended future to offset some of those thicc anim costs, keen to slap together UAF / Mass / ST and see where perf tanks out. Future's looking real sunny
There are many Mass processors for state tree, init and also execution. Much of it can run in parallell too if you set a boolean in config
Definitely 🙂 UAF is quite amazing
Appreciate the jam Siggi gotta dip, will send through that ST new user exp doc in coupla days
please let team know we lovin this stuff 
Can someone explain to me how context actor in a state tree gets updated during execution?
It wont be updated after being set, its the owner of the component. Im guessing you might be using the AI component on a controller? There is a bug we are working on now where possess/unpossess doesnt correctly set the actor in time when the tree logic starts.
Yes I'm using it on the controller. Shouldn't I be?
I'm having an issue where I can't stop a character from moving because the Async task pointer I'm setting outside of the state tree comes out as invalid in the state tree. And I can't think of a work around, or how to do this properly
Is there a way to force it to be updated?
Otherwise how to people update variables within the actor itself? What is the best approach to accomplish this?
No thats fine, I was just saying we recently found an issue in that component where the state tree might start without the controller having possessed a pawn and everything being initialized correctly.
Im not sure I follow. Is the actor pointer null or something else?
No. The actor is fine, but I'm setting a AITask variable with an async task pointer in a GameplayBehavior outside of the state tree, and when trying to access it in a state tree task it shows as invalid. Even though in the Actor tick it shows as valid
For what its worth - I have a few BP tasks like ArcChar and I haven't ran into the issues they're describing. My ST delegates have always broadcasted fine. 5.6.0
That's why I was asking if the context actor ever get's updated, during state tree execution
its still the same actor, its just a reference. My guess is you have a timing issue, probably trying to read the value of an external variable before its fully set?
Unticking LockAiLogic fixed this 🫠
I'm not sure I understand why. Thank you for the help though
I thought it would at least let me terminate it at will
Interesting, wonder are you using LinkedStateTrees? Or TryEnter and then transitions to move things? Wonder if my setup has something specific
And 5.6?
Legend I'll try without those then to see if I can't find a consistent repo. Thanks
Has anyone had this problem before? It is specifically the Move to Roam Location state of the NPCs in the Arena Shooter template.
https://streamable.com/950cjd
What is the name for the keybinding to open the ai debugging?
https://dev.epicgames.com/documentation/en-us/unreal-engine/ai-debugging-in-unreal-engine?application_version=5.6
The docs say it's ', but nothing happens for me.
I want to change the keybinding. because i think there is a problem due to qwertz
Give more details, is this an AI template or did you create it?
Looks like "Project Settings -> Engine -> Gameplay Debugger -> Input -> Activation Key"
I altered the NPCs in the Arena Shooter template to use a struct for stats and hitscan weapons. Move to Roam Location only works if frames are chopping.
If the template was working correctly before the modification, create a new project template from this one, then copy the systems from the faulty project to the new one. This should resolve the issue. Also, during the transfer, you might discover which system was causing the problem
That's what I'm about to do but I was hoping someone has seen an NPC behave this way when just moving to random locations (only when frames aren't chopping).
Right now I think there's a problem with the EQS and I'm going to replace it with some other move to random location task
The NPCs definitely are finding a location to move to, but they're just glitching while doing it and only if my frames aren't chopping.
I don't understand EQSs and if it has anything to do with why they glitch-move to the target location that it finds
What exactly do you mean by "when frames aren't chopping"? Do you mean that the V-Sync feature is causing the problem?
The Move to Roam Location state works fine whenever frames chop. If you see the video, at one point I alt tab to demonstrate how they will move at normal speed for a brief moment
at :30 in
I suspect something is ticking constantly and refreshing. So that when the frames lower it is able to run that one logic normally.
But I have zero idea what would be doing that because Find Roam Location seems to work fine.
I have isolated the problem to the Searching state and its sub-states.
They seem to be stuck in the Search for Enemy state
Compare it to the template and see what it changed in the enemy search state
Perhaps you entered incomplete or incorrect variables, or perhaps you performed incorrect transitions
Yo for this specific one I think I figured it out, When I changed the Initialize from
Try Enter >> Try Select Children In Order
The binding worked as expected. But I had it said to TryEnter which I guess although the debugger shows the full leaf chain, I guess it means I break the natural nesting flow?
I'm using TryEnter because I prefer rather than 'The ball rolls down the hill' I feel like I have more choice when the ball rolls to the next increment. Although it seems like that may be causing a few of my problems along the way?
Interestingly you can add an 'Base' State with the SelectionBehaviour - Try Enter. (Changing Initialize to - TrySelectChildrenInOrder)
and get the behaviour I'd expect it rests in Base, but the Initialize bindings will receive as expected. But Initialize set to TryEnter and you lose those bindings events 
Wrong channel, please try #generative-ai
Hey guys, need help from StateTree gurus. Can anyone please tell, what am I doing wrong here? I use StateTrees for my quest system, and I'm planning to implement persistence via workaround using Selection Utility. I've implemented my custom selection utility and assigned it to each child state of Root. However, this doesn't work as expected, the first state is always selected no matter what. And judging by logs and debugger, my custom selection utility's GetScore method never even gets invoked. Why is that?
Also, I probably just don't understand correctly what Selection Utilities are. My previous understanding was that it's just the thing that provides you a score, that score will be multiplied by weight, and that result will be used as final Utility (that will be used for selecting child by highest utility). However now I've noticed this:
If you add another selection utility, it builds an expression, and it combines Utility Scores with boolean operators for some reason (despite the fact they only have GetScore that returns float). I also don't understand why is that
Also, here is my consideration implementation:
This log is never printed, I've also tried putting breakpoint in this node and in C++ code that invokes blueprint's ReceiveGetScore, the execution never stops there as well
Hi, I've noticed that if a state tree's state with children has bShouldStateChangeOnReselect = false and EnterState returns EStateTreeRunStatus::Failed, the next time FStateTreeExecutionContext::TickTriggerTransitionsInternal() will try to find a new state as part of its max 5 iterations, it won't call EnterState. Is this how it's expected to work? Shouldn't EnterState be called again if EnterState failed in the previous iteration? 🤔
I'm facing a problem, where the controller seems not to be rotating with the character.
I have a different project, where it works, but I can't spot the difference.
II have a perception on the controller, so I can check the cone to see, if it's rotating.
So the characters look always in the same direction, but the mesh is rotating correctly.
I checked every option in both (character and controller).
The only difference I can see is, that the one with the problem is created with c++ and the perception component is created in the constructor
In other words, should this tree print "Hello"?
FAlwaysFailTask::FAlwaysFailTask()
{
bShouldStateChangeOnReselect = false;
}
EStateTreeRunStatus FAlwaysFailTask::EnterState(FStateTreeExecutionContext& Context, const FStateTreeTransitionResult& Transition) const
{
return EStateTreeRunStatus::Failed;
}
EStateTreeRunStatus FPrintTask::Tick(FStateTreeExecutionContext& Context, const float DeltaTime) const
{
UE_LOG(LogTemp, Log, TEXT("Hello"));
return EStateTreeRunStatus::Running;
}
I'm really struggling with StateTree. I've been trying to move some of the logic I got working under Behavior Trees to StateTrees. Basically, on spawn for the AI I have them assigned a patrol route with an instance-editable variable based on the actor that guides the patrol (BP_AIPatrol). The patrol route actor has a function in it called IncrementPatrolRoute that will add to a patrol index that varies depending on the length of the patrol, and when it reaches the end, swaps things around to get the actor to move back along the same route to the origin.
This works in BTs just fine (fig 1.), but I'm not sure how to get StateTree to pull the patrol route. I'm assuming I need to pass it via payload somehow for an entry condition? But when it comes to the StateTree task, there's no way to grab what I need from the controlled pawn, STT's EnterState only has transition data and none of the pins will reference the source actor. (fig 2.) How do I get the state in my state tree to fire if the actor has a patrol route assigned to it? (fig 3.)
I tried to add it to the global bindings but I'm not sure how to call that
(plus, that is only setup at runtime, and if I want functionality later where a guard will relieve another guard and take over their patrol route, that's not flexible enough)
...well shit
What does it actually mean, currently I am using soft ref in instance data.
When task is finish, then get active again, does instance data get reset?
I'm not sure I fully understand the problem but using the Output and Input 'Variable Categories' for variables isn't letting you do what you need?
I'd imagine you just Output the Path variable but think I'm not understanding the issue.
no, as I'm aware. I have to manually clear pointers when exit task to avoid keeping reference.
I did not know you can insert icons into your state & task xD
After some testing. If the next state is child state, instance data will not be clear yet. Otherwise it will be clear.
cleared meaning it will create a new instance data for that and the old one will be invalid?
Or they will stay at the same block of address
It is same block of address. I checked.
Thanks
That was in 5.4/5.5, dunno if still the case
In code or a param ?
I remember trying this with a global param, using the picker in editor
Yeh the age old, can do BP comments as well although the StateTree debugger doesn't display them cleanly all the time it seems
how to do BP comments?
Emojipedia or whatever website you can find emojis on and you'll find them work in alot of places just out of the box
Ahh, just thought you can do comments on the state tree itself.
not a bad idea tbh
You can SORTA do this. Basically filling out the description of the tree leaf at right
Hello everyone, hope this is the right place to ask this. I am relatively new to unreal. My ultimate goal for a project I am working on (for uni) is to make an AI in unreal 5 that can play an RTS game. However as a shorter term goal i would happily take some pointers on where to start my research. Because quite frankly at the moment i cant even get an AI controller to control more than one BP independently from one another. Any and all advice appreciated, thank you in advance
Anyone able to assist me with EQS troubleshooting? I an new and attempting to do some very basic EQS. I am just setting up a sphere trace from a location to determine "good cover locations" for an AI basically. If I set up the location to draw the trace from an actor in the world, an AI character, or the playerpawn the EQS test pawn returns all locations as good even when they are not. If I manually set the location to trace from by entering world coordinates in the blueprint instead of grabbing an actors location it also does not work as expected. IF I set the location as the EQS test pawn OR the player start it works as expected.
I think I am missing something of vital importance-
example of it working, useing the player start as the actor of class
example of not working
I would start by debug drawing lines and spheres at your locations to visually see what is actually happening
Also the functions you posted do not help since we can't know where/how do you use said values
one sec- I will add more detail- I have also been working on trying to get it to work
linking a video showing everything almost done
I recorded and uploaded to youtube? I recoreded at too high resolution and was hitting file size limit https://www.youtube.com/watch?v=giBaHyGUXMI
what I was typeing in notepad "Ok I am working on this state tree
I have it going from root to the search part of it (all testing stuff ect)
it goes from search to test eqs
under test eqs it runs the task I set in there
this is the task
enter state- it then runs the hide part
thats just a custom event
it pulls the character running the tree, runs the query, then prints that it ran query (for troubleshooting)
on query finished- it gets the results (should only be on result)
the result is location, i also print location to view it for troubleshooting
move to location then finish task after delay (im not sure the delay is working, but thats a later problem)
this is the EQS that runs
checks path exists, filters?
then does sphere trace
thats just the default one atm - offset so it doesn't get stuck in floor when it looks
looking for the test dummy sorry
howed he get there rip
the dummy has the test in it- so it is traceing correctly i think
currently useing self location of scource of trace-
the state tree is being used by this actor
he should do trace from self, then go to another location that is not seen from self trace i think?
but he is not
observe
its running the query, and returning a location it selects, but does not appear to be actually filtering the results/doing the sphere trace.
"
alright I discovered where the issue stemed from, the EQS trace scoring basically, I switched to filter and score and now it works as intended, it appears it was not Appling score values to the locations ; time to figure out how to get scoring to work 
what's up with blackboard having struct type possible, but you cannot set or get them?
or am i missing something?
apparently it is so
You can use it for custom bbk types (c++). Is what Vector uses
would this be a realistic ask for a perception system in UE or is this going to be impossible?
PITS means Pie in the Sky, basically preemptively being ready to cut it if I don't have time to do it
In this video, I walk you through the best self-hosted AI tools you can actually run in your home lab. From Ollama and OpenWebUI to n8n, LocalAI, AnythingLLM, Whisper, Stable Diffusion, and ComfyUI, I cover how each tool works, how they fit together, and how you can build your own private AI stack at home. If you’ve been thinking about running...
Not for this channel. This is game AI using the tools in Unreal. Like Behavior Trees and State Trees, EQS, Perception, etc... - not the investors wet dream AI. Try #generative-ai
Any good AI tutorial for UE with C++?
That teaches in deep so I can understand how to implement certain behaviour like investigate but when the other soldier arrive, the alerted soldier alert him and he also starts to investigate but instead he provide cover in case the investigating soldier find anything
Tutorial to learn the AI
Anyone have suggestions for good C++ common tasks they have built for StateTree that aren't possible in BPs?
Looking to extend stateTree Tasks/Components as a starting point to learning more about it 🙏
Went with exposing up some simple functions/types to better understand the relationship of elements, anyone learning this is going quite well for better understanding the relationship of things.
<@&213101288538374145>
I don't understand why the Context Data needs to be added with a fixed FGuid. So it's persistence when serialize and deserialize?
I dunno if anyone's tried this, but I wanted to know if maybe someone knows.
Is it possible to add SmartObject slots to dynamic objects or moving actors like NPCs? I was thinking about doing this to allow for specific formations for NPCs (like a wedge or a snake formation). Or are SmartObjects baked into the level at runtime and cannot move/change?
I guess if it doesn't work that way I could always try and grab a followed actor's position and just do the vector math for where they should aim to follow, but I was hoping to make things easier on myself
Smart objects should be spawnable. It would be absurd for that to be not the case.
I don't mean spawnable, I mean attached as a component to a dynamic actor
Anyone know why **** NAVMESH NEEDS TO BE REBUILT **** is showing up at runtime, when everything in project settings and elsewhere is set to "DYNAMIC"?
for whatever reason, moving the actor that has dynamic navmesh on it at runtime, forces a refresh and it works, but not before doing this... and I don't see anything in blueprint to recast navmesh manually
So you nav mesh is set to dynamic and you get the nav mesh need to be rebuilt? That doesn't add up.
what's weird is, the blueprint actor spawning at runtime (dynamic mesh actor) works fine, and I have an actor with a navigation invoker spawning on that spawned mesh, which works fine... (except the nav invoker part), but no navmesh
until... I move the spawned mesh actor at runtime, THEN the navmesh appears
also works if any options are toggled on the spawned mesh actor, which forces some random refresh on it, which navmesh sees apparently
@slow bobcat I guess the theory is that navmesh does an initial pass at runtime looking for already existing meshes, does not yet see the dynamic mesh created..., then via bp mesh is made, navmesh is not signaled that this happened
Ummm that sounds odd...
hello! I am writing my first State Tree Task in C++. I took an existing state from the Gameplay Interactions plugin basically as boilerplate. Now, the source compiles fine, but I cannot see the task in the editor.
The code is in a Loaded GameFeature Plugin, and I can correctly see other stuff from that plugin. Not sure if i forgot something obvious? Any help would be great!
(attached source because discord wants me to pay to write long messages) 😢
Not sure that is how it works. I would imagine that an actor invokers would not create nav unless/until it needs to move
Or there's a path check
&*(#%$
so it looks like this is going to be another one of those, spend 3 days trying 200 different things, and it ends up being a box you need to uncheck somewhere in a sea of 600 other options
pain
ha, there is a mandatory other layer to the system. i dont understand it really but the thing is, I had to inherit from FStateTreeTaskCommonBase
Explain please. I'm interested
Hey everyone i am trying to make a metahuma chatbot but i am soo lost right now in how to do so i want the chatbot to response even questions like what is the current weather in New Orleans i wanna know if there is any step by step tutorial or something or maybe like what ton use how to do so so far what i know is audio2face nvidia ace and metahumansdk has something to do with the process maybe even TTS bot something but i am absolutely lost please help a friend out.
that would go in #generative-ai most likely