#gameplay-ai

1 messages · Page 77 of 1

royal mist
#

teal = utility selection state, blue = task state (mostly contains tasks), yellow = action state (mostly contains child states)

#

ooooo that sounds so cool

misty wharf
#

I think Siggi mentioned something about being able to inject subtrees maybe that's something that could be used?

royal mist
#

yeah eh

#

that does sound like its in the territory

misty wharf
#

I have a complicated BT-based system on some of my NPC's, where the NPC's have a set of tasks and each task has an associated BT... The NPC runs a "top level" BT and if it goes into the "do tasks" part of the BT, it uses the task-specific child tree

royal mist
#

sort of like a utility selection thing hey?

#

or how does the task get selected :O?

misty wharf
#

The tasks are always ran through but it could be selected via utility score also

royal mist
#

nice

misty wharf
#

(It generates them when the NPC spawns)

royal mist
#

oooooo

#

Im just cracking into state trees

#

but ive been a fan of utility ai system for some time

misty wharf
#

I also have a newer ST based system which does something similar, but based on a shared task queue where the NPC picks tasks to execute from :)

royal mist
#

thats cool

deft palm
#

Blackboard for state tree? Could you be more specific?

misty wharf
royal mist
#

interesting

royal mist
#

that seems cleaner than storing random vars on the character BP

misty wharf
#

Yeah it depends on what you're doing but it could be an option

royal mist
#

I have a bit of data on my character bp that would be nice to modularize

#

or whatever

misty wharf
#

You could in theory also use a custom state tree context to hold values, but it's a bit more involved

royal mist
#

hm yeah hey

deft palm
royal mist
#

state trees are cool tho, I like the hybrid design

#

its like best of both worlds

#

utility state selection, and rule based

#

I was trying to mash something up between STRIPS/GOAP and utility ai

#

and i think state trees are similar to what I was trying to do with that

#

maybe not exact but ye

final prism
#

Does anyone know how the navmodifiers work internally? I'm trying to figure out which part of the navmesh generation they slot in to, but I've only been able to make guesses. Like if I mark something as a null area, it properly erodes the polygons, but it never seems to call the erode part of the navmesh generation? Or where does it re-triangulate the polygons when a modifier is added?

slow bobcat
#

You can do a quick test to track all that down:

  • in the level blueprint listen to some key input and spawn a nav modifier (you can just spawn an empty bp with a nav modifier component)
  • set a breakpoint in FRecastTileGenerator::GenerateTile
  • spawn the actor
harsh storm
#

When are you going to write a dang blog post Bruno? We need this stuff recorded.

slow bobcat
elfin smelt
#

NavigationWizards.mp3

harsh storm
slow bobcat
#

XD

#

At some point I will post all this in a blog and share my neat flow graphs about nav generation

#

such an easy system to map
(irony off)

harsh storm
#

See, that's why it takes you months. You put effort into graphs.

slow bobcat
#

that thing is my insurance. I can't rely on my memory

final prism
slow bobcat
final prism
#

Then again maybe UE is trying to bamboozle me I'll try running it with performance off..

slow bobcat
#

check setting a breakpoint in FRecastNavMeshGenerator::EnsureBuildCompletion

#

ah ok sorry I got things mixed up.
Set a breakpoint in ARecastNavMesh::OnNavMeshTilesUpdated and that will trigger. You can follow from there

#

you will end up in FNavigationDirtyAreasController::Tick

#

and this is the stack that happens before it due to pending octree updates (that's when the bounds of your modifier are added to the octree)

[Inlined] FNavigationDirtyAreasController::AddArea(const UE::Math::TBox<…> &, ENavigationDirtyFlag, const TFunction<…> &, const FNavigationDirtyElement *, const FName &) NavigationDirtyAreasController.cpp:135
FNavigationDataHandler::AddElementToNavOctree(const FNavigationDirtyElement &) NavigationDataHandler.cpp:237
FNavigationDataHandler::ProcessPendingOctreeUpdates() NavigationDataHandler.cpp:648
UNavigationSystemV1::Tick(float) NavigationSystem.cpp:16167```
misty wharf
#

Nice charts :D

#

And yeah it's pretty complicated. I managed to figure out how to create a custom navmesh

#

Basically in my game I needed to determine whether player placed objects are reachable by NPC's based on certain rules... I ended up doing a navigation query starting from a certain point and ending at the object. If it was possible to navigate, then it was reachable.

#

But this needed certain custom rules like what objects should be ignored for this query, which was separate from how they should impact actual navigation, so I needed to generate a custom navmesh for it :P

final prism
slow bobcat
final prism
# slow bobcat That I'm not sure. Never looked into it

ahhhh I see what's going on, I think I may yet be correct! When it generates the tile after a nav modifier moved it sets "regenerate compressed layers" to false, so it doesn't do the whole navmesh process, it just generates the navigation data

#

My theory is that navmodifiers don't do any erosion, they just expand the convex hull by the radius of the agent

slow bobcat
#

That you know more than I do. I have no idea about the low level generation aside some stuff in the detour library. It's a pending topic for me

mighty hornet
#

This was the bulk of my overhead. It's a spline relative position call that I run once per frame for every pawn. And was calling it again whenever needed in my tasks. Now I am just grabbing the cached value off the pawn and cut my frame time down to ~200-300us for each AI...or about 90%. Huge. I still want to optimize further though.

Curious how much efficiency could be gained by moving everything to c++. Any insight?

misty wharf
#

In my experience there can be quite significant savings from converting BP ST or BT nodes into C++ if they are being called often enough

slow bobcat
#

There are some videos about the topic

#

That last one is off because that's in editor, which you should never use to measure performance. Bp's in Package builds are much faster

serene fern
#

So having an issue which is when the player actor is moved elsewhere in the world the AI seems to on them moving still think they can see them when they cant any ideas what might be happening ?

slow bobcat
serene fern
#

I found the issue I was having race condition

#

when I was trying to clear the sense target it seems in the same frame it was also setting it

#

adding a delay though for like 0.0 forces the clear of the sensed target to be nulled so all good

misty wharf
#

It probably isn't giving a good comparative time, but at least so far it does seem to tell me if my code is taking longer than it should even if it does have some editor overhead :D

serene fern
#

is there a way where I can force the Nav mesh to be a bit more into the centre away from the sides ??

#

at the moment AI is taking the path literally hugging the wall

#

only thing I need to keep in mind is theres doors that well it needs to get through so I can't really quash it down and is there a way to do it where if they are chasing the player they kind of ignore the edge being off limits is a way

slow bobcat
slow bobcat
serene fern
#

and then can I have it ignore them when chasing the player ?

#

bassically so the player can't hunker down near edge of the wall and it not be able to get them

simple moon
#

anyone have and tips/ a video recommendation to make my ai move? now it just stays at the same place and wiggels 😛 the world is procedural generated like minecraft, so it wont stop expanding aslong as you run 😛

#

is there a way to add navmeshbounds to the player controller? or something?:P

mighty hornet
serene fern
#

arrr

slow bobcat
# serene fern arrr

You could could try different approaches. You could have another nav aganet defined with a bigger radius. Use that to patrol/move and the green one you already have to attack/chase the player

serene fern
#

the other option is I make a system that has it follow points in the world and them points are places say in centre of cross parts

serene fern
slow bobcat
serene fern
#

my project is cpp so I don't mind doing that just be a cpp task I'd have to make

slow bobcat
#

Another option is to post-process the path to move it away from corners. Unreal has some functions for it. Also in c++

serene fern
#

hmm i might try the first one initially and see how I go

#

if that fails I'll attempt the second option you've mentioned

robust pumice
#

Hey everyone,
I'm currently working on simulating a realistic daily routine for NPCs in Unreal Engine (Blueprint only).
Each NPC has a Schedule array containing structs (NPC_ScheduleEntry) with fields:

Hour (Integer)

Activity (GameplayTag)

I get the current in-game time via Ultra Dynamic Sky → TimeOfDay, and store it as an integer CurrentHour (e.g. 900 = 9:00 AM).

What the logic is supposed to do:

Loop through the Schedule array (using ForEachLoop).

For each entry: check if Entry.Hour ≤ CurrentHour.

If true, save the entry as LastValidEntry.

After the loop, use LastValidEntry.Activity to set CurrentTask.

** The issue**

Even though CurrentHour = 900 and the only schedule entry has Hour = 900,
→ LastValidEntry ends up being None,
→ so CurrentTask is never set correctly.

I’ve confirmed that the schedule array has the correct entry and format. I suspect:

either the ForEachLoop condition isn’t working as intended,

or the assignment logic is firing incorrectly.

Maybe I should use ForEachLoopWithBreak instead?

Any ideas what might be causing this or how to fix it?

(Screenshot attached)

misty wharf
#

I'm gonna guess that that's probably the problem :)

chilly nebula
chilly nebula
# mighty hornet This was the bulk of my overhead. It's a spline relative position call that I r...

As already mentioned above, BP call overhead isnt very noticable except on code you call very frequently like on ticks. I recommend Ari's talk here that goes a bit into and measure the exact overhead.
https://www.youtube.com/watch?v=S2olUc9zcB8

Watch this recorded session from Unreal Fest Seattle 2024 that uncovers the truth behind Unreal Engine best practices.

Are Ticks really that problematic? Should you make all your meshes Nanite? Is the ChildActorComponent truly cursed? Should you never use Cast?

You've probably heard many of these so-called ""best practices”. Check out this...

▶ Play video
livid scroll
#

Why is this always stuck here in this condition?

#

always in a state of fleeing?

harsh storm
#

Did you remember to call Finish Task?

livid scroll
#

now it looks like this, what is this green arrow?

#

now its stuck between 2nd & 3rd

harsh storm
#

Time to bust out the visual logger

livid scroll
#

look at this, a friend of mine told me to hook both the On Success & the On Fail to the Success (True)

#

I feel like this is wrong

#

but my friend is really much more advanced so I thought this is a good practice

harsh storm
#

I mean, I wouldn't say the task succeeded if the moving portion failed - but that's just me.

#

(And probably a whole host of other people 😛)

livid scroll
#

the person who told me this uses it in all his tasks

harsh storm
#

Don't mean it is right

#

When the task reports that it is a success, even though it actually isn't, it can screw up the actual logic of the BT

#

Sequence - execute each task left to right until the first one FAILS
Selector - execute each task left to right until the first one SUCCEEDS

#

So - by you saying that every result succeeds - you will always move to the next task in a sequence, even if you end up in an invalid state due to the move to failing.

#

(I probably worded it weirdly, but the point remains)

livid scroll
harsh storm
#

You'd need to use EQS then

#

Gives you more control on how to do the pathing

livid scroll
#

like for example

  1. give birth to other chickens
  2. eat
  3. sleep
    that's mostly it
livid scroll
#

and yes I think its a good idea

harsh storm
#

This video is still relevant today
https://www.youtube.com/watch?v=iY1jnFvHgbE

In this presentation, Epic's Paulo Souza uses Unreal Engine's built-in AI features to build smart enemy behaviors for a game with stealth-like mechanics.

By relying on the Gameplay Framework in Unreal, we're able to quickly create convincing AI using Behavior Trees. Behavior Trees are great for creating complex AI that can be presented in a way...

▶ Play video
#

Goes through the main AI tools

livid scroll
#

I saw this video btw

harsh storm
#

Watching and understanding are two different things

livid scroll
harsh storm
#

Then you should've been able to tell your friend that he was wrong in his advice.

livid scroll
#

I dont undertand it until i actually implement it

harsh storm
#

Understanding is the key. Read/watch 100 times if you have to.

#

Baby steps.

harsh storm
# livid scroll

Also for what it is worth - the far right sequence will never run.

livid scroll
#

I also have more problems than that 😂

#

my chicken doesnt look at realistic anyways even with the way it moves now

#

because of the animation blend space

#

and the model is just kinda OFF

#

I might need to first learn how to rig or something

#

but i've been on this for 1 year now

harsh storm
#

The chicken? Godspeed 🫡

livid scroll
#

My game is almost done in terms of everything else but the AIs

#

yes, and the bear 🐻 🐻‍❄️

#

which is the bad guy mostly

#

but I haven't set much logic into him, he just follows you around and gets in front of your face till you wanna break your monitor & keyboard with your head but thats pretty much it

livid scroll
livid scroll
#

somehow my brain is able to understand everything else & work with everything else just fine except for this AI programming related shit.

#

I hate AI programming the most out of anything in Unreal so far 😂 😭

harsh storm
#

Personally - I don't think STs are easier than BTs right now. But I may be in the minority on that. But I also don't think the tool is the problem.

livid scroll
harsh storm
#

Yeah, people like new & shiny things.

livid scroll
#

question about youtube videos, when following youtube videos that are not exactly always applicable like Ali Enzoheri's videos, there are over 20 videos in one of his playlists with 1 hour long videos each, he has his own assets, he often pulls his own little examples that have zero application to my problems, so there are so many videos made by him, not so much by other users, but besides that it's maybe even less than 5% of those things can be useful.

And most of the other videos on youtube made by popular UE youtbers are just the simple patrol - chase AI basic logic which they copied this from the official devs.UnrealEgine.com which is provided by UE documentation itself but they're not adding anything new unfortunately, most of the videos are kinda like this, and ytb is soooo limited in terms of AI programming😕

livid scroll
harsh storm
livid scroll
#

I guess no question, I guess thats it, just wondering how or why it is like that

#

seems like behavior trees have been around for so long too, almost as much as UE itself

#

kinda disapointing actually

#

thats it

#

🤔

harsh storm
#

BT has been around for at least a decade (at least in UE). As for why no one has done a good in-depth tutorial about it? Because the people who know how to use it are too busy working on games.

slow bobcat
livid scroll
#

Seems like digital era snake oils salesmen some of them videos

harsh storm
#

I watched a little of Ali's stuff because a lot of people praised it - but early on, he makes some mistakes that can easily cause problems. So I attribute his popularity more in his teaching style than content. He does do more than the average person who does a one-off video on AI though. I'll give him that. Like, he actually show off how he approaches doing ranged combat and stuff. As well as mixing everything together. So there is at least some exposure.

livid scroll
#

or maybe its mostly about the views & likes not really even capable of teaching you how to tie your own shoelaces or smth

harsh storm
#

As for all the other AI videos that just show you how to chase the player for the 82934298457259th time... 🤷

livid scroll
harsh storm
#

I've been wanting to do an actual in-depth video/series, just...no time for the level of quality that I want.

#

I even have my notes saved somewhere on my computer.

#

Plus - the general audience of YT doesn't want actual solutions, because they can be quite time consuming to implement AND explain. They want to solve their problem here and now.

slow bobcat
#

I already did an attempt I never updated, so it's probably not accurate anymore. That was for a "simple" thing and took forever to post. Can't imagine posting actual complicated stuff

gentle hamlet
#

I realized despite tutorials saving you time in the moment, it totally breaks apart when you want to do something on your own

slow bobcat
robust veldt
#

It is a bug from nav modifier which does not update nav mesh when actor is attached.

slow bobcat
robust veldt
slow bobcat
robust veldt
slow bobcat
robust veldt
slow bobcat
robust veldt
#

In USceneComponent::PropagateTransformUpdate method, TransformUpdated is broadcast before UpdateChildTransforms that make nav modifier get wrong location of child component.

slow bobcat
robust veldt
foggy sedge
#

hiya!
im new to ai, been following a bunch of tutorials. im trying to do a simple third person ai that just sees my player when they are detected by the sight perception. i am running into an issue where the the player is nto being detected if they are behind some geometry that goes roughly to their waist.
i tried raising eye height of ai but that didn't really fix anything. any ideas? is the sight perception line tracing to the bottom of the player collider?

misty wharf
foggy sedge
#

@misty wharf awesome thank you!

livid scroll
#

btw my chicken ai was kinda working before

#

but I decided to change it once again just so that I can kind of learn how different things work by playing around

#

I realized that I still have no clue how this fucking TargetActor is Set works

#

or what it means

#

its a boolean, I get that,but where is this logic at?

#

I haven't hooked up any logic to it

#

so how is my editor gonna favor this one in some cases if the chicken for example sees the player

#

& then I can also add a BTTask_flee

#

for example the blackboard right now never gets activated at all

#

I still dont really know how this works either

#

but it kind of gets the job done (almost) but I still need to learn how it works because Im gonna need to add more complicated stuff in the future

solid wedge
#

Difference between (default)AI Move To Vector vs Actor? Move to vector is convenient but updating a moving target made me switch to move to actors (empty actors existing simply for moving navigation goals). Any insights?

royal mist
#

Tho they can kind of be a pain to debug, even with the debug tools

harsh storm
# livid scroll its a boolean, I get that,but where is this logic at?

It is a decorator. Pretty much, you will go into that branch IF the BB Key TargetActor is set (so not null). Otherwise, you won't. The logic for setting the TargetActor - that is somewhere else in your code. Typically it is handled by AI Perception. But that isn't the only way.

deft palm
#

Hi Siggi: I implemented my StateTree Task like this

USTRUCT()
struct FStateTreeSetGlobalResourceAndDepositBaseTaskInstanceData
{
GENERATED_BODY()

UPROPERTY(EditAnywhere, Category = Context)
TObjectPtr<AActor> Actor = nullptr;

using ResourceNodeRef = TObjectPtr<AAResourceNode>;
UPROPERTY(EditAnywhere, Category = Parameter)
TStateTreePropertyRef<ResourceNodeRef> ResourceNode;

using DepositBaseRef = TObjectPtr<ABaseBuilding>;
UPROPERTY(EditAnywhere, Category = Parameter)
TStateTreePropertyRef<DepositBaseRef> DepositBase;

};

in the task's EnterState:

auto ResourceNodePtrRef = InstanceData.ResourceNode.GetMutablePtr(Context);
*ResourceNodePtrRef = ResourceComponent->GetCurrentResourceNode();

auto DepositBasePtrRef = InstanceData.DepositBase.GetMutablePtr(Context);
*DepositBasePtrRef = ResourceComponent->GetDepositBaseTarget();

I got a compilation error:

StateTreePropertyBindings.h(969,57): Error : no member named 'IsValid' in 'UE::StateTree::PropertyRefHelpers::Validator<TObjectPtr<ABaseBuilding>>'

#

My question is: how to set and get the global parameter of a object reference in the task?

#

Thanks a lot

misty wharf
#

Ugh I thought I was being smart implementing GameplayTaskOwner on a Behavior Tree task, so that the BT task could auto-cancel any gameplay tasks launched from it... but of course the interface's function aren't getting called 🤔

#

Man, this is kinda annoying. Looks like in theory it works - if you use NewBTAITask in C++

#

So I have kind of elaborate logic that I needed for my AI, and I put it into a singular BT task, instead of splitting it into multiple tasks... because it would've become kinda noisy in the tree, and making choices in the BT tree isn't very nice either, but I can just easily do it in regular BP logic in the BT node

#

But because of that I need to do more bookkeeping of any AI tasks that I'm running from the node which is kinda annoying :P

#

Would've been great if it would've been able to track those easily which feels like the whole point of the BT task being a gameplay task owner, but I guess not

slow bobcat
misty wharf
#

Possibly yeah

#

It's currently implemented in BP's so it's gonna be instanced anyway :)

chilly nebula
livid scroll
#

oh wait but I got this one right here

#

IIrc I followed a tutorial for this, kind of a weird setup

#

I thought there would be a decorator blueprint where those things would need to be set up

#

or a blackboard blueprint or something

#

So all of these things here will be connected exclusive to the AI controller?

#

does that mean I can also set up "services" tpye of functions or whatever in the AI controller and it will work as if im creating a service

#

and how will I know when those things will FIRE up?

#

I can make a million functions & corresponding blackboard keys and they will never function or work if they're not somehow connected to anythin g

#

Ok as I see it this is hooked up to an actual event here

#

but these are the only type of variables that can be hooked up to actual events

harsh storm
#

There is a lot to unpack here

livid scroll
#

As I see it I get certain events based on the kind of actor components I've set up here?

harsh storm
#

Decorator is its own class. You can create custom decorators that test some condition if you want. But Epic provides some pretty useful ones out of the box. Such as making sure some BB key is valid. Which is what you're doing right now. Making sure TargetActor != nullptr pretty much (might be an IsValid() check under the hood, but its old code so not sure)

Service is also its own class. You use them primarily for the tick support. So you can do things while the node is running.

These two things are for the Behavior Tree itself. Not for an AI Controller or pawn or w/e else.

When you communicate to the BT from outside of it, you will mostly go through the AIController because it has access to the blackboard. Other things can obviously get the reference if desired - but it is game dependent.

AI Perception is something unrelated to the BT - but it is often used to update values in the BB.

#

So you could use w/e you want to communicate to the BB (doesn't have to be the AI Perception stuff)

livid scroll
harsh storm
#

Because those blue nodes are in C++

#

You didn't write them

#

They're provided to you by Epic

#

You need to have an IDE up (and maybe the debug symbols?)

#

If that even works for them

#

But if you make a BP decorator and double click on it - it'll take you to that.

livid scroll
harsh storm
#

Why?

livid scroll
harsh storm
#

By making sure the TargetActor is not set (so set to nullptr in the BB)

livid scroll
#

so is it set or is it not set?

harsh storm
#

It isn't. This is just setting up the BB

livid scroll
#

wtf does being set mean here 😂

harsh storm
#

If it has a value

#

Your logic for setting it is currently being handled in your AIController

livid scroll
#

that means my blackboard is set up wrong

#

and it will never work, right?

harsh storm
#

No

#

You can't set up a blackboard wrong

#

It just holds variables.

lavish vault
#

What is the difference between State Tree and State Tree AI in components?

harsh storm
#

State Tree is generic and State Tree AI gives you the AI Controller in the context.

livid scroll
#

are you seeing a character or are you not seeing a character

#

technically any other actors are also characters, so perhaps I'd need to set up logic to confirm if it's a player chaaracter VS if it's another AI character

#

I left the SpottedActor variable unconnceted so perhaps this is forcing the 2nd one to be forcible UNSET

#

it needs to remove the value to be correct on the 2nd one

harsh storm
# livid scroll because if not then how else will this selector work?

This is how the BT will flow:

The selector will first check the first sequence node and see that it has a decorator on it. Then it will run a method on the decorator that performs the test (I forget what the method is called). If that test returns true - it will then go into the sequence node and start executing the tasks left to right. If the sequence successfully executes each task, it reports that it was a success and then the BT will start the process over again. If one of the tasks fails, it stops right there and starts this whole process over again.

If the decorator returns false, then the selector will go to the next branch (your middle sequence node).

Rinse and repeat.

livid scroll
harsh storm
#

Probably because they didn't explain it. Or glossed over it very quickly.

livid scroll
harsh storm
livid scroll
#

ok maybe not actually, because selector only selects one thing, and then moves on to business as usual

harsh storm
#

Once the sequence does its evaluation, the tree repeats the entire flow.

livid scroll
#

so what are some other types of blackboard conditional variable examples that can be set up with this?

harsh storm
#

Just look through the decorators

livid scroll
#

are the possibilities unlimited or they are kind of forced limited to what the events are in this blueprint

#

for example for move completed, I can make a float variable

harsh storm
#

Those events have nothing to do with the topic

livid scroll
#

for On Instigated any damage, I can make an integer variable, on Possesses Pawn Changed I can set up an actor variable, on Actor Begin Overlap -> actor variable again...

On Clicked --> boolean variable

etc.

harsh storm
#

I don't understand what you're trying to convey.

livid scroll
harsh storm
#

No they do not

#

The decorators have no knowledge about those events

livid scroll
#

can I set up these decorators outside of the AI controller?

harsh storm
#

There is no connection to be had

livid scroll
#

yes

#

I mean, blackboard variables can only be validated here, thats what i was asking

harsh storm
#

No

#

You can validate the BB variables anywhere

#

It is just a bag of variables

#

Grab one by name and test it

#

You just need access to the BB

#

The decorators are just there to be able to do tests.

#

So the sky is the limit on how you want to do tests

#

(Before Bruno comes in and ackutallys me - you can do more with decorators due to inherited functionality, but they're most often just used for test logic)

#

😛

#

You use one of the Epic provided ones if they fit your requirements. Otherwise, make your own.

livid scroll
livid scroll
harsh storm
#

The blackboard itself may be invalid

livid scroll
#

Ok Im pressing both keys

#

it's stuck on the Is Not Set

#

& waiting

#

Ok so for now I need to cast it

#

Im not sure how I should be doing these casts tbh

#

never worked with blackboards or chickens or whatever

#

I guess I'll do Get actor of class

#

It works but reallyyyy slow

#

I guess thats because it first has to finish the waiting timefacepalm

#

which is very wrong

#

it seems like the wait is very unecessary or kind of breaks the natural flow of processes

livid scroll
lavish vault
#

I'm following a tutorial on state trees, 2 years old, and when he creates override event -> Enter state, he gets a function. Whereas I just create a general event tick (in event graph). Which means I don't have the Return node with return value (succeeded etc.)

Where has this been moved?

#

this is his vs mine

#

I mean I could just use the state tree finish task node i guess, if that's the same. However I can't find an equivalent for the "Running" enum

harsh storm
harsh storm
#

For it to return "running" - you just don't call finish task

livid scroll
#

One thing that I really hate about STs or BTs is that everything is inside of something else and its really hard to describe it to someone, it's not what you're used to when for your whole life for example you've been programmign in blueprint and then you come into BTs and they make it so in such a way that nothing is intuitive in the least intutive way possible

harsh storm
#

To be fair - you didn't know what "set the variable" meant. That isn't a BT problem.

lavish vault
deft palm
#

This is the global parameters

#

And Btw, I need to use the global parameters of ResourceNode and DepositTarget to determine where the StateTree goes ("FindAndSetTarget" or "CollectAndFill")

harsh storm
#

Do we have any stat commands for the state tree?

foggy sedge
#

another ai question...

the default ai sight collision channel is set to Visibility, but both capsule component and the character mesh are set to ignore trace responses on the visibility channel.

#

(using the third person template)

#

what is the "normal"/"common" way to have this setup?

misty wharf
#

So it should work with that setup

foggy sedge
#

omg, ofc, thanks!
yes now it makes perfect sense.

#

nice website btw :)!

rare ruin
misty wharf
serene fern
#

is there a way for a recast nav thing to hold it's settings so for instance if I tick on draw poly edges and Enable Drawing ?

#

at the minute loading into different maps I have to toggle them two options on for the one recast nav thing

slow bobcat
serene fern
#

so I have two recast in my world cause I have two nav agent types

#

showing navigation only shows one of then, for the other to show I have to enable following options

#

and the show poly edges

slow bobcat
#

Aaaah yeah. That's shit. I had that problem in a project and zi needed up doing a console command to show one or the other

serene fern
#

I was wondering is there a way for these recast to keep them settings so I don't have to keep going in to have all of them show when I turn on show navigation, it's fine if not

slow bobcat
#

I think I can dig the code I did for swapping the debug. But I'm not at home. Will take some time until I sit down on my pc again

vast nest
#

why is ai pawnsensing not working for me? it worked intially but now its just not working.
here's my code:

misty wharf
misty wharf
#

Man, I wish there was more information on how to best utilize gameplay and ai tasks 🤔

#

I've been debugging a bunch of issues in some of my NPC systems, mainly caused by the complex interactions between them and a bunch of other things

#

For example, there's an issue currently where an NPC has a "pickup item" AI Task, but due to the complex interactions with the game systems, there are some cases where another pickup task is started before the previous one gets finished or canceled (because it seems that BT tasks might not actually abort on the same tick)

#

but it kinda looks like with the right settings, the gameplay tasks component can actually handle this 🤔

royal mist
#

oh is pawnsensing old? wtf is ai perception and how do I use that?

#

ah weird

deft palm
#

I did some research and found that:

TStateTreePropertyRef<T>Parameter;
InstanceData.Parameter.GetMutablePtr(Context);

using the above code to set a global parameter of a StateTree in a custom task can succeed, Only if the parameter's type is one of the few basic types(int, bool, float, FText, FString).

#

I think this definitely needs to be improved.
Making accessing external variables unnecessary complex.

chilly nebula
# deft palm I did some research and found that: TStateTreePropertyRef<T>Parameter; Instanc...

I havent had time to test your case just yet, but did you try any of the other PropertyRef variants? I know property ref has been used for actor refs in the past, and even the code docs has an example

` * // Reference to Vector, TArray<FVector>, AActor*, TArray<AActor*>

  • UPROPERTY(EditAnywhere, meta = (RefType = "/Script/CoreUObject.Vector, /Script/Engine.Actor", CanRefToArray))
  • FStateTreePropertyRef RefToLocationLikeTypes;`
#

I recommend you take a look at STateTreePropertyRef.h

final prism
#

So I'm trying to wrap my head around the new navlink builder functionality, but I think I'm missing something with how the navmesh generation works..
The navlink builder seems to run on the navmesh tile generator, what I don't understand is how can it generate links that span multiple tiles this way? (Which you can easily see is the case if you look at the navmesh in any decently complex level with this navlink generation enabled)

deft palm
near condor
#

For folks working with State Trees, would any of you be able/willing to share some documentation/tutorials that go over Considerations?

I have been using this document from Epic, but something about it is just not clicking with me and I would love some examples to look at: https://dev.epicgames.com/documentation/en-us/unreal-engine/state-tree-selectors-overview#considerationtypes

Epic Games Developer

Overview of the state selectors available in StateTree for Unreal Engine.

deft palm
chilly nebula
chilly nebula
deft palm
#

AActor* is Okay

chilly nebula
#

So what is the problem then? 🙂 Just use that. Or ideally if you can, use a weak pointer

deft palm
#

TWeakObjectPtr<AActor>?

chilly nebula
#

yes

deft palm
#

why TObjectPtr<AActor> failed?

chilly nebula
chilly nebula
deft palm
#

not at the moment

#

I will use weak pointer

#

thank you very much

chilly nebula
#

np! Hope it all works out 🙂 just remember that weak pointers can become null if the actor you point at is destroyed, so plan your code accordingly

deft palm
#

okay sure

#

hello, How can I link my StateTree's Node to a linked asset like the picture below at runtime?

#

Thanks a lot~

chilly nebula
near condor
# chilly nebula Can you tell me a little about what you find confusing or what issues you are ru...

Yes, I can try my best! I will walk you through the steps I went while trying to work with them and what I thought each step. If you want to jump straight to the question instead, check the bolded area.

1.) In the State Tree, I pressed the button for New Consideration, picked the base, saved the new consideration, and opened it.

Note: This felt straight-forward.

2.) Inside of the new State Tree Consideration Blueprint Base, I notice the EventGraph is empty, which tells me to next check the FUNCTIONS category to see if it is a blueprint where the functions are intended to be overridden. I see GetScore and GetDescription, and create overrides for them.

Note: After spending time with Unreal, this felt somewhat straight-forward as well.

3.) I check out the functions, starting with GetDescription. I see that it is as advertised, and just for putting a description. I then check GetScore. GetScore confuses me a little, but I keep seeing in the documentation that we are primarily working with 0 and 1, and as a float, so I assume it is like 0% to 100%. I create what I figure to be a simple test (see Figure 01).

Note: I suppose here I am confused on what is done with the Return Value in GetScore.

4.) In wondering what to do with the Return Value in GetScore, I decide the next step should be to add it via the Selection Utility for two Scenarios (see Figure 02).

Note: You can see how each Scenario is configured in Figure 03 (Scenario_A) and Figure 04 (Scenario_B).

5.) I run the test with the State Tree Debugger window open and take a sample to look at. I notice in Trigger Transitions, it outputs the warning "Could not trigger completion transition, jump back to root state.", where the intention was the have it go to TestWait.

Note: I assume this is not to do with Considerations, but probably the task, Debug Text, not returning as completed?


So what I am not exactly clear on, is the float intended to be sort of how weights are used? And if so, with both Scenario A and B are set to a Weight of 0.5f, how does the Weight get used after the Consideration is performed?

Thank you in advance!

misty wharf
#
bClaimRequiredResources = true;
AddRequiredResource(UKotAIResource_NPCAction::StaticClass());
ResourceOverlapPolicy = ETaskResourceOverlapPolicy::StartAtEnd;

Damn I think this just solved the annoying synchronization problems I was having with my NPC's

#

This makes it so that if there's an existing AI or GameplayTask running on the NPC with the NPCAction resource claimed, it just waits for it to finish/cancel before activating another - and it works with the latent node for gameplay tasks so you don't need to deal with it at all

#

Just need to use GameplayTask derivatives for latent NPC actions

chilly nebula
misty wharf
#

Yeah I knew the gameplay tasks component had a bunch of stuff in it but never looked at it in much detail other than seeing the comment that claims it has something to do with gameplay abilities lol

#

which it really doesn't

near condor
chilly nebula
deft palm
#

What is the type of ResourceOverlapPolicy btw 😁

#

I wanna take a look at it 😁

misty wharf
#

ETaskResourceOverlapPolicy, this code is for UGameplayTask subclasses

deft palm
#

Okay. Thank you 😁

near condor
misty wharf
#

I was curious what exactly does an AITask do on top of a GameplayTask - it turns out, almost nothing

void UAITask::Activate()
{
    Super::Activate();

    if (OwnerController == nullptr)
    {
        AActor* OwnerActor = GetOwnerActor();
        if (OwnerActor)
        {
            OwnerController = GetAIControllerForActor(OwnerActor);
        }
        else
        {
            // ERROR!
        }
    }
}

// ERROR!

final prism
misty wharf
#

Yeah

slow bobcat
final prism
#

Based on FRecastTileGenerator::BuildTileCacheLinks at least

#

Maybe there's a step that occurs after that I haven't found

slow bobcat
# final prism Maybe there's a step that occurs after that I haven't found

I'm super new to this feature and it's another team memeber the one that worked with it just Friday (he changed the code so we only generate nav links in tiles under special volumes placed by desigers), but looking at the code, looks to me that bGenerateLinks is enabled in every tile when using the tool within RecastNavGeneratior.
Then there's this step (image) where it seems to regenerate the CompressedLayers data if you want to generate links

#

So I guess the first time it will do the whole nav data, then only the tiles modified and, by checking the polyRef of the nav link end, it will also re-work the end-tile within GatherGeometry

final prism
#

Yes that's the flag you have to enable on the navmesh settings to enable link generation, its probably propagated to the tile gnerator

slow bobcat
#

My guess is that, since all the tiles are marked to generate tiles, nothing really needs to be passed to the tile generator. It only needs to read data from the tile to know if nav link generation has to be done on the Pending Tiles (PendingElement in the image)

#

Ah, seems that this is also part of the equation

final prism
slow bobcat
#

That's within FRecastTileGenerator::GenerateNavigationDataLayer

#

ah ok ok I see

final prism
#

Since its within the tile generator, it should only have access to tile specific data, not neighboring tiles

#

I think it marks up portal edges for later processing though, I'm currently looking through the code flow

slow bobcat
#

Yeah, looks like it just marks data like "hey, this nav link starts in this nav edge and ends here" for the linkBuilderConfig

#

An looking at it, it seems that this is where the tree limitation I was talking about comes into place (I know about it because I have suffered it). I thing the tiles need to be neighbours

#

Never mind. I think just marks a "this is where the nav link starts/ends" and that's it

#

Said limitation might not exist anymore (I suffered it in 4.27)

#

it would be awesome to know the difference XD

final prism
final prism
slow bobcat
final prism
slow bobcat
#

then one tile generator will say "I'm the starting tile and this is the start edge", the other generator will say "I'm the end tile and this is the end edge"

#

And "somewhere" there's a common nav link identifier to grab the other edge when a nav link start/end is found during path finding

final prism
#

Why complex low level systems always gotta be unreadable 😢

slow bobcat
slow bobcat
#

`void UXXXX::EnableDebugNavData(ENavDebugFlag NavDataIndex)
{
APlayerController* playerController = UGameplayStatics::GetPlayerController(GetWorld(), 0);
if (!IsValid(playerController))
{
return;
}

UNavigationSystemV1* currentNavSystem = FNavigationSystem::GetCurrent<UNavigationSystemV1>(playerController);
if (!IsValid(currentNavSystem))
{
    return;
}

if ((NavDataIndex == ENavDebugFlag::None &&  CurrentNavDebugFlag != ENavDebugFlag::None)
    || (NavDataIndex != ENavDebugFlag::None && CurrentNavDebugFlag == ENavDebugFlag::None))
{
    playerController->ConsoleCommand(FString::Printf(TEXT("Show Navigation")));
}

// this ensures we create the nav Render component without making it visible
currentNavSystem->VerifyNavigationRenderingComponents(false);

// This is the default recast nav data generated by our default nav agent type. We generate our own Recast object, derived from ARecast
if (ACustomRecastNavMesh* aiNavData =
    Cast<ACustomBaseRecastNavMesh>(currentNavSystem->GetNavDataForAgentName(TEXT("Default"))))
{
    aiNavData->EnableDebugDraw(NavDataIndex == ENavDebugFlag::Default);
    aiNavData->RenderingComp->SetVisibility(NavDataIndex == ENavDebugFlag::Default);
}

// this is the nav data type generated from our other nav agent config. It derives from our custom Recast Data (ARecast <- CustomRecast <- CustomDerived)
if (ACustomDerivedRecastNavMesh* otherNavData =
    Cast<ACustomDerivedRecastNavMesh>(currentNavSystem->GetNavDataForAgentName(TEXT("SomeOtherTypeName"))))
{
    otherNavData->EnableDebugDraw(NavDataIndex == ENavDebugFlag::SomeOtherNav);
    otherNavData->RenderingComp->SetVisibility(NavDataIndex == ENavDebugFlag::SomeOtherNav);
}

CurrentNavDebugFlag = NavDataIndex;

}`

#

this logic relies on you using different Recast Data generated per nav agent (which I guess is mandatory? I'm not sure, haven't been in a project with different recast objects in a long time)

final prism
#

dtNavMesh::connectExtLinks specifically

#

I assume this is the reason we can't have links that span more than one tile, it just checks all neighboring tiles and connects the links if possible

slow bobcat
#

ooooh nice find. Ok so my theory was comletely wrong. Good thing you trhow some facts there. Thanks a lot for sharing all this

final prism
#

No worries, yeah I'm currently looking at finding a way to calculate the full size of tile cache layer areas, however these are generated per tile.. So I need to find a way to connect these over multiple tiles to calculate the true area size (in case they are connected over multiple tiles)

slow bobcat
final prism
#

You typically don't want small patches of "crouchiness" so you need to remove areas that are too small

slow bobcat
#

Aaaah I see

#

Sounds a very interesting problem

final prism
#

Yeah I think there are very few or no games that have areas both the player and npcs can crouch under (without being simple enough to just have a navlink)

light ravine
#

Anybody got any tips or pointers for how to handle AI being able to path in sublevels that are unloaded?

#

I am thinking, that say that we are loading/unloading parts of a level for performance, but still want the AI that was in that level to be able to get to the player into the currently loaded level

#

I assume the AI would always be spawned in the persistent layer, but how can I make it so that they don't fall through the ground and so that there is pathing still available

chilly nebula
light ravine
deft palm
#

Hello guys, I got a question here just out of curiosity:
"Object Reference" in the image, Is it a TObjectPtr or a TWeakObjectPtr?

misty wharf
#

I don't know if it's possible to explicitly declare/reference weak pointers in blueprints

deft palm
#

Thanks a lot😁 . why is it not possible~~

unreal briar
#

Hey guys,
Any advice for a good architecture to create squad system for an RTS game?

near condor
#

@chilly nebula sorry for the ping but these Dave Mark GDC hour long each presentations have been excellent and are allowing me to pull together concepts from my other autonomous programming work for concepting AI in UE. Thank you again so much, these are exactly what I have been wanting for a long time, and makes sense I could not find them since they aren't on youtube to my knowledge!

chilly nebula
final prism
chilly nebula
slow bobcat
near condor
restive imp
#

Hello,

Beginner with AI here,
I'm trying to make my AI Move and shoot at the same time with StateTree

I use the same Task to do it with Event Start -> Move To Location
And Even Tick -> Shoot at target

But it seem's that when the AI is in MoveToLocationOrActor Node it lock AiLogic until he reach the destination point is their a way to bypass it ?
If i uncheck it in the Blueprint he just stay in place and shoot.

deft palm
#

If you uncheck lock ailogic box

You could put the 2 tasks in 2 states and trigger the transition to shooting state when arrived

deft palm
# restive imp Hello, Beginner with AI here, I'm trying to make my AI Move and shoot at the s...

Btw there’s an excellent explanation of the execution of state tree tasks in the sever

And I quote

If Task_A finishes immediately and you want to use the result in Task_B,
The problem can be solved by simply placing Task_A and Task_B in the same State and giving Task_A a variable whose Category is Output.
But this can only be used in the limited case where Task_A terminates immediately.
It's much more common for this not to be the case, so I'll write it below.

If you need sequential tasks, where the next task uses the result of the previous task, you can do the following:

- Parent
  - Child_A
  - Child_B
  • Let Parent own StateParameter.
  • Child_A updates the StateParameter of Parent. Once the update is complete, Child_A will transition to NextState.
    • To do this, Child_A's Task must have TStateTreePropertyRef or FStateTreePropertyRef.The built-in FStateTreeRunEnvQueryInstanceData::Result is a good example.
  • Child_B uses StateParameter of Parent.
restive imp
hasty turret
#

Hi everyone. I've been working on implementing Sekiro-style AI using State Trees for a while. State Trees work well for handling combos and their transitions, but I'm running into trouble when it comes to logic involving timers, counters, and interrupts. For example, I want the AI to do a turn-around attack when the player is behind them, or trigger a sweep attack after the player blocks successfully a certain number of times(and then maybe dodge back and idle for a few seconds). These kinds of reactive behaviors are hard to represent cleanly in a State Tree. Any advice or thoughts for handling this type of combat-heavy, condition-based AI?

near flame
#

Hello everyone.
I struggle recreating the bad AI system that i had and i don't know how can i switch between :Idle ,Move To Arena,Strafe,Move To Portal states
how is the best way to switch between them?
I had an enumerator with this states and used it in the old system ,but i don't know if this approach is good or no

#

The selector works but i have no idea how to implement the states below
and also when i tried to connect this one ,it made by default the idle state,and after finishing the monologue,it was stuck at root

chilly nebula
# hasty turret Hi everyone. I've been working on implementing Sekiro-style AI using State Trees...

Counters and timers are best to setup as parameters either on a parent state that wont change (ie Combat) or global, and pass them in as ref (see discussion on TStateTreePropertyRef above) to a task to modify/refresh them. Then setup a condition to check their value.
"Check for number of blocks" can be done that way, with a task that resets the counter on a failed block/parry and another to increment.
Timers can be set as time stamps, so when you enter a certain state you save the current time, and in your condition you check if current time is higher than saved timestamp + whatever time you want to wait.

Interrupts can be done with a transition with a condition, but you might need to do some of that as a ticking transition. 5.6 is bringing new features for better async tasks that could help here.

fathom sun
#

Hello, I'm trying to make so that my AI patrols along a spline following the CurrentPatrolPointIndex. However, I want it to pick the closest point when it starts patrolling. E.g., if it leaves the combat, I want it to pick the closest one. If it finished moving towards one patrolling point, and tries to pick the next one, I do NOT want it to pick the closest one, but use the one in the CurrentPatrolPointIndex.

I have patrolling as a separate BT for ease of use. I thought about using something like a service or a decorator to check whether the BT has switched to something else, so that I can pick the closest point. However, all the ReceiveActivationAI, ReceiveExecutionStartAI etc seem to be called anytime I start executing the patrolling BT in general, so it looks like I can't achieve this using either service or a decorator.

How would you try to achieve something like this?

near flame
#

Is there any reason for AI not to go to this location even if i see that the wires are active and Portal location is valid?

#

I use similar logic to this one and it works fine

#

but this one doesnt work,why?

slow bobcat
near flame
#

yeah they work,cuz this one works

slow bobcat
#

Also check visual logger navigation and path following categories, let's see what the debug says

near flame
near flame
#

i hear the first time about path following categories and visual logger navigation

slow bobcat
#

open visual logger, hit record and play your logic, then check the log categories.
If you don't know what visual logger is, there are lots of info online about it

crisp vessel
#

cant figure out what's wrong, everything seems to work, judging by string prints, but enemyai actor doesn't go to "covers", it just stands still

misty wharf
#

Ugh, why can nothing with AI ever be simple lol

#

It just occurred to me that I need to support resuming smart object behaviors... because if the game is saved while an NPC is using one, it needs to be able to continue what it was doing when loaded

slow bobcat
slow bobcat
harsh storm
#

I was just about to say - "just uhhh...cancel it"

misty wharf
#

heh

harsh storm
#

I solve all my saving issues by just not saving 👍

misty wharf
#

Yeah I mean majority of my SO's aren't going to have a problem with that I think, but I have some which might

#

I already limit saving to certain points because of this kind of things, but it's going to be problematic to cancel it entirely for some 🤔

#

They would still need to keep track of what they canceled and resume it

slow bobcat
misty wharf
#

I'm using custom gameplay behaviors insteado f BT's because some of the behaviors would probably be pretty annoying to model in BT's with all the logic and choices :)

#

But I think I can make it so that if an NPC tries to activate the SO again, the SO can detect from its own internal state that it needs to actually do something slightly different

#

it's kind of a faff I wish I didn't have to save but it's the kinda game where that can happen :P

crisp vessel
#

not player

#

btw

#

seems like hes moving

#

but very odd

fathom sun
#

Hello, is there an easy to way to randomize one of the three tasks in a selector? I want a way to randomize my AI actions, like strafing, guarding, making a thrust or a slash, or any other type of attack randomly, and with a little bit of weights depending on the environment and the type of target it's facing

harsh storm
#

You need to build some kind of utility composite node. There isn't anything out of the box for BTs. But there is something for state trees.

fathom sun
#

The thing is that you can't create your custom composites since 5.4

harsh storm
#

There are also 3rd party solutions that have it already.

misty wharf
#

Iirc there's an example of creating a random or utility BT composite somewhere on the internets

fathom sun
fathom sun
misty wharf
#

Classic Epic just breaking shit cos they forgot an API macro

fathom sun
#

And even rejecting the pull request to fix that

misty wharf
#

Probably just the bot closing PRs that nobody bothered to look at

fathom sun
fathom sun
harsh storm
misty wharf
#

Maybe, but it might just get closed by the bot after no human looks at it :D

#

hmm actually

#
    AIMODULE_API virtual void InitializeMemory(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, EBTMemoryInit::Type InitType) const override;
    AIMODULE_API virtual void CleanupMemory(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, EBTMemoryClear::Type CleanupType) const override;
#

this is what the functions look like in 5.5

#

maybe it was done?

fathom sun
#

I guess

#

Is it the time to upgrade to 5.5? 🤔

misty wharf
#

It's past .1 and .2 so it seemed fine to me so far :D

fathom sun
#

Alright, I'll try it out, thank you for letting me know that they have fixed it

lyric flint
#

He y there
I’m working on a UE5 project where NPCs walk on a spherical planet, using custom gravity to stick them to the surface. Orientation and gravity are functioning great, but I’m stuck on getting AI pathfinding to work all around the globe.
i can only generate nav-mesh at the very top of the sphere, everything else is considered too steep (or otherwise unwalkable).

Has anyone successfully wrapped a UE5 NavMesh fully around a sphere?

misty wharf
#

That sounds like an enormous amount of changes you'd need on the generator code and everything else 🤔

lyric flint
#

Damm, i jsut saw some plugins do it but they are really pricy

misty wharf
#

You could try your luck emailing the plugin author :)

lyric flint
#

Yeah, but is it really that imposible

misty wharf
#

Maybe there's some other solution to it, at least if the navigation isn't necessarily that complex

#

Eg. you could maybe generate points manually on the surface of the sphere, and navigate using those instead

lyric flint
#

Thanks, i might try something like that 🙂

#

but how can i make the ai move without using ai move to

#

the move to location or actor doesent seem to work

misty wharf
#

You'd probably have to build a custom solution to steer it towards the points

lyric flint
#

shit okay thank you

chilly nebula
slow bobcat
lyric flint
slow bobcat
# crisp vessel second

Then that's probably your problem. That pint is very far from the nav. Use the project point to nav node and pass the result point to the move to node.

harsh storm
#

Let's see if I can unravel all the goodies @chilly nebula has been loosely advertising 😎

harsh storm
#

Looks like a toggle that we can do to have a task be evaluated for transition or not

#

I wonder if this is what Siggi was referring to when he said we could make the ST fully event based?

chilly nebula
harsh storm
#

Yeah - I saw that too. Thought it was a little awkward of a placement, but not like I have any idea on where a better place for it would be. Or maybe there just needs to be like "Completion ....something" kind of text next to the dropdown. I just didn't mention it because you've already shown it.

#

Haven't looked at any of the new task delegates and listeners.

chilly nebula
#

UI will continue to be improved 🙂 the delegates are opening up some new patterns that are causing us to rethink things on a bigger scale. You can basically create task graphs by chaining tasks together now.

harsh storm
#

I'll see if I can find those task delegates and listeners. I was mainly just looking at the BP STT stuff.

slow bobcat
harsh storm
#

Found it

chilly nebula
harsh storm
#

I appreciate you Siggi. Just sayin'.

chilly nebula
# harsh storm Found it

key thing about delegates is they are bound like properties. You setup listeners and dispatchers on your tasks, and then hook them up via the bindings UI.

harsh storm
chilly nebula
harsh storm
#

So now, what we can do is something like:

State A

  • Child B

Have A run a task that has some delegates. Then B can listen for those delegates on the enter state method. And respond in kind.

#

Man I hate Discords formatting sometimes. But you get the idea.

#

So A could set up all the data needed for its child states and then broadcast the delegate when it is done.

chilly nebula
#

yep! + you can setup so the delegate triggers a transition

harsh storm
#

Yeah - saw that too.

chilly nebula
#

What we are working on now (related to the payload discussion) is how to best deliver result of an async task that signals completion.. like a run EQS task. There are some issues with the current approach that we want to improve

harsh storm
#

I'd imagine y'all have until like November 😅

#

Can't imagine 5.6 would be the only version released this year.

#

So, some quick impressions - seems like this is a nice self-contained way to handle more event-y stuff. Because outside systems have no access to the delegate stuff it looks. So Events would still be preferred if outside systems need to communicate to the State Tree

chilly nebula
harsh storm
#

It was me

chilly nebula
#

ah ok 🙂 even better then

misty wharf
#

What was the problem?

harsh storm
#

For some reason - the data just wasn't being transferred.

#

So the EQS result wasn't going to the move to vector

chilly nebula
harsh storm
#

Thus causing the Move To to fail

#

However, when I wrote my own (using the BP EQS nodes) it worked perfectly fine.

misty wharf
#

Interesting, good to know if I happen to run into it

chilly nebula
# harsh storm For some reason - the data just wasn't being transferred.

yeah we've identified a few issues around that, some are fixed in 5.6 but at least one is related to the thing I mentioned above with needing a payload. The issue is if you have a task in a child state binding to a parameter of an async task in a parent state, it might prematurely copy the bound value and not update it in all cases when the async task finishes.

harsh storm
chilly nebula
harsh storm
#

So, these three things - already 👌

chilly nebula
#

Duro Im curious if you try to set up your EQS+MoveTo again in 5.6 if it works or not. If it doesnt, I really want to get an internal repro so I can be sure we'll get that fixed.

harsh storm
#

The tick scheduling and optimizations aren't something that are within my purview as I've not had issues with those before.

harsh storm
chilly nebula
harsh storm
#

I saw the wait for next tick or something just before I shutdown the editor.

#

But also - nice. Looks like we can employ the service pattern from BTs better now. (Controlling the tick rate was the big thing from it)

chilly nebula
harsh storm
#

Minus the BB, I think that handles most (if not all) of the ways to set up a BT. Because we could already use "decorators" as an enter state conditon. Replicating Services just needed to be able to control tick frequency. Because they're essentially just a task that ticks with some safeguards (which can be handled with the enter/exit state stuff). And to get the sequence logic, it is literally just having states transition to the next state on state success.

#

And selector logic is enter conditions and/or transitions on failure.

chilly nebula
harsh storm
#

Can the tasks listen to delegates from other tasks on the same state?

chilly nebula
harsh storm
harsh storm
chilly nebula
harsh storm
#

That is fine by me and makes logical sense.

chilly nebula
#

There is nothing preventing you from setting up a whole task hierarchy inside one state now, ie a state that triggers 2 other tasks, and those trigger X many and so on and on...

#

Only downside Im aware of atm is the debugging tools dont show this very well

harsh storm
chilly nebula
#

<@&213101288538374145>

chilly nebula
harsh storm
#

I'm just thinking of a situation where, let's say Task A has a delegate and Task B has a listener. Task B needs to, on Enter State, set its callback method with that Receive Callback (or w/e the BP node was named. Only looked briefly) to some function.

What happens if Task A broadcasts the delegate on like the 3rd node call in the enter state function. IE - Enter State -> Do something -> Do something -> Broadcast.

As I type this out, this has nothing to do with what I actually brought up with sequential Enter State calls. So ignore I said that part 🤣 (because it would still fail)

#

The issue being - task B hasn't set up the callback function yet, but task A already triggered the delegate.

#

Mind you - I don't know if the listener property has a way to bind to a function in the property bindings part. I only had time for like 5 minutes of snoopin' around because I had to get back to work.

chilly nebula
harsh storm
#

That is one of the race conditions that come to mind with the sequential task setup you described.

signal dock
#

Hi, new to State trees and wanted to ask what’s the best approach to handle two different enemy types (range/melee with distinct tasks for each). Does a single AI controller with two states trees make the most sense? If so would you override the trees or just destroy the ST component and re-add that component with a different set on the controller when possessing? Or just one big state tree, and inside each task check what enemy type it is and execute the fitting attack?

deft palm
harsh storm
deft palm
#

Please watch this video

slow bobcat
# signal dock Hi, new to State trees and wanted to ask what’s the best approach to handle two ...

For heat you need to do you don't need infinite axis utility AI, which is what that video explains (or any kind of utility AI for that matter).
A common approach is to have a melee bt (or st in your case) and a ranged bt/st. Then each type of enemy uses the appropriate one.
Within each tree there will be concepts like "approach location/target", "attack" and others.
Inside said actions you can then plug in sub trees (linked trees in the case of st's) and have custom behaviors for each unit sub-type. Ie: a sniper ranged enemy will behave differently than a shotgun ranged enemy. When looking for a shooting location, the sniper will move far and behind cover while the shotgun will move closer to the target. That would be the "approach location" part.
When attacking, the sniper might aim, shoot, reload, repeat and the shit gun might just aim, empty the shotgun (2 bullets) and reload, being the reload much longer

#

The trees will look the same within a type, but the execution of the parts will be different and held in a different tree

#

That's a common approach

#

You could even have one general tree for all, but usually ranged look for cover points, try to pisition themselves out of the way of other ranged enemies etc. Their bt's are usually a bit deeper than melee

chilly nebula
robust pumice
#

Hi, i'm currently trying to build a realistic daily routine system using Behavior Trees, where the NPC walks to a bench and sits down.

Setup:

A Blackboard Key (BankLocation, type: Vector) is correctly set at runtime.

The NPC has a Sequence in the Behavior Tree that contains:

MoveTo → target: BankLocation

BTTask_PlayInteractionAnimation → should play a sitting animation

Problem:

The NPC walks toward the bench but stops shortly before reaching it.

What could be the issue?

ocean wren
#

Use smart objects for that

slow bobcat
chilly nebula
near flame
#

@slow bobcat i checked with the visual logger and here is the message it wrote

slow bobcat
slow bobcat
near flame
#

its because of the collision or i need to rise it a bit ?

chilly nebula
slow bobcat
# near flame its because of the collision or i need to rise it a bit ?

your door is affecting the nav and creating a hole in it. The point is within said hole and you are not using any extent (allegedly) to project that onto the nav.
Project the point onto the nav and use the result in the move to node.
Or you can set the bCanAffectNavigation flag to false on the door (might cause other issues like AI's getting stuck when the path goes throuhg it)

slow bobcat
near flame
#

yeah i succeeded,just added a billboard component on the teleport actor and used it as the location

#

Thanks for introducing me to a new tool

slow bobcat
signal dock
# slow bobcat For heat you need to do you don't need infinite axis utility AI, which is what t...

Thanks for the suggestions. I tried setting up two ST’s in the same AI controller but can’t seem to get it to work- any idea if it’s not something that can be done with BP?
Edit: Yeah, looked it up a bit and unfortunately seems like you can’t set a state trees on runtime.
Found this, I’ll give it a go:

https://github.com/gamedevkirk/UnrealEngine-ExtendedStateTreeComponent

GitHub

Contribute to gamedevkirk/UnrealEngine-ExtendedStateTreeComponent development by creating an account on GitHub.

slow bobcat
# signal dock Thanks for the suggestions. I tried setting up two ST’s in the same AI controlle...

Rather than setting 2 ST's in the AI controller, you can just set the one based on the enemy type, make it more data driven.
You could do this on Posses before running anything else I believe.
The StateTreeRef is protected in the State Tree Component.
You could have a child of the component with a SetStateTreeRef being called OnPosses before calling the Super:: part of it that callls InitializeComponent() on it

#

hahah ok, just opened your link. Yep, exactly that

signal dock
#

Really wondering why Epic isn't providing a native implementation of it

#

But oh well noted

slow bobcat
#

Because it's very dependant on how you initialize things. If you were to swap the tree at some point, you will need to call the init functions again.
One thing you can do is just have linked trees in your main tree and use those depending on the enemy type

#

I think that's the idea in general: rely on linked trees

#

In our game we have the State Tree Component running several trees because parallel tree didn't exist and linked trees where a bit messy.

signal dock
#

I wanted to use linked trees but I just couldn't find solid documentation in the engine for it

slow bobcat
#

the code is your documentation

signal dock
#

well I'm trying BP first when possible.. and going to the online UE documentation to look things up

#

But realistically lots of times there jut aren't any

deft palm
#

.

#

I also implemented the similar code. I think I was just coping the blueprint version of it

#

I wasn’t sure. It was weeks ago

slow bobcat
chilly nebula
#

void UStateTreeComponent::SetStateTree(UStateTree* InStateTree)
void UStateTreeComponent::SetStateTreeReference(FStateTreeReference InStateTreeReference)

signal dock
#

Hi look at that, I just got a 5.6 preview notification 😄

#

Lets fire it up and see if these sweet ST setters are there

chilly nebula
#

😉 yup Preview was just released, enjoy!

vestal briar
#

I was wondering if it is bad practice to have a loop in a state tree where states are selected by tags that are set in a selector state within the loop.

#

I could use the Selection Utilities here, but I specifically want those states to be used based on cooldowns, timers, distance etc.

harsh storm
harsh storm
#

Unless I'm more blind than Ray Charles.

chilly nebula
chilly nebula
harsh storm
#

Looks like my exploratory stuff hit all the stuff that is coming for STs

#

And the main focus, gameplay wise, was ST and Mass for this release.

chilly nebula
chilly nebula
harsh storm
#

Yeah - but 8 out of the 11 cards were Mass/ST related.

#

That's what I meant.

chilly nebula
#

Doesnt mean there was no work done 🙂

harsh storm
#

Oh, definitely not. I'm not including stuff like the async streaming stuff for world partition or the zen improvements or the motion design stuff or anything like that. I was talking strictly about the gameplay framework section.

slow bobcat
#

And all the new stuff for level streaming and data layers looks awesome too

harsh storm
#

But it won't be realized for awhile. Because I think games are still mainly releasing on like 5.3 and lower.

vestal briar
slow bobcat
#

Tbh The stutter issue is on the dev side more than the engine.... That said, the engine doesn't make it easy to improve it

harsh storm
#

To them - because so many UE games are plagued with it, it is the fault of the engine.

slow bobcat
harsh storm
#

You should link the talks to be honest

#

If they've proven to be so useful

#

Then we can bother the mods to pin it

harsh storm
#

Wrap them in <> to not have the embed pics

near condor
#

These really filled in the gaps for what I was missing. They also allowed me to tie together a lot of my current systems, at least conceptually, since I was building with the intent of modularity from the start.

#

So thank you

near condor
#

and thank you Duroxxigar for the tips there

harsh storm
#

<@&213101288538374145> Can we get these talks pinned?

near condor
#

honestly? yeah. AI is a ham beast, and I feel as though it should be required learning

chilly nebula
crisp vessel
#

how to open this window in Learning Agents Interactor? I dont have it

#

nwm, I found it in "window"

#

it was hidden by default for some reason

crisp vessel
#

where can I find good q-learning tutorial for ue5.4?

#

grok, chatgpt and gemini have very strange info about learning agents plugin, it doesn't stick with reality

chilly nebula
hallow compass
restive imp
#

Hello , i'm trying to have my AI to move Physic Item to hide behind it what would be the best way to do it ? Put Tag on mesh able to move ? Overlapping Event with Collision on the AI ? any idea ?

granite path
#

Hello Ive been playing with AI and UE5. Well Im thinking that AI is actually the one playing with me. :/

slow bobcat
warped solstice
#

i think this is the best channel for this question

how did you guys resolve problem of dealing dmg through walls? i mean case like melee AI attacking with long sword/hand whatever, how do you check if the dmg should be dealt or not?
trace from hand to dmg place to check if there is wall in the middle is the easiest solution, but i dont belive its good or safe, and may cretae more problems than solutions, so what other options did you try?

misty wharf
#

I'm assuming the reason for this in the first place is that you're using some kind of overlap check which just ends up going on the other side of a wall because of its size -- to me it seems you could do a linetrace from the actor to the point that was hit, and check if something is between them. This seems like it oughta work, although I've not faced this specific problem myself.

shadow furnace
#

My dumb idea would be to just trace from inside of the movement capsule against things that block movement in order to have a better chance of starting the trace above a surface rather than inside of it

restive imp
slow bobcat
slow bobcat
# warped solstice i think this is the best channel for this question how did you guys resolve pro...

you could always keep overlap for damage in one collider and have another at the same location with the same geometry (let's say a capsule) that does physics collision block against walls, furniture etc (basically anything in the Static channel). The sword will not pass the wall. You can only enable the physics collison while the AI is doing the attack animation and disable it later (or as soon as it applies damage)

warped solstice
#

thanks for ideas, will check them again

chilly nebula
near condor
near condor
#

I could be testing this wrong... But I am confused.
Version UE 5.5.4

"I do not sense the Target." behavior = Try Select Children With Highest Utility
Screenshot indicates neither Idle nor Patrol have Considerations added to them, but the weight is adjusted for each.

I imagined that If:

  Idle is set at a lower weight (0.9f), without a Consideration applied, that it would treat it like 1.0f*0.9f=0.9f
  Patrol is set at a higher weight (1.0f), without a Consideration applied, that it would treat it like 1.0f*1.0f=1.0f

So by that logic, I would have thought it would default to selecting Patrol, never Idle.
However, it always picks Idle. Does this mean the "default" without a consideration is 0.0f, so then weights are multiplied against 0.0f, essentially zeroing them out, and since both would be Zero, and in the case of a tie, Try Select Children With Highest Utility would then select Idle?

#

I added a Consideration to both. A simple one that always outputs "1.0f".

I kept the weighting I had set, and now it selects Patrol every time.

chilly nebula
# near condor I could be testing this wrong... But I am confused. Version UE 5.5.4 __"I do no...

Btw always look at the debugger, it should give you insight into why something is selected.

My guess is there might be bug where this doesn't work without a consideration, since they are very central to how the scoring works.
Can you tell me a bit what you were trying to do here, and why you thought the utility would work without a consideration? If you only have a static weight, it will always select the same path.

btw. if you just want a weighted random, there is a separate state selector for that.

earnest musk
#

Hi all, small question regarding StateTree - what is the current status of evaluators? AFAIK they were to be deprecated in favor of global tasks, but they are still in.

chilly nebula
earnest musk
#

Nope, just wanted to clear this thing 🙂

serene fern
#

So i'm having odd issue where a AI Move TO node is aborting but I can't work out way

#

the place it's trying to go to is valid

#

so i think I've found issue it seem to be choosing a non valid Smart object

coarse smelt
#

Hello, I've been using EQS queries in my BehaviorTree so that my Ai characters can find Actors of particular classes. Howver, I now have 20+ classes that my Ai might need to find and I feel like there must be a better solution. I want to pass an Actor class variable to the Ai character and have the character go to the nearest instance of that class. I've seen suggestions where I write a function in the character class to search for the class, and then (if I need to do more Ai stuff with it) pass it to the EQS as an EQS Query Context. Is this the easiest way to do what I'm trying to do? And a bonus question: is there a reason EQS Queries don't have an Actor input parameter? This feels like it'd be useful!

valid basin
#

HI guys, Im new to unreal. New to state tree. Im struggling with a simple setup.

Idle: Move to Random Location > Wait for 1 sec > loop
Chase: Move to Player when distance to player is < 250 unit
Back to Idle: when distance to player is > 250 unit

From my animation gif has shown. When player is <250 unit. The AI does chase, But if I move out of 250 unit before the AI get to the player. It gets back to patrol as expected. But when it get to the "wait" state, it'll try to get to the player again eventhough the player is out of its trigger range. It is like it hasn't been able to reach to the destiny and it keeps trying during the wait state. I have no idea why.

heady silo
#

I did a search in here and haven't found this yet, so I'll ask here:

I'm trying to come up with a generic function that can run for an AI character to locate objects in a certain radius that updates frequently and has a memory. I want to take those locations and put them in arrays for AIPerception to use as reference, and pipe these into data that BTTasks can use. In addition, I want to use the same generic function to highlight objects near the player that they can use in the world.

Let's say our NPC is currently unarmed and needs to find a weapon. We run this check to figure out what is nearby to use, and how to use it.
Say there's a knife and a gun. The knife is closer to hand than the gun, but the gun fits the more immediate need of a ranged opponent. But the ranged opponent is close enough that the knife can be grabbed on the way to the enemy to attack.

So we need to store some data-

The nearby objects as ObjectsInSearchArea(array)
Distance to each object from our starting position as DistanceToObject(array)
Types of objects as defined in a weapon class like BP_Weapon_Pickup

and reference these in the Task executed in the tree.

So I want to compare the generated list to what is seen in AIPerceptionSight() and get the closest object to move to it. I guess if I was to expand it to have more "decision making" I'd need to get the enemy's location via perception or their last known location and set distance values such that if the unit is close enough to attack quickly in melee to prioritize the knife, and further than that distance to priortize the weapon and getting to cover. Does any of this code even look close or am I way off?

#

I guess maybe this would make more sense in a GOAP system but I'm trying to reduce my learning overload by concentrating purely on what I can do with BTs for now

#

unless StateTree would be a better fit for functionality like this?

#

//revised

#

(ignore the tick usage, I will probably try and make this into a BT Service)

vestal briar
vestal briar
valid basin
#

It is still not making sense. it is clearly in the wait state. and the wait state has only 1 delay task. why is it moving towards the player.

obtuse igloo
#

Hey all!
I'm messing with Smart Objects, and I was wondering how I could get my AI to stop trying to move to and use a Smart Object after it's slots have been disabled? My AI is trying to move to and eat an item, but If the player picks the item up (it gets attached to the player's hands), I'd like the AI to stop trying to go to the object and abort it's task and un-occupying the slot. Any ideas appreciated ^_^!

slow bobcat
slow bobcat
slow bobcat
heady silo
slow bobcat
heady silo
#

So could I just do something like sensing the class of the nearby weapons, and then picking the highest class with the shortest distance?

slow bobcat
# heady silo So could I just do something like sensing the class of the nearby weapons, and t...

that's what an EQS would do yeah.

  • A generator will produced a raw set of data. ie: all the weapons within 25m (our give you all the available guns to pick in the game and a test will discard the ones further than X meters)
  • then a test will score them based on distance (the closest the higher) <- this the engine already has
  • another test will score them by how dangerous they are (a gun is more dangerous than a knife) <- this you will need to create by reading the Dangerous value from your weapon

When the eqs is done, it will give you back an array of weapons (items in EQS lingo) ordered by their score

crisp vessel
#

why I cant use attack function from enemy blueprint?

#

and how to use conditions in behaviour tree?

misty wharf
# crisp vessel why I cant use attack function from enemy blueprint?

Behavior Trees can only use nodes created for behavior trees. If you want to use a function from your actor, you need to create a new Behavior Tree Task which wraps the call of the function.

For conditions, you would typically use decorators, but the way all this works in BT's is not quite the same as using if/else in BP's. If you don't know how this works, it would probably be good to read the docs on how Behavior Trees evaluate.

chilly nebula
#

Its per state and affects child states as well.

near condor
# chilly nebula Btw always look at the debugger, it should give you insight into why something i...

Apologies for the delayed reply! I was trying to toy with it more and some work came up. I was more so just trying to understand how it is selecting states, with and without considerations.

For why I thought it would work without a consideration, I assumed that the weight value is being supplemented as "chance" even without a consideration, and assumed that without a consideration, all default base scores were a value of 1.0f

However, it appears the "default" of the setup without a consideration is to be treated as though it were a zero, as weight holds no impact without a consideration as you mentioned.


Unrelated to the weighting, I was also noticing that with a consideration, they seem to not really accept Input variables?
But only sort of?
They can take in the Actor/Controller/Global Params, but if you create params on the State itself that "set" variables within the scoring method, it seems as though it just straight up breaks the Consideration.

Example: in the screenshot, I have the Input Var STC_TestBool, and the default value is true. Having that variable in the first place setup with a binding in the state tree is problematic, as the state tree seems to skip over the state entirely if it exists, with no clear messaging indicating so.

I understand the method is Read only after compiling, so I need to get used to that, that's entirely on me. Plus it would be messy anyways managing variables within Considerations.

Though, it does raise a question, since print to log statements don't seem to work within the considerations (if using custom messages from the state parameters), how can I see the scoring during run time? I feel it would help a bit to see that history. I have the debugger window open in the state tree and the blueprint debug window to watch variables, but I imagine at scale, it can get a bit harder to catch that historical information for the exact time it happened and try to piece it together.

or I am overthinking things ha

obtuse igloo
wise sluice
slow bobcat
obtuse igloo
#

I’d appreciate it lots!! Thank you guys 😭

slow bobcat
obtuse igloo
#

I disable the slot when it gets picked up and hoped that it would fix it but the AI continues moving to where the item was to use it even if it’s not there anymore

slow bobcat
heady silo
#

or maybe a composite?

heady silo
# heady silo

This one might do for now, it basically it testing if we can see/reach the weapon most efficiently which is probably "good enough" for a first game

#

I think maybe a sorting method is probably doable with gameplay tags?

open onyx
#

I'm trying to call SendStateTreeEvent to trigger a state transition in 5.5. I have on-screen "print statements" surrounding the C++ SendStateTreeEvent call (so I know it's getting past that point in the code at least), and my actual state tree transition looks like the attached. The "AI.Aggroed" tag is declared / defined in C++ so there shouldn't be a typo issue. Is there anything else I'm missing? Do I need to have something for the Payload Struct value? I have a task in the Idle state (the state in which this event resides) that continually prints out "Is In Idle State", so I know at least the tree is running and the first state is active. I also have a similar printing task in the Combat state that never appears; the state remains Idle.

This is the C++ for what it's worth

DEBUG_PRINT("Target was successfully sensed.");
AggroTarget = Cast<ALegendCharacter>(Actor);
if (StateTreeAIComp && StateTreeAIComp->IsRunning())
{
    const FGameplayTag AggroTag = UGameplayTagsManager::Get().RequestGameplayTag(FName("AI.Aggroed"));
    const FStateTreeEvent Event(Tag_AI_Aggroed);
    StateTreeAIComp->SendStateTreeEvent(Event);
    DEBUG_PRINT("sent event");
}
else
{
    DEBUG_PRINT("didn't send event");
}
slow bobcat
# open onyx I'm trying to call `SendStateTreeEvent` to trigger a state transition in 5.5. I ...

Some questions:

  • where and how are you declaring the tag in c++? The fact that you mention a typo rises concerns since tags are not written by hand, they are chosen from a menu. I see it selected in the picture but just in case
  • where is the event transition set? Is it in the Idle state that is running?
  • have you checked the state tree debugger to see if there's any extra info there?
fierce carbon
#

My zombies, when attacking, knock my character into the air. Is there a way to prevent this? I've tried to ignore impulse on damage but it's still happening

slow bobcat
#

Deleted my last message, was not for this chat or the person tagged

elder perch
#

I just want to say, thank you

wise sluice
#

Hello ! I tried to do some weird stuff with SmartObject parameters 👀 (Unreal 5.4)
It turns out that the smartObject rendering component debug display the entrance properly in editor when sliding the value but not when validating the input 😔 It fallback to its original position

#

It looks like it should be doable to update the debug position since the smartObject entry turns blue when it is on a right position compared to navmesh

#

Is there a way to have a customizable entrance location per SmartObject instance?

#

Okay it turns out that my actor was wrongly setup
I reparented my actor as a GenericSmartObject actor and it works well !

chilly nebula
chilly nebula
#

Pretty good overview video of the new State Tree features in 5.6:
https://www.youtube.com/watch?v=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...

▶ Play video
open onyx
#
  1. The tag thing became a red herring, apologies. I mentioned typos to assure I wasn't getting the tag via RequestGameplayTag (and its typo-able FName arg). I have my Tags set using UE_DECLARE_GAMEPLAY_TAG_EXTERN / UE_DEFINE_GAMEPLAY_TAG in a single header/source file-pair.

I'll back up a bit and explain my setup.

  • BP_NpcCharacter blueprint class. Details panel, I set the pawn's AI Controller Class variable to:
  • AMyAIController C++ class / BP_MyAIController. In C++- I declare StateTreeAIComp like so
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "AI")
TObjectPtr<UStateTreeAIComponent> StateTreeAIComp;

and in the blueprint details panel, set the StateTree asset, ST_Aggressive.

The original code I pasted is within AMyAIController's OnTargetPerceptionUpdate. This is how I have the sense configs set up:

AIPerceptionComp = CreateDefaultSubobject<UAIPerceptionComponent>(TEXT("AIPerceptionComp"));
AIPerceptionComp->SetComponentTickInterval(1);

SightConfig = CreateDefaultSubobject<UAISenseConfig_Sight>(TEXT("SightConfig"));
SightConfig->SightRadius = 2000;
SightConfig->LoseSightRadius = 2200.0f;
SightConfig->PeripheralVisionAngleDegrees = 60.0f;
SightConfig->DetectionByAffiliation.bDetectEnemies = true;
SightConfig->DetectionByAffiliation.bDetectNeutrals = true;
SightConfig->DetectionByAffiliation.bDetectFriendlies = true;

AIPerceptionComp->ConfigureSense(*SightConfig);
AIPerceptionComp->SetDominantSense(SightConfig->GetSenseImplementation());
  1. The event transition is within Idle. The "debug task" is:
etc Tick(FStateTreeExecutionContext&, float) const override
{
    GEngine->AddOnScreenDebugMessage(-1, 0.5f, FColor::Yellow, TEXT("Still in Idle"));
    return EStateTreeRunStatus::Running;
}

"Running" to stop re-doing Root->Idle. "Succeeded" has same result. A duplicate task in Combat.

  1. "debug0" attachment shows it entering Idle. The markers are the same, see "debug1". "states" shows the tree. Sorry for huge message 😄
open onyx
simple verge
#

Is there some kind of bug with StateTreeTask Run EQS Query that exits the state before other tasks are complete?

misty wharf
#

I think 5.6 adds the option to choose whether you want any or all to complete before anything is triggered

lofty ember
simple verge
#

Is it supposed to feel inconsistent or do I not understand some subtlety? You can share a delay and a debug text task and the delay will complete, for example.

harsh storm
#

Because the debug text task probably never actually "finishes"

simple verge
#

It's also the opposite of how mass states work WRT selecting and using SO objects where the usage must be an inner state, no?

harsh storm
#

So no transition would happen

misty wharf
#

Yeah you have to design it with this in mind, 5.6 might change it I guess but perhaps it'll still be necessary to consider it for some cases

simple verge
misty wharf
chilly nebula
# simple verge Wait you're right. debug text will block completion if its the only task on a s...

All of this is fixed in 5.6, where we added controls for what tasks will contribute to state completion. You as the designer can toggle on/off per task, set completion to trigger on any or all tasks and so on.
Task authors can also set default, and if a task will ever contribute to completion.

FYI - Almost all tasks should complete, that is the right pattern from now on.

Regarding EQS, the best pattern is to trigger a transition on completion and read the result in a child state.

misty wharf
#

Ah nice, it also allows changing on a per task basis

#

I actually thought about implementing it as a bool for some tasks, whether it should finish or not, so this definitely makes sense

chilly nebula
#

one sec, I'll show you a new screenshot from today

#

That green + icon there shows the task is currently contributing, clicking it turns it into a - (this icon is a star in Preview release)

#

btw someone asked about this recently, this is what the configurable tick rate looks like 🙂 it appears as soon as you change the policy on the schema

misty wharf
#

I can delete most of the text in the custom state tree tasks page lol

simple verge
deft kettle
#

Hi, wanted to ask for some advice on how use a python RL algorithm on a agent.
My agent is a archer that can move around the room, rotate, and shoot ( these are the actions that is getting from the python script)
I am sending to the script his location, the enemy location, the distance to him, the angle between the agent and the enemy and a variable that will tell if he can shoot or not.
I am quite new in this, and I trying to create an PPO as continuous action space, basically I want my agent to learn how to shoot the enemies in the room.
My issue is that it doesn't learn anything in time, and sometimes the mu values reach Nan values, do you have any advice?

chilly nebula
simple verge
#

kk thanks for the help

signal olive
#

Trying to leverage the AI perception component to implement Thief-style hearing, surprisingly harder than I thought

misty wharf
signal olive
misty wharf
#

Ah

signal olive
#

It's still something I'm getting to grips with

misty wharf
#
const float ClampedLoudness = FMath::Max(0.f, Event.Loudness);
const FVector::FReal DistToSoundSquared = FVector::DistSquared(Event.NoiseLocation, Listener.CachedLocation);
            
// Limit by loudness modified squared range (this is the old behavior)
if (DistToSoundSquared > PropDigest.HearingRangeSq * FMath::Square(ClampedLoudness))
{
    continue;
}
// Limit by max range
else if (Event.MaxRange > 0.f && DistToSoundSquared > FMath::Square(Event.MaxRange * ClampedLoudness))
{
    continue;
}
#

Yeah looks like it uses loudness as part of the distance check

signal olive
#

Which I guess is okay for sounds that are actually loud enough to be heard from a distance but not so good for being able to sneak up on someone without them hearing unless the loudness is literally zero

misty wharf
#

Yeah, tbh it feels like it might be easier to just use distance. Either they hear the sound or not.

earnest musk
#

A bit abstract question - working on AI that can attack player owned structures or capture points. So far came with an idea make them visible to AI using perception, basically giving them team id. On top of that when AI sees a player structure, and sense adds it to threat list, it gets some initial threat so enemies keep attacking it if unattended. For capturing probably will go with ECS or something.
Does this approach sound sensible?

solid spire
#

Yeah that generally sounds good

vestal briar
slow bobcat
# earnest musk A bit abstract question - working on AI that can attack player owned structures ...

Seems good, unless we are talking about many enemies and things to perceive. Then it is not. The Perception system struggles when it has to process high numbers.
How it works internally: each perceived stimuli is added to a collection (I don't recall if it's an array or a map). When processing it, the system checks how long is taking to process said collection within the frame. When reaching the time limit, it stops and waits for the next frame.
Every time said stimulis change location, new ones show up or the listener actor moves, they are added to the collection and the collection can change order.
If this happens often in high numbers, you can end up in a situation where some stimulis are not being processed ever.
This happened to me in a project. We had over 30 enemies being detected in some situations (top down arpg twin stick shooter). We had bug where some enemies were never processed (generally the ones added at the end). I got confirmation from epic (udn) that the system was never written for high volumes of stimuli happening. I ended up changing the system to disable stimulis (enemies mostly) that were further away than the vision radius.
My advice: think of a different way you can control.

  • the team id is a good idea, but you don't need perception for it. There's an interface and an API for teams in unreal you can use
  • structures might have different points to be attacked. Ie: is you have a castle, you probably want to attack the entrance wooden door rather than a wall. But if a wall is half-destroyed already, you probably whan to attack that. To do that, you need to check paths to specific locations in the castle. Consider options like adding interesting pints to an Octree (unreal has an octree API but it mostly supports adding, not removing. That you need to implement (it's not difficult). An octree is a super fast way to check locations within radius and obtain world data.
  • every time a new player's building or capture point spawns in the world, you can add it to the octree. Your AI's can check every 2s if there's a new point of interest using the octree.
  • all this can be done in eqs's that you control or in multi-thread async tasks that each AI can run making it cheap
#

To sumarize: if you plan on having many AI's checking on many things (other AI's, players, buildings (and within buildings, attack points), capture points... Consider an approach detached from the Perception System

#

If its going to be basic "yeah, the player is going to have 2/3 buildings and that's it", the Perception will be ok

slow bobcat
harsh storm
#

I keep pondering how I would handle writing ai perception 2.0 with #mass but the line tracing is where I typically stop at. Mainly due to lazinesss and not really "needing" it myself

slow bobcat
#

We do use it for hearing though

earnest musk
slow bobcat
earnest musk
#

Thanks for advices folks 🙂

harsh storm
slow bobcat
harsh storm
#

I figured Game AI pro would've had it, just was not at my PC to look.

harsh storm
#

This one I do know

#

I have read this one - but even so, they still use raycasts.

#

The sight stuff already does a distance and dot product check before doing the line trace tests. So, I don't know how valuable it actually would be to move that stuff to mass and then just tell mass to tell the actor when to do the line trace tests.

#

That would require the actor to update the backing entities position, which sounds like it would defeat the purpose of even using Mass.

#

I've lightly talked to Mieszko about at least EQS being powered by Mass as well.

slow bobcat
slow bobcat
mighty hornet
#

Hey, anyone know how to get around this error? This is being thrown when I try to destroy an AI controller running a state machine (even if logic has stopped). I assume it's because there are tasks that haven't finished being completed.

[2025.05.17-15.30.50:456][582]LogWindows: Error: 
[2025.05.17-15.30.50:456][582]LogWindows: Error: [Callstack] 0x000001a524934f5a UnrealEditor-StateTreeModule.dll!TStaticArray<FStateTreeSharedEvent,8,8>::TArrayStorageElementAligned::~TArrayStorageElementAligned() []
[2025.05.17-15.30.50:456][582]LogWindows: Error: [Callstack] 0x000001a5249f6fda UnrealEditor-StateTreeModule.dll!`eh vector destructor iterator'() []
[2025.05.17-15.30.50:456][582]LogWindows: Error: [Callstack] 0x000001a5249280f8 UnrealEditor-StateTreeModule.dll!DestructItems<FStateTreeFrameStateSelectionEvents,int>() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Templates\MemoryOps.h:102]
[2025.05.17-15.30.50:456][582]LogWindows: Error: [Callstack] 0x000001a524926855 UnrealEditor-StateTreeModule.dll!UScriptStruct::TCppStructOps<FStateTreeTransitionResult>::Destruct() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Public\UObject\Class.h:1368]
[2025.05.17-15.30.50:456][582]LogWindows: Error: [Callstack] 0x00007ffae0c45a1f UnrealEditor-CoreUObject.dll!UScriptStruct::DestroyStruct() [D:\build\++UE5\Sync\Engine\Source\Runtime\CoreUObject\Private\UObject\Class.cpp:3736]```
misty wharf
#

eh vector destructor
It's those darn canadian vectors again

mighty hornet
#

Us Canadians always use Canadian vectors you know 🙂

misty wharf
#

I've never seen this myself and I've used ST's a bunch... have you tried looking at the callstack in your IDE?

mighty hornet
#

No, that's probably the next step though. This is happening during level teardown when I'm trying to head back to my main menu.

misty wharf
#

Are you using any custom state tree tasks or just the builtins?

mighty hornet
#

All custom tasks

misty wharf
#

Right - just makes me wonder if it's something to do with cleaning up the task which is then causing a problem somewhere

mighty hornet
#

And to make it more fun, they're all written in C++ on FStateTreeTaskCommonBase

#

I'm not sure if the blueprint versions have extra cleanup built in

misty wharf
#

In my experience there isn't anything special you'd need to do with them, but if you were storing something unusual on the task struct instance or perhaps in the instance data, that could do it I suppose

wintry osprey
#

Anyone knows why nav-mesh doesn't generate on geometry script made meshes? I know it works, just if there's some check box somewhere

mighty hornet
#

Nothing too unusual on the task instance data... Actor pointers, basic types. A TArray of actors and a TMap of <AActor* , float> about the most complex thing

#

I think I'll try debugging through VS, as you suggested, maybe set up some breakpoints around the destroy events

misty wharf
#

Yeah that's probably the best place to start, could be so many things affecting it 🤔

harsh storm
chilly nebula
obtuse igloo
wooden fern
#

Quick question on Nav Modifiers. I have a map that is tile based, using 500x500 tiles for road tiles, grass tiles, etc.. Each tile is an actor with a Nav Modifier component to change the modifier area on for allowing where NPC's can and cant walk obviously. But im wondering if this is bad to do? Because lets say my map gets big enough and end up with 2000 tiles made up of roads and grass and sidewalks, that means there's 2000 nav mesh modifiers too. Curious on if they will cause performance issues with that sheer amount? I am using Static nav generation though. So I guess it's a one time build thing and never have to worry on it?

#

Pic for reference on what I am currently doing. Red is parts the AI cannot walk. The green is the sidewalks where they can walk.

All of this map is approx 1500 tile actors. (Which means 1500 nav mesh modifiers too as stated above)

mighty hornet
chilly nebula
slow bobcat
wooden fern
#

Yeah they seem to work. During the build process in editor it will create the static map with those modifiers involved.

#

But Im guessing any changes at runtime, nothing will change, is basically what I believe.

#

But I wonder if there is a significant cost to using A LOT of modifiers like what i've done above, using a tiled mesh map.

slow bobcat
wooden fern
#

Sweet! All shall be good then. 🙂

#

I thought to myself, if it's static, that means its baked Nav Mesh that doesn't need recomputing. But UE will be UE, always best to ask if what I'm doing is overkill lol. It's just that my map setup is a different approach to many. No landscape involved haha

near condor
#

Hey all, just curious if anyone knows why I would be experiencing this:

#

If I swap the "order" of them in the State, it still triggers the Move to Location breakpoint first.

misty wharf
#

I wonder if there's a defined "intended" behavior for this to begin with

#

Because a lot of the mentions of tasks in states is that they "run in parallel"

#

So I don't know should you assume that they will run in the order you've defined them in

rustic flax
#

the fact that you can bind properties of later tasks to earlier tasks in the list implies an order, doesn’t it?

misty wharf
#

Oh that's true, I guess it would

near condor
near condor
#

I do feel like I frequently run into questions on State Trees, but I promise I have worked on each of my problems for a while (95% of the time)

rustic flax
#

is there a reason that StateTree doesn't allow running bits of logic attached to particular transitions? i feel in state machine code it's very typical to have like if (LostPlayerPerception) { CurrentTarget = nullptr; Cooldown = 5.0f; RequestNextState( ... ); } but StateTree doesn't permit it?

you can work-around by having a one-tick intermediate state with an Enter task, but the extra tick in between could often be problematic

chilly nebula
cerulean otter
#

Was there a specific architectural reason for that behavior? What are the upsides/ downsides as opposed to guaranteeing an order (unless were flirting with threadding?)

dim pier
#

Is it possible to expose a gameplay tag picker in the state tree gui?

obtuse igloo
#

Anyone know why my Receive Abort events aren't firing for this UseSmartObject node i've got?

rustic flax
#

(When I first learned about magic categories and their mysterious implications I was not happy lol 😤)

dim pier
slow bobcat
obtuse igloo
#

The flow control for the decorator is set to Aborts self

slow bobcat
#

Does that logic run while your sequence's children run?

#

I'm trying to remember something about the rules of abort. There's something related to how the nodes are setup in composite nodes I can't recall now.

obtuse igloo
#

But yeah when it goes false, its not aborting or anything idk why exactly

slow bobcat
#

For example, this is what the blackboar decorator does internally

#

In the end, it's just calling RequestBranchDeactivation

#

I always work in c++ so not sure how to implement abort in BP's

chilly nebula
#

You can easily verify this just by printing out a string in InitState or task Tick and writing out a string set in the task.

cerulean otter
#

Im still getting to grips with the whole thing and had some faulty assumptions

obtuse igloo
slow bobcat
#

the floor you are using, does it have the flag bCanAffectNavigation set to true?

near condor
slow bobcat
#

hey guys noob question about state trees: we are thinking about setting the value of a Global Param in a state tree (it will point to a behavior tree) from C++ in a component (not the state tree component).
If I have the StateTreeRef of said tree, is there a function to set the param value in it?
Haven't look very hard, but on a simple search I don't see any obvious function to do it.
I would imagine it implies something with the GetMutableGlobalParameters in UStateTreeInstanceData?

modern owl
#

For smart objects, how do you integrate the player into the mix so that if the player wants to say, sit on a bench, he follows the same check for occupancy->claim->approach->play animation flow?

harsh storm
slow bobcat
harsh storm
#

I do not. But I think EQS task does it.

#

I'm at my day job, so can't pop open UE unfortunately.

misty wharf
#

Creating a custom Use Smart Object gameplay task to replace the AI Task based one could make it more convenient

#

I guess temporarily possessing it with an AI Controller for the duration could be an option as well

modern owl
misty wharf
modern owl
#

yea no not that simple im afraid typical third person

misty wharf
#

Right, if you're not using BT-based behaviors in your SO's, it shouldn't be too hard to manually claim and activate the behavior

#

It will require C++ though in case that's a problem

modern owl
#

nope i can do c++ its just the smart object system in particular im unfamiliar with

misty wharf
#

Take a look at the AITask for it, it's called something like AITask_UseGameplayBehaviorSmartObject

#

It should contain the logic to claim the SO, and to get the GB from it. Unless I completely misremember, this logic shouldn't require an AI controller

stoic pier
#

I have a sight sense set up which works fine for detection and when the player moves away Stimulus.WasSuccessfullySensed() triggers as false which is what I want. If the player just stands in place and the AI walks past the detection starts but end detection never triggers

misty wharf
stoic pier
#

found this on the forums, seems max age doesn't count down if “auto success range from last seen location” is set, changed this to -1 and works as expected

misty wharf
#

Ah, yeah I never used those myself, I've also heard the forget related settings can be kinda hard to correctly configure

open onyx
# open onyx 1. The tag thing became a red herring, apologies. I mentioned typos to assure I ...

From my earlier post, I figured out the issue. I was putting some tasks into the "Combat" state, which had child states, but critically, none were enabled. Because of this, the Combat state is never entered even though the transition event registers (maybe a safety valve of sorts since Combat itself, has no transitions or (enabled) children, it just nopes back to root?) In any case, if the tree looks like the attached, no transition happens. If I take the Debug Text / Delay tasks and put them into an Enabled child state, the transition works.

obtuse igloo
#

Hi guys! I'm kind of in the need of some guidance on how I'd go about having an AI climb when they reach this Nav Link that I have on my wall with a custom trace channel, "Climbable".

Currently I've made it so that when the AI reaches the link, the AI's movement mode is set to fly and will trace the wall up until it gets to the top of the climbable wall and can no longer climb. I've been going off of this Gorka tutorial > https://www.youtube.com/watch?v=F_g_AnDyWi8&list=PLiSlOaRBfgkcPAhYpGps16PT_9f28amXi&index=31

I was wondering if there'd be a better way to do this somehow! Please let me know! 😊 (For reference, I'm trying to get the AI to run simple obstacle courses with swimming, climbing, and running, like in Chao Garden races)

Hello guys, in this quick and simple tutorial we are going to continue with my UE5 RPG Tutorial Series in Unreal Engine 5!
↪️Just opened my Discord Server, join NOW: https://bit.ly/GorkaGamesYouTubeDiscordServer

➡️Whole Series: https://www.youtube.com/watch?v=FNTyIWkv5k8&list=PLiSlOaRBfgkcPAhYpGps16PT_9f28amXi

👉Awesome Unreal Engine...

▶ Play video
iron zephyr
#

Hello, does anybody know how to access the currently active states in a StateTree. Ive tried some things but none of them gave me a representation of the active States. Maybe it is possible to use the Visual Debugger via cpp to get those values since it displays them, but i could not find any functions or info in the documentation.

misty wharf
wise sluice
# iron zephyr Hello, does anybody know how to access the currently active states in a StateTre...

If you need the currently active state in code from anywhere
You can implement this function in StateTreeComponent (or a custom child of this class)
⚠️ I coded that in 5.4, not sure it still the same in 5.5/5.6

    TStringBuilder<256> stringBuilder;
    
    if (StateTreeRef.IsValid())
    {
        const FStateTreeExecutionContext& stateTreeExecutionContext = FStateTreeExecutionContext(*GetOwner(), *StateTreeRef.GetStateTree(), InstanceData);
        for (const FName& stateName : stateTreeExecutionContext.GetActiveStateNames())
        {
            stringBuilder.Appendf(TEXT("[%s]"), *stateName.ToString());
        }
    }  
wise sluice
#

Apart from that
I'm currently playing with SmartObject + Gameplay Interaction StateTree
Anyone can confirm that in 5.5, the StateTree calling "Use SmartObject" and the SmartObject StateTree still run in parallel ?

It seems to work differently from LinkedAsset which is running the StateTree calling the "LinkedAsset state" and kind of inject the StateTree asset within it (Another point is that it is hard to debug for now)
I guess it's because it's two different systems and they were developed at different time frames.

I noticed that if i send a StateTree Event to the AI, it will receive it in the main StateTree but not in the SmartObject one 😔

iron zephyr
wise sluice
#

But yeah the code that i shared should be sufficient for now

misty wharf
# wise sluice Apart from that I'm currently playing with SmartObject + Gameplay Interaction St...

I vaguely recall it might run separate, ST's have the capability to do that much more easily than BT's (which was one of the big problems I had with BT-based SO tasks, it can't even resume the previous BT from where it left off) - easiest way to find out for sure would be to look at the GameplayInteraction Smart Object Behavior's code, it should be fairly obvious if it executes the ST there

slow bobcat
#

quick question about State Tree Event's payload: am I supposed to be able to retrieve the payload somewhere?
Let's say I send an Event with a Payload.
That Event triggers a transition to a State with a condition.
I would like to grab said payload to check something in the condition
And if the condition passes, I want to use the rest of the payload data in the Task run by the State.

Is that possible?

#

I'm seeing functions like

    void SetCollectExternalDataCallback(const FOnCollectStateTreeExternalData& Callback);```

and since the Payload is a ConstStructView...
```const FConstStructView Payload```

Is that how you catch the payload of an event?
#

I'm always super confused about how the Struct stuff works for State Trees. Any good documentation/examples anywhere to understand how is this used? It's completely Alien to me

iron zephyr
iron zephyr
wise sluice
wise sluice
#

Event Payload struct? PropertyBinding? StateTreeTask InstanceData (which can be a struct or an UObject depending your needs 👀)?

slow bobcat
# wise sluice What do you mean the struct stuff?

What I mean is: the whole State Tree system is built on top of the StructUtils: InstancedStruct (and the containers), PropertyBag, StructArrayViews and some other related code.
I have no idea how any of that works. While I can map the whole State Tree System and do complicated stuff, I fail to understand its core technology when I hit that wall.
I need some proper teaching about how the Struct Utils things work.

#

But my most immediate problem is to understand how to retrieve and handle passed payloads in an Event

slow bobcat
summer hazel
#

Hello, in the behavior tree when I use a blackboard based condition which is an enum, when I choose for example "State A" and "Not equal" does that mean the task will activate only when this enum isn't equal to state A ?

summer hazel
wise sluice
slow bobcat
wise sluice
slow bobcat
#

I guess somewhere here?

wise sluice
#

So your entire StateTree is in c++?

slow bobcat
#

no, but: state tree component, conditions, tasks and some other stuff is. Designers compose them using the UI like anybody else, but we handle most of the stuff in c++. It's rare we have to use anything but our custom stuff

near condor
summer hazel
#

hey guys, do people usually use the level blueprint to spawn actors when needed or create a seperate actor spawning blueprint?

slow bobcat
# near condor Here is an example of what I have going on that is what Siggi linked to

I see you are doing it from within a node (a task/condition) and that you are able to grab the property ref.
But what if I'm doing this outside a tree?
I'm in a component, I have the statetree ref and I want to change a global param in it.
How would I proceed?
We're trying something like this

if (stateTree)
{
    FInstancedPropertyBag& InstancedPropertyBag = stateTree->GetMutableParameters();
    FStructView PropertyBagView = InstancedPropertyBag.GetMutableValue();
    const UPropertyBag* PropertyBag = InstancedPropertyBag.GetPropertyBagStruct();
    if (PropertyBagView.IsValid() && PropertyBag)
    {
        if (const FPropertyBagPropertyDesc* PropertyBagDesc = PropertyBag->FindPropertyDescByName(FName("InputTree")))
        {
            if (const FProperty* TargetProperty = PropertyBag->FindPropertyByName(PropertyBagDesc->Name))
            {
                void* TargetPtr = TargetProperty->ContainerPtrToValuePtr<void>(PropertyBagView.GetMemory());
                TargetProperty->CopyCompleteValue(TargetPtr, feInstanceData.InitialActionBehaviorTree);

                stateTree->SetPropertyOverridden(PropertyBagDesc->ID, true);
            }
        }
    }
}```

But I have the feeling that we should be getting the property bag from the instance data or a on-the-go context like this
```FStateTreeInstanceData& treeInstanceData = ownerStateTreeComponent->StateTreeInstanceDataMap.FindOrAdd(stateTree->GetStateTree());
    const FStateTreeExecutionContext context(*GetOwner(), *stateTree->GetStateTree(), treeInstanceData);
celest python
#

oh well just saw your last message, appearently you're already ahead

near condor
# slow bobcat I see you are doing it from within a node (a task/condition) and that you are ab...

Back before the property references were a thing, I believe I tried something similar with c++ functions, and was finding it unreliable/cumbersome to try to modify that stuff externally (Though, part of that could have been from juggling a pooling tool at the same time). If I were to try to do what you are attempting now, I feel like I would try to go about it the same way one would go about modify widgets.

So I do not over explain, are you familiar with "Widget Controllers" as a concept?

slow bobcat
slow bobcat
celest python
near condor
# slow bobcat Widget controllers: not sure what you mean. Are you suggesting some form of AI t...

No, I imagine another name for them exists as the name "Widget Controller" sounds like an actual npc/player controller, but they are not. They are more like a middle man object that exists to hold variables and broadcast changes out for listeners on Widgets (so widgets don't need to hold the logic of how to get all the data it needs to display).

So what I am proposing is for an object to be spawned that is just a default, no mesh object, to serve as the "Controller", and have a global task that listens for stuff broadcast out from the "Controller", then apply the changes to the State Tree Properties/Parameters.

slow bobcat
slow bobcat
near condor
#

no worries, I trust ya. Was a shot in the dark without game context

slow bobcat
#

the worst part is that I'm sure that knowledge has been discussed and solved here already, but I can't find it

harsh storm
near condor
#

idk about that, pretty heavy components are added/updated each Unreal Version as of the last few (at least in my opinion). So new stuff is added constantly. Despite that, I am still sticking with State Trees, I find them far easier to work with than behavior trees for my use-case.

slow bobcat
slow bobcat
#

I feel like the first time I looked at c++ looking at PropertyBag.h/cpp

harsh storm
#

@slow bobcat Have you gotten to the capabilities talk (from Hazelight) in your GDC backlog yet?

slow bobcat
celest python
harsh storm
#

Funny - I heard the opposite from former Hazelight devs who work with GAS now.

slow bobcat