#gameplay-ai
1 messages · Page 87 of 1
Sure. What I'm telling you is that it is redundant
Why does the "Aggro" state need to wait for an enum to be "Attack"?
Why not just transition to the Attack state when you need to?
I understand, but then what would be the enter condition for attack state? It would still have to wait for something like "hastarget" bool
Sure - but then that is one enter condition versus two.
Less to manage.
Less white noise
Your states should manage the transitions
they are set at the same time
Further evidence of the redundancy
but then in this instace you would suggest a call to state tree event?
i've never seen it used but it is there
No.
Just have the state transition directly to the Aggro state
You have a list of transitions that the state can do
Is aggro the highest state in your tree?
State Trees are a combination of State Machines and Behavior Trees
no, idle is
And is there an enter condition on that?
Yeah, the Idle could just be "Set Bool Var", "Delay"
and I just manage motivation internally
And then the transition goes right into the Patrol state
And this is the extra work that isn't really offering any gains
It is there because your state tree isn't set up correctly.
A band-aid if you would
I understand. You've given me a lot to consider
the thing is I always have to come up with an enter condtion to avoid reentering certain states
this use of motivation seemed the easiest to me
although I udnerstand it is redundant in some cases or not ideal
The parent state of an overall state (So Idle, Patrol, Investigation, etc...) should manage the enter conditions to the state itself. These enter conditions will be the same requirements that you have when you have your task changing this enum to X value.
Then the child states underneath the overall state will do w/e
In order to transition to another state, you just add in that transition
You can get by with having minimal enter conditions even
Because the State Tree doesn't evaluate the entire tree all the time
Once you're in "Idle" for example - you're in Idle until you tell it to transition based on some conditions
i dont get why you guys dont play around with the combat variant character it does kind of make all allot clearer when you dig into there blueprints
(Assuming a default State Tree setup)
- I don't know what that is
- I don't need it
dont be daft
I'm not?
its unreals combat character
Still don't know what it is
Are you talking about one of the new template things?
yes
personally I like to do my own from scratch to learn the system properly
well fair but yep allot of the stuff is directly there thats all i am saying
and this you would add global tasks, or on event transitions on root?
It depends.
States should manage their transitions
That's kind of the point of state machines
Part of it I should say at least
Yeah - that is the super duper old school way to do things
By old school, I mean like 1997
so I guess it would be the opposite of the enter conditions now
The most basic of state machines that people typically build is just a giant switch case with an enum
Then they'll typically move into replacing that enum with an object based state machine
Then they learn they can put state machines inside of state machines (and this is a hierarchical state machine)
But ultimately - it is all the same. States have to know about what other states it can transition to
And then they learn that they can make a state machine that evaluates a list of states like a behavior tree
And voila - you now have State Trees
(I skipped some things for the sake of brevity - don't @ me Bruno)
again a lot to think about. I'll start making changes and retesting everything
i never get out of enum level 1/2 in c++ standalone as i fear it will get out of control 😂
I'll post here just to show how it ended up, if you are interested
You just need to start thinking in terms of a state machine really
I'm not saying STs are perfect mind you
state machines are like super dupa logic gates for ai
You can keep your State Tree very very very simple as well
Don't need to do a bunch of fancy stuff.
I guess enum was just the easiest way to manage, but not the best in terms of readability I guess
It was just the way that you knew how to manage.
I would say it made it more difficult to manage
Because you always have to make sure this enum is being changed correctly
the way the combat variant has is ace.. it uses anim notifys and interfaces to chat back the combat character
Instead of setting up the State Tree to do that anyway
This right here is lacking any transitions.
well most of the variable are change either through perception or outside of the tree
You simply didn't know that you could've just had the idle go to the Patrol state
You're relying on the selection logic
Instead of transitions
And that may have boned your understanding of State Trees from the get go
Root -> Idle -> Root -> Patrol
That's how the tree is progressing
Instead of Root -> Idle (on success) -> Patrol
well this is my second state tree, and I had issues with states being rerun when I didn't want them to. but you would say the enter conditions were missing probably
The state tree doesn't evaluate the entire tree
Once you're in a state - you're in that state
How you manage it from there is up to you
but it does go always back to root, which will then evaluate each state in order
So your transitions may have been screwy to put you into that situation
It doesn't
once a child state completes it always goes back to parent to select the next child though
Because you didn't set up the transition
It'll go back to the root by default
IE - when there are no transitions
I had issues trying to keep stuff looping in the same state, I find it easier to just go back to root and block the states with enter conditions
again might be the wrong way to do it
this is a state tree I was working on before, which I actually posted here before
it's finished and working properly I would say
Sure - after beating it into submission
care to elaborate?
I would say none
So, when does this state tree run?
well yeah it will start "Search for Work"
Then why is there an enter condition?
Can the actor ever have IsScared set to true the first time this state tree runs?
unlikely, but it could
How?
in a very unforseeable case
Do you run this on demand or something?
IE - you give them this during gameplay, after they already spawned and were doing stuff
it runs as soon as the game starts
they actually should start scared
now that I think about it
sorry my bad
Then I would switch the order of the states
Scared being the first entry point
And not having an enter condition
Because it is the actual entry point.
From there, any transition is entirely managed by me
So the other enter conditions aren't needed in this specific case.
Because state transitions are what determines where it goes
Same with "HasFoundWork"
Only transition to that state when the task that is responsible for finding work completes successfully
from from the wait child states you would just go to parent?
I'm assuming all the Set Bool Variable tasks are setting the IsScared stuff and HasFoundWork stuff and what not
yes
So that would be a lot of tasks that you could remove
I'm sure you detected a trend by now, but it depends™
It really depends on how I want the actor to behave
If you want to go through the tree again - then do so, sure.
I have waits in my trees that will just go through the same state again. I have them that will go to some other state. I have some that will go back to Root as a "reset" kind of.
The decision comes down to "what do I want this state to transition to?"
And then design my state trees as such
like I said I was using enter condition to block entry and then just letting root state select which one it should go to
base on which child state it could enter
in this case I would have to make wait linger indefinitely until a forced transition would make it go somewhere else
which would basically happen wherever I changed the bool values or the enums
I guess this wasn't the intended way to use state trees
This would be a design issue
You just need to design the tree accordingly - to better support repeating the entire tree
like in this last tree case, if it's scared it shouldn't go anywhere else, if it is working it shouldn't go anywhere else (not 100%), other wise roam and look for work
Okay - but then how does it get to the "Wait" part of its state?
I don't use UE's smart object stuff, so I can't say anything about any of that.
But your state that is actually instructing them to do something should keep them in that state until they are done/interrupted from said state.
it case of the work state, I was having an issue that wihtout the wait it wuold go to roam automatically even though it hadn't finsh the start working task
you would probablt say it's because I'm mismanaging it
Depends on how you wrote the task
I could show but it's a lot XD
But in general, yes. There is a certain degree of misunderstanding that you endured while making the tree.
At least based on what I've seen.
thanks, I appreciate the input. I'll rethink both my trees.
i'm not saying there aren't wack parts of the ST mind you.
Just, if you're lacking fundamentals, you're likely to blame the tool
If you do understand the fundamentals and you do some weird stuff - hey, you do you boo.
no I get it. thanks, it is indeed lack of understanding of fundamentals, and I guess proper usage of the tool
I'll try and apply what you've taught me. it will take a bit.
Really, for you, I'd say to rely more on Transitions and Enter Conditions.
Those are probably the big weaknesses for you
Transitions being the biggest though
thanks again
How do I reset PerThreadSharedInstanceData in UStateTree
Hey. I'm trying to modify the navigation cost for paths created using the landscape spline actor. I tried using navmodifier by adding it to the spline mesh actor, but it didn't work. So I enabled dynamic obstacle for the mesh I'm using in the spline actor, but now I get an error when trying to build the game: Ensure condition failed: !NavCollision->IsDynamicObstacle() [File:D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\Components\SplineMeshComponent.cpp] [Line: 745]
Does anyone know of a solution?
Hello guys! Is there a proper way to do cooldown for states? Like in Behavior Tree
I found a BUG! OnPathEvent will rebuild the path to the old End location. In the example, I call my Repath without using GoalActorObservation (since I wrote my own system for tracking changes in the distance to the goal in MassEntity). Repath returns the correct path, but if dynamic navigation changes after that, the path will rebuild to the original EndLocation used when initializing the path.
//Custom repath existing path
FNavPathSharedPtr NavPathSharedPtr = NavPath->GetPath();
FPathFindingQuery Query(NavPathSharedPtr.ToSharedRef());
Query = Query.SetPathInstanceToUpdate(NavPathSharedPtr);
Query.StartLocation = NewPathStartLocation;
Query.EndLocation = NewPathEndLocation;
const FPathFindingResult Result = FindPathSync(Query.NavAgentProperties, Query);
NavPathSharedPtr->SetTimeStamp(TimeStamp);
void UXAIMoveToAsyncAction::OnPathEvent(FNavigationPath* InPath, ENavPathEvent::Type Event)
{
TRACE_CPUPROFILER_EVENT_SCOPE(TEXT("[UXAIMoveToAsyncAction::OnPathEvent]"));
if (!NavPath || NavPath->GetPath().Get() != InPath)
{
UE_LOG(LogTemp, Warning, TEXT("[UXAIMoveToAsyncAction::OnPathEvent] Wrong InPath"));
return;
}
if (Event == ENavPathEvent::UpdatedDueToNavigationChanged)
{
PathPoints = InPath->GetPathPoints();
PathIndex = 0;
const int32 PathPointsNum = PathPoints.Num();
/*for (int32 i = 0; i < PathPointsNum; i++)
{
DrawDebugPoint(WeakWorld.Get(), PathPoints[i].Location, 10.f, FColor::Emerald, false, 5.f, SDPG_World);
if (PathPoints.IsValidIndex(i + 1))
{
DrawDebugLine(WeakWorld.Get(), PathPoints[i].Location, PathPoints[i + 1].Location, FColor::Emerald, false, 5.f, SDPG_World, 4.f);
}
}*/
}
}
I don't know who wrote the navigation system, but it looks terrible. After checking the engine source, I noticed that even PathFollowingComponent fails to complete the path if the navigation has changed—which essentially creates double the load, since the path has already been rebuilt and should return the correct points, but it doesn't. I wrote my own AI system using MassEntity and asynchronous physics, as well as my own MoveTo nodes. The only problem now is that FNavPathSharedPtr needs to update EndLocation. Does anyone know a solution? Because it seems like the best way is to simply rebuild the path during custom GoalActor Observation, instead of using the old FNavPathSharedPtr.
I recall "on nav changed" triggering a new path search because the goal was invalidated.
Would need to dig old code. Maybe it's soemthing we fixed on the spot
The query request has some invalidation code for the path
There's also an event for "goal target changed". Isn't that your case? The target moved whole rebuilding?
I made Repath asynchronous for everyone and on MassEntity, which helps reduce the load on the game thread. Each AI will trigger path updates based on its own timer. Here are the files for my plugin. This also works with dynamic navigation and supports pauses for MoveTo. You can look at Repath and OnPathEvent. I couldn't implement an EndLocation update, since OnPathEvent would still return the path to its old position. I need to be able to change EndLocation everywhere during a path rebuild, even if GoalActorObservation isn't used. I also created a custom filter because regular filters are too inconvenient. They need to have PreUpdateQueryFilter and PostUpdateQueryFilter so that you can change some parameters for calculating the cost before the path starts rebuilding. I'll also attach the custom filter files.
@slow bobcat Currently, these are the main problems in navigation - updating the path, manually deleting the path from NavigationData (complete invalidation), extended functions for navigation filters
But I don't get this... Repath is asynch already... It runs in a async task called move to. Do you mean multithread?
We do all this async and in MT but we don't use mass... So maybe we didn't run with the issue
Our approach is:
- custom async task move to that always runs async.
- the nav path inside is async multi thread, since nav supports multi thread
- upon finishing the path calculation we do some other stuff (path offset etc)
- repath also triggers a MT nav calculation from the event listener (this has a bit of work to make it happen)
The path deletion... We hable that through a movement request that is invalidates iirc
can i execute a state tree in a uobject without the actor component? in my case i want a subsystem to have a state tree
Sure - you just need to write a UObject subobject for it
The State Tree is just an asset
The State Tree component provides a way to run it
And of course, you will also need to make sure the schema is correct
Look at the State Tree Component to figure out how it works.
Is there a way to reliably force an exit to a state? This is supposed to be my firing logic for enemy AI but I want them to break out of trying to fire if they don't currently have ammo and force a run to cover to reload.
Why ST store runtime data inside UStateTree::PerThreadSharedInstanceData , it already have FStateTreeInstanceData
it is so annoy, I have to manually reset data to avoid ref to GC Object:
if (RunningST->GetSharedInstanceData().IsValid())
{
RunningST->GetSharedInstanceData()->Reset();
RunningST->GetSharedInstanceData()->CopyFrom(*const_cast<UStateTree*>(RunningST.Get()), RunningTree.SharedInstanceData);
}
That should be an enter condition - otherwise, call FinishTask with it being marked as not successful
Why are you doing that for exactly?
Because ST reference to GCed actor in PerThreadSharedInstanceData
But doesn't that happen because you get a new instance data in the new taks execution? @chilly nebula if you have the time, can you throw some light here please? I'm very interested in understanding the new flow and seems this is a good test case
Yeah, but when ST is exist, it is still ref, let me revert the fix and send the error, you will see it.
It seem that property function's instance data is store in ST, instead of runtime FStateTreeInstanceData
First question I have is what version is @robust veldt running on? We made some substantial changes to instance data in 5.7. Essentially "Shared instance data" is now soft deprecated.
This should be documented in our code, but I'll gather a summary for you and post in a bit.
I am using UE5.5.3.
The reference from PerThreadSharedInstanceData. From instance data of property function.
Example instance data that output actor, I try use Transient but not work.
What exactly are you trying to do? A property binding function that returns a weak pointer to an actor? And you want to store it in shared data?
Im happy to bring a question to the team, I just need to understand your intentions first
I have a property function to return list of actor that match tag, using instance data as above.
So that I can bind like this:
Im not sure thats possible, binding functions were not really built to store data. Why do you not output this as a parameter and bind to a tree parameter?
Yeah, that is my intend.
Property function require instance data to output value right?, as I search in the source code.
sorry, I think Im slightly misunderstanding you. Let me check a few things
@robust veldt did you include the macro call below your instance struct definition? In 5.5 I believe it was
STATETREE_POD_INSTANCEDATA(FInGameMissionGetMarkerTagsData);
Hmm, I am not include that macro, what is it purpose?
it might not be relevant in this case, but you can see the definition in code if you search for it.
I think you might be running into another issue with array binding, trying to find when we fixed that
@robust veldt can you test this on 5.7? There are just too many possible fixes we've done since 5.5 to go through them all now
I will test tomorrow, currently workaround by manually reset it. Hope it won't crash in package build.
{
RunningST->GetSharedInstanceData()->Reset();
RunningST->GetSharedInstanceData()->CopyFrom(*const_cast<UStateTree*>(RunningST.Get()), RunningTree.SharedInstanceData);
}```
besides fixes for array binding, we have been changing instance data a lot. We did fix an issue where data was persisting in shared data when it shouldnt be, and offered a new alterantive to people who want to persist data.
We are working on a new doc for an overview of the architecture, including all the different types of instance data and their purposes.
Global tasks/evaluators have their own instance data , and node tasks have their own. We also have more temporary ones for cases like transitions.
Overall we want users just to use the provided execution context and not have to worry about what type of instance data is being used where.
@slow bobcat is probably interested, this is one of the recent-ish changes where condition use a different type of instance data.
https://github.com/EpicGames/UnrealEngine/commit/9f681e5c7e828a75d9df6234abbed7c6d5853ecf
I have a case that a state has a child with Enter Condition state, if the child state failed to enter, current state also failed to enter although it has task to run. Does this behavior is changed in newer version?
My intend is to have a child as an optional state.
Its probably better to model that as two child states, one you will always enter and the 2nd one can be optional (if not selected its sibling will be)
Hello ! In 5.4 i made several StateTree referencing other StateTree with a different schemas through LinkedAsset
And it was compiling and working without issues.
It seems that in 5.6, the StateTree doesn't allow different schemas from the owning StateTree in LinkedAsset.
Different Schemas is not supported anymore? Or can i just comment the compiler error?
Im honestly surprised if this ever worked. As you know the schema can set the context data, and it wouldnt be able to carry correctly across linked trees with different schemas. For example if your parent tree has only actor in the context, and your linked tree requires a controller.. where is the data for the controller instance supposed to come from? Or if you try to link a Mass-schema to an actor-schema for example.
I've forwarded your question to the team on what changed in 5.6.. but my guess is it never worked and we just added a validation for it.
Hmmm maybe we use wrongly the schema then
Im curious to hear what you used it for
We added compilation error on the whole tree
Prior to 5.5 with Utility
We made a custom Ticket selection system and we made a compiler for those ticket configuration
Schemas are mostly for defining the context of the asset, and controls what tasks etc can be used when authoring the tree asset.
We are also introducing the concept of an "editor schema" which can lock down or customize certain editor features.
ok that sounds fine, but why did you need to mix different schemas?
Main tree use the Ticket Manager (with its own schema)
And linked asset calls classic StateTreeSchema
So it's compatible in some way but not really
MainTree schema inherit from the StateTreeSchema
yeah thats tricky, and probably due to how difficult it is to implement custom selectors
Basically, i made a system where all AI are in concurrence with each other to select a behavior
So they all compute scores in the same subsystem
While if i'm correct, utility statetree compute each AI independently
But in any case, i built this system way before we heard about Utility in StateTree
@wise sluice the team responded to me, and indeed the change was made because of the reasons I stated above. While some context data can be compatible, there is no way to guarantee they are and then you will have a crash with missing data as I outlined.
Ok i don't have different data
I guess, i'll change our architecture and have only one Schema
Where could we add the compilation logic instead?
Let me know how it goes 🙂 we have some plans to expand on the utility selection system (a couple improvements in 5.7)
// have global verification on the stateTree
if (StateTree->Schema)
{
FString ErrorMessage;
if (!StateTree->Schema->Compile(StateTree, ErrorMessage))
{
StateTree->ResetCompiled();
Log.Reportf(EMessageSeverity::Error, TEXT("Internal schema rules broken : %s"), *ErrorMessage);
return false;
}
}
We added that in the StateTreeCompiler::Compile
Thanks for all the information anyway @chilly nebula
Does the new stuff from 5.6 / 5.7 is documented somewhere ?
In my own utility system, we added the possibility to enable/disable each consideration within the debugger, that's pretty handy
It seems that it is not the case for the Utility implementation
So i have an issue with my state tree which is this
finish task is being called on that teststate with success but the state tree doesn't appear to be moving onto the next state, appears to just get stuck on that test state one
any help would be appreciated
thats what it does inside the task
could reallyyyy do with some help on this as well cause I'm doing everything right from what I can see
the expected result would be the state tree should be going through the state at least to attack completed
fixed nevermind
A member of my team confirmed that your issue should indeed be fixed in 5.7 🙂 let me know once you can test it
It should be mentioned in the release notes, but I know those can be difficult to go through point by point 🙂
Pretty sure i'm doing something wrong in the background (still looking into it), but just from this alone, why would it be stuck in idle, and not move to patrol and then investigate since "HasHeardSomething" bool is set to true? AI character stays in same place doesn't even move to location
clearly skipping "Move to Point of Interest"
Did you set Idle up to complete and transition to next sibling state?
If Idle completes and simply return to Root, then Root will run the same selection and select the same state as before (Idle).
I know this can be confusing, but you need to assume the mindset that the state selector on root doesnt remember what it did last time it ran.
"Try Select Children in Order" does not mean it will select all the states automatically in sequence. It it selects one, then the selector has completed its job.
this is the transition in idle.
what's happening from what I could debug is that as soon as this transition hits, it also hits the one in Patrol since "HasHeardSomething" is already set to true
we are aware of an issue that can happen when two transitions trigger at the same time. If you can find a way to work around that and only trigger one, that would be best 🙂
it's failing the move to in "Move to Point of Interest" 🤔
that then fails the state and probably returns to root?
tries next then fails to enter goes to wait and then root yes
why it fails the move to I can't understand
look at your logs, try to find out why the MoveTo is failing.. or put a breakpoint in task and step through it
ok thanks, so I can disregard it being an issue with transition then?
or would you still suggest I avoid triggering both consecutively?
based on what you show, the transition is triggering correctly but the MoveTo task is failing the state.
You can ofc build in some redundancy to better deal with failure, but the heart of the problem seems to be the MoveTo task there.
What I mentioned is when two transitions trigger at the exact same time, they dont always run in the order you expect.
even within different states?
ty
especially when transitions in two different states trigger at the same time
@reef trellis visual logger is a got to to find AI related issues
some stuff is (sadly) only logged to the vlogger and not in the console
Tested in 5.6 the issue is not happen.
Good to hear 🙂
Hello guys! I have read the documentation, but I dont quite understand how it works. When AI reach player it go to TryAttackOnReach state and check cooldown condition. If cooldown condition pass, go to AttackOnReach and SetCooldown, on complete go to TEST_Wait. On complete TEST_Wait I go to TryAttackOnReach and if cooldown condition not pass go to ROOT, but I think it must go to TEST_Wait again, as child state of OnStateAngry state. Why it work like that and how I can do it properly?
All states selection behavior is TrySelectChildrenInOrder
From documentation. But why it doesnt work like that? On not pass condition AttackOnReach it goes to Root, not to next child state TEST_Wait
Hey everyone, I learned how to inject inputs for the player using Enhanced Input.
It solved all my problems with UI virtual controls, since I’m no longer calling functions directly — I’m injecting inputs instead, and it just works.
Now I’m creating my bot AIs, which have a PlayerState and are children of the PlayerCharacter, so basically they have everything a player has.
What I need is, in the Behavior Tree, to call a task that simply injects an input for “Dash” and then see my AI dash.
But I can’t, because Enhanced Input only works with a Local Player Controller, and my AI uses an AI Controller, of course.
Is there any way to make an AI inject inputs and reuse all my ability actions, so I don’t need to call functions directly?
You should call the functions directly. One reason you shouldn't feed AI through the input system is because you may want to provide additional feedback to the player when an input is pressed that you wouldn't do for the AI.
It's also a lot easier to debug.
out of interest does anyone know if theres a way through the AI Perception system to create a stimuls
for example say player is currently seem by an npc and the player runs into a room. I would want AI to know they've done this and it would trigger the AI investigating that room rather then just going to last place they saw the player. Is there a way to do this through perception system
as it'd only be for NPC that can see the player. Also, it'd only be in the local area where player is
as i'm not massivly good at AI i;ve asked Chat GPT and it's said I can report stimuls at that location with a tag etc
I would use EQS @serene fern
In what way ?
Cause the AI would nees to some how see theyve gone into a room compared to just loosing sight of them in a general area
When the player goes into a room, have the AI go to that room. Then, when the AI gets in the room, if it doesn't see the player, run an EQS (or you don't really need this to be honest) to get all the closest hiding spots (these would most likely be a BP class). So you'd just get all actors of class within X distance. Then have the AI go check each one.
The EQS already has something for the All actors of class within X distance.
Oh yeah that bit i have an idea for its more so the AI seeing player entering a room whats best way there
Just rely on the sight really
Just a delegate on player being fired and AI bound to it whilst its got sight of player ?
Sight -> Lose sight -> move towards location -> if no hiding spots nearby, they're not in a room that needs to be investigated
Arr so your saying rather then the AI seeing them enter a room, the AI maybe does a trace at that location to see if theres a room nearby maybe
And then just self handle searching the room if it wants to
The AI will lose sight of them at the doorway
So when the AI gets to that location, the AI should be at the doorway-ish
Then there is when you'd do your "should I investigate" check
Arr right okay
You could even make it where you do a dot product check and a line trace check to make sure that the AI doesn't like, turn around and go to another room to investigate.
I imagine you're making an Outlast style thing, so I wouldn't be too concerned about perf either. Most likely only doing like 1 stalker enemy type.
Well the doors will prob have a smart object thing on them so maybe i can do that by checking if there is one nearby the AI and based on that AI can then check the room their practically stood right next to
@chilly nebula IN/OUT isn't broken my brain just is broskis XD I've been typing IN/OUT for weeks instead of input/output
Hey guys, does anyone know of an issue in 5.2 where I cannot select my Environment Query into and Query Templates, I also can't add my EQS ContextBP into the Enviroment Query. The dropdown boxes have my assets there but when I click on them it just reverts to the previous selection.
i figured it out, for some reason you just needed to move them to a different folder and it started working
I've been having a lot of strange issues with state trees if I possess my AI pawns manually after begin play. Like the movement and targeting breaks. Does anyone know why possessing AI's manually after begin play could cause these issues?
Are you using the AI Schema? Can imagine the initial Get Context might be unhappy with delayed posession. May need to start the Tree after posession?
Alright... considering there is this channel focused on AI I try again {I asked this on #ue5-general with no reaction or response}, this should be the perfect place for this...
I was using the AI Assistant to create a plugin, yesterday, and it's been something that was taking a large amount of time until, at some point, it mentioned BlueprintUE and self-hosted version of it to integrate my plugin with that environment {I didn't know was possible but I was definitely interested} and asked me this "Let me know if you want detailed steps or scripts for exporting Blueprint JSON from Unreal or configuring the BlueprintUE hosting environment." but when I ask it to help me "configuring BlueprintUE hosting environment" it started giving a complex answer then suddenly stopped and gave me a message saying "Sorry, I can’t assist with that issue as it violates Epic’s terms of use."
Any hint please? Ain't the first time it occurs to get stuck because of that type of response from it with no explanation whatsoever of which terms are violated exactly.
Thanks.
PS: I've tried to formulate my question to it a few times with always the same response, the last time it was elaborating the answer and started writing then reached some point where it finds something in that setup instructions which made it stop and give me that short response instead.
Wrong channel, this channel for AI in game, not the LLM.
Which channel is the "right one"?
Generative ai maybe? #generative-ai
<@&213101288538374145> the above is becoming quite common, any way to make the "gen ai" channels more visible so people know where to go? 🙂
I don't think we have a channel for discussing that assistant. #generative-ai is offtopic and generically for any kind of LLM, I guess.
Obviously #gameplay-ai is for normal, non-hallucinating NPCs etc., so it's not the right place here.
@viral tree You can post to #generative-ai if you want to generally discuss it as an LLM in the form of after-hour offtopic.
Anything else is probably more a case for #ue5-general .
The question itself sounds like something you would want to report to Epic directly. I have no clue what it wants with BlueprintUE, because that's just "PasteBin" for Blueprints, so you can visually share them when needing debug help. Not sure what "integrate my plugin with that environment" means, cause that's not what BlueprintUE is about. BlueprintUE otherwise offers three "tools":
- A self-hosted version, which is basically the website blueprintue.com but hosted by yourself. There are probably some reasons someone would want to do that, but I don't think it's something relevant to your plugin? Epic Games itself uses BlueprintUE on their website, but that's still just the same as blueprintue.com. Maybe minus the fact that Brits can't access it :D
- A C++ Plugin that allows exporting your Blueprints directly to blueprintue.com. Idea behind that is to not having to copy paste it to share something, but just press a button. So just a convinience tool.
- UAsset Reader. No idea what it all can do, but also pretty sure that's not related to your plugin stuff?
Feels like the AI is just hallucinating once again.
I don't think we want to make the #generative-ai etc. channels more visible.
Especially for beginners this is garbage. They should ask questions in the correct channels and get answers from humans.
#generative-ai or with the Blue Man in #programmer-hangout are mostly the only places we would probably want discussion of this stuff (aside from maybe #lounge ).
We can also not do anything about the new Assistant being as helpful as any other LLM, so not sure it even makes sense to offer a place to discuss it.
There are users out there who are interested in the topic and want to discuss it with other like minded individuals, so I can imagine we'll continue to see more of this
The problem is more so that #gameplay-ai attracts LLM peeps.
Yeah, and that's fine, since we have #generative-ai for that.
I just don't want it pushed up the channel list, personally.
Best thing to do in those cases is to just tell them to go to #generative-ai or similar, like you peeps did. Or report the message to us, which you peeps also did. If it really gets too much then we will have to think about adjusting the name of this channel to make it less bright of a lamp for LLM users.
"We were AI before it was cool!" 😄
I'm doubtful there's much reading of it but updating the details may help a little?
Behaviour Trees, EQS, NPCs, AIControllers, StateTrees, (Not LLM / Generative AI)
or something alike?
We've been through this with other channels. The user aren't reading the description 99% of a time.
Easy done that adds up
Yeah, easy if mods would have the rights for it.
ah, meant easy done more like 'that makes sense' but all good 🙏
Right, German brain didn't process that sentence. I will ask Admins anyway.
Hi ! Follow up to the StateTree issue with LinkedAsset that i had for anyone interested.
Context : I came from 5.4 and 5.6 doesn't allow me anymore to use different schema in LinkedAsset state.
I removed the compilation error in the StateTreeCompiler.cpp and the condition that requires an exact match in StateTree Schema in StateTreeExecutionContext.cpp
I saw that we have a logic that check if the data is incompatible anyway so it should be safe.
//if (!NextLinkedStateAsset->HasCompatibleContextData(RootStateTree)
//|| NextLinkedStateAsset->GetSchema()->GetClass() != RootStateTree.GetSchema()->GetClass())
if (!NextLinkedStateAsset->HasCompatibleContextData(RootStateTree))
Since I use a schema in RootStateTree that share the exact same data, i assume it will work fine (and it indeed work fine since my AI are running with this kind of statetree since one year without issues)
I get why it is like this and i need to refactor how we deal with StateTree Schema to remove this change but for now it does the trick so if it can be useful to anyone with a similar situation 🙏
I'm a firm believer in, as long as you know the risks and know the why, do whatever works for your project.
Hmm, I tried starting logic manually and also adding the AI component later but those don't seem to work. I'm going to try to find a workaround. Thanks for the help though!
im wondering why i cant select the With Sword bool in the child state since it requires to enter the parent state
USTRUCT(BlueprintType, DisplayName="Player Movement Dash Event")
struct FSDPlayerMovementDashEvent
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite) bool bWithSword;
};
i also wish i could save an conditionnal entry payload struct var to the state params
uh, i cant get bind here ?
you mean to payload struct?
yeah
yeah no surprised, there is no FProperty for UStruct type
its flaw of property access module rather than ST
also tried making a task with the payload as input and outputs the struct, but child state condition cant use it
oh
UStruct vs UScriptStruct
that dropdown menu uses the former
which makes it difficult for property access lib to create bindings
okay
also, i got a state doing a transition to another state
which has its behavior to try to enter the childs
but it seems that the selection behavior is to first try to enter a child state than running its own tasks
and "transition to" doesnt have a option to select next selectable CHILD, only siblings
If the next sibling can be entered, it'll then try its children.
So you're selecting the next selectable child implicitly
Tasks only get ran once the entire tree's states have been successfully entered.
compile errors as "doesnt has sibling state"
since there isnt any states on that level afterwards
for now i moved the enter conditions from the childrens states to the transitions on state succeeded
so my parent task runs, sets some values, then we try one by one which transition can be done
Yes - because you're still in the parent state
State A > State B > State C > State C.A
You're still in State C
You need to explicitly transition out of State C
Next Selectable State is within the state
here on State C i got those 2 possible transitions that has exclusive conditions
i expecte the state to try then one by one until one works, then no trying to run the other ones
but it doesnt ... it suceeds at running the first transition, then tries the second and fail (expected) and goes to root ...
this isnt what ST says tho
Dash Group has no state after it.
yeah
So it has nothing to transition to
thats what i said ?
Dash Group doesn't dictate how its child states transition
it doesnt yeah, it should tell where to go when being entered
That's the selection behavior dropdown
tried this other approach which doesnt behave how i expect it
I'm reading this statement as something you want the parent state to have access to with transitions.
This is how it is supposed to work. It goes from top to bottom and will transition when one passes. So ordering does matter. What version on you on?
5.6
will transition when one passes
"Ground Dash" isnt entered when the transition passes tho ?
debugger says it tried next transition
What I'm saying is - it is a bug if it is not behaving that way
If the conditions for Ground Dash pass, then it should transition. It shouldn't evaluate Ground Dash (Sword)'s transition rules.
well hopefully sigi will check around soon so i can know if im doing something wrong or not
Hey guys, what is the way to create navmesh for large world partitioned maps? Do you just create a giant nav mesh bounds volume that wraps the entire world?
calling events in the task doesnt do anything at all
What do you mean?
it just stops the state tree
Can't say I've had an issue with this. And where it comes from shouldn't matter.
If I recall, events get processed at the start of the process.
Its either the start or end of the process.
even with one transition it fails when the task finishes
Hitting this ensure when opening my State Tree for the first time when starting editor. Don't really understand why. I know it's complaining about a State Tree property (an array of vectors) referenced in a State Tree Task, but don't know the reason. Anyone experienced this before?
@chilly nebula, would you know if this is a bug ? Im on latest 5.6
Tried a lot of various combinations and nothing works.
I got a state tree that isn't running at all
- I have a boss character that inherits from "enemy base"
- State tree setup is made all within "enemy base"
- other ST assets work just fine in my common enemies, which also inherit from "enemy base". They don't work in the boss character
- my boss ST doesn't work anywhere - no actor that receives it will run even the first node, even if it's just debug text
in the visual logger, the only thing that differs that ST from the others (that work) is it has some "redirected" logs
I'm getting the issue of enemy ai being slow to react to sight stimulus the more enemy ai characters i add to a level. With 1 its instant and with 50 its almost 3 seconds.
I think the fact are all sensing each other is the culprit so i want to set just the player character as a stimuli and make everything else invisible
I tried the below in the DefaultEngine.ini
[/Script/AIModule.AISense_Sight]
bAutoRegisterAllPawnsAsSources=false
Any help appreciated. Need to be able to place a decent volume of ai characters with perception and still be performant
your character should register itself as a stimuli, also there is only so many traces it does per frame
you can set these also
int32 MaxTracesPerTick;
/** Maximum number of asynchronous traces that can be requested in a single update call*/
UPROPERTY(EditDefaultsOnly, Category = "AI Perception", config)
int32 MaxAsyncTracesPerTick;
UPROPERTY(EditDefaultsOnly, Category = "AI Perception", config)
int32 MinQueriesPerTimeSliceCheck;
UPROPERTY(EditDefaultsOnly, Category = "AI Perception", config)
double MaxTimeSlicePerTick;
UPROPERTY(EditDefaultsOnly, Category = "AI Perception", config)
float HighImportanceQueryDistanceThreshold;
float HighImportanceDistanceSquare;
UPROPERTY(EditDefaultsOnly, Category = "AI Perception", config)
float MaxQueryImportance;
UPROPERTY(EditDefaultsOnly, Category = "AI Perception", config)
float SightLimitQueryImportance;
/** Defines the amount of async trace queries to prevent based on the number of pending queries at the start of an update.
* 1 means that the async trace budget is slashed by the pending queries count
* 0 means that the async trace budget is not impacted by the pending queries
*/
UPROPERTY(EditDefaultsOnly, Category = "AI Perception", config)
float PendingQueriesBudgetReductionRatio;
/** Defines if we are allowed to use asynchronous trace queries when there is no IAISightTargetInterface for a Target */
UPROPERTY(EditDefaultsOnly, Category = "AI Perception", config)
bool bUseAsynchronousTraceForDefaultSightQueries;```
or you can add a IAISightTargetInteface to your character
and handle it
you override virtual UAISense_Sight::EVisibilityResult CanBeSeenFrom(const FCanBeSeenFromContext& Context, FVector& OutSeenLocation, int32& OutNumberOfLoSChecksPerformed, int32& OutNumberOfAsyncLosCheckRequested, float& OutSightStrength, int32* UserData = nullptr, const FOnPendingVisibilityQueryProcessedDelegate* Delegate = nullptr) { OutNumberOfAsyncLosCheckRequested = 0; PRAGMA_DISABLE_DEPRECATION_WARNINGS const bool bCanBeSeenFrom = CanBeSeenFrom(Context.ObserverLocation, OutSeenLocation, OutNumberOfLoSChecksPerformed, OutSightStrength, Context.IgnoreActor, Context.bWasVisible, UserData); PRAGMA_ENABLE_DEPRECATION_WARNINGS return bCanBeSeenFrom ? UAISense_Sight::EVisibilityResult::Visible : UAISense_Sight::EVisibilityResult::NotVisible; }
Engine/Source/Runtime/AIModule/Classes/Perception/AISightTargetInterface.h
That's what i'm looking for. Thanks, i'll give it a go and hopefully it fixes it
There is a known issue when two transitions trigger at the same time, its possible you are hitting that. We'll have a fix submitted soon
Can you try changing this so you model it as substates instead of multiple transitions both triggered by succeeded? ie
Ground Dash
Sword
Default
And enter conditions on each as you need
the ST for visual aid
i initially wanted that
transition from parant A to parent B (Group Dash)
and one by one try each child state of B until Enter conditions suceeds
thing is, to do the conditions i need some data the child can't get because child states cant access conditionnal parent enter event
.
i tried with a Task in the Group Dash parent state so i could read the payload and save it to some exposed vars.
but when a transition occurs, child states are run first, so the parent task isnt run before the transition tries to be applied to the child states
i also tried to run the correct transition event in the task BP of the Group Dash
and have the "On Event" transition set on it, but doesnt do anything
.
tried delegates to, nothing ....
delaying by a few ticks after the transition to Group Dash doesnt change the results to
The rename of the channel caused me to do a double look for it lol
Hopefully means less rando LLM spamming 🙏
https://www.fab.com/listings/1423ad9b-9c53-43be-b4c8-af1b655377bf
anyone used this/had good experiences with this? Is it worth getting on sale?
WEBSITEDISCORDThe HTN Planning plugin lets you create AI that can plan multiple steps ahead by predicting the consequences of its actions. Here are some examples:Video: an HTN-based character inventing the optimal plan to attack a targetVideo: two groups of HTN-based characters tactically fighting in a simple FPS arenaJust like with Behavior Tre...
Haven't had a need for it yet. But definitely pretty nice.
I got it while was on sale some years ago just in case.
Because at the time I did have a game idea that would've benefitted from it. But never went through with the idea.
Better or worse than Logic Driver?
I'd love to use a planner system but I likely will need some kind of hybrid setup to allow for better scripting usage if needed
I'd say better - specificially because Logic Driver is just a state machine
And UE has a state machine these days. Even if it might feel a bit wonky at times
Building your own state machine isn't too big of an ask either
Does anyone know how to get EQS to generate points on actors? When I switched my floor actor to a staticmeshactor cube my AI suddenly started working
@chilly nebula :D Apparently we all agreed on this one very quickly. Hopefully the rename helps.
this transition stuff gives me an headache
none of the available ways to transition works in my situation
Thanks Cedric 🙂 appreciate it
Odd question- I want to be able to trigger StateTree events when a linetrace fails to hit a character- so even if the bullet didn't directly hit, they can sense that a shot passed near them and react appropriately. Every shot in my game does two line traces- once to get the initial point of aim for some calculations and the second fires the actual round with an off axis to simulate recoil. So I was thinking that I could use either a out hit on the initial trace to collide with a sphere around the character or some kind of overlap event with the line trace of the actual shot. Would this work? How would I make this work?
(I'm also not sure how to get touch events in a statetree)
I'm also trying to process and fire vector locations to the StateTree seperately based on visual and audio stimuli. The perception system picks up visuals but doesn't start the behavior correctly
In BP how do I make the ai not run in a straight line and collide w/ other actors?
I tried EVOAvoidance and cant use detour crowd ai controller as im already using an ai controller class.
https://youtu.be/vtj9t1sbuW0
Ai always goes in a straight line and does not avoid other actors.
Why can't you reparent your AI controller BP to the crowd one?
the bp crowd blueprint is c++. will reparent a node based BP to a c++ one?
I can't say that sentence makes sense.
AIController is the most basic controller for AIs. The Crowd one probably inherits from it anyway.
Made the changes but the pathing is still poor.
when using the perception component, do i have to call RequestStimuliListenerUpdate() on all the AI's using perception when someone changes team for the hostile, friendly, neutral thing to update?
oh seems like unregistering and reregistering the StimuliSourceComponent is whats needed
For anyone looking for some new AI talks... This just went up
https://youtu.be/XKQfMZOXFv0
In ‘Lords of the Fallen’, CI Games Mediterranean Projects SL customized Unreal Engine’s AI systems to meet the demands of a fast-paced, modular, and scalable AI ecosystem—one that supports rapid iteration and is designed to extend across future titles in the franchise.
This talk recorded at Unreal Fest Stockholm takes a deep dive into...
@harsh storm i think you are a fan of this guy no?
Little rough around the edges but overall alright I'd say
Open for specific questions
Sure sure... Too late man... Too late! (*runs away crying *)
Was anyone at UnrealFest and know if there's any talks that'll come out relating to The Witcher 4 (SmartObjects / StateTree UAF?)
Any good reasons not to expose up ST data to BP users anyone can think of? Tryna think if I'm allowing too much power to destroy themselves
Good... Enough...
Not in Unreal Fest Stockholm
Ive been waiting for this one, since I missed seeing it IRL!
Hope you enjoy it. Too bad I couldn't give code for the state trees part
Anyone have more resources on State Tree?
The pinned messages have a bunch of talks
There's also a pin for @hallow compass blog where you can find a nice compilation
Thank you so much 
Really want implement for our GDs but I consider which part they can involve and how?
Hello, I'm a beginner in Unreal Engine.
I am leaving a message because there is a difficulty in implementing the NNE-related functions of the Unreal Engine. Please help me.
I want to get ONNX files from users at runtime and run the deep learning model.
Q1. In the NNE example of the UE engine, ONNX is put in the content browser and run. I wonder if it is hard to change the runtime ONNX when using the data stored in the content browser.
Q2. When using Unreal Engine NNE, can I get the ONNX file from the user and use it?
Thank you for reading. 🙂
Talks will answer that question and for you probably. They have examples etc
This is for gameplay AI. Your quesiton will be better answered at #generative-ai
@slow bobcat that debugger in your video is that some COG implementation or something custom/?
Thank you for your guide. 😄
It's ImGUI. In Lords 2 we use COG now. I recommend to straight jump into COG
I hit up ImGUI for some lightweight-ness but coming from design it's a bit spicy. COG seems a but nicer training wheels with same benefits, so recommend COG is fine?
Both solutions demand code implementation. If ImGUI was an issue for designers due to that, you will have the same issue with COG. I think they have some BP stuff but I have never used/cared.
Has anyone managed to make EQS work with Smart objects?
I'm having immense trouble with getting any useful return since EQS returns only the location and not the slot that is passing tests
Hi i am using state tree 5.6 and i would like to save the output loaction of a task to a "global" state tree variable, but i dont see a way to bind this to anything?
i can only bind a variable from a task that exists in the same state to this output variable.
About 8ish Mins in the property reference stuff will explain it.
https://youtu.be/bvWHU5nvU-0
A Quick Look at the New Features and Updates for State Trees in Unreal Engine 5.6.
From Custom Tick and State Control Flow, to the New Delegate Dispatchers and Listeners now available, and more...
NEW Gameplay Camera System In Unreal 5.5: https://youtu.be/oT9uSfET3nU?si=_XtqtDWPh0BiPZIA
Unreal Engine Beginner Videos To Watch Next: https://you...
Has anyone tried stress testing the AI perception system, and see how performant it runs with a lot of actors and stimuli?
hmmm but how do i get the state tree handle inside a state bp?
I believe it's just a variable described in the video and the variable lets you set the 'type'
how do you guys read transition payload vars for conditional transition ?
I'm wondering how devs typically handle stealth and awareness in situations where the enemy is behind cover?
Like ideally you'd want the enemies to shoot at you when you're behind cover and they're aware of you in a firefight but still be able to use cover to escape their line of sight and disappear
Or maybe try to toss a grenade to the cover you're behind even if they cant directly see you, just assume that you're back there.
But how do you distinguish between an enemy that is behind cover and one you have lost sight of?
The whole picture is:
- You have an enter condition in you State with Required Event To Enter set to true and set the payload struct you want to use
- In the task within that state you have a variable of the same type as the payload set in your condition. You can now bind to the payload data in the condition
- Then you send an event from somewhere that passes a payload of the type your condition needs to trigger the transition
Can you bind it?
you have different ways.
- If you go the Uncharted / Last of Us way, you can throw a grenade when you detect the player is out of sight and not moving for longer than X seconds
- Another version used in other games like The Ascent is that + have some "crazy melee" guy that will just run to your location to hit you
As for "how do you distinguish" part, it's all the same.
- If the combat is active, then the player is behind cover
- if it's not, then you lost the player
Examples:
- Player behind cover shooting at enemies. The enemies are being either hit or hearing/detecting bullet impacts nearby them: they are under fire. Combat is active. If the player hasn't been visible for a while, try the grenade/reach approach to push it out of cover and force movement.
- Player behind a column, no attack, doesn't move. Try the approach/grenade. If that doesn't work because it's not possible (maybe it's a location not reachable for the enemy and there isn't a clear line of sight), then you play the usual bark "where is that fucker???!!!" and they can return to idle/patrol. These situations tend to be logged as bugs when you can use them as exploits, so I recommend you create an optional log when the target is lost
It wasnt showing
I think i need to mark it as an Output
Thanks!
Not moving, how, exactly? Is there a way of doing this without giving the enemy AI pseudo-omnicience and being able to directly observe the movement speed of the player?
Also, the "how do you distinguish" part i meant between how do you handle the transition between combat and non-combat if that transition is typically handled by breaking line of sight for a period of time and taking cover effectively does the same?
Is there a way of doing this without giving the enemy AI pseudo-omnicience
that's pretty much how all AI's works in games to some extent. You not only feed them the info they get through their senses, but lots more in different ways (check The Director Approach used by Left for dead series for example). You need to make the AI understand things like "level of threat" that can only be managed by passing information to it. In this case, more than the speed of the player, you will just care about "is moving" or not and for how long while the player is your target. Or, at least, how long since you saw the player (more on this in the second part)
do you handle the transition between combat and non-combat if that transition is typically handled by breaking line of sight for a period of time and taking cover effectively does the same
yep, it's the same. The difference is how do you measure when to stop caring. As I mentioned, one way is to check if the LoS was broken for long and there's no way for you to reach the target.
if you can't see the player but you can toss a grenade to the last known location, you are in combat still. If after tossing the greande you don't geet any feedback (you don't see or hear the player), you can assume you lost it. You could then do what we do in our game, have a "in between" state between Idle and Combat which means "hey, I know there was a guy over there, so I will go to investigate. Not in combat but definitely not in idle". If after going to the last known location of the player we don't find anything, the go to Idle
@vast narwhal I've been trying to answer you to the questions about the talk on youtube but I can't. Not sure what is going on. I write the answer, click reply and youtube blocks it.
I'm available here for questions
Good morning Bruno,
It's very kind of you that you took the extra step to make sure to find me and reach out to me. I honestly don't know why YouTube sometimes does this!
I have so many questions, but I will make it as short as possible, and also my DMs are always open if you feel like answering me there directly. As a level designer, I didn’t fully grasp all of your technical points, but it gave me new insights. My boss will likely have plenty of questions and thoughts after watching your talk; I have sent the link to him. Will let you know when I hear from him; he is travelling at the moment! I am currently learning blueprints because my boss truly believes that if I learn this, it will make me an unstoppable level designer.
Here's my question to you:
- How does a level designer communicate to a programmer during the blockout phase, especially if they have an idea about the enemies and potential new AI and how they behave? What's the process like in Lords of the Fallen?
- How much testing is done on all enemy AI during the blockout phase, and what happens when a team decides to change something about how enemies should behave or patrol routes during the polish phase of level design in the same space with different enemy sizes? What did you and your team do when this happened in Lords of the Fallen?
- What is the most important advice you have to give to level designers when making levels, in terms of your experience as a senior programmer when it comes to enemy AI and how that affects the level design?
Thank you for taking your time, and have a great day.
PS: I had to use a glitch to bypass the Empyrean Church before the patch in PS5, the key didn't work for me because the co-op opened the chest and somehow the key was lost. I have about 90 hours in Lords of the Fallen and the game is incredible and I cannot wait to play Lords of the Fallen 2.
will answer all this in private since it's not "I have Unreal AI questions".
I need to go out now but will try to answer in few hours
5.7 also has a new feature where you can bind the Output property to a global/state property directly 🙂
oh sweet, gues i gotta upgrade now 😄
you can use a State Tree Property Reference instead of an Output. And define the variable either on State Tree parameters or the State parameters. Then just call Set-by-ref
If the tree fails to enter a specific state shouldn't it go to next sibling or follow the defined transitions? When my tree fails to enter Look For Work it is going to "Root" state instead of "Wait" state.
😔 time for my first of many questions in this channel
On Perception Updated isn't going off, same with On Target Perception Updated
getting a picture of details
I know it isn't working because I have a print string out of the events
What's the difference?
Assuming behind cover = hidden
there really is no difference. Assuming the AI knows the walkable area around where they lost sight of their enemy, they can run some sort of heuristic to decide between "that guy is chilling in that area" or "I bet he ran off"
That is, if you wanted to be really systemic about it. If all you care about is selling the behavior, you could always just let the AI know where their enemy is and make a roll to decide whether to toss a grenade or investigate.
A common cause is the optimization that perception can be doing. Can dig in from that or start with potentially a near empty test level and if your Plane + 1 AI isn't firing off perception then it's another root cause.
can you dumb that down
When there's lots of things being detected/events firing off it might skip some amongst the optimization. So if you make a near empty level say 1 plane for the floor and your AI and the thing it should detect.
You'll be able to tell if that optimization is making you miss perception events or to look elsewhere
ahhh okay
Also try to set Max Age to something higher than 0, and use the AI perception debut mode
Is there a way to modify the a* heuristic without doing engine changes? I believe it uses simple euclidian distance by default
Out of the box I think they only support heuristic scale in Project Settings. What's the issue you are having? And what heuristic would you like?
Mostly that it weighs vertical distance just as much as horizontal, so partial moves can move to points above off namvesh points instead of next to them
ah... I see... yeah that's a headache
I think this is where they apply the euclidian. Just simple distance.
The cost is calculated with a dtVdist too
This is from dtStatus dtNavMeshQuery::findPath(dtPolyRef startRef, dtPolyRef endRef, const dtReal* startPos, const dtReal* endPos, const dtReal costLimit, const dtQueryFilter* filter, dtQueryResult& result, dtReal* totalCost) const
this is what get cost does
I guess you could modify that function to differentiate between X and Y distance?
Isn't this happening only for locations that are super close or just on top of each other? Sounds like an edge case
Any chance you can show anything to understand the issue?
Not really, but yes it's solveable in other ways, but it piqued my interest if modifying the heuristic is even doable
@hearty niche I think you also asked me some questions in the youtube channel but my answer seems to be deleted too now. No idea why.
The Simple Stupid Funnel is the name of the algorithm unreal uses to do the string pulling part of the path calculation. You can find its code in DetourNaveMeshQuery.cpp in the function findStraightPath. If you need to see documentation about how it works, you need to refer to Mikko's blog (he created the Detour system unreal uses too) https://digestingduck.blogspot.com/2010/03/simple-stupid-funnel-algorithm.html. If you are asking about documentiation for the Unreal Offset From Corners, you can find it in NAvMeshPath.cpp, function "OffsetFromCorners". As for our own algorithm (Good Enough Path Offset), there are two sources: this very talk or my article in Game AI Uncovered Vol.5, which will launch next year (date to be confirmed) https://www.routledge.com/Game-AI-Uncovered-Volume-Five/Roberts/p/book/9781032840536 To give you a short answer: there's no plugin
Damn you found me lol. Is this from your souls like pathfinding talk?
yeah
How did you know it's me?
`Selection Flow
Selecting a new State
StateTree selects active States similarly to a behavior tree. State selection starts from root on the first Tick, and it continues down the tree evaluating each State's Enter Conditions.
If the Enter Conditions do not pass, the selection proceeds to the next sibling State.`
Posted a little bit above, I have this state with these child states, it fails to enter "Look for Work" because condition is set to true, which is correct, but then instead of going to "Wait" and back to "Search for Work" again, it goes to Root. According to documentation that isn't standard flow. So what is happening here? couldn't see anything in the debugger that would hint to the issue
Tried my luck looking for VegitoBlue here. It's a weird enough nickname to find I guess?
Is it lol?
Either way, thanks
Btw yt seems to auto delete links from comments now
Happened when I was sharing a yt video with another youtuber
It can be set per channel afaik. Epic has it turned off?
good to know. Edited the comment and removed the links just in case.
Can state trees be run MT ?
Aside the state trees itself, seems like almost nothing is 100% relying on UObjects
Yes. The Mass one has an option to.
I believe you have to configure it in the processor though
im also wondering if people tried to use a state tree for partial authoring of player movements
i started last week and it worked out very well
Or in the config file 🙂 yes
What are the differences between a Mass State tree and a "regular" one? Can I use Mass trees to drive AI decisions?
i think the point of Mass X State Tree is that instead of having your ST ran on tick by the STC a processor runs it
Yeah but is the tree any different in its implementation?
idk, im interested to
time to get my enemies working 😭
aight gotta look somewhere else it still doesn't fire
this is next
nope
i was following this https://dev.epicgames.com/documentation/en-us/unreal-engine/behavior-tree-in-unreal-engine---quick-start-guide#6-aicontrollersetup
How would you guys go about "masking" the nav mesh?
What I mean is, I don't want the ai to navigate using any area they haven't explored before
The path is there, they just don't know about it. Stuff like that.
The schema
yes, the schema and the context objects are different.. ie you cannot share tasks or the state tree asset between actor and Mass-based state trees.
With some tricks, you can do NPCs fully in Mass today. The issues you will probably run into atm are with skeletal animation and rendering, but we are quickly heading towards a reality you can do those with the new UAF animation framework.
One great approach I've seen is utilizing a mix of Mass + actor parts for the same NPC. Anything out beyond a certain distance is fully Mass based, and once the character comes close enough an actor is spawned and an actor-based State Tree is activated and either disables the Mass one or they run in parallel handling different tasks.
Movement and avoidance are examples of logic we've run on Mass, then sync the transform to the actor or even use the "suggested velocity" to drive root-motion based animation.
Fantastic explanation. Thanks a lot!
Is this supported by the mass LOD? Fragment that utilized high-res low-res actor flow or can't sit amongst that and is a custom solve you've seen?
custom solution
how bad is not using State Trees and Behavior Trees, just straight blueprints, for AI?
I feel like I can understand the trees, but for some reason they mess up a lot more easily for me
Doable, but a nightmare. Bt's and St's exist precisely to ease the control over decisions flow and data management
expected such lol
really nice presentation! @slow bobcat I have some doubts about my understanding of the BT memory handling you developed.
I understand that it is mainly to save the state of the main behavior during reaction and in particular because you have some utility inside the tree that you do not want to repeat ?
Is it because you use State Trees before the introduction of utility states or because you had already some legacy code with custom utility in it ?
This is probably a naïve question but if you would have utility states, I guess the scoring functions could save the last evaluation in the parameters or something else in the ST and go back to the same state after interruption ?
The states could inject the relevant Behavior Tree in the Master Tree via a STT. Does that make sense ? I am making a State Tree + BT system to avoid ending up with a Spaghetti BT, but I fear I might miss some of the subtleties you ran into with my current setup.
hi! thanks a lot!
Will try to answer the questions:
-
The main reason for our custom memory save is because of the way Uneal BT system is made. The system assumes one thing: when you run your AI through BT's, there will be always a hierarchy running. That is, a main (master) tree that is always loaded and running and, to it, you will attach other sub-trees. Since we don't have a master enemy tree, we don't have a hierarchy. What we do is to treat BT's as single blocks of logic. If in Idle, I runt the BT Idle, if in combat, I run the Combat BT but they key difference is that they DO NOT belong to a parent tree. That requires independent calls Start and Stop. In the talk I explain that, when calling stop, all the memories (Instanced and Known Instances) are cleared out, making it impossible to go back to a tree maintaining it's previous state. The main bug that uncovered this issue was the Utility we use in the trees: it was picking the same option every time it came back to the tree (ie: combat -> parry -> combat, both combat runs would yield the same results). It's not so much "save the state of the main behavior" but "save the state of the last time you run a tree, whatever that tree is". With it, among other things, the values chosen by the utility nodes
-
About Utility in BT's vs ST's: we have utility in BT's because ST's didn't even exist when we started Lords. Keep in mind that the project started prototypes somewhere between 2019 and 2020. UE5 would take quite some time to release. Then ue5 released and we replaced the logic we had in Logic Driver (a 3rd party State Machines plugin) with State Trees. Even though ST's were super experimental and crude, we managed to get everything we needed out of them. Then we moved to Lords2 with all the lessons and issues I mention in the talk. As I mention, we already had over 100 BT's from Lords that we wanted to re-use, mostly as a base for new/better behaviors where possible, hence us keeping all our BT logic (Utility
among other things)
This is probably a naïve question but if you would have utility states, I guess the scoring functions could save the last evaluation in the parameters or something else in the ST and go back to the same state after interruption ?
I would need to think about this but, from the top of my head, it would imply re-make everything in State Trees. But I guess yeah, the ST utiility would run and pick a BT to run, then the issue will be gone because the ST will always run. Main problem for us is we have A LOT of sub-trees with utility in them. We would also still have the issue of data within the BT's (like custom cooldowns for example) but, reached that point, it would be a matter of evaluating if moving entirely to State Trees is what we want (so far, it's not. They are changing way too often, missing/buggy features and, in general, the UX is not welcomed here).
To us sounds like a more cumbersome way to deal with it, but for others might be the way to combine ST's and BT's
thanks for the detailed answer ! I will keep experimenting. For more context, what I am building is some kind of way to "package behavior" in data assets which regroups one gameplay tag , a BT, a Cooldown, a utility function and a condition function. Those are then populated in the state tree just by setting a tag parameter on a premade state . The rest of the info is extracted from the data asset (conditions, utility scoring, cooldown, BT to run) . Each state contains a unique task that injects the behavior tree (from the data asset) in the Master Tree. The goal is to have the main decisions decided by conditions + utility and BTs just handle the execution of simple plans with no or very limited decision making. I ended up with this setup to avoid having a large, unmaintainable behavior tree but we are a very very small team and I have too much stuff under my radar so I fear I missed some important aspects that will hit me in the nose later 😂
yep, that's a perfectly valid usage.
TBH I could have built the entire system keeping the master enemy tree and injecting the reaction BT's within a RunDynamicBT node on the very left of the MasterEnemyTree called "Reaction". That would allowed me to inject the reaction while keeping the memory of the other trees (since combat, idle etc never change once set). Looking back I had a discussion with the other AI programmer about that being much simpler but I really wanted to get rid of the forced tree hierarchy, see if it was possible.
Only thing would be to have some decorator aborting all lower priorities to run the newly injected reaction. Not sure how I would control the Queued reactions though. Sure there's a simple way to do it.
I think that the approach you are following is probably the correct and, If I were to do the same again in some other company, I would probably do the same:
- Decide in a controlled data struct (the state tree)
- Execute the result in another (Master BT where I would inject the reaction)
That same approach could be adapted for goal planners too.
I think you are doing a good job
Thanks for the feedback, I'll report back when this gets more battle proven !
@slow bobcat I think you also work through Context 'objects' for holding your data for the most part. Does this cause you to not really utilize parameters / in-out Categories for StateTrees / Tasks.
I'm realizing since adjusting to using a context object I don't have any parameters/In-out task variables (often).
Wondering if this is a bad pattern or just what naturally occurs when one moves to the context data existing on an object/data asset.
A side effect of our system using a combination of state trees and bt's from the previous game is that we don't need to use parameters that much. We use them for events with payload and we bind parameters in tasks to the schema exposed stuff (not only the Actor/Controller, but their components too). Most of our data is in Blackboards that are used by both, the Bt's and the ST's. We created custom state tree conditions and tasks where you can select a BB asset in the owner AI of the tree and select a Bbk from it to get/set it's value. That way we can make St tasks and conditions generic as we would do with tasks and decorators in a BT.
So pretty much we reached the same point you are reaching: barely any need to use out parameters (aside the mentioned transition events).
To our team that's a flaw in ST's, there's no centralised data storage, so you end up using local variables (parameters) in to the tree making it imposible to reuse in other AI archetype without reworking how to set the parameters or you end up with an external object (BB for us) with all the data and the the parameters are "useless" . But I might be missing something here. Keep in mind we have been using ST's since their very early versions and we might have bad habits
Appreciate ya thoughts as always though 🙏 I think the interesting place where the implementations diverge is I'm avoiding transitions quite aggressively because I dislike the concept of a transition not being it's own 'state'.
Instead leaning on these red circles you can see which are dispatcher bindings wrapped up nicely along with the Succeedded / Failed transition flow. Maybe it's because my trees are very linear though, sounds like you have a 'chooser' style layer that occurs on your transitions.
But in unison I'm wary that I'm not doing what 'the engine wants me to' but wonder if the parameter workflow is there to exist as more of a Blueprint facing implementation
Are the dispatchers a custom thing you made or are they the new "delegates" rolled out in 5.6? I haven't had the chance to catch up with that
It's those delegates wrapped in some basic logic, so my base parent class for tasks have a 'start' and 'complete' by default. Then the tasks themselves choose when to TryBroadcastCompleted, which is just filtered by the bool
It's also to satisfy the Visualization I prefer this for hiding them when not in use and don't like the inline display when they're off still being so visible/noisey
These were the first elements I found myself leaning on in ST, so am wary I'm not using StateTree properly because of avoiding so many of their base systems
I mean... There's no "properly" aside guidelines for pipelines in unreal (like "set the studio the unreal way"), the rest is "hey, here's our tool, use it however it fits your needs best". As far as your system doesn't throw you into an engine code changes rampage or invalidates debug tools provided... You should be good
Very true, seems like we're mainly just discovering different ways as ST evolves. Thanks for the thoughts wise one.
Hi, can anyone help me? I can’t figure out why the FPS drops when I add NavModifierVolumes to the map, but when I remove NavModifierVolumes, everything works fine.
no idea about the performance issue, but what is your use case for nav modifiers ? If its just to forbid access to those area it could be achieved by changing the agent radius
Hi, I’m working on a wolf AI that’s supposed to strafe around the player in a circular motion. I’m using an EQS setup that generates points around the player and the wolf moves to the furthest point each time. The issue is that the movement doesn’t look like proper strafing — the wolf keeps turning toward each point instead of circling smoothly, and the transition between points looks choppy.
Does anyone know a better way to achieve a smooth circling/strafing behavior?
Maybe use the same method used for AI cars : generate a spline for the path (you could generate random control points for it ) and control the inputs (left/right forward speed ) so force the wolf in the direction of a control point a few meters away from him on the spline. That way there is always a continuous target for the wolf and there is no go to point -> wait -> go to next point transition.
Dynamically change the AI move To waypoint might work as well. Example of setup for the vehicle AI spline method: https://youtu.be/HNpA9ArbZok
In this tutorial, we will guide you through the process of setting up a vehicle in Unreal Engine to follow a spline path in a continuous loop. This is the first part of our series on developing an obstacle avoidance system for AI vehicles. We will set up the steering, brake, and throttle for the vehicle.
Playlist: https://youtube.com/playlist?li...
Thanks for the reply — that sounds interesting. I’ll give it a try and see what I can come up with next.
I think that was part of the point for STs. I know I have brought up the lack of something like the BB to Siggi before and he mentioned that ST is more for data locality. So, instead of having global variables, you should have variables as local to the task as possible. Kind of like how we do it in programming in general. Make the variable as locally scoped as possible.
That said - I think the biggest issue is just how data is moved around in ST now. There are so many things surrounding it. We should be able to just bind to something and if the task alters the value, then it should update the variable for other tasks that are bound to it. This might be a thing now with 5.7's out variables though.
And 5.7 also looked like it added a long running context instance data or something like that. Something that is meant to be running for the lifetime of the state tree. Haven't been able to check that out yet as we're still on 5.6 (we're releasing soon)
Your second paragraph basically described a BB hehehe.
Yeah... Will see with 5.7. I hope I have time to research once we make the jump
Oh - I'm in favor of having a BB. I love 'em.
If I increase the agent's radius, the navmesh for narrow passages will not be generated, and I have such places. And another problem is that since I have cars, they sometimes drive outside the boundaries and then cannot find their way back.
Duroxx and BB ticking a tree... K I I s s I n g!
Check a thing: show the nav while running the game and observe if it's all green or it has patches in red. red means the nav is reconstructing. I once have an issue because a moving platform was set to affect navigation and was forcing rebuild of nav constantly
I checked, the navmesh is not regenerating, I even turned off the auto-generation of the navmesh
What command are you using for insights?
keyboard "P"
No I mean for the performance measures using Unreal Insights in your images
I didn't use any commands just recorded by default
Record with -statnamedevents -trace=cpu
Does anyone know if theres a way to have my ai when a particular level their on is unloaded still conform to navigation but obvs they wouldnt be rendered if that makes sense
Are you meaning in a way that's like you're simulating their behaviour when simplifying them down to save on performance etc?
Is this true of StateTrees? I tested it and it seems to be, but there's no guidance in the docs:
1️⃣ Task execution order in Blueprint StateTrees
In C++, tasks in a state execute in the order they’re listed.
In Blueprints, the runtime doesn’t guarantee strict sequential execution for tasks in the same state:
Multiple tasks may start at the same frame.
Looping tasks or async tasks may preempt others.
Tasks without explicit dependency wires or execution pins may run “in parallel” in terms of scheduling.
Result: the first node in the editor isn’t necessarily the first node executed.
Kinds yeah. The best approach is to have a rule of thimb like this:
- tasks run in parallel
- no way to know which one will finish first
it has a lot of implications for tasks which don't finish as well, I'm having to break up my states into really fine-grained pieces of rice
Depending which version you're on, you can use the delegate dispatchers and listeners from 5.6 onwards to make a framework for more manual task control.
where are those?
About 18mins into this video https://youtu.be/bvWHU5nvU-0
A Quick Look at the New Features and Updates for State Trees in Unreal Engine 5.6.
From Custom Tick and State Control Flow, to the New Delegate Dispatchers and Listeners now available, and more...
NEW Gameplay Camera System In Unreal 5.5: https://youtu.be/oT9uSfET3nU?si=_XtqtDWPh0BiPZIA
Unreal Engine Beginner Videos To Watch Next: https://you...
Then you put a boolean gate that starts your "true" StartTask flow. So you can manually manage the execution of one task into another
So id ve wanting a way to allow them to continue navigating around
Even when the stream level isn loaded, cause theyd be on persisrent level you see so
Dont think you could do this if you're using nav, if you want to "finish" their path you could maybe generate a spline path of their current goal. But can't see how you could otherwise unless you like read a baked navmesh somehow.
It sounds like you could do what ubisoft? I think did for watchdogs and create alibis, as the level streams back in just think about where they should be but it's at best an estimation
Exactly. Unless your state is not set to "wait for all the task to finish", the first one finishing will trigger the transition logic and, if successful, the tree will jump to other state and the rest of the task will be not finished
well. sort of, I noticed that they can actually finish on the next tick, which is interesting
that update exposure time doesn't have anything asynchronous in it
That... I'm not sure. There's a weird ticking logic in transitions that check tasks again iirc
Not sure I understand what the picture means
oh, that's a screenshot of the timeline debugger
it's the order that everything is running in on my statetree, you wont know what it all means but the red arrow shows how the state completed because a task completed and then it ticks the whole state tree and that task which doesnt even have an ontick event finishes. I'm still getting my head around the ticking as well, it seems necessary at the least because tasks can do transitions inside them as well and raise events, so it needs to iterate through the tree again to see if the event is handled anywhere, etc.
that debugger alone is the reason I'm sticking with all this, it's awesome
Oh there is an issue I had at times where I'd have to delay until next tick before firing off a delegate since if it fired on the same initial tick that the bind occurs, the bind would miss
Funny you mention this because I kinda hate it a bit. It's always confusing to read for me.
Are the two task shown there siblings within the root state?
Because if that's the case, that would explain it. The root node always tick and you are technically in the same frame when the task finishes and the transition ticks the tree to evaluate what to do
I think.
so out of interest the AI Perception Sense Angle width
is it not the same to a cone angle for instance ?
yes, scoping the variables is what is unique to ST.. you can still make them all tree-level if you want 🙂 but binding outside of the tree still is a bit iffy.
We are actually working on more improvement for property binding and want to make it both easier and intuitiy to use. The pushing of value updates you mentioned on is partially there in 5.7 (for updates in ticks) and rest coming hopefully in 5.8.
Behind the scenes property binding works in ways that are just not transparent or intuitive to the users, and I really want to improve that. The word "binding" implies referencing, instead of the value copying that is happening behind the scenes.
Stay tuned! 🙂
essentially I'm trying to debug my AI Perception which is on one of my actor but issue is the debug cone I'm drawing doesn't seem to match up with the AI Perception angle wifth
The thing I dont like about BB is the unstructured nature of it, you cannot express dependencies and so you can have issues when trying to read a value before its set or even never being set.
But I at least want to offer people the opportinity to set something similar up in State Tree if they prefer that pattern 🙂
you drawing it yourself, or using gameplay debugger or vislogger?
could be something as simple as angle being expressed as angle from center instead of the whole cone or vice versa
I think it's cause one expects something different to the other
does it look rougly half the size it should be, or twice as large?
could also be radians vs degrees, but I doubt that.. usually designer-exposed values are always in degrees
so in terms of when it detecting the player looks like the Perception detection widgth is more then 45 which is what the draw debug cone angle is being drawn at
Did you look up the code for the component? That can probably explain what is going on
does AI Perception component not draw debug if the actor has not controller ??
@chilly nebula can you imagine a task control flow where we have that natural do 1 before the other, or they're event-driven with payloads or such. Or likely sticking to either make more states or make a custom local solution?
speaking to how people sometimes come in expected 1-2-3-4 in task flow but they always hit in parallel* initially
oh yes, talked about this quite a bit internally 🙂 we want to enable these patterns, but they shouldnt become a replacement for structuring your states correctly. However I feel the current setup does sometimes force you to add substates just to get around limitations (that we are fixing now)
I think pretty soon you will be able to setup a task hierarchy to activate and send events (task delegates) through. They will still technically all start in parallel, but can respond to async delegates to trigger more work.
The proper solution for this will be in Verse, which has really nice concurrency expressions for flows like that
Oh that'd be shweeeet. I've wrapped some delegates into a base task with some bools to hide them and it's pretty clean but wanted to see if the engine would do something similar longterm
Aren't you using the Gameplay Debugger or Visual Logger to debug it?
Im happy to see this honestly 🙂 its exactly the kind of pattern we've discussed.
Not planning on shipping anything out of the box though, at least for now
@chilly nebula is that the final pattern you'd expect? I've been craving a way to dynamically add them from inside the task is the main thing
so gameplay debugger not sure what that is and visual logger don't think that'd work in this situation cause the actor with the AI Perception component on it doesn't have a controller cause it's essentially just a security camera etc
oh this looks just lovely ❤️ and yeah we have considered adding built-in things like a completed dispatcher.. still TBD
the AI Perception Component does work however as in it'll sense player and stuff
Im going to show this to the team ❤️
yeh you hit that problem of you dont always want them but often do
need to be optional yeah, with no cost when not used
If they wanna BP expose FCompactStateTree for silly BP users to make EUW crimes 😆
Managed to get alot of the state info to this EUW and it lets me use emojis
I am sorry for the crime of rebuilding the debugger, but emojis and nested trees
btw those of you who care about state machines a lot (including @slow bobcat , even though he loves his BTs).. have you looked at https://stately.ai/ ? Im curious about your opinion...
Build and deploy workflows and app logic with Stately’s AI enhanced, collaborative tools.
as in this kind of visualization? are there any good examples?
I mean... I love both, it's just designers here love bt's. I'm sure I will change boats once I get a good combat designer showing me good stuff with ST's. I also need to catch up A LOT with 5.6 and 5.7. Will look into that link and let you know what I think
I am doing some research into future UX 🙂 I know current ST UX has limiations and not so friendly for many people
You can get a live demo (https://stately.ai/editor?source=landing-page) and it comes with a prebuilt simple state machine
I also think they need a push outside the sequence/selector mentality
The issue with these I think as a complete BP salesman is that non-indie users will suffer real quickly in terms of the chaotic spaghetti of AnimBPs and BPs that occur atm
I'll grab that live demo though and poke around
I would love to hear more about that, and what you would expect
ST although can be tough is so nicely structured and 'forces' a layer of structure while still flexible to decide how your setup works, do you seperate into nested trees, mega trees ,etc
One aspect ST and most hierarchical/nested state machines fail in the UX is properly communicating that parent states are also active, people often think only the leaf state is
True that was an initial overcome thing, but I specifically remember I used debug strings instead of the debugger, I feel like if the debugger was the first thing you used no matter what you'd see it clearly
But the ol why is completed firing over and over is one of the common questions I hit atm
Akin to the parallel tasks. Those elements definitely come across as surprises to the natural expectations (this is going in without docos though)
yes, people coming from BT are more used to sequential execution
btw @drifting ginkgo have you had a chance to try the new ST debugger in 5.7?
Yeh gave it a go but correct me if I'm wrong there's a 2 tree limit in terms of linkedAsset depth?
The custom debugger is also just a good exercise I find for understanding the underlying data of things
really? hmm, I wasnt aware of that
wouldnt surprise me though, linked asset bugs keep popping up 🙂
I have a fixed linked tree, then a GameplayTag override that sits one tree below that and is overriden from a SmartObject interaction
maybe the overrides are being missed
So it could be adding some jank to it, to visualize it I gather the LinkedTree Overrides and then place them in the null LinkedAsset of my BP exposed FCompactStateTreeState-duplicate
Given they're not valid in the expected LinkedAsset that could explain why the debugger wouldn't visualize
what version is that on? there was a bug with overrides in 5.6
I guess 5.7 since you mentioned the new debugger
hm
Sorry, confusing message. What I mean "our designers need a little push to move them from their area if comfort with Sequences and Selectors to get them into State trees"
100% agree on that, seen the same myself
Just got a repo so seems like 5.7 it interestingly displays in the wordy debug, which is really good but as a user I see lots of words and immediately shy away from. See on the right it says Take Item, which is the 'dynamic' tree
it connected these nicely, but the runtime one although displayed in words didn't get displayed in the left part of the image of the debugger
Nice! Loveing the custom icons on the states 🙂
...yes I made custom icons.... those aren't emojis manually added in the titles XD
Since the timeline kills emojis cause font restrictions is alot of why I moved away from it, but I'm a big outlier here. Although Icons would be a sick image slot if that could be added
yeah, its something we can look into.. but showing complete "merged trees" can probably get a bit messy.. something we need to look into. We have licensees doing very complex and deep linking at runtime
Looks like you are working on some kind of simulation game, love it 🙂 worked on some myself in the past.
These appear to be collapsible but yeh can imagine getting the right tunings are tough
ah this was more a learning demo for StateTree tbh something different from the day job. Building a full NPC routine can show what I imagine a full pipeline should be
When you realize epic's already built the thing you need after spending hours building it XD
If anyone's getting owned by odd ST behaviour watch out for the ScheduledTickPolicy.
The automated sleep was causing my debugger to not update at an effective rate.
hi, I was trying to work out how the enemy is supposed to toggle between attack and evade in this tree? there appears to be no logic to enforce this. From my understanding it'd always default to attacking?
this is from the Alzoheiry Smart AI tutorials if you recognise it
That evade/attack selector seems like the place although not 100% on BTs.
I'm abit rusty but think selector means there's something going on there in comparison to the parallels you see?
that would be the condition for entering that tree at all
"Assuming you can see the target" then the two choices
Can you show the far left of the attack tree
sure
i'm going to backtrack and see how he set that section up.. i have a feeling he broke the code
Yeh this looks a bit strange from the words alone the context doesn't make alot of sense for an attack to be involving a teleport
Teleport to POI - ranged attack - teleport to POI is a bit peculiar a flow
oh that bit is to teleport behind the player, shoot, then teleport away again..
interestingly the evade/attack are knocked into one early on, only seperated later.. i'm unravelling it
Hi, I have a question. I’m creating a HoMM-like game and I want to implement AI. I’m wondering whether to use the built-in AI system in UE or create my own, since I’ve already implemented my own Pawn/Path Finding etc. I can use C++.
If it's just you that will be working on AI then go with whatever you feel most comfortable with. The advantage of building your own AI system is that you can tailor it to solve your specific problems. Unreal's systems are designed to be general solutions that can be used to create AI for a wide variety of games. There is a lot of structure and overhead that comes with a generic tech.
If you're working with a team then you need to factor in that Unreal's tech includes a lot of built-in tools for editing and debugging AI. These become much more important if there is more than one person working on the AI or if they are non-technical.
Also, for an HoMM-like game I'd probably think about using a utility system for the core action decision making. Unreal does provide some utility system functionality as part of its state trees, but I'd be more inclined to create my own if that was the core tech of my AI. The toughest part about utility systems is tuning the scores, and I think you can do a lot better with tooling using either your own system or a specialized plugin.
has anyone ever seen this with state trees? I have a global task that adds a component to the bound Actor. If I leave that task running forever then the tree executes, but if after adding the component I call Finish Task then this happens. The tree never executes into Root. But the task has completed. Why is that?
If you're curious this is the task blueprint.
I mean the fix is easy - just never finish the task. But it's just weird that it's inconsistent with the rest of the statetree
what if I moved it back to root? would it re-run without a Finish Task call whenever the root is activated?
I have no way to know the answer to all these things without extensive trial and error or hassling everyone on here who somehow already knows
it makes working my way around a potential bug nearly impossible, because I don't understand all the shifting pieces to narrow the bug down. the bug I'm seeing is that I can't transition to a sibling node in certain situations (which have nothing to do with conditions)
minimum reproducible case
A refuses to select B
according to the docs this should work.
are any of you guys using tasks on Root? so far I'm yet to see a screenshot of anyone who is, and this definitely affects transitions
I use tasks on Root fine.
And it transitions fine without the root task?
What is the transition condition?
What does the root task look like?
do your root tasks ever call Finish Task? do you have any that run on tick? I 100% can't get it to work with an OnTick one
it updates a variable every tick
No to both.
I honestly think this is either a bug or design flaw. the alternative is to move my root tasks to global tasks, but they work differently. I can't determine the order of those using delegates
and one depends on the other running first
There isn't a guaranteed order when multiple tasks are on the same state either
right, but using event delegates can make that work. I could just roll my own shit solution to that. but that sucks
doing action A then B is such a primitive thing that needs to be supported everywhere
it's not supported when a parent task runs on tick
from my trial and error testing for over 2 days
thing is broken man
Again - what is your end goal?
I'm building enemy AI
I assumed
it follows waypoints, guards, reacts to its senses, etc.
but I can't get it to go from one state to the next
because my tasks keep getting in the way
it has to do a whole bunch of things on tick
Why?
because of its behavior, for example one thing it does it increment or decrement an awareness float based on a whole variety of conditions each tick
and that's used to make decisions around the statetree
but the reality is that if I am changing that float, it breaks parts of the tree unexpectedly
What version are you on?
5.6
if you want to see even more quantum physics, A is not transitioning to B. and there's NO root tasks now
only one task that delays 2 seconds then completes
Works fine for me
what build are you on
5.6.0
can you try moving your task to global tasks intead of on root?
does your task actually do any logic in the blueprint?
Yeah - it just prints string
k let me try that
Yeah - works fine as a global task as well
still doesn't work for me
it's the only task on global and it looks like this
I'm running out of things to strip out. let me delete my evaluators
I don't use evaluators at all.
They should be removed imo
Global tasks pretty much replaced them.
Probably some edge thing that evaluators do that GTs don't. Idk.
with evaluators removed
I'll change the MoveTo to a print string I guess
THAT worked. WHYYY
this tree is so unstable it can't even handle a moveto
so is it possible the moveto is failing immediately in like OnEnter or something
it would be nice if it logged something in verbose logs
Perhaps the place it is meant to move to is invalid
I'm worrying about using this for anything more complex than 3 states. how am I meant to know that
maybe I can create an error state and transition there on failed from any state
but even that isn't reliable because of how branch selection works
maybe 100% use my own tasks
I mean, the log sucks but it does show that Error happened
I have a few STs with far more than 3 states. Haven't ran into any quirks.
how do you handle errors?
so case by case
Yeah - pretty much like any error to be honest.
thanks for your help man. I was going nuts, you caused me to strip this back to 1 task
In your case - I would investigate why the move to has an invalid destination
I'd look into the version you're on as well, maybe search this discord channel I think there was some known issues with MoveTo in certain versions.
Making your own MoveTo task is likely a 'safer' starting point and not too tough
the biggest things I learned from this was that I can't rely on a node being entered if it immediately wants to fail
that scenario isn't listed in the debugger at all
it's just "failed to transition, return to root"
There's this portion that lets up to '5' transitions happen in 1-tick, so lets say your logic is pretty empty, it can actually parse through 5 transitions in 1 tick frame
I'm struggling with 1
but good to know
Also I find it's best to use succeeded/failed instead of completed. Because Completed often fires all the way up the chain
failed doesn't fire up the chain?
I only use Completed when it doesn't matter if it passed or failed.
in my mind, it didn't matter if this passed or failed. I thought at least I will see it transition to the node. 2 days later I'm now realising, no I won't see that
The issue with completed is when you 'nest' like this, if I move into a different thing underneath GET INGOT for example. I believeee, every single state up that chain will fire Completed.
So you can move 'sideways' down your chain but you'll be firing the Completed events on those upper tiers
how do you even work with all this lmao
it's like.. constantly navigating endless rules and half of them aren't written down
Gimme a sec to stop editor crashing might be able to help a lil XD
I don't think I've experienced this myself. But I also don't have stuff like that either.
I just want it to work more like a finite state machine. but it seems now that it's an infinite state machine which is thrown into a 5 dimensional quantum entanglement
You can use it like one though?
so far, I haven't been able to. not when all nodes decide to complete at the same time. or all tasks are running across multiple states simultaneously
or a failure happens before a transition even happens
So don't model your state tree to do that?
I'm trying lol
The way to think of it is like a Behaviour Tree, it's constantly evaluating
but MoveTo was my first task and it's asynchornous!
It isn't
it is. it ticks
o.O yours don't tick? Unless they enter a state?
I can imagine if you expect a static tree where you drive the transitions manually the unexpected TrySelectChildrenInOrder will confuse people
you could safely never look at the debugger and not use ontick though. and you wouldnt know probably
It doesn't constantly evaluate unless you tell it to
Once you're in a state - you're in that state (well, family of states)
that didn't confuse me. until it didn't select children in order...
Show me an example of it not doing that
ok
If your task is succeeding you'll loop like this
or 'completing' / failing same thing I think
I think it happened with this error situation. what happened was that B went to C but failed to transition but I didn't know that because it wasn't logged. So it reset at root and then went to A. So I expected A then B then C but I got A then B then A
Compare to this in which the print task doesn't finish, it now sits in this state
So you have an issue with it defaulting to Root if it has no transitions?
regardless of what transitions ANYTHING has I had that issue for 3 days
because.. I wasn't handling error transitions separately.
I usually code something and then go back through and handle the error conditions. but with statetrees I now understand that's not generally an option
Yes - your invalid move data should've been logged. And it probably was somewhere (I forget where it would be to be honest.)
It probably went Root -> A -> B -> Root because Move To failed and you weren't handling failures.
it honestly isn't. I spent a while with the VeryVerbose text logs
yes. eventually I saw this in the debugger/logs and understood it. but its not breadcrumbed like that. it says "transition failed" in the next tick and doesn't tell you which transition. you can deduce it, but worse is that it doesn't tell you which selector failed. it doesn't log selector attempts even in veryverbose. I hope this will be improved.
Pretty sure it is the visual debugger that logs move to stuff. Because it goes through the pathing.
It uses the same AI Move To task that the BT used. So yeah, it definitely gets logged.
how do I use this "visual log"?
It's really powerful
And there are some additional UE_VLOG logs in the state tree task itself.
I'm not seeing it there
sorry wrong screenshot, this is at the transition fail
ok fine. there's something there. a warning
that is not easy to correlate
is that even it? lol
It shouldn't be. That looks like its at the very end?
So when you called endplay pretty much
But if the navmesh is borked, that could be an issue as well.
I think it's the way I'm evaluating the variables
this bring up another question - what happens if I bind to a variable on an evaluator that I've just set on the currently active state task? is it ready in time to enter the next state (with MoveTo that might fail if it's not ready - in the screenshot)
because this fails and I'm suspecting that
how can I debug that?
I think I'll go with Arc's suggestion of wrapping MoveTo in my own task
there. get properly logged!
well turns out that's not running, it crashes and goes back to root before getting to my now custom MoveTo task
still this same old error
@drifting ginkgo how hard is it edit the engine source to add better logging around that error?
I'm thinking every time something runs RequestedTransition.IsValid() and it's going to fail, I could verbose log the reason
Couldn't tell ya, editing StateTree I'm not finding too bad but I'm more skimming the water than really rewriting anything
I guess it's a plugin, so I only need to rebuild the plugin?
Yeh the rebuilds with my debug stuff anyway is like 2 mins tops atm.
The plugin source doesn't contain an unreal Module. What did you use to build it?
right 😄 that's what I was trying to avoid by just building the plugin independently 😄
how do epic get away with this in the hide-and-seek example? there is no guarantee that the first task would set that variable before MoveTo runs. in fact it probably wouldn't.
as @harsh storm mentioned, global tasks shouldnt finish. But there is also a boolean on tasks you can set to not letting it trigger state complete when they finish.
oh really, do you know where that is in 5.6?
In this case it does, since the Get Random Location task is synchronous. Problems start to arise when dealing with async tasks that try to update their Output parameters with other tasks bound to them.
In 5.6, you need to trigger a transition on async task finishing and then read the result in a child state.
In 5.7 you can use async tasks that update values within a tick
Right now we are fixing the last remaining issue, which are async tasks using external callbacks, for example EQS or navigation systems.
Without these fixes, if you have a task in the SAME state it wont get the updated value when an async task finishes running.
yes, one sec I'll see if I can find you the name.. its on the base task
what determines if a task is synchronous or async? is that a distinction that can be made in blueprint tasks?
it sounds like I should upgrade to 5.7
If you do the task work in the OnEnter and write to an output parameter there.
If you need to update the value of the output parameter in a tick or via a callback from an external component, then its an async operation.
Behind the scenes, this is because of how property binding functions.. all tasks that have bindings to other parameterse (tree, state or other tasks) copy their values when they start. The issues is them copying that value once, and not being aware when the value gets updated.
what if I do work OnEnter but never complete the task? is that still synchronous?
/** * True if the task is considered for completion. * False if the task runs in the background without affecting the state completion. */ UPROPERTY(EditDefaultsOnly, Category = "Default") uint8 bConsideredForCompletion : 1;
set that to 0 and the task wont trigger state complete when it calls finish
no thats fine
As a general comment, we know that not everything with State Tree is intuitive (ie works as you'd expect it to). We are working to fix a lot of that 🙂
so no output parameter = async?
Should you lean towards using the sub-state flow you mentioned or event driven for the most part and tick is just hoping it works?
Hoping just being it's an 'unreliable' flow?
no, not sure how you got to that conclusion.
As I explained above, if you need to update an output parameter outside of EnterState, you will run into the issue you are having with MoveTo
The sub-state flow is the current recommendation yes, and what works in all cases atm.
If you want to get really advanced, you can do some tricks with PropertyRefs and ticks 🙂
The main issue I'm having is that I can't tell why this transition is failing and reverting to root. I'm having to build unreal source now to debug it because I've gone through every criteria that unreal assistance suggests I check and also checked the verbose logs but there is no info about what transition is failing or why
so is that what you are referring to with the moveto issue? because I've spread it across two states instead of 2 tasks on one state here. I thought moveto was the issue but it ended up to only be the issue on my cut down minimal tree. now that I've gone back to my original tree I don't see what the issue is
even if I add a dummy sibling node which only prints a string it still won't transition to that node
@chilly nebula the weird thing is I can see all the activated tasks and states have finished, so the reason must be because the sibling state is blocking selection somehow, or its parent state. but there are no conditions on any of them
so is this some kind of 5.6 issue which might be fixed already in 5.7?
sorry I dont have time to debug specific cases. But a standard pattern is to run something like EQS on one state, then a transition waits for the result and moves to sibling state where the MoveTo is.
Based on your previous screenshots, its sounds like your task is failing because of an issue with the navmesh?
The only thing fixed in 5.7 relevant for this is tasks using Tick to update values of output parameters
okay. I'll debug it, that's okay. thanks. yeah I thought it was nav mesh but a placeholder sibling state won't get selected either
I would start by validating that the position your task is sending to the moveto is in a location where the navmesh exists
I did that by wrapping MoveTo and then I realised it wasn't even executing the task at all - so the issue comes at the selection stage not at the task stage
actually this does fit your EQS example possibly. because I'm not "waiting for a result and then transitioning" but I'm just using an "on completion" transition which is waiting for my task to complete - is it possible that the limitation also includes that as well?
In your screenshot it says it failed to trigger the transition, but you cut off the details why. Scroll down the tree and see whats there
Depends on what your first state does, how it picks a location to feed into the MoveTo
the rest just shows the execution from root again and it loop forever like that
yeah from an "external callback" I would describe
if its a custom task, then you need to expose a task delegate (new concept in 5.6) and trigger that in your callback function. Then your transition listens to that task delegate and transitions when it comes back.
Im pretty sure your state is trying to execute the transition before the results arrive, and that also explains why the MoveTo fails
yeah okay. that's why I was asking super specific questions about async or not. I also thought delegates could solve this
but should they have to 😄 thats a whole other question
they do up to a point 🙂 but they dont fix the property binding value issue
sure, all of this fits under "things that should be easier to do in State Tree" 🙂
there's a bit of a learning curve, but State Tree is being used in some very large and complex cases in huge AAA games being developed now
can you imagine the default tunings being more like Try Enter? Where there's less automatic movement through the states, or nah that's kinda core to ST
the learning curve is real, but the more that I learn it, the more excited I am. anyway I am going to go and add VeryVerbose logging now to whenever Transition -> IsValid fails to log why it fails. that will be a huge helpful thing
with regards to the selectors? Yes, there are some things there I wish were easier to grasp 🙂
Yeh for the default settings it feels like if I had to manually cause the transitions for the first time experience, you'd learn how the flow rides as opposed to the waves already rolling ina more BT like way. Might go against it though 🤷♂️
I don't think I've fully grasped the power of full root -> leaf activation yet
like I'm yet to see a really great example of why that's so beneficial
I've just been treating it like you would services in BT.
So - I could have a setup kind of like this:
Root
- State A
- State A1
- State A2
- State A3
- State B
And State A would have some kind of task that needs to be running for all of the states in its children. Like a LookAt task or something.
Then I don't need to put that task on A1, A2, A3, etc...
yep! code re-use is more easily done in hierarchical/embedded state machines 🙂
I think that concept is often misunderstood for State Tree honestly, and we are looking into future ways to make that more explicit in the UX.
Just as an example, sometimes people expect to be able to select a specific statE (State A) in your case and make that run, and then optionally select A1, A2 or A3. They are missing the fact that A is more a common parent to them all rather than an individual state on its own.
ie the leaf states are the actual states, and parent states are more capturing whats common between them all
Ue5 BP.
I'm using get random reachable point in radius for my AI to path on a nav mesh. This mesh is called Nav2. The issue is it always returns false.
Greatly increasing the radius has it return true but it will only try to go to the first nav mesh on the map, Nav1. It cannot reach it as there is a wall in the way. How do i get this working on the current nav mesh?
Hi can someone tell me if the transitional rule On Event instantly finishes a State and goes to the specified state requested?
I have this Roam, and FindRandomLocation which is working as i need it to but then once i pass the state tree event it never moves into the Chase state because the FindRandomLocation never does Finish Task I guess to be able to move but then how do i finish the state please?
Obviously I have it set so it Succeeds the task when the AI has moved to the random spot and then re-run until the trigger event is fired then stop all tasks assocaited with Roam and go to Chase?? Im so stumped by some of this atm : (
The AI character does do the roaming and also goes to the chase state because he stops roaming until the player moves out of sight again, Just the state tree never actually highlights the chase state in yellow just Roam and FindRandomLocation stay highlighted. Thanks for any help !
so i got this state which On delegate will try to enter a child state
what i dont understand is WHY it tries to enter the "parent" state (Sword Ground Dash)
because this will obviously fail since i dont have the payload i had to enter it
I think something that would help towards this would be to make a native way to configure that example so that State A's tasks can run first, then one of A1 A2 A3. delegates would work, but they need to be added explicitly instead of checking a box, and are less visible because you have to hunt around for the matching pairs. enabling "don't mark state as complete when task completes" would not work (because of the active chain simultaneously running tasks).
Parent states are also active, the whole chain is. This is why its a hierarchical/nested state machine.
sadly its not that simple 🙂 when you transition from a substate A to substate B, then their common parent A persists and doesnt need to be cleared+re-initialized
which is fine. the tasks already completed, and A -> B can recognise that?
i would thought i could skip re-entering the parent state
I think most of the hierarchy already runs in a deterministic order, even how events are consumed, ticking order and prioritization of transitions.
also, do you plan on adding params to delegates ?
You dont really need to with the fixes we are working on. Exposing delegate + output parameter should do everything you need
because .... since its a delegate thats triggering the event i cannot send the payload again
so i cant go to a nested child
There are some options for controlling that already yes, might be currently behind a cvar I dont remember off the top of my head
this didnt suffice
ie control over whether the state should re-initialize or persist when moving between its child states
I think the boolean might be on transition, look there
look up EStateTreeStateSelectionRules
Also EStateTreeTransitionChangeTypeRules
i did that on the childs ... doing it on the parent worked
on type FCompactStateTransition
EStateTreeTransitionChangeTypeRules ChangeTypeTargetStateRule = EStateTreeTransitionChangeTypeRules::Default;
hey guys well good news I got my project migrated to 5.7.1 local build. I know it was successful because my statetree error is still there 😄 however this time I notice there is an "internal" transition to root which I didn't specify. I'm wondering how to interpret the highlighted line in the debugger
this is so interesting. I'm debugging it and it's not even considering a transition at all for the "Set Destination to Current Waypoint" leaf node. It starts at its parent and goes back to root, so it missed the critical transition to the next sibling that I've defined. that's why it's failing to trigger a completion transition
yeah I see why now. it's something that I didn't realise. one of the parents' states are completing which is invalidating the leaf node's task. even though the leaf node and its task are marked as completed after the leaf node is entered, it's actually a parent which is marking it as complete, not itself
it's even more nuanced than that. it's because the code checks from the root downwards to evaluate which tasks have completed and thus which states can complete first. it finds that the parent completed its tasks during the last tick, which completely ignores the child whos task also did, because it decides that the parent is the lowest depth who can transition out of this current status. so it starts at the parent who completed (in my case "Walking Waypoints") and walks back up the tree to root to find a transition.
@chilly nebula I didn't realise the specifics of this. I thought if tasks across an active branch completed within the same frame that the child-most state (whos tasks completed) is the most eligible to transition out. but that's actually not the case, the highest level state who's task completed is the lowest state that is eligable to transition. (where highest = root in my terminology)
so that actually changes this example very subtly. this example only transitions to the sibling when "ZG Claim SmartObject" completes AFTER the tasks on Reach. So it's more nuanced than "When the tasks complete", it has to be "when the tasks complete bottom-up" - which is actually counter-intuitive
dunno maybe this is obvious to some people but the text is literally not there to read into and gain that understanding, from my perspective anyway. and not knowing that blocked me for a few days because I just couldn't find what was wrong using the visual debugger, I had to step through C++ to find that. I was unlucky because in all the testing I did I never stumbled across it with trial and error
Can someone answer me a question please If i have 4 tasks within a state and 2 tasks fail and 2 succeeds has the entire state succeeded or failed? Im trying to understand the difference between OnCompleted (IE... All tasks are completed and have resulted in Fail or Succeed) but then how does on Succeeded work (Im guessing the State succeeds when a task succeeds? but in the case of 4 tasks would only the 1st succeed "succeed the state?" or do they all need to be succeeded? Any light is appreciated thanks! I forgot to add the Task section would be set to All not Any.
I'm not 100% certain but I think by default because they all run asynchronously it would be the first to succeed or fail would transition accordingly
but you can use bConsideredForCompletion to set a task to be a background task and not considered for state completion, I figured out the best way to do that one-off is to toggle the little clipboard icon on a task
@nova prawn sorry I just saw you updated your message to say that you are using All instead of Any tasks, so in that case I'd expect all 4 need to succeed for a succeeded transition (or completed if you don't have a succeeded transition). if any fails you will get fail transition (or completed transition if you don't have a failed transition)
Did 5.7 rework how considerations work in state trees? I'm having some odd issues now where my state tree task is being re-run over and over and it looks like the consideration is being hit but it doesn't even matter. I haven't changed my code.
you might be hitting a bug we are aware of, where if two transitions trigger at the same time their order can get messed up.
Overall I recommend not letting tasks on parent states complete unless you are using that for transitions.
this is correct
when using All, I belive its the first task to fail that will trigger a transition
if that is a bug then I maybe this loops needs to be reversed: https://github.com/EpicGames/UnrealEngine/blob/684b4c133ed87e8050d1fdaa287242f0fe2c1153/Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Private/StateTreeExecutionContext.cpp#L5824. but I see that it's duplicated from other parts of the file. I tested it by just commenting out the break; on 5834 and it seems to work from bottom-up how I would expect the transition rule to work
Hey, I'm requesting Stimuli Listener Update but it does not report anything back while still standing in front of the AI. How do I get what the AI is seeing on request?
Hi! Just a weird thing I wanted to share and maybe someone has explanation but it's not urgent. I have a spline assigned to my enemy. He moves along the spline but today the traversal just stopped working without me doing any changes to related blueprints. After about 7 hours, without restarting unreal he just started working again without me fixing anything, I was working whole day on lights and assets far away from the enemy or his patrol route.
Thanks !
hey guys, I have open world map with cliffs and sometimes the bots get to places where there is no navmesh, just off the cliff edge, how can this be ?
because then all the MoveTo tasks fail due to invalid start location
Heya, sorry if this is the wrong place, but has anyone set up AI NPCs doing traversal with GASP? I'm looking at using AIMoveTo to get the enemy to follow me, but I'd also want them to be able to use the traversal system from GASP. Right now, all I get is the AI to go around obstacles instead of across / over them.
If you think this needs moved to a different section, I'll do it
A secondary question would be: Would this be better used with the Mover plugin in 5.7? Since in a tech animation capacity, it seems that Epic is moving into making that more robust over time (my project is still early on, so there is chance the Mover will become more powerful over time)
slow mods
<@&213101288538374145>
This sounds interesting yet to try myself but given alot of ai movement cost can come from the character movement component depending on your density you likely want to utilize mover. Depends on if you have release dates limits etc though as I'm not sure movers left experimental yet
Havent checked the 5.7 gasp demo yet but is it utilizing UAF yet? They mention it's targetwd for 5.8 for sure, that'd be another big upside
I do not currently have a release date. Very early on in the prototype phase atm. Which is why I can deal with it, since engine upgrades don't affect me as much right now.
I'm not sure what you mean by UAF, though. I'm just currently learning AI scripting, so there's a slot I don't know
I'm trying to use query params with my EQS query in combination with Smart Objects, but it just isn't working
This has been exposed on a RunEQS node
But the exact same EQS Query Template, on a Find and Use Smart Object Node, isn't exposed
I think the only way to do that out of the box would be with nav links, just puts tons of them all around the obstacles. you would have to take over with a custom controller for things like wall climbing though I imagine.
I was a tutorial from someone who used looped timers to call the movement+ traversal action for following the player. I imagine that would be costly as well as add more complexity when you use it in a complex state tree, wouldn't it?
Can someone make sense for me as to why I need "Detect friendlies" enabled for my AI to hear me but sight only needs Neutral+Enemies?
took me forever to figure out this was the issue and made me quite angry, irrationally so
Because detection in UE has been broken since 4.25. Affiliation based detection needs C++, so just check them all and figure out how to blueprint detection flags or learn C++ seem to be your two options. It’d be nice if Epic corrected this, but they’re too busy with other things most likely.
Thanks for letting me know
No problem!
Finally! If you're struggling to capture the transitions that occur in 1 tick, which is up to 5 Max Iterations by default. You can plug into epics GetRecordedTransitions you have to override the UStateTreeComponent and manually duplicate most of the tick behaviour to your child class (or engine mod the default one).
But then you can enable EStateTreeRecordTransitions::YES in the Context build, giving you a nice lil cache to grab those transitions.
FStateTreeExecutionContext Context(*GetOwner(), *StateTreeRef.GetStateTree(), InstanceData, FOnCollectStateTreeExternalData(), EStateTreeRecordTransitions::Yes);
Then you just dig down and grab
Context.GetRecordedTransitions()[i].States[y].StateTree->GetStateFromHandle(insert your FStateTreeHandle);