#gameplay-ai

1 messages · Page 75 of 1

deft palm
#

Thank you very much

feral bluff
#

thank you very much, this will give me food for thought. can you tell me in what format exactly should the EQS be used? Search for the end point of the path or should it work somehow differently? I tried to search for some articles on this topic but did not find anything suitable

maybe you can also suggest some effective way to set up avoidance for AI so that they don't get stuck in each other?

chilly nebula
feral bluff
deft palm
#

hi Siggi, I think it could compile

#

I skipped the module of "GameplayStateTreeModule" so there was an error

chilly nebula
#

ok I was just able to make a subclass just fine, I think you are missing a header

deft palm
chilly nebula
#

Its important to include both "AIModule" and "GameplayStateTreeModule" in your .Build.cs file

deft palm
#

Yeah I included AIModule

chilly nebula
#

I first did it manually, by including this in my header:
#include "Components/StateTreeAIComponent.h"

#

Only two changes I did to my clean project:

  • Added the GameplayStateTree plugion
  • Added to PublicDependencyModuleNames in my .Build.cs: GameplayStateTreeModule", "AIModule"
#

If you are not seeing the components after that, then perhaps you are on an older version of Rider or you are not using the .uproject support and forgot to generate project files?

#

Did you open the .sln or .uproject in Rider?

chilly nebula
deft palm
chilly nebula
#

what version of Unreal are you using? Just eliminating whats different here

deft palm
#

5.5

#

JetBrains Rider 2024.3.6

chilly nebula
#

same as me then

deft palm
#

Okay Thank you very much

#

I will create my project from scratch see what is going wrong

chilly nebula
#

not sure what to tell you, it worked with very minimal project setup here?

What happens when you add a new class with actor base class and change it? does it compile?

#

this is from my Build.cs:
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "EnhancedInput", "GameplayStateTreeModule", "AIModule" });

deft palm
#

Okay

chilly nebula
#

This is what the top of my header file for a new class looks like:

`#include "CoreMinimal.h"
#include "Components/StateTreeAIComponent.h"
#include "MyTreeClass.generated.h"

UCLASS()
class STATETREETESTS55_API UMyTreeClass : public UStateTreeAIComponent `

#

compiles just fine

deft palm
#

yeah I can find the statetreecomponent in my rider too

#

using your configuration

#

quite weird

deft palm
#

Hi Siggi, I found the solution I had to include the header of the classes in a cpp file compile it

#

then I can find it in the Rider's "add unreal class"

chilly nebula
#

ok then its a Rider bug 🙂 glad you found a solution

deft palm
#

Thank you very much

#

Thank you very much Bruno

misty wharf
#

I never even use that function in Rider, it requires so much clicking around

#

Easier to just pick actor or one of the uobject bases it offers immediately, and change the class the boilerplate inherits from :D

slow bobcat
#

I'm very curious abut this image. What's this about?

deft palm
#

This is the header file’s path

slow bobcat
#

Aaah OK just read you use Apple. now I understand what I'm seeing

slow bobcat
#

I though there was some misery command line tool in rider to list dependencies or something like that. Just realized you are simply listing files in a directory Unix style

rugged garnet
#

Why does GetAIPerceptionComponent() return null in StateTreeCondition, but not null in BPTick?

#

The result is the same even if I use GetComponentByClass().

slow bobcat
rugged garnet
#

I wrote a function in the library that gets the component instead.

tribal lintel
#

Thinking about a bad idea. I wanted to use an classification model to decide rather a player run up/across a wall.

dim pier
#

I see there's talk about StateTrees and I've been reading articles that were complaining about them(maybe old), so I'm curious what are people's thoughts on them... are they stable and production ready?

slow bobcat
dim pier
#

never mind I found some

lusty egret
#

Hey, I was wondering why the Sequence doesn't abort the task when the value change. (Aborts self is activated and the parameter is an object that is required to be set)

Here a small image:

#

It keep running in this loop and doesn't exit even if the value is at None (fail)

If someone did encounter this, it would be really helpful, thank you ❤️

lusty egret
#

Problem solve!

#

(for people who are curious) It is the sequencer not reading the new state of the Blackboard and being stuck in a task. Launching a finish task in the task being stuck solve the issue!

wise granite
#

Hi guys! I've run into an issue with navigation and was wondering if anyone has faced something similar or knows how to fix it.I'm the creator of the Layered Fog of War plugin, and I'm trying to make pathfinding take the fog state into account. Nothing too complicated in theory! Here's what I've done so far:

  • Overridden ARecastNavMesh and RecreateDefaultFilter to replace the default query classes with mine, FFOWNavigationQueryFilter and UFOW_RecastQueryFilter
  • Overridden of the FNavigationQueryFilter
  • Overridden of FRecastQueryFilter, and getVirtualCost to invalidate polygons based on the fog state.
  • Overridden of UNavFilter_AIControllerDefault, add variable to filter the fog state

I've then changed the RecastNavMesh used in the ProjectSettings by mine and then tried the setup.
The result is that it partially works

  • without the CrowdManager path is found and the agent get along it
  • with the CrowdManager the agent initially follows the correct path but then reroutes itself and moves through the fog, which should be non-navigable.

I've tried to debug it but the Visual logger never shows a repath, and the initial path correctly avoids the fog. I also checked the code, and the filter used by the crowd manager seems to be the FNavigationQueryFilter and not my override FFOWNavigationQueryFilter

deft palm
#

Hi guys, I try to use statetreeaicomponent, but the state tree exit with information like the selected lines

#

How can I set the ReferenceActor of a statetreeaicomponent?

lofty ember
deft palm
bleak drift
#

What happens when calling StopLogic on a State Tree?
Because the tree is still effecting the Character afterwards somehow.

deft palm
#

so it actually does not affect anything

bleak drift
bleak drift
#

As soon as the Walk to node is activated, the stuttering/rubberbanding starts.

#

Looking at the debug view, I even see the State tree stopping, the only thing I wonder, why there are 9 simultaneous executeion all of a sudden, while there is only one state tree running.

misty wharf
#

Didn't follow the convo but it sounds like you might be entering the moveto task over and over again if it stutters

#

Eg. the reason it stutters is because it starts trying to path to it, path to it, path to it...

lofty ember
bleak drift
misty wharf
#

🤔 yeah in that case I suppose not

#

I would check in visual logger what is going on with the movement

#

it usually contains more info on movement and pathfinding

bleak drift
misty wharf
#

Tools->Debug->Visual logger or something along those lines

bleak drift
#

the weird thing, if I'm running it locally it works fine, but as client it stutters.

bleak drift
#

I mean it maybe has something to do with the max walk speed task, if I skip that, it works, but not sure how this can have any effect.

rugged garnet
#

How to make the global task of the state tree run only in the substate? It's like the service for behavior tree.

rugged garnet
#

I found that I could solve this problem with a task that runs repeatedly.

low kayak
#

can anyone tell me about what eqs produce in outputs ?like only positions of valid items?

slow bobcat
low kayak
#

if i run the eqs in behaviour tree then what will it return ??

harsh storm
#

The same thing that Bruno said

#

Where you run it doesn't change what gets returned.

keen crow
#

given some location, is it possible to check in cpp if it is inside of some specific nav area modifier volume?

slow bobcat
#

If you don't have pointers to the volumes, you could do what I do:

  • create your own extension of the nav system
  • override On Navigation Bounds Added and On Navigation Bounds Removed and add/remove volumes from your collection.
  • I have said collection within a subsystem class that also has other functionality related to nav volumes
#

If you do that, make sure your World settings Navigation setup points to your Nav System Children and re-generate navigation if you use static or Dynamic with Modifiers

keen crow
normal seal
#

so this is where all the nerds reside eh

#

this channel reminds me of the deep sea spongebob eposide

#

where there are diffirent dark creatures exist

dim pier
#

wouldn't the cpp section be more fitting for this description?

normal seal
#

ask cup guy

dim pier
#

fair enough, I haven't been around here for too long and haven't found the ai stuff to be too difficult so far

normal seal
#

u still in the surface sir

#

where life is happy and colorful

dim pier
normal seal
#

I am glad to hear

dim pier
#

I've just recently discovered state trees which I plan to use for 50(?) ai characters as I've heard that state trees are more performant and easier to understand than behavior trees

#

but involve more work

normal seal
#

i dont use either

#

i use bp or mass

#

BT ig are garbage

#

state trees seems promising but i cant say yet

harsh storm
queen venture
#

Does anyone know how to restart a State Tree properly? I get to the end of my tasks and I made a task that uses the AIController reference to Restart Logic from the Task itself. It seems to start another state but then immediately stops and the tree no longer runs.

normal seal
#

on mobile 150 actors with CMC so heavy

dim pier
#

↑ I would like to know as well, if CMC is going to be the bottleneck, what can/should I do about it?

queen venture
#

They're making a CMC replacement AFAIK called Mover. Not sure if that will handle any of the issues you are facing or not though

dim pier
#

looks like it was introduced in 5.4

queen venture
harsh storm
harsh storm
queen venture
#

Yea Mover is quite new and I believe experimental, but hopefully over time it will become the standard and surpass CMC in performance. I really like the physics stuff that seems to work on it.

normal seal
normal seal
harsh storm
#

Because CMC is old as hell and they want to introduce more modularity most likely.

#

Time will tell how it turns out.

#

CMC is a necessary beast.

normal seal
#

ahh yeah typical epic, introduce new features

#

make it heavy and slow, after few years before it matures and become stable

#

rerlease new unstable repalcement

#

then repeat cycle

#

so angering

#

epic ruins gaming repuation, now when people hear a game is made with ue5, they panic. an unrecoverable damage to its repuation sadly

#

i removed epic ue5 logo from my game so they wont know y game made with a stuttery mess of engine

harsh storm
#

That's just fear mongering.

normal seal
#

yes, but people dont know

#

they see bad games made with ue5 and their brains adapt to the feeling that ue5 games are bad by nature

#

u cant change their miind, they are not tech savy or willing to spend time

harsh storm
normal seal
#

my friend when know my game with ue5 said wont buy

#

i was so sad

#

why duroxxiagr this is happenig why!!!

normal seal
harsh storm
#

This doomerism talk is not necessary.

dim pier
dense owl
slow bobcat
#

In case anyone wants info about mover, some comparisons vs CMC here
https://youtu.be/P4IKS5k47Wg

The recently released Mover plugin is an experimental tool supporting movement of actors with rollback networking. In this session, we will discuss its high-level concepts, compare it with CharacterMovementComponent, take a look at what's running under the hood, and see what's planned for future development. Please note the README documentation...

▶ Play video
keen crow
slow bobcat
#

I was referign to the later

keen crow
#

oh, then we misunderstood each other, because I was specifically interested in detecting whether some location is affected by some nav area

slow bobcat
slow bobcat
# normal seal u are wrong.

no I'm not. I have been through that. You are forced by the EULA to acknowledge, which is usually by showing the logo. I know some games that reached an agreement with Epic to not show the logo in their splash screens but that costed them money + adding a bunch of stuff in the start section of their credits (I believe games made by Sony with Unreal do something like this, like Astro Bot and Sackboy ps5). You also can't change their logo unless you get authorization (Rime from Tequila Games has a custom one for example). There are other ways to acknowledge them aside the initial splash screen logo, but they need to be approved.
Of course you can ignore all that, but you might face problems if Epic realized it and wants to take action (there are legal precedents)
Some info here (btw, I'm not the Bruno in that thread)
https://forums.unrealengine.com/t/is-it-a-requirement-for-all-unreal-engine-games-to-display-the-logo/126426/6

Epic Developer Community Forums

There is a Trademark Usage Agreement that you need to sign (it is a pdf which you will fill the missing data and send back) and you will be pointed out where to find the logos, pictures and rules for colors etc. Just send an e-mail to lauren.willoughby@epicgames.com and you will get the info!

#

sorry everyone from poluting the AI channel with unrelated topics

normal seal
#

by the time my game gets big, i hope the repuation of this engine to get restored back then i will look into putting the splash sceen back into my game

#

thanks for the information

feral bluff
#

so, I need to make characters move in a formation. I plan to use a custom subsystem to store information about the formation structure (what units are in it, who is the leader, etc.). Then, in the behavior tree, when moving, the leader of the formation will, using a custom service, periodically generate coordinates of the formation relative to the leader and, using the subsystem, distribute these coordinates between the characters. Accordingly, in this way, everyone except the leader will periodically adjust their location so as not to break the formation. How correct do you think this solution is and can you recommend anything else?

queen venture
#

So I've tracked down an issue with my State Tree building up lag over time due to using Event Tick on one of my global state tree tasks. The task is used to update some global variables as well as check some conditions which the AI needs to know on tick basically. Is there a better way to do this or can I at least slow down the tick rate somewhere?

#

Hmm I found where I can turn down the tick rate of the entire State Tree. I guess I'll try to build in something for the global task itself perhaps.

slow bobcat
queen venture
#

That's just one example

slow bobcat
#

I do the same, but it's an event driven thing: upon being attacked, a g.tag is assigned to the attacked AI. If the tag is present, we do X thing. When the attack finishes, tag is gone.

queen venture
#

Right, but there is no state to say "i've been attacked now block" it's more of is this attacker doing anything now? How about now?

slow bobcat
#

We use to have checks on tick like you for many things, but it was not feasible performance wise in the long term, so we turned everything event driven

queen venture
#

And it's also distance based, so is this attack close enough to be blocked? Ok then use block

slow bobcat
slow bobcat
#

Souls likes

queen venture
#

I am also using gas to trigger things as well, I'm just not sure how to tell the AI that the attacker who they are locked on to is close enough and doing A, B, C attack without just checking from a global task

#

Mine's just a multiplayer fighter

slow bobcat
#

Yeah that one might need way more accuracy frame wise

#

Your approach is probably better for your game

queen venture
#

I'm thinking eventually it will just be a tick rate tweak and also make the task a C++ only task if it's running every tick

slow bobcat
queen venture
#

Very annoying right now though in the prototyping phase

slow bobcat
#

Yeah...

queen venture
#

The range is rather ridiculous though, like 4000 units to check sometimes

#

Or 2000 usually

slow bobcat
#

You could have a specific component with its own tick rate for this things

queen venture
#

Yea I might have to just make it happen in its own component but I'm not entirely sure that will change much. The problem might just be trying to do so much on tick while also running AI logic

#

It's weird though when the AI dies and respawns, the framerate subsides

#

I even tried calling a reset after they kill me and it doesn't do the same as the AI dying

#

Hard to track down, but it does appear when I disable the tick task that it doesn't drop framerate over time

#

And it doesn't seem to have a limit either. Appears to be like I will eventually have 2 FPS if I leave it long enough

slow bobcat
#

Time to use insights

#

And track down what's getting more expensive by the minute

hot herald
#

hey guys i need some insight on how you would approach this maybe my head is fried for now haha but i got 3 giant AIs in which it will only get vulnerable once all the protector minions for that giant are dead. i got the titan and minions behavior done, any suggestions on how should i link both of them up to ensure that only giant "A" will get vulnerable once the minions for this giant are dead? I will have a total of 3 giants in my map

quiet iron
#

Anyone got this problem while playing built version? I create a custom service using instance node memory, I also implement get memory size correctly, it work perfect on editor but have trouble on build.

slow bobcat
slow bobcat
quiet iron
#

I figured it out, it took a whole bunch of time to debug this. Apparently, even though the memory struct is not public, if you have 2 private structs with the same names, the sizeof(StructName) will went wrong.

#

I just renamed the struct with my own project prefix so it looks different.

hot herald
slow bobcat
hot herald
slow bobcat
# hot herald any suggestions on how should i make my giant know about my minions tho?

there are many ways.
It could be your giant the one spawning the minions and the registering would happen at that moment.
It could be the minions spawn on their own and they have a property/data/component/g.tag that marks them as "protectors of boss"and they look for a boss in the map and register themselves to its TArray<Minion> collection.
It could be you have spawners for those minions on the level and you giant spawner is linked to them
It could be that the giant spawns the last and, upon spawning, it searches for minions to register to their death events (with an EQS for example)

#

many ways. Up to you which one is best for your system. Probably one I haven't listed

steel wagon
#

is State tree breakpoint system bugged? I place break points but they never get hit.

#

Like the AI never stops as if I have placed zero breakpoints

misty wharf
# steel wagon is State tree breakpoint system bugged? I place break points but they never get ...

I don't remember for sure but at least with BT's, the debugger won't always work unless you select the actor / bt owner you want to debug with. It has a selector for it in the top menu bar, I'd assume the ST editor has that too, so I'd check that first.

If that doesn't help/exist, try enabling the ST debugger from the menu in the ST editor, perhaps that's required to be on for the breakpoints to hit

hot herald
forest tundra
#

AIPerception sees me through the wall even though I have collision block

steel wagon
steel wagon
forest tundra
#

sure

slow bobcat
#

maybe they are not using the right physics profile?

steel wagon
feral bluff
#

as far as I understand, the standard "DetourCrowdAIController" prompts the agent to go around the obstacle. I need more of a behavior like it works in StarCraft 2 - the unit should push away the obstacle. Can you advise something about this?

misty wharf
#

I think the simplest way to do that would probably be to allow your agent to overlap, and apply a pushing force to things you're overlapping with

feral bluff
misty wharf
#

I don't see why not. They would probably cancel it out

slow bobcat
#

and then you can parametrize that a bit to have a bigger push/detection radius and some other stuff

feral bluff
slow bobcat
#

that's the best I got. Haven't used in the past 2 projects so.. I'm a bit outdated

#

@chilly nebula sorry to tag you, but this is another black hole in Unreal's AI: almost no documentation, almost no examples and lots of mysticism around

quartz forum
#

Why when I use RunBehaviorTree multiple times on the same AI, it creates multiple instances of BT Task ?

feral bluff
#

basically you just specify which BT to use

quartz forum
#

When i run twice the same BT, it does create multiple instances of tasks

sterile tide
#

Hi! I'm starting to work on AI (no prior experience with it tbh), and I was defaulting to using Behavior Trees. But then I just discovered about this new State Tree thing. I've searched a bit, but the pros/cons of each are still a bit unclear to me.

My logic is generally pretty simple and mostly boils down to a priority list. BTs seem to handle this extremely well right off the bat. I might just be misunderstanding how they work, but this kind of logic seems much harder to handle using ST?

I'm mostly concerned about reusability, as I'm expecting dozens of different enemy types, which will require custom AI. They will be mostly similar, but require unique logic as each will use different skills and such. I could work on a monolithic generic AI that can handle every enemy I guess, but I'd really like to be able to add unique features and do custom tweaks here and there, so I'm not hot on the idea. I'd like to iterate fast though, so working from scratch every time would also suck.

I'd really appreciate any suggestions, thank you!

slow bobcat
slow bobcat
#

There's no better or worse outside your specific context and reality

#

The reusability problem exists in both and both are solved by your approach. The more data driven the better. Don't have Attack for enemy A and atraco for enemy B. Have a node Attack that call the attack function on your AI, being it's implementation different on each Ai. Same st/bt, different usages

#

If you use that concept with subtrees (bt:s or st's) and you read what to run from a data asset, you will have even more flexibility

chilly nebula
queen venture
dim pier
#

just learned how important "Categories" are, thought they were just for convenience

slow bobcat
dim pier
#

I can't seem to be able to pass a character reference from a global task that uses ai perception to another task... the global task works as I can retrieve the character after setting it
but in the chase task, it's blank

fiery hemlock
#

Wouldn't it be useful to have a settable Tag in AIPerceptionStimuliSource when registering sources for senses? Stimulus has a prepared Sensed Stimulus Tag member for this, but unfortunately, this seems to be only usable in conjunction with Report Noise. This looks kind of inconsistent to me.

dim pier
#

I sort of got it to work by storing the actor reference in the character bp but that feels wrong

feral bluff
#

returning to the movement in the formation. Using the ECS turned out to be ineffective. I am now doing this through the subsystem in the Tick Event, the photo shows two methods that are called.

It works better already, but I suspect that this is also not a very effective solution. How adequate do you think this solution is and how can it be improved?

#

Ideally, of course, you would redefine the navigation logic itself to adjust the movement vector at runtime, but I'm not sure how difficult it would be to do this since this is quite low-level logic.

keen crow
feral bluff
final prism
#

What's the typical way to save/load behaviour tree/state tree state? 🤔

misty wharf
#

Someone was here at one point claiming you can just straight up serialize/deserialize a BT component, but I never got that working. Haven't tried with StateTrees.

final prism
#

I guess the question is if that's even intended, or if the answer is "dont do that, just restore that data in the blackboard and hope it starts back up in the same state"

misty wharf
#

It's kinda hard to say tbh. It seems like any non-trivial AI would not be able to go into the previous state purely from BB or other readable state, or to do so, it would require an incredible amount of extra decorators to ensure it does so

chilly nebula
misty wharf
#

Ah good, I was thinking about pinging Siggi about that question on saving/loading BT and ST state :D

#

Siggi, would you happen to have any insights on that question from Moritz?

chilly nebula
#

State Tree only keeps parameters in memory that are on the active state path, so global parameters and parameters/output params on all active states including the root.

I'm actually not sure what the best approach would be here, but I'll ask around... its a good question!

misty wharf
#

Nice, thanks :)

#

In one of my projects the solution was to just... not allow saving while NPC's were present lol... I do have another one where it just resets the tree and the AI figures it out from there, but in that one the logic was a lot simpler.

chilly nebula
#

I see that FStateTreeReference can be serialized, and we now have a method on the state tree component to set the ST reference directly. So that might be one approach.. nope! This is only the asset ref + values for the exposed parameters.

I'm checking if I can get you a better answer

misty wharf
#

One thing I like about FlowGraph is that it's been designed with this in mind, so it slots in quite well into situations where you want to save the graph execution state. Each node can have its own save/load logic quite easily. I could see that being a slight issue with BT and ST since I don't think the nodes have functions that you could override to deal with loading their state or such

slow bobcat
#

I do this because we run trees independently and we can come back to them. We need to restore the previous state of the tree in combat situations, specially for utility-related nodes

misty wharf
#

Interesting, I'll have to keep that in mind :)

#

I think my BT design in cases where it's been particularly problematic isn't the best, but more pressing issues than redoing the whole thing :D

chilly nebula
#

Ok, there is no easy way to wholesale serialize a ST, sorry 🙂 I recommend an approach similar as people have replied above, to set your AI up in a way that it can be restarted and will be able to pick things up again.
You can always manually serialize anything you do want to store, like a target being chased, save it and push back into a re-initialized tree.

If you really want to explore serialization, you can get part of the way there by looking at what is in FStateTreeInstanceStorage.. but things like state of tasks being executed or transitions in motions are tricky.

final prism
#

Yeah thought that would be the case, good to know thanks

quartz forum
slow bobcat
quartz forum
slow bobcat
#

AI's in unreal can only run one BT at a time

#

Wait... calling run will call Stop on the tree, which I believe is also cleans the instances too. I would need to check

#

If you want to keep instances around, you need to use sub-trees

quartz forum
#

Only one BT is run at the time, but when i call back an already used behavior, I can see I have multiple instances of its tasks

#

I want to delete thoses instances, it is wasting memory

slow bobcat
#

Well the best way would be starting by making your nodes Not Instanced (only possible in c++)

#

The second thing is that, when calling stop, the tree component will clear the BT instances array and, with them, all their memories and the Known Instances. You shouldn't have any node instances alive at all

#

without checking the code is difficult to say but, seeing you are running trees independently, you should make your nodes not instanced and rely on their memory to store values while they run

quartz forum
#

I clicked several times on the ground to move the character, and have multiples instances of BT's tasks

#

I have a BT for each behavior

slow bobcat
#

Do you have access to c++ or do you use it? I'm not 100% sure if that list is representative of the currently alive instances of the task

quartz forum
#

I am working with c++ and BP

#

the instances represents the number of times I clicked on the ground (except the first BTT_MoveToLocation_C_0)

slow bobcat
#

ok, then you can set a breakpoint in your task tick and see if it stops several times and check if the pointer is the same (only one instance alive) or different ones (one per instance alive)

#

yeah but that doesn't mean all those instances are actually alive and in memory

#

It might be the case, but I'm not sure

quartz forum
#

thank you for your help i ll come back later

sterile tide
#

Is there some way to get BT's "abort lower priority" logic in a State Tree? Or do I have to setup transitions everywhere?
As in "if low on health, stop what you're doing and heal yourself". Is placing transitions everywhere the only way to handle this?

rancid mural
#

Any recommendations for learning State Trees, ideally something that's either up to date from beginning to end with 5.5's improvements or at least has followups that go into changes/improvements?

harsh storm
#

It at least saves you from having to manually place a transition on so many things.

harsh storm
slow bobcat
harsh storm
#

Then you just experiment from there.

rancid mural
#

👍

harsh storm
#

And 5.6 is going to bring even more changes

rancid mural
#

I was mostly hoping there was some amazing breakdown out there to help me minimize the 'wonder why something doesn't work, poke it for hours, finally come here and someone tells me actually that's just kinda screwed up at the moment' cycle.

I saw this when I was looking into pros and cons of State Trees and it made me a little gunshy, especially since the update note near the top doesn't really elaborate on what's improved or solved compared to when it was written.
https://jeanpaulsoftware.com/2024/08/13/state-tree-hell/

harsh storm
#

You can probably search this chat for mine, Bruno's, zomg's, and others feedback to Siggi on issues with the ST in its current form. It was only a week or two ago.

#

Really the big issues are:

  1. Doing async stuff is frustrating. IE - multiple tasks on one state.
  2. Data flow - how to pass data around the ST overall. As well as from outside sources, this includes reactionary things. And also if task B depends on data from task A but task A is an async action (ties in with point 1)
#

And I know Bruno brought up some stuff with the debugger for it as well. Just don't recall.

#

However, Siggi has told us that a lot the stuff we brought up was already on their radar and there are some changes coming in 5.6

#

So, we'll see.

sterile tide
harsh storm
#

As a heads up - they do plan on deprecating BT in the future.

#

Most likely sometime around UE6 or during UE6's lifetime.

sterile tide
#

Wow, straight up deprecating it? 😮

harsh storm
#

Yeah. Hurt my heart as I really like the BT, but it is what it is.

#

ST is the future.

#

Of course that info may not matter for you. As your game may get released long before it even happens.

sterile tide
#

Yeah, thats a shame! It probably wont affect me directly, but its good to know

slow bobcat
harsh storm
slow bobcat
#

Seems unreasonable to deprecated something that works and is super well documented and standard in the industry

harsh storm
#

#gameplay-ai message

will keep existing until last dying breath of BT in Unreal (so roughly until UE6).

#

I did a PR to get rid of the blackboard wait task because of the changes they made where all the tasks can accept a BB key now.

slow bobcat
#

No no, there's no depreciation there! Just dying! LALALALA I HEAR NOTHING....

harsh storm
#

Plus, as you know, I do prefer the BT over the ST 😅

quartz forum
fiery hemlock
#

I found an interesting effect: if having small values like 12 degrees for Peripheral Vision Half Angle on the sight config, perception fails, if the stimuli source (exactly in front of the sensing actor) is too near. Doing simple test shows, that at some increased distance, it gets detected.

dusk condor
#

In terms of helping to automate Blueprint creation, are there any GenAI tlools that are

  1. inexpensive
  2. reliable
    and
  3. respect data privacy
ocean wren
#

Unlikely 😉

harsh storm
solid wedge
#

Where is a good practice location to store the data for who is in my party? (Single player rpg) PlayerController or GameMode?

harsh storm
#

SinglePlayer? Doesn't really matter. Pick whichever you prefer.

solid wedge
#

Is playercontroller reliably persistent?

harsh storm
#

Doesn't persist through map changes. Otherwise, yes.

manic steeple
#

Hello. How can I set a blackboard value as a struct? it gives me the option to use a struct in the blackboard but there is no Set Value As Struct function?

solid wedge
#

Game mode does though, so ill use game mode just in case my idea for level management changes.

#

True?

harsh storm
#

No. Not true.

manic steeple
#

wouldn't that typically go in the save game? thats probably where I'd try and put it

#

i am not smart though

harsh storm
#

GameInstance is more common to handle things that need to go from map to map.

#

Or you can use seamless travel

solid wedge
#

Ok ty

harsh storm
#

First time I'm even hearing someone try.

#

So the question is then - why are you trying to use a struct?

manic steeple
#

Its the way I'm storing stuff my NPCs perceive, so I can have a sort of gradual detection

harsh storm
#

It'd be copied to the value and not be a reference though

#

So it's more of a snapshot in time

manic steeple
#

yeah, the code only tells the blackboard once something is fully detected so it can go and do investigation tasks

harsh storm
#

You can retrieve the struct through the controller or pawn as well. As that gets passed to each task.

harsh storm
manic steeple
#

this might be a design flaw, yes. I will try retrieving the struct like you said, thank you.

manic steeple
#

scam

harsh storm
#

<@&213101288538374145> 👆

dim pier
slow bobcat
rancid mural
#

So, for something like an attack, I've stumbled my way to having a task send a gameplay event to the pawn to trigger whichever attack gameplay ability, with a reference to the task stored in the payload which I use to finish task as success or failure within the gameplay ability.

Is this a crazy person approach, and if so, what would be a better way to go about things? I guess I could tell the task to wait for a gameplay tag on the enemy and finish appropriately when it sees that instead of passing the reference, if that's less weird.

ebon shore
#

Hey everyone! I’m not using BT for my AI, and I have the AI moving to the player. But I’m using 2d assets so I want the AI to prioritize the y axis and make sure hes lined up close there, and less close on the x- is there a way to input custom acceptance radii for each float?

loud flame
#

Hello everyone 🙂 I'm looking for a course/tutorial or similar that guide me to implement 3d pathfinding from scratch. Do you know any resource that could help me?

Thank you in advance

midnight scroll
#

I'm not understanding filtering at all. I have a test here that returns 0.f or 1.f based on some conditions. If I test the scores, this is returning correctly at least if I show the scores and their related data set.

But when I set up a filter with a minimum of 0.5 I would expect to only get results for the 1.f entries. But I still have the 0.f entries in my query.

What am I misunderstanding with this?

#

Nevermind. This was my derp. 😄 Wasn't using the filter values.

cyan ivy
#

I've done nothing beyond set down a navmesh and plop in "aimoveto" but my AI seems to want to hug walls and get stuck as a result.
What can i do to get wiser ai?

severe jay
#

What is the general approach to doing a continuous EQS and MoveTo with StateTrees? I've tried a few approaches -- Running the env query as a single task in a state, then running the moveto task in a sibling state, but this results in the AI moving to the location and then running a new query. Ideally for my case, the tasks would run parallel for the same state, so I've tried some hacky workarounds, but none of them seem to work smoothly or reliably

queen venture
#

What is the intended effect of using Enter Conditions in state trees? If I put a couple enter conditions on a leaf state that don't pass, then put a Next State transition on that leaf for completed, failed, and even succeeded, it doesn't seem to continue on down the chain of sibling nodes like I thought it should..

#

I was under the impression that if it fails the enter conditions, it would simply continue on the chain of sibling nodes if the parent was Try Select Children in Order

slow bobcat
slow bobcat
slow bobcat
#

The se way that a running parent will evaluate all its siblings at the same level in parallel

queen venture
slow bobcat
queen venture
#

So it's to fail a parent node then?

#

And all of its children

#

Or at least past a specific node that failed

slow bobcat
#

If a parent state can't enter, its children will not run

#

A sibiling (if any) will be choosen (assuming that's the setup on the evaluated state)

queen venture
#

So basically once it hits a fail node, the rest of the siblings are caput if I understand correctly

#

But the ones before it still run

slow bobcat
queen venture
#

Hmm well what I'm experiencing is that the siblings after a failed sibling no longer run at all

slow bobcat
#
Epic Developer Community Forums

A practical guide to understanding and working with StateTree as it relates to AI. It covers key concepts, terminology, and execution flow for StateTree. This is accomplished while building a basic wildlife AI agent using the new StateTreeAIComponent. https://dev.epicgames.com/community/learning/tutorials/lwnR/unreal-engine-your-first-60-minute...

queen venture
#

I was hoping the enter condition would just mean ok don't run that sibling node, go to the next

queen venture
#

Yea so I'm assuming a bug then.. it's not working that way

#

Hopefully fixed in 5.6

slow bobcat
#

Not a bug

#

You probably have something not properly setup

#

Can we see your St?

queen venture
#

Hmm ok. Well it's not super straight forward then I guess. Yea I will need to resume this with you Monday or next week if you have time and don't mind, had to step out and won't be at my desktop to show pictures. I can describe though, I had 3 enter conditions ANDed together and anytime one failed, the sibling node wouldn't run and it kicked back to root for some reason even though the enter condition node had transitions for failed, succeeded, completed to just go to the next state. I also tried transition on tick but nothing was working.

slow bobcat
#

Are you using the debugger to know what's going on? I would start there

queen venture
#

I have been, but for this issue specifically I did not breakpoint it. I'll try again next week and let you know what I find. Thanks for the help.

cyan ivy
solemn garnet
#

Has anyone had issues in c++ state tree tasks with instance data not resetting. Possibly something to do with a state transitioning to itself

severe jay
# slow bobcat You can try run the eqs in a global task

Unfortunately, that doesn't update the MoveTo task correctly, because I'm trying to get the FVector location result from the query. From the source code, it looks like the StateTree MoveTo task will only track moving goals when using actors

slow bobcat
slow bobcat
# severe jay Unfortunately, that doesn't update the MoveTo task correctly, because I'm trying...

Ah you want re-pathing to a location... Yeah that's not supported by unreal, repathing within an AIMoveTo async task only happens for actors (the path event on goal actor moved triggers it) . The work around is to have a very very simple actor (no components but the scene component, no ticking, no collision) that it's handled by the AI. When your eqs produces a location, se the actor location to it. Your movement task will move towards that actor. It's a more or less common approach in unreal.

severe jay
slow bobcat
#

"common"

slow bobcat
#

The other thing is that, running eqs on tick generally sounds like a bad idea. What's the use case?

solemn garnet
slender cypress
# queen venture Hmm ok. Well it's not super straight forward then I guess. Yea I will need to re...

it kicked back to root for some reason
There's a specific behavior in the StateTree system: if the EnterConditions returns false for all children states of a given parent state, the system is designed to force a transition back to the root state.
If you are seeing the message "Could not trigger completion transition, jump back to root state" in the StateTree debugger, this might be the situation you are encountering.

For example, in the StateTree shown in this image:

  • All state's Selection Behavior is the default: Try Select Children In Order.
  • The Fail_Cond_0 state has EnterConditions where its Test always returns false.
  • The Fail_Cond_1 state also has EnterConditions where its Test always returns false.
#

When this StateTree runs, after Wait_0 is completed, it will transition to Wait_0 again, and this will continue forever.
All but Root and Wait_0 (such as the Wait_1 state) will never be active.
I'm not sure if this exactly matches your situation. Sorry if this isn't relevant to your problem.
( By the way, in the CitySample's StateTree, it does not jump to the root even though all children's EnterConditions fail, so there seems to be some setting for this issue, but I have not yet figured out what it is. )

slender cypress
#

Additionally, there are several other pitfalls associated with EnterConditions.
For example, if a child state's EnterConditions depend on the StateParameter or TaskOutput of a parent state that is not currently active, that EnterCondition check will always fail, regardless of the actual value of the TestCondition function would return. (Strictly speaking, the TestCondition function is not executed. )
In this case, you can see the message "Evaluation forced to false: source data cannot be accessed (e.g. enter conditions trying to access inactive parent state)" in the StateTree debugger.
(https://github.com/EpicGames/UnrealEngine/blob/2d53fcab0066b1f16dd956b227720841cad0f6f7/Engine/Plugins/Runtime/StateTree/Source/StateTreeModule/Private/StateTreeExecutionContext.cpp#L2741 )

Because EnterConditions can have these kinds of pitfalls, I am considering using Tasks to perform the check logic instead of EnterConditions.
For instance, the image shows an example where:

  • If the CheckCooldown Task succeeds, the StateTree transitions to the Log_String state.
  • If it fails, it transitions to the Wait_OnCheckFail Task.
severe jay
queen venture
# slender cypress Additionally, there are several other pitfalls associated with EnterConditions. ...

Wow what a thorough investigation and information, hugely helpful and I will be checking all of this next week when I look at it again. Thank you so much! It probably is one of the conditions you mentioned although the other sibling states are passing properly so maybe it’s the latter case where it uses information from a non active state. Either way, I too decided on using checks in a task instead and it works well so it will just be an investigation for me of why enter conditions aren’t working the way I thought they would.

trim bone
#

Any ideas on what could be making that BT Search and BT Execution Time act like that? I'm not positive what those are, but need to keep that .5 ms spike from happening in our AI^^;

slow bobcat
#

But could be something else. Where was the capture taken from?

trim bone
#

We do have one instance of "Run Dynamic" in that BT, but it shouldn't have been getting hit I don't think... hmmm. When you say "where" are you asking about insight, or the circumstances or?

slow bobcat
#

If it's a Test Build or Development or what

trim bone
#

That was in the editor

slow bobcat
#

Yeah never measure perf in editor. Is nowhere near reality

#

That could be a debug print, a debug draw, a log print, an ensure somewhere....

#

Measure in a test build better

trim bone
#

gotcha, fair enough, may have freaked out too soon on that, but thanks^^

slow bobcat
#

Understandable XD

#

If you compile your own editor etc (form the epic source code) you can always temporarily add cpu text stats in the engine functions to figure out what happens and remove them later

blissful inlet
trim bone
frigid plinth
#

Does anyone know any good resources that tell me how to make a car AI, Not one that follows a spline I want it to randomly drive around all over.

harsh storm
#

That would be no different than non-car ai

trim bone
#

really just the gameplay/rules that you would have to implement, like speed limits, stops, etc.

plucky thunder
plucky thunder
#

does anyone know?

slow bobcat
rugged garnet
#

Why didn't it enter the "middle Range" State?

slender cypress
#

if it works, StateTree Debugger will show Root.Wait0 like this.

#

If this minimal example does not work, the cause is probably something other than the StateTree asset.
For example, you may not have assigned a StateTree asset to the property of the StateTreeAIComponent of the AIController.

#

If this minimal example works, then there is a problem somewhere in your ST_Wildlifeaione2 StateTree asset.
For example, the AIController Class and Context Actor Class in the area surrounded by the pink frame in the image may differ from the classes actually used.

plucky thunder
#

break on enter?

#

just spent5 2 hours trynna get this to work thinkign it was never entering the root lo

finite sedge
#

could someone please help?

I'm making a basic enemy that just walks up to you and attacks you for now. I want to just get the basics out the way first. but I'm also using the gameplay ability system as well and everything works. The enemy comes up to the player and attacks even though my anim montage doesn't seem to be working, but I think that can be something I can fix later. issues I'm having when the enemy attacks: the player does take damage, but my bTT_Attack never exits, and even with a breakpoint, it doesn't fire. I just need someone to tell me what I might have missed. I will post two screenshots, one of the actual ability and the BTTask.

GA_Attack_Punch: https://blueprintue.com/blueprint/i5sgyyq4/

BT_Task_Attack: https://blueprintue.com/blueprint/4h2kuhn3/

finite sedge
#

sorry

thick steeple
#

hi! I'm using a MoveTo node in the Behavior Tree to move to the location where the AI starts but it doesn't seem to be fully moving to that location, it stops at a different previous one. anyone knows why it might be happening?

slow bobcat
thick steeple
#

then how can I fix it? I just have to substract the radius of the capsule to the location or is there a better way to not have to calculate it for every location?

slender cypress
thick steeple
slow bobcat
#

Anyone here that uses custom Nav Areas can help me out figuring if something is a bug I have or something the engine does by default please?
The test is simple: if you drop a nav modifier volume on the level and you set it to use your custom Nav Area, upon generating the nav, how do the flags por the polys withing the nav area look like?
Assume your nav area generates flags in hex 0x200
I was expecting the polys to look 0x01/0x200 -> that is Poly Flag is default, nav area is your custom area
But to me the poly are is showing up as 0x200, which messes up with our logic because we have custom poly flags.
I just noticed this so no idea since when is this happening

This is what happens to me with my custom nav area

slow bobcat
#

and this is how I have my code setup

keen crow
#

Is there a way to "spoil" pathfinding to make it return x-th best path from point a to b? I have a piece of logic where NPCs predict a prefire location (a point to focus on when waiting or moving to enemy instead of focusing on enemy directly) by getting a path from enemy to themselves and the prefire location is the 1st point of the path where nothing blocks visibility for NPCs. However, when a level geometry is complex, most of the NPCs look at the same path, since it is the shortest one, leaving another potential path unwatched. So the only idea i have right now is to instead of making a path from expected enemy location to an NPC, run an EQS to find a point in proximity of the NPC (with some tests) and use a path from enemy to this point from EQS to get a prefire location, but this sounds like a hack to me 🤔

keen crow
slow bobcat
slow bobcat
keen crow
keen crow
#

and then I iterate through path points to find a point that would be a good "look at" location when there's no direct LoS to an enemy

slow bobcat
# keen crow what do you mean by 0x01/0x200? do you mean that you want it to return true for ...

nav flags for a polygons are in contained in 16 bits (uint16). One part is for poly flags, the other is for Area flags.
If you look at the image (or if you enable Show Poly Labels in your recast object while showing the nav in editor) you will see both set shown in hex format.
[0x00 (poly flags) : 0x00 (area flags)]
For default nav area, the flag is always 0x01, meaning you have nad data in that poly.
So the expected (or at least what I expect) is to see [0x01 (there's default nav data) : 0x200 (the poly belongs to a Fire Area)]

In other places, because we do poly manipulation data, we have it right but, as default, the area flag is used everywhere

slow bobcat
#

you could simply temporarily change the are flag of the affected polys to Obstacle (I think they have a super high cost)

final prism
fiery hemlock
# harsh storm Nope. Mieszko said it is being deprecated around UE6

I'm always asking myself whether to start using State Trees vs. BTs, many discussions just lead to some it depends. Now when starting a new project (which may take lot of time to finish), this makes me think again if it would be an option to go for State Trees, also the fact, that there's so much discussion on them - so in long term, looks like it is worth giving them a try? Do you have any reference, where that deprecation has been announced?

harsh storm
#

I linked Mieszko saying it

keen crow
slow bobcat
fiery hemlock
keen crow
slow bobcat
final prism
#

Finding a better way to spread out the found cover points may be easier and still solve the problem, but depends on the game

keen crow
cunning vault
#

Someone played with the GDC Boy and Kite demo on last versions aka from 4.27 to 5.5 and knows why the navmesh seems to don't work even if the invokers are there isn't generating or something strange going on

jagged plover
#

Dumb question: if you're making a door that can open and close and needs to affect navigation via smartlink, should the door actor itself just be a subclass of ANavLinkProxy? Or is it better to have a door actor, and then separately place a nav proxy? The latter feels like more effort to maintain so I'm leaning toward just having the door be a sublcass of ANavLinkProxy but I'm wondering if there's some other downside to that.

#

Okay answering my own question: don't do that because the proxy actor sets itself hidden and turns of its collision so it obviously isn't meant to be used that way, heh.

keen crow
jagged plover
#

Seems the right solution is just to have my own native class that can add smart link components and use that as the parent for my door blueprint.

#

I suppose a ChildActor component on my door with a nav link proxy actor would also work but I fear those stupid things (ChildActor components).

jagged plover
#

Well...actually it seems like nav proxies don't work as child actors in 5.5? If I place them in the world directly they work fine, but any I create via ChildActorComponent don't work. One more reason to hate that stupid component I guess.

#

Seems someone else encountered this as well and maybe it broke in 5.4: https://forums.unrealengine.com/t/navlinkproxy-child-actor-smart-link-in-5-4/1946864

Epic Developer Community Forums

I would like to ask for advice on how to properly implement NPCs passing through doors in a game. The NPC starts at point A and needs to reach point B, but there is a door in the way. The NPC should walk up to the door, open it, and then proceed to point B. I approached this by creating a door actor with embedded logic for animations, character...

slow bobcat
#

We use the component for doors, but without checking I can't remember what are we inheriting from for it.

#

But same use case: doors, bridges etc

torpid juniper
jagged plover
#

That seems to work totally fine.

jagged plover
slow bobcat
keen crow
#

can a montage with root motion throw NPC off the navmesh? 🤔

final prism
#

Does anyone know if there's documentation somewhere on how the pathfollowing works? It seems to have a bunch of cool functionality to detect blocking paths, being off of nav corridors and does proper turning with velocity intact, but I can't find any documentation so its all just trial and error..

slow bobcat
#

a good point to start is the UAITask_MoveTo since it has a path observer and some other stuff.

final prism
#

hmm is the path following able to handle obstacles when it diverges from the calculated path?

misty wharf
#

If the obstacle affects the navmesh (=navmesh is regenerated or such) it should be able to go around it, but if the obstacle doesn't affect the navmesh, I don't think the default system knows how to deal with it

#

I do recall it can detect if it bumps into something or if it's unable to proceed on the required path due to something being in the way, which you could use to implement your own logic to repath

slow bobcat
final prism
#

It's more about it predicting the path, if it's bumping into things while path following doesn't seem super intelligent

#

Yeah I do mean navmesh affecting things, how does it avoid those? Can't seem to find relevant code in the path following other than it modifying the acceleration to move from one segment to the next

wise sluice
#

Hello ! Does 5.5 have a search bar in the StateTree (in the States) ? 👀

slow bobcat
abstract chasm
#

Any idea why is this behavior so jittery at the start? I am using behavior tree with looped move to to random location (Sorry for phone capture)

severe jay
#

Is there any way to expose a pure function to a state tree's property bindings?

keen crow
#

So I have a decorator that has bTickIntervals and bNotifyTick, bNotifyActivation set to true. In OnNodeActivation I call SetNextTickTime to my specific delay time, but for some reason the decorators ::TickNode never gets called (breakpoints never hit). What could I be doing wrong here?

slender cypress
#

For example, here's the code for an FStateTreePropertyFunctionCommonBase derived type to use UAbilitySystemComponent::GetOwnedGameplayTags:

#pragma once

#include "CoreMinimal.h"
#include "StateTreePropertyFunctionBase.h"
#include "RPGSTPF_GetASCOwnedTags.generated.h"

USTRUCT()
struct RPGUD_API FRPGSTPF_GetASCOwnedTags_InstanceData
{
    GENERATED_BODY()

    UPROPERTY(EditAnywhere, Category = Input)
    AActor* ASCOwner = nullptr;

    UPROPERTY(EditAnywhere, Category = Output)
    FGameplayTagContainer Output = FGameplayTagContainer();
};

USTRUCT()
struct RPGUD_API FRPGSTPF_GetASCOwnedTags : public FStateTreePropertyFunctionCommonBase
{
    GENERATED_BODY()

    using FInstanceDataType = FRPGSTPF_GetASCOwnedTags_InstanceData;


    virtual const UStruct* GetInstanceDataType() const override
    {
        return FInstanceDataType::StaticStruct();
    }

    virtual void Execute(FStateTreeExecutionContext& Context) const override;
};
void FRPGSTPF_GetASCOwnedTags::Execute(FStateTreeExecutionContext& Context) const
{
    TRACE_CPUPROFILER_EVENT_SCOPE_STR(__FUNCTION__);

    Super::Execute(Context);

    // OMK2_ASSERT is my assert macro. it is something like ensure() , check() ...
    FInstanceDataType& InstanceData = Context.GetInstanceData(*this);
    OMK2_ASSERT(IsValid(InstanceData.ASCOwner));
    const UAbilitySystemComponent* ASC = UAbilitySystemGlobals::GetAbilitySystemComponentFromActor(InstanceData.ASCOwner);
    OMK2_ASSERT(IsValid(ASC));

    ASC->GetOwnedGameplayTags(InstanceData.Output);
}

This can be used, for example, to bind to FGameplayTagMatchConditionInstanceData::TagContainer.

severe jay
#

That's very helpful, thank you!

slow bobcat
slow bobcat
#

Could it be it ceases to be relevant in the same frame?

keen crow
#

shouldn't be. it has abort mode set to none and those decorators are placed almost at the top of the tree (so not affected by run behavior dynamic nuances)

slow bobcat
#

Double check just in case.
You can set a breakpoint in BecomeRelevant and another in CeaseRelevant.
Add this to the watch list in Visual Studio (works on Rider too changing the syntax a bit) {,,UnrealEditor-Core}::GFrameNumber
And see if they happen in the same frame or on consecutive frames

#

for rider you have to use @ ALREADY PREPROCESSED @{,,UnrealEditor-Core}::GFrameNumber

keen crow
#

ok, i think i fugured it out. it seems decorator won't tick unless their FlowAbortMode is something except None. I have poor understanding of BT's search data, but I guess this might be the place where it is decided whether decorators are going to tick or not

slow bobcat
lament hemlock
#

I am trying to get a door to work with my navmesh using a NavLinkProxy, but as soon as I turn on "Smart Link Is Relevant" the link stops working?
I have a navmesh that my AI walks around fine. I added a navModifierVolume to break the navmesh in a doorway. I then added a NavLinkProxy to connect back up the gap and the AI used it fine.
Now I want to be able to turn that link on and off depending on if the door is open or closed. If I click on "CopyEndPointsFromSimpleLink" and turn on "SmartLinkIsRelevant" the AI stop using the link and wont go through the door? How can I set up a NavLinkProxy so I can turn it on and off?
I'm using Unreal version 5.5.4

misty wharf
#

so it will walk up to the link and activate it... and whatever comes next is up to you.

lament hemlock
slow bobcat
#

One way is to modify the tunnel nav polygons area cost on entry. That can only be done in c++ AFAIK. Another way would be to simply change the area flag of the corridor polys to some custom area and use a nav filter when obtaining a path that would exclude that area flag. Then restore the area flag when done.
If you can't do all that, you can always not have nav in the corridors and handle them with smart nav links and don't allow AI's to use a nav link if it's already in use

solid wedge
#

How is everyone here sending their AI Controller data? (references to other actors, game mode data, etc)

solid wedge
slow bobcat
#

So your custom game mode needs to know about your AI's controller and other actors? Can you give us some specific example?

harsh storm
#

That is kind of odd.

slender cypress
#

Assuming that AYourCustomGameMode really does need to know about AYourAIController, an implementation might look something like this.

#

I haven't actually run it and I'm not sure if it's correct, so I apologize if I'm wrong.
Depending on your specific use case, the type of your public variable could be something like TMulticastDelegate instead of TArray<AYourAIController*>.

solemn garnet
#

Has anyone had issues with the FindSlotEntranceLocation state tree task? It seems to keep failing for me and I don't know why

solid wedge
#

My AI Controllers need data that is stored in custom GameMode. In this case, it's who is on what 'team'. Arrays of APawns.

#

I'm settling on the solution of using event dispatchers: anytime the TeamRoster variable updates in the GameMode, send that variable to each ai controller. Each AI controller would then update their personally decalred variable of that same type.

#

Because I feel like having all of my AI Controllers call the Game Mode for data would be more cpu intensive than using event dispatchers to update variables in each AI controller.

misty wharf
chilly nebula
#

Time for a little 5.6 State Tree tease! Hmmm.. I wonder what this could be? 🙂

slow bobcat
#

Ufff man

#

Just release that in a hot fix please

#

You are teasing us

#

Suggestion: consider the possibility of adding a "custom" option where a function is called so we can have other results. People probably want things like "if A and C or if B and D" or "all but, if H finishes first, transition". Customization for the win

chilly nebula
#

5.6 is so full of State Tree goodies, our team has done an amazing job honestly. Looking forward to see what you all think!

slow bobcat
#

Man... I'm writing a proposal for a talk at Unreal fest and, by the time I get there it will be "look... We did stuff thus way... But Siggi changed everything and our shit means nothjgn now. Let me show you how things can be done in 2023...."

#

XD

chilly nebula
harsh storm
#

@chilly nebula And make sure docs come with this stuff. I know its a lot to ask but, it goes a long way!

near flame
green herald
#

Hi folks! Still kinda fresh to Behaviour Trees etc. Blackboard states "OnAlert" is set, yet active returns to root instead of going to the Alert behaviour. What am I missing here?

slow bobcat
green herald
# slow bobcat What's after the selector on the left?

Not yet connected fully, it's being adapted from another BT. The Attack isn't plugged up yet, as you can see, since I'll be building a new task for this particular Pawn. Still, I'd usually see the flow flash at least to the "Can See" Node...?

slow bobcat
wind heath
#

Does anyone know how to make the Navigation Mesh visualization we get in the Gameplay Debugger appear at the right Z height on top of the WorldPartition landscape? There is a large offset as is clearly visible around the visibility mask.

#

Not directly AI but there was no other category that fit.

#

(Using Navigation Invoker)

green herald
slow bobcat
real raven
#

UPVOTE!!!!!!

near flame
#

Time limit is not custom
Wait is not custom
The rest of all are custom

keen crow
slow bobcat
slow bobcat
#

It effectively cuts out 1s before your 11s wait finishes

near flame
#

but i want to fail the whole sequence after an amount of time

#

i want it to completely fail after 10 seconds and never make this sequence again

slow bobcat
#

Umm then you would need somehow add a cooldown decorator that starts when the sequence finishes.

#

The way we handle cases like this is by adding gameplay effects with lifetime that add a g.tag to the owner for that time. The g.e is added on cease relevant and a decorator checks if the tag is present to avoid execution. But that's all using gas and custom made nodes

near flame
#

i tried the cooldown decorator and it seems to work,but it blocks the execution only for a while i think also for 10 seconds
and then restarts

slow bobcat
#

The problem with cooldown is that I think it starts counting on enter, not on exit. But I might be wrong

#

If I'm wrong, you can use both:

  • the decorator you use to ensure the logic runs for 10s
  • the cooldown to avoid re-entering for 10s later
near flame
#

order of decorators does matter?

slow bobcat
#

No, it doesn't. They are AND conditions

#

What matter is when/how do they "decorate" your bt

#

And when/how they evaluate internally

#

Specially for abort stuff

near flame
#

i put both of em and its still the same

slow bobcat
#

Yeah that's because cooldown starts when evaluated, not on exit

#

Try set cooldown to 20 and time limit to 10

#

The problem you will have though is that, if a task fails in let's say the 1st second, you will not reevaluate for the next 19s

#

So your "run 10, wait 10" will not work

#

It will be "run 1, wait 19"

near flame
#

it waits 20 seconds and then restarts

slow bobcat
#

Yeah

#

But that's what you want right?

#
  • sequence starts running, the 20s starts counting
  • sequence runs for 10s (10s left in the cooldown) and aborts
  • sequence tries to reevaluate and fails because cooldown is still active
  • after 10s of revaluation attempts, the cooldown finishes and the sequence runs again
#

So you technically run your sequence for 10s and blocked it for another 10s

#

That is assuming the cooldown starts on enter the sequence (become relevant) which I'm unsure now (I'm taking your word for it)

#

Aaah wait

#

Sorry

near flame
#

i want it to be blocked entirely ,i want the invincible state to run 10 seconds and then shut down this state permanently,i dont want it to restart in any condition

slow bobcat
#

"and never make this sequence run again"

#

Just re-read your message form before

#

Ummm

#

You could create a do-once decorator, we have one

#

Basically the decorator has a bool set to true by default that is set to false on cease relevant

#

When the decorator evaluates, return the bool

#

It will fail always after the child execution finishes (the sequence in your case)

#

You will need to make it Instanced (every BP decorator implementation is instanced) or not Instanced and store the bool in its node memory (c++ only)

near flame
#

i dont get it,can you describe step by step please?

slow bobcat
#

Make your own decorator, override On Cease Relevant, change the bool value property from true to false there. Override the evaluation function of the decorator (I can't remember the exact name) and return the bool there

blissful inlet
#

hi guys. why abp can stop working when enemy is patrolling?

slow bobcat
heady perch
#

Hi guys

#

How can I make AI characters detect each other as obstacles in blueprint? Right now, they do recognize the AI in front of them as an obstacle, but they don’t try to avoid or get around it.

slow bobcat
#

There isn't much documentation about it but some. They will push each other out of the way so they don't get stuck

#

If you want true path avoidance, it will require more work

charred dome
#

I've been trying out state trees and have been really enjoying them. However something I haven't been able to figure out is how is there a way to dynamically inject StateTree subtrees the way we can inject subtrees into a behavior tree?

I haven't really figured out a way to do this yet. It's possible there's a way to achieve this I just don't understand. The state type documentation is kinda sparse

chilly nebula
#

Basically like setting up named "slots" that you then set a link for at runtime.

charred dome
#

what's the func that sets the link?

#

Is this how I want to set this up? Is there a function that lets me change the default assets that I setup in these slots?

#

I'm trying to replicate a pattern I use in behavior tree where I have an item slot that can define an agent behavior that can come from other places.

thick steeple
#

hi! anyone knows how can I make the AI to avoid other NPCs? like, they stands waiting but I want them to find another path. I'm using the move to node from the behavior tree

dim pier
#

I think the answer to this question is still on the screen lol

thick steeple
#

what?

dim pier
#

if you scroll up, Bruno answered 61level's question of basically the same thing

thick steeple
#

oh thanks, I didn't see it

junior totem
#

Hi guys, is there anyone looking for AI engineer/developer?

dim pier
#

you might try the job board

near flame
#

hey,so if i play only the Necromancer Invincible task,it works fine,the necromancer sprite goes from a to b point ,but when i connect all tasks,he does not play this animation,i tried adding a wait node after it,i tried adding set timer by event inside it,and none of this worked,can yall suppose why?

fiery hemlock
#

I did come across some BT implementation and doubt, that this is the way BTs are meant to be used. Basically, that one uses the Service to do rotations and movements. Apart from repeating many things within the Tick of the Service running at high frequency to make the interpolation for the rotation, my question is, if this isn't kind of a misuse. Shouln't Tasks do the work and Services more or less just check and set variables and conditions? This one looks nice at a first glance and works, but looks like doing it vice versa. One might say "if it works it is ok", but I'm just thinking about doing it the right way things are meant to be done. Any thoughts on this?

still marsh
#

Did anyone know the workflow of moving all BT's to State Trees ?

slow bobcat
slow bobcat
#

We have services that override the focus so the character looks to X location/actor while a child task moves it

#

To give you an example

#

We have other services that apply a tag and remove it on exit

slow bobcat
#

Does anyone know of a good talk/web/book that explains in detail breaking friction, dumping etc for AI characters in Unreal?

misty grove
#

Seeking Alternative to ProjectPointToNavigation() in UE 5.0

I'm working in Unreal Engine 5.0 and looking for a way to find the nearest navigable point from a given world location.

Currently, I'm using ProjectPointToNavigation(), but it requires an Extent parameter—which I’d prefer to avoid.

using a large extent often results in inaccurate behavior, where the AI navigates to an unintended location instead of moving toward the desired target.

Does anyone have suggestions?

harsh storm
final prism
misty wharf
#

For example in my game there's some cases where the AI needs to pick up an item on a table. If the item location is projected, it can do it, but sometimes it would walk to the opposite side of the table than what would be sensible. I projected some additional points around the item's location, and picked the one closest to the AI which made it walk to the appropriate side correctly

scenic stream
#

Using UE 5.5 trying to use subtree within behavior tree
I'm working on a simple problem where I want to have a behavior tree use a Run Behavior node to run another behavior tree.
It'll look like ParentTree with ParentBlackboard calls run behavior to run ChildTree with ChildBlackboard
ChildBlackboard has ParentBlackboard as its parent

The node says that the subtrees blackboard not compatible.

I've looked into the source for BTTask_RunBehavior.cpp and it has a line bIsBBCompatible = BlackboardData == OtherBlackboardData || BlackboardData->IsChildOf(*OtherBlackboardData);
ParentBlackboard has to have ChildBlackboard as its parent in order to run the subtree.

Is that the only way to do this?

slow bobcat
scenic stream
slow bobcat
glass perch
#

I'm looking for a good tutorial for enemy ai using state trees. Any recommendations? ...please don't make me read through all the docs

slow bobcat
#

The pins of the channel have some useful links

chilly nebula
#

Hey all,

For future UE releases, we at Epic want to make it easier for new users to get started with State Tree, and provide a more fleshed out library of tasks and conditions that are ready to use.

It would be great to hear your top wishes for tasks and conditions that could be provided "out of the box" to build your AI behaviors and other stateful systems with.

What are the common tasks that everyone builds when making behaviors with State Tree? Is there a system you wish we would support integration for directly, like for example GAS abilities?

slow bobcat
wise sluice
#

Also additionally :

  • Tasks that run EQS and wait for its results
  • More Debug tasks (either debugTrace or vlog driven)
final prism
chilly nebula
final prism
#

Is there already something in unreal to combine a smart object with a navlink? 🤔

final prism
#

running custom behaviours that are a bit more complicated while using a navlink

chilly nebula
#

navlinks are used to move between two navmeshes, is this to add conditions or something else?

final prism
#

I think an example would be a locked door that could be opened with a button press or something. The navlink would be through the door, but the logic of moving from one side to the other would include pressing a button

#

Youd still want to be able to succeed a pathfinding query that gets you from one side to the next

#

Or something like crawling through a small space, you might want some complicated logic for how many people can occupy the space at one time, be able to crawl back and forth etc

chilly nebula
#

The door example sounds like a navlink with a condition, shouldnt be too hard to add. And then you could have a smart object/action that changes that condition.

final prism
#

Well in this example the action would need to be part of the pathfinding, for example an npc wants to go investigate a noise behind that door, if its locked due to the button not being pressed, the pathfinding query will fail, unless its somehow included in there

chilly nebula
#

ah got it, but would the pathfinding query need to take into account if the character CAN unlock the door? thats where things often get tricky 🙂

final prism
#

Yes I guess it would, if the navlink were tied to a smart object for example, you could query the preconditions on that and if its claimable, then succeed or fail the query based on that 🤔 And when you do the path following, you could use the smart object as part of the navlink traversal, assuming that will execute all the logic to move you to the other side of the door and press the button

chilly nebula
#

but its a good idea overall 🙂 should be doable, there is already code there that moves the character along an arc when traversing the link.. should be able to expand on that to use a SO that is linked, you would just need to resume the path when exiting the SO

wise sluice
wraith robin
celest python
solid wedge
slow bobcat
deft aspen
#

Decided to cleanup Gameplay Tags in my project, and noticed that Smart Object Plugin and State Tree are defining some test native gameplay tags (Test.SmartObject.Tag1 in SmartObjectsTest.cpp:27).
Is there any way to remove them from a project without needing to recompile engine?

chilly nebula
misty wharf
solid wedge
slow bobcat
#

But how dies the capsule look up? Doesn't it project the actor location?

slow bobcat
#

I don't think the look at rotates the capsule around X/Y

fleet cobalt
#

Hey folks, I'm on 5.5.4 trying to use Linked State Tree Assets but I keep crashing when they have a Parameter. Has anyone experienced this before or accomplished having Linked State Tree Assets with Parameters?

deft aspen
slow bobcat
left veldt
#

Hello guys I from Mongolia I have made system to spawn parcel for transport in my game and unfortunately when I spawn too many parcels it says "assertion failed" and i crash

#

why

solid wedge
#

I just switched all of my AI logic from BP to C++. Are there any C++ exclusive AI functionalities that I may not be aware of, or that you find useful?

slow bobcat
slow bobcat
solid wedge
final prism
slow bobcat
lapis cargo
#

Hi, I'm using simple c++ to generate navmesh at runtime. I move the navmesh bounding volume and call Build() on the navmesh system.
This works. However when I load a different level with a navmesh and return to the one with navmesh generation the code stops working completly.
I get no errors, the built navmesh is empty, and logs say it took 0.0 seconds to build. I'm using 5.2, any idea what might be the cause? Thanks!

slow bobcat
# lapis cargo Hi, I'm using simple c++ to generate navmesh at runtime. I move the navmesh boun...

Never seen anyone doing this. The thing is that, by doing that, I think you might be re-creating the recast nave mesh object into whatever level the first nav bounds volume is. You would need to call build again when coming back.
You could add a small volume at 000 in the persistent level to ensure the recast object is always added to the persistent. But since you call build on the second level while the 1st level is gone... You will delete all the nav from level 1 because there's no level to build nav upon

#

I'm don't know why are you doing that nav mesh bounds move and then call build but sounds wrong

#

That kind of scenario is usually handled by dynamic nav mesh using invokers

#

What's the use case?

plucky thunder
#

Hello guys working on ai state trees im havign issue with delays, i want to have my montages play for like 20 seconds etc etc any help?, Also the 50 sec delay is no tworking

fleet cobalt
# plucky thunder Hello guys working on ai state trees im havign issue with delays, i want to have...

You probably want the latent version and to call Finish Task after the Montage is complete. Try something like this and remove the delays.

If you're interested in the montage looping for 20 seconds, I would probably control that within state tree itself. Like having a child state that calls the Animation Montage and completes, spitting out whatever delta seconds have occurred. Then track the value somewhere (like a property maybe?) in the State Tree and transition out of the State once it's past 20 seconds.

solid wedge
#

Omg that sounds awesome.

chilly nebula
# lapis cargo Hi, I'm using simple c++ to generate navmesh at runtime. I move the navmesh boun...

Like Bruno, Im also interested in what your use case is. Navigation system also supports a fully runtime generated mode for procgen worlds called Invokers or "navigation on demand". We use this for example in Lego Fortnite.
https://dev.epicgames.com/documentation/en-us/unreal-engine/using-navigation-invokers-in-unreal-engine

Epic Games Developer

This guide shows how to use Navigation Invokers in Unreal Engine.

keen crow
#

Are blackboard key ids the same for all blackboard components on all controllers? I have the following situation. I have 2 NPCs N1 and N2 and a BTTask that has a FBlackboardKeySelector (say BBKey) and inside that task I make N1 to observe N2s BBKey. But for doing this I get N2s blackboard and register observer against a BBKey that is used for N1. I haven't debugged it yet but I'm wondering if BBKey KeyIDs exist per-BlackboardComponent or per blackboard asset 🤔

keen crow
fringe aurora
#

Are age expired senses suppose to hang around in the LastSensedStimuli array?

fringe aurora
remote fractal
#

My AI keeps chasing me and then stopping randomly, thoughts?
I'm using sight perception from AI Perception component

I believe they are finishing the move to

remote fractal
#

just randomly stops chasing me like this, i think the navmesh is bugging for some reason

#

Seems to replicate when the AI reaches me, and then DOESNT lose line of sight with me... if it gets lost (or the line gets intersected) then it starts up again.)

slow bobcat
#

@remote fractal
Sounds like a bug in your logic. Like you are forgetting to reset something upon reaching.
It could be it's stuck too. If you use visual logger you should be able to check why did the move to stopped

slow bobcat
#

As in "I heard this guy, but that was 55s ago"

solid wedge
#

If my max-load use case is a single player game with 36 humans simultaneously navigating in the same level and navmesh, and I want all of these ai humans to possessable by the player at any moment,

  • Do I need to use the Character class for all 36 humans?
  • Does basic of the shelf AI navigation require CMC? Or can I work some c++ magic to prevent all 36 humans from needing a CMC? Maybe slightly beefed up pawn classes? (I do not want to use Mover)
final prism
final prism
misty wharf
#

Well strictly speaking it's just something that can be possessed by a controller of some variety, you can certainly use other mechanisms for it also if you're so inclined :)

#

(obviously a lot of code in UE assumes the controller + pawn architecture but in any case)

#

Although I don't think a "plain" pawn adds much on top of actor so maybe it doesn't matter that much

harsh storm
#

It doesn't.

#

There would be some major NIH syndrome if you were circumventing the controller + pawn setup while using the actor system overall.

misty wharf
#

Yeah you're right, I think there's some really niche usecases where it might make sense though :)

harsh storm
#

Yeah, those are outside of the actor system though.

#

Like using your own game simulation. Or #mass

lunar cedar
#

question regarding state tree (maybe behavior tree logic would solve this to?). i have some call of duty zombies style zombie ai and i have them setup to find the closest player, move to them, then attack. the issue i cannot figure out logic wise inside of state tree is to "refresh" the closest player. for example, 2 players, 1 zombie, zombie selects player1 as they are the closest and starts moving to them. in the process player2 runs closer to the zombie, i would like the zombie to change move to targets to player2. heres my current setup

smoky mason
#

Hi everyone, I have this issue with designing modular BT for ranged enemy. Is there a way to achieve SimpleParallel-like behavior only with multiple behavior trees? Lets say that I need to implement classic "move and shoot" behavior but SimpleParallel wont cut it for me since both movement and shooting consist of multiple nodes and I would also like to be able to swap implementations of these two features dynamically. So basically can I somehow run two RunBehavior nodes simultaneously?

dense owl
lofty ember
# lunar cedar question regarding state tree (maybe behavior tree logic would solve this to?). ...

for the current setup you could add 2 child states to FindAndMoveToPlayer:

  • Check (compare if STTFindClosestPlayer is still the same as the one found in parent state), you can make a simple task for it or go deeper with child states, check conditions on one to compare found players and trigger appropriate transitions on those child states
    • on success (the same)
      • transition to Delay
    • on fail (different)
      • transition to Root
  • Delay (1s?)
    • on completed
      • transition to Check
harsh storm
smoky mason
lunar cedar
loud mango
#

Hey, the behavior tree doesn’t work properly on the npcs i spawn. i think it’s because the navigation isn’t built correctly. when i add delay nodes, it works, but that kind of delayed result isn’t what i want. is there a way to build the navigation in advance? or is there another solution for this?

loud mango
wide heart
#

I'm trying to build a custom EQS point generator using blueprints and I'm running into crashes. Some research already suggests this is an unfixed bug without a workaround? In any case I need to generate custom points for my project. I'm not very good with C++, but I can learn what I need to get this done, but I'm asking here to verify among the community knowledge: Do custom EQS Point Generators work in C++? I wouldn't want to struggle through learning only to run up against the same bug again.

remote fractal
# slow bobcat <@468098653559717908> Sounds like a bug in your logic. Like you are forgetting ...

it is definitely a bug in my logic although I am uncertain as to how I fix it.
i followed the official documentation quickstart guide and it appears that the event for having the crabs lose sight (it was set on a timer so i could reset the timer meaning it would be like 4 seconds of having to lose LOS before they'd stop chasing you)
now i just need to figure out how to reimplement that without it breaking it lmao

slow bobcat
# loud mango and i'm also using it in the navigation invoker

Ok so your are using dynamic with nav invokers. You could pause the AI until the nav is done for example.
If you want to "bake" the nav you need to use static or Dynamic with Modifiers. There are videos online explaining the different between the 3 stc

slow bobcat
wide heart
# slow bobcat They work both in c++ and BP as far as I know. What crash do you get?

My generator doesn't generator any points. My understanding is because I need to set the generated item type to points in the class default. If I do that and then move my EQS testing pawn it crashes. "Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffffffffffff"

Upon rebooting moving the testing pawn doesn't crash but it also doesn't generate points. If I go back into the Generator BP and unset then set the Generated Item Type and move the pawn again then it crashes again.

slow bobcat
wide heart
#
[2025.04.17-19.02.18:629][553]LogWindows: Error: === Critical error: ===
[2025.04.17-19.02.18:629][553]LogWindows: Error: 
[2025.04.17-19.02.18:629][553]LogWindows: Error: Fatal error!
[2025.04.17-19.02.18:629][553]LogWindows: Error: 
[2025.04.17-19.02.18:629][553]LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0xffffffffffffffff```

That?
slow bobcat
#

Ummm is that all?

#

Rent there more lines below in the calls tack explaining the chain of execution?

#

Below the last line

wide heart
#

Sorry here's the whole thing. I didn't see how it was helpful though:

slow bobcat
#

Ah ok, you need to download the debug symbols for the editor, otherwise it's a useless callstack. But it might be faster if you post here the code of your generator (or BP)

wide heart
#

Maybe I should do that. Here's the generator though:

#

I'm actually trying to generate a 3d grid of points around the actor but I reduced it to this to debug. The crash happens with it just doing this.

slow bobcat
#

And how are you running the eqs? Could it be your array has nullptr entries? Place an Is Valid before the get actor location

#

Just in case

wide heart
#

Oh also I just added that validate and that crash is from after.

slow bobcat
#

Is attack target from your context valid?

#

The crash is in EnvironmentQueryInstance.cpp line 322

#

I'm not at home but maybe someone can check that line in the source (or you can sign up for epic github) and see what fails

wide heart
#

Well the context that I'm using works when I use it in a non-custom EQS query, and I did add a validate to the generator BP.

#

I joined epic UE github. Line 322 begins this If statement:

        {
            SCOPE_CYCLE_COUNTER(STAT_AI_EQS_GeneratorTime);
            DEC_DWORD_STAT_BY(STAT_AI_EQS_NumItems, Items.Num());

            RawData.Reset();
            Items.Reset();
            ItemType = OptionItem.ItemType;
            bPassOnSingleResult = false;
            ValueSize = (ItemType->GetDefaultObject<UEnvQueryItemType>())->GetValueSize();```
#

My Generator currently has "Can Run Async = False"

#

The built in points generators also have Can Run Async = False

slow bobcat
wide heart
slow bobcat
#

I don't think that has nothing to do with the state tree

#

If you don't run it, does the log go away?

#

Do the objects show up in the outliner? Are they spawned into the world?

fringe aurora
slow bobcat
fringe aurora
# slow bobcat I have used it but set it from c++ ages ago. What guide to use it did you follow...

I set it up in c++, there really isnt anything to it, other than adding the component:

ADRAIController::ADRAIController(const FObjectInitializer& ObjectInitializer)
    : Super(ObjectInitializer.SetDefaultSubobjectClass<UCrowdFollowingComponent>(TEXT("PathFollowingComponent")))```

I am using the Mover plugin though. As I'm digging into the code more, I can see that UCrowdFollowingComponent uses RVO, which Mover doesn't support yet.
slow bobcat
#

If you set a breakpoint in the object constructor where you out the debug, what's the callstack?

slow bobcat
#

Do you have the state tree debugger open while doing this?

fierce carbon
#

I have tried everything and don't know what else to do.. for some reason all of my AI die when I apply damage to the AI from a projectile overlap. Does anyone know what could be causing this? I've tried to set replication on the AI, but it doesn't do anything. It's a singleplayer game btw.

#

They all die no matter where I place the characters

stable plover
#

Is your overlap radius too big

#

Can you show where you are applying and receiving the damage, hard to help without any ode visible

unreal briar
#

Guys, any advice for create vehicle movement component for an RTS single player game ?

misty wharf
#

Eg. just have it rotate to which way it's moving and based on terrain angle

tacit orchid
#

Hello 🙂 Im trying to use the AI perception feature but whatever I do my NPC isnt seeing my player character. Ive put the perception component on my AI Controller and a stimulus source on my player character. Both have sight config enabled and Ive resized the sight radius to make sure Im actually entering and leaving the radius. But its completely ignoring me which hurts.

misty wharf
#

have you set the detect by affiliation to all? I recall the default setting won't detect anything

#

(the stimulus source is unnecessary usually also... all pawns are registered as stimulus sources by default, but it can be disabled)

tacit orchid
tacit orchid
tacit orchid
misty wharf
#

🤔

#

That's odd, I don't think they've changed it to not be like that

tacit orchid
#

Idk. I removed the source and it didnt detect me. put it back on and it did

misty wharf
#

well no harm from having it on there either way :)

tacit orchid
#

wild that printing while having the AI debugger open is still bugged...

misty wharf
#

Ugh, well that's a great Smart Objects gotcha...

#

I modified one of my Smart Object Definitions to include a new activity tag in addition to another one it had... wondering why isn't it working, the actors using it can find it just fine with the old tag but not with the new one

#

No idea what's going on, nothing makes sense

#

Restart editor

#

Now it works

#

????

worthy lagoon
#

Anyone know how I can make it so the AI doesn't clump up together and perhaps strafes around the player? (without using BT's)

grave sequoia
#

Does anyone know how to optimize the source code of the MovementComponent's enemy-seeking component?

misty wharf
misty wharf
grave sequoia
#

CharacterMovement Pathfinding Part

misty wharf
#

Well it kind of depends on what is expensive as it can depend on what your game is doing

#

But generally you can disable things like physics interactions, or use NavWalking instead of regular Walking

grave sequoia
misty wharf
#

There's an option that lets you choose the default ground movement mode or something like that

grave sequoia
misty wharf
#

It snaps the character to the navmesh and doesn't do ground checks like the regular walking mode does, so it's somewhat cheaper

grave sequoia
misty wharf
#

What do you mean?

worthy lagoon
grave sequoia
misty wharf
#

Normal walking uses the ground check to keep the character touching the ground, so it does linetraces and some checks like that

#

With NavWalking it puts it directly on the navmesh, so it doesn't need to do the checks

#

It has no effect on pathfinding or such

grave sequoia
#

Do you have any other AI optimization tips?

misty wharf
#

Use Unreal Insights to profile your game, it should tell you what is time consuming and should help you find what can be optimized

grave sequoia
#

I know this

#

Maybe it's at the Movement source code level

misty wharf
#

How many moving NPCs do you have?

grave sequoia
#

Or some options

#

Maximum 32-50 on the same screen

misty wharf
#

Hmm yeah CharacterMovementComponent can start being a bit slow with that many depending on things 🤔

#

if you use Unreal Insights, try enabling Stat Named Events from the menu, this should give you more information about the CMC and some other things

grave sequoia
#

My friend gave me some information

#

For general monster characters:
Rewrite the ResolvePenetration function: The default ResolvePenetration logic will try four position adjustments to solve the penetration problem, and the physical calculation overhead in this process is large. By simplifying the process and reducing it to a single adjustment, the performance consumption can be effectively reduced.
Remove SlideAlongSurface: Monsters usually do not need to slide along the wall after colliding with the wall. Therefore, removing this function call in the PerformMovement process can further reduce the performance burden.
Streamline PerformMovement calls: In the customized PerformMovement implementation, we can reduce multiple calls to ResolvePenetration and only retain the necessary adjustments to the final position.

For large-scale group monster scenes, based on the above optimizations:
Streamline PhysicsWalking logic: For a large number of monsters in the scene, PhysicsWalking can be completely rewritten and replaced with a simplified logic: first delete all the code, directly calculate the movement based on the direction, speed and DeltaTime provided by the navigation system, and then maintain contact with the ground through FindFloor.
Refactored findFloor functionality: Replaced the default ground detection logic and used FindNavFloor to query the navigation mesh instead of the actual terrain. This adjustment can significantly reduce the computational resources required for collision detection.

#

I can't write specific coverage

misty wharf
#

I don't know if ChatGPT knows much about this tbh lol

grave sequoia
#

Of course not, otherwise I wouldn't ask.

misty wharf
#

But PhysicsWalking is the default Walking mode, so at least on that respect it is correct - using NavWalking instead should alleviate the cost in that and FindFloor

#

If your NPC movement is very simple, you could try using floating pawn movement instead which should be significantly cheaper, or write your own movement logic

#

CharacterMovementComponent is very robust and has stuff for multiplayer etc. in it, it handles a lot of weird corner cases etc., so it's kind of complicated

grave sequoia
#

Unfortunately, it's not that simple

misty wharf
#

What does the output from insights look like?

grave sequoia
#

I'm not using the engine yet

slow bobcat
slow bobcat
#

Well maybe accurate is not the right word. I will better use "advisable"

#

The main problem with the CMC is all the physics part, which didn't improve at all when the editor switched from Physx to Chaos

#

Funny how it's tells you about "keep find floor" when that is one of the expensive parts due to all the physics checks (line traces and sweeping traces).

neon atlas
grave sequoia
#

@slow bobcatCan you help me change the CMC source code?

slow bobcat
# grave sequoia <@397712228435886091>Can you help me change the CMC source code?

No, that's a titanic endeavour.
First you need to have your use case done, then profile with insights in a development build to have a very clear image of what is exactly your problem, thenadd cpu stats in engine code you are going to need and that are not there to narrow down expensive functions.
And then with that think what to modify and how.

What is exactly the problem in your game that is requiring you to cheap the CMC? I imagine your framerate is bad/low in certain situation, what is that situation? Can you share an insights screenshot of a bad frame?

grave sequoia
#

I have solved the frame rate problem, but I am still looking for some optimization experience.

slow bobcat
#

Have you tried approaches like creating an LOD manager for AI or Tick Aggregation?

#

Because those two are very effective

kindred zephyr
#

Has anyone compiled a project State Tree project that has tasks, evaluators, etc extended in C++ ... on MacOS? I had an extremely frustrating day yesterday trying to fix a compiler error that popped up during Mac compilation, where it was complaining about the template keyword in StateTreeExecutionContext.h

#

example on line 242 EventQueue->template ForEachEvent([Function](const FStateTreeSharedEvent& Event)

#

I wound up disabling the Unity build and going through every error that threw up, which I did... and then wound up having the exact same errors

misty wharf
#

Can't speak for Mac, but at least on Windows errors from the engine code generally means your compiler or related versions are wrong

chilly nebula
#

Im not very familiar with the Mac platform, but I do know we run regular CI builds for it.

Yeah I was about to suggest making sure your compiler is of the correct version

kindred zephyr
#

Yes that's what I was thinking

#

Thing is I've compiled other projects on the Mac before and that all went fine, so this was a bit of a head-scratcher

#

Any idea what the 'right' version is?

chilly nebula
#

The docs state Xcode 15.4 or newer for 5.5

kindred zephyr
#

hmm I wonder if this is a Rider thing

chilly nebula
#

you on UE 5.5? latest Rider? On Windows you still need to install the VS compiler when using Rider, probably the same for XCode on Mac

kindred zephyr
#

Yes, yes, and yes

#

XCode 16.3

#

Rider 2025.1

chilly nebula
#

in your output log in Rider, look for an entry early in the log that states what compiler is being used. I had issues in the past (on Windows) where an older compiler was being used even though a newer one was installed

#

oooh 2025.1 is out 😄 Im behind!

misty wharf
#

I think it was released just a few days ago :)

kindred zephyr
#

I stuck all of this on the Mac just before leaving for Easter so it had better be the latest!

chilly nebula
#

I remember there being a setting in Rider to override what compiler to use, seeing if I can find it for you
Edit: Nevermind, that was just the MSbuild toolset version

kindred zephyr
#

Just looking for it and I see this

#

Enable all diagnostics

#

I wound up just editing the source code as I'd had enough, so I'm going to switch that off and revert and see if it gets fixed

chilly nebula
#

When I build on Windows I see a log like like this, you probably have something similar

0>Using Visual Studio 2022 14.43.34809 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808) and Windows 10.0.22621.0 SDK (C:\Program Files (x86)\Windows Kits\10).

kindred zephyr
#

Yeah seen that on PC

#

Don't seem to get anything quite so explicit in the Mac log

#

Non-unity builds are looongggg

#

Honestly stuff like this makes me miss the PHP job I had after University

chilly nebula
#

it gets easier with time 🙂 more focus on what matters, less on platform errors

vagrant python
#

Pawn sensing isn't lining up with the player's camera and sight traces are being blocked by that actor attached on the right shoulder. How can I specify the positioning for the sight trace?

kindred zephyr
#

😄

kindred zephyr
#

Pawn Sensing might do the same thing

vagrant python
kindred zephyr
#

Also you can change the collision profile of the thing that's on the shoulder

vagrant python
#

we're working in bp right now but it seems the default pawn at least controls the height of the view position with a bp exposed param

#

changing the collision profile can get messy with the actor being used for other hit dependent stuff

kindred zephyr
#

Same compilation error if I take out -weverything from the clang command line options and do a full rebuild: 0>StateTreeExecutionContext.h(227,24): Error : a template argument list is expected after a name prefixed by the template keyword [-Wmissing-template-arg-list-after-template-kw] 0> 227 | EventQueue->template ForEachEvent(Function);

#

I'm just going to take that line out, compile, and do something on the project that isn't coding

#

@chilly nebula @misty wharf thanks for the input anyway!

kindred zephyr
#

up to you, probably best to go with overriding that function anyway

vagrant python
#

we have a cpp character we'll change with overriding that function, but setting the base eye height in bp works good enough for our purposes, thanks

kindred zephyr
cobalt pagoda
#

If i havent learnt much about any of ai yet, is it better to start learning with state trees or behavior trees? Like, do state trees replace behavior ones?

harsh storm
#

Start with BTs. Far more information about them. And it isn't in such a state of change. They're very industry standard as well. They'll be around for a long time.

#

Then transition to State Trees when you feel comfortable.

cobalt pagoda
#

yeh ok, I was thinking that, but state trees looked more fun so I was hoping they were getting replaced 😭

#

thanks

keen crow
#

idk i'm not that experienced professional but i'd suggest the opposite to dive straight into state trees because this is the tool that will get new features and updates, even though i detest them and stay on BTs as long as possible

cobalt pagoda
#

why do you detest them?

keen crow
#

mostly baby duck syndrome, i feel myself much more comfortable building behaviors in BTs (FPS enemies and TPS action RPG people), I have my own tricks, implementations and ideas how to build specific behaviors. But to be specific but brief

  1. I tried STs 3 times, at 5.0, 5.1 and 5.3 ||so my view of them might be obsolete||. Each time I was pushed away by lack of provided bread and butter stuff like move to, run eqs, time limits and other minor ||when considered separatedly|| stuff, that I could have just created on my own by copypasting BTs implementation, but at that time STs were lacking cpp documentation and I just wasn't motivated enough to get to that
  2. I don't like the concept of everything is a state and I like the concept of composites (especially considering you can make your custom ones). It just seems counter-intuitive to me that instead of laying out a sequence of actions:
    find and claim a smart object - move to it - orient to it - start using it
    I must do
    enter state find smart object - from that state move to state move to smart object - from that and so on
    To me it seems like BTs composites, services and tasks ||and state/branch-handler decorators (i know that STs have their own entites to manage flow control, transitions they are called?)|| are blended into 1 entity but I am so used to think of orchestrating AI behaviors with these 4 concepts that moving to ST with just a concept of a state and transition seems to me like limiting my toolset
#
  1. Idk if STs have it now, but I don't like that there are no blackboards. I find blackboards a convenient tool that allows parametrization and flow control by decorators **and **decouples NPC behavior from its character but AFAIK in STs it's the opposite - the way to go is to reference your NPC and to reference its variables directly
  2. I find BTs graph editor more comfortable for navigation and reading, and as an AI programmer I spend quite a lot of time tinkering in BTs. I haven't tried, but I assume with complex behaviors STs get cumbersome and unreadable faster than BTs, even if you subtree behaviors

A counter argument would be the transition system in STs which is more straightforward as you can litterally specify state transitions, but idk, I'm already used to handle state transitions by decorators, even though I've read an opinion multiple times that it is bad to have a lot of decorators controlling the flow of the behavior

cobalt pagoda
#

So (unless its been updated) BTs are more agnostic and I can throw them on more things easier? That sounds better just for that tbh

#

but aalso running into my first problem lmao... why doesnt wait fire after wander?

#

the character is moving around, and then immediately moving to the next spot

keen crow
keen crow
# cobalt pagoda but aalso running into my first problem lmao... why doesnt wait fire after wande...

because you always finish the Wander task with a failure instead of handling success and fail with different bool param. The way sequences work is

execute everything underneath until first child (which can be either a task or another composite) failure. return success if all succeded, failure if any failed
and selectors work as
execute everything until first child success. return success if any child succeded, failure if none succeded

#

but if you're going to stay with BTs then i'd personally suggest you to split wander task into making a BTTask_FindWanderLocation (which you should also consider doing in EQS) which sets Vector BB parameter and use built-in MoveTo task and use the location you've got previously in Wander task

cobalt pagoda
cobalt pagoda
#

thank you 🙂

steep zenith
#

why is it red

slow bobcat
steep zenith
#

weird, its staying red even in game, and i never touched the colours

#

only in game though, not in editor

slow bobcat
# steep zenith only in game though, not in editor

This means something is forcing that part to be rebuilt constantly (probably). I'm guessing you are using dynamic nav and something that affects nav is constantly moving or you have a nav mesh modifier interacting constantly somehow

lyric flint
#

hi im following a tutorial(first image), and learning ab state trees, but my editor dosnt look the same (i mean the new task new condition etc), and i enabled the plugins for them, but it still looks like this (second image) what am i doing wrong 😭

harsh storm
#

What version of UE are you on?

lyric flint
#

5.3

harsh storm
#

And what version is the tutorial on?

lyric flint
#

dosnt say it just says ue5

harsh storm
#

What is the upload date

lyric flint
#

3 months ago

harsh storm
#

Then its probably 5.5

lyric flint
#

shit

harsh storm
#

And that would be why.

lyric flint
#

ugh

#

ok ty 😭 ig i could ask in here instead of hunting for a tutorial, im trying to make a like pet sim like ai, kinda like chao garden in sonic adventure, but im not rly sure what im doing, what would be the best way to like make something like that?

harsh storm
#

That's an awfully broad question

#

"How do I write AI" isn't really a realistic thing to answer in Discord.

lyric flint
#

thats litterally all i have to go off of 💀 im just starting to learn ab ai, sry i didnt word my question the best 💀

harsh storm
#

Its been a long time since I played Sonic Adventure, so I don't really recall the AI for that particular part.

#

But in general - like everything else in programming, break it down into steps.

lyric flint
#

its more im just trying to make like the creatures in my game can sleep, have moods, etc, i was trying to set it up w just blueprints but ik thats not a good way to do it that state tree is prolly better

harsh storm
#

Doing it in BP is fine

#

It just just an architectural decision.

#

BT and ST are just ways to design your AI

lyric flint
#

it was not working great how i had it in blueprints

harsh storm
#

That isn't a problem in BP - that is a problem in your understanding of the design. BTs and STs will help structure this stuff in some regard. (And yes, you should use them a decent chunk of the time)

#

I just don't want you to walk away with thinking that you have to use them.

#

So, first, you need to decide the rules of the AI

lyric flint
#

wdym

harsh storm
#

Sorry - jumped into a meeting

glacial harbor
#

Has anyone been able to use GASP with actual AI pathfinding? All guides and videos have them use movement input directly towards the target location/actor. Which means it doesn't use pathfinding at all and can't navigate

#

I've been able to narrow it down to the "Future Velocity" calculation inside the Anim BP. For some reason, trajectory or future velocity isn't calculated correctly for an AI.
I could use the AI's Control Rotation to simulate movement input, but that has its own issues too.

lofty ember
#

Is sending state tree events directly from EQS query (actually from EnvQueryGenerator) a bad idea?

slow bobcat
lofty ember
misty grove
#

FPathFindingResult PathResult = NavSys->FindPathSync(Query, EPathFindingMode::Regular);

is there any alternative of this FindPathSync() ? , its really broken in 5.4 and 5.5

points are null even if destination location is obviously reachable

slow bobcat
#

That works perfectly fine. If you get null points it's probably due to it not being reachable. What does visual logger say about your query?

steel moat
slow bobcat
steel moat
#
FVector ATurretBase::RandomMovement()
{
    if (ArrayOfPoints.Num() > 0)
    {
        int i = FMath::RandRange(0, ArrayOfPoints.Num() - 1);

        if(AIController->TestPath(GetActorLocation(),ArrayOfPoints[i])) return ArrayOfPoints[i];
        
    }
    return GetActorLocation();
}

So Im using this function to check if the path exists or not, this function will provide location to the AI to move, now as the function TestPath is returning false it gives the Actor's current location which results in the AI not moving anywhere.

steel moat
slow bobcat
#

If your draw debug a sphere at your goal location, is it's centre on the nav? Or is it above?

steel moat
#

on the nav

#

i tried both ways nothing works

slow bobcat
#

Is the green thing in the background the nav?

slow bobcat
steel moat
slow bobcat
#

Show the nav at runtime. You might not have nav there st runtime

slow bobcat
#

Is that at runtime or without playing in editor?

final prism
final prism
steel moat
# final prism Is testpath a custom function you wrote? Because in vanilla unreal thats a funct...
bool ATurret_AIController::TestPath(FVector startLocation, FVector endLocation)
{
    if (UNavigationSystemV1* NavSys = UNavigationSystemV1::GetCurrent(GetWorld()))
    {
        FPathFindingQuery Query;
        Query.StartLocation = startLocation;
        Query.EndLocation = endLocation;

        Query.SetAllowPartialPaths(true);
        Query.NavAgentProperties.AgentHeight = GetNavAgentPropertiesRef().AgentHeight;
        Query.NavAgentProperties.AgentRadius = GetNavAgentPropertiesRef().AgentRadius;
        Query.Owner = this;
        const ANavigationData* NavData = NavSys->GetNavDataForProps(this->GetNavAgentPropertiesRef(), this->GetNavAgentLocation());
        Query.NavData = NavData;

        FPathFindingResult PathResult = NavSys->FindPathSync(Query, EPathFindingMode::Regular);
        return PathResult.IsSuccessful();

    }
    return false;
}

This is what im doing inside the TestPath function

steel moat
final prism
#

If youre running pie, you can just run the game, and eject, then hit p to display the navmesh

steel moat
#

yea its on navmesh, .

final prism
# steel moat ```c++ bool ATurret_AIController::TestPath(FVector startLocation, FVector endLoc...

So performance implications aside, theres 2 issues that might be causing this (but not necessarily):

  • by not using the ai controller findpath, you are not doing any projection onto the navmesh. This means your locations could be anywhere and won't be exactly on the navmesh, which can cause these issues. By default it should use the navagent size as the query extents, so it should be ok but better to be safe than sorry
  • You are using the actor location, not the actor feet location. This means you are trying to path from the midpoint of the actor instead of a point on the navmesh. Again, it uses the extents of the agent so maybe that part works, but its better to use the feet here
slow bobcat
slow bobcat
steel moat
final prism
#

I think the only difference between the two is that testpath forgoes calculating a max path cost

slow bobcat
steel moat
#

human steps

#

wait wrong example

#

1-2 meters

slow bobcat
#

Ummm then inspecting the log in visual logger should give some clues

steel moat
#

Will see for now I went ahead as it fixed the issue 🗿

final prism
#

FPathFindingQuery::ComputeCostLimitFromHeuristic is what probably was missing

steel moat
#

so bcuz the cost was 0 it was returning fasle??

final prism
#

It is the max cost. To improve performance, the pathfinding algorithm assumes a max path cost to search within, any path that costs more than that will automatically be omitted. If the max cost is set to 0, that means it will ommit all paths

#

(unless there is a path of 0 cost which is unlikely)

solid wedge
#

Is it a good idea to put fundamental blackboard key valid checks inside of a decorator, instead of tasks that need the blackboard key?

final prism
# steel moat so bcuz the cost was 0 it was returning fasle??

The usual heuristic it applies is the euclidian distance from start to end point, that would be the minimum "cost" it assumes. It then applies a multiplier (I think its 1.2 on the default move-to) to that cost so it searches for paths that are also slightly longer than straight lines to the goal

final prism
steel moat
dawn wadi
#

I met that on headless training steps

keen crow
viral zodiac
#

Hey guys!

I'm still pretty inexperienced with unreal 5, and thought someone might be able to point me in the right direction. I'm currently trying to figure out how to implement a system for an enemy in my project that if far enough away from the player, will either despawn/respawn closer to them, OR just simply teleport. The enemy currently is using a behaviour tree to run most of its logic, split between several basic behaviour states (roam, investigate, chase). Having briefly dabbled with EQS, my initial thought was to use the EQS system to determine points in a certain radius to the player, but I am pretty uncertain how I would go about executing that.

harsh storm
#

EQS would be the right choice. All you really need to do is use that to determine the location and then call some teleport/respawn method on the pawn.

viral zodiac
#

would you think a teleport or a spawn method would be a better option? I'm not familiar with either really, but I was thinking respawning might be a good way to potentially clear any hiccups the ai might be experiencing. But again, I don't know where to start learning how to do that.

harsh storm
#

That's game dependent. So you need to decide which is better for your game.

viral zodiac
#

Fair enough! Do you have any suggestions as to where I should start were I to go the spawn route? I assume because I'm likely removing both the ai blueprint and the ai controller, that would require that I would need a separate ai spawner blueprint that would call the eqs system to dictate where the fresh ai would spawn?

misty wharf
obtuse igloo
#

Hi guys, Ive made a "Smart Door" class that derives from NavLinkProxy so that my AI can open doors when navigating.

Problem is that the static mesh I've put on the door does not at all appear during runtime or even on the thumbnail of the blueprint deriving from the class. Anyone got any ideas as to why?


#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Navigation/NavLinkProxy.h"
#include "Net/UnrealNetwork.h"
#include "Delegates/Delegate.h"
#include "SmartDoor.generated.h"

UENUM(BlueprintType)
enum class EDoorState : uint8
{
    Closed UMETA(DisplayName = "Closed"),
    Open UMETA(DisplayName = "Open"),
    Locked UMETA(DisplayName = "Locked")
};

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDoorStateChanged, EDoorState, NewDoorState);

UCLASS()
class ENTREEENTROPY_API ASmartDoor : public ANavLinkProxy
{
    GENERATED_BODY()

public:
    ASmartDoor();

protected:
    virtual void BeginPlay() override;

public:

    UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Door")
    UStaticMeshComponent* DoorMesh;

    UPROPERTY(ReplicatedUsing = OnRep_DoorState, BlueprintReadOnly, Category = "Door")
    EDoorState DoorState;

    // Whether the door needs a key to be opened
    UPROPERTY(Replicated, EditAnywhere, BlueprintReadWrite, Category = "Door")
    bool bNeedsKey;

    // Delegate to broadcast door state changes
    UPROPERTY(BlueprintAssignable, Category = "Door")
    FDoorStateChanged OnDoorStateChanged;

    // Function to set door state
    UFUNCTION(BlueprintCallable, Category = "Door")
    void SetDoorState(EDoorState NewState);

    // Callback for door state replication
    UFUNCTION()
    void OnRep_DoorState();

    // Networking
    virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;

private:

    // Update smart link activity
    void UpdateSmartLink();

    // Helper function to call when the door state changes
    void NotifyDoorStateChanged();
}; ```
#
#include "Components/BoxComponent.h"
#include "Components/StaticMeshComponent.h"
#include "NavLinkCustomComponent.h"
#include "Net/UnrealNetwork.h"
#include "Engine/World.h"

ASmartDoor::ASmartDoor()
{
    // Default door state and needs key
    DoorState = EDoorState::Closed;
    bNeedsKey = false;

    DoorMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Door"));
    DoorMesh->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform);

    // Replication setup
    bReplicates = true;
}

void ASmartDoor::BeginPlay()
{
    Super::BeginPlay();
}
#

It's visible here in the editor but during runtime the door just doesn't appear at all, or even count as nav collision

slow bobcat
#

Out of curisity, what does happen if you show the nav at runtime?

obtuse igloo
slow bobcat
obtuse igloo
#

WHAT!! Can you explain how to do that? 😭

slow bobcat
obtuse igloo
slow bobcat
#

Ah wait you posted code indeed! Sorry I missed that on my phone!
OK so... Create a class that inherits from UNavLinkCustomComponent. Then add it as a component to an actor