#gameplay-ai

1 messages · Page 52 of 1

dapper crest
#

I'm having a look around for ways to improve the performance of our AI, currently looking at navigation.

misty wharf
#

I don't think navigation is particularly expensive, most of it is when the path is initially calculated

dapper crest
#

Yea so I guess if there was a cost related to it, it would more likely be settings on the character movement component? Regardless, seems like more of time is spent in the execution of the behavior tree and even more on just ticks in general. So I should probably look there first

odd kestrel
#

hi everyone! I'm experimenting with StateTrees in my game and I wanted to keep the StateTreeComponent in the AiController (as the BrainComponent) to leverage the existing code in it (and also because it seems more organized this way). The problem I'm facing however is:

  • With the component inside of the controller, becomes a lot harder to set tree parameters in the StateTreeComponent compared to when the component is in the pawn itself
  • Having the component in the controller, I cannot reference any level actors in the parameters
    Does anyone have a good suggestion on how to handle it? Should I just move the state tree component to the actor and have part of the AI in the actor, and part in the AIController (like other components - e.g. the perception component)
coral mesa
#

anyone?

dim lynx
#

hi, my AI doesn't play montage

#

why?

#

Default slot is set propertly

#

skeleton is correct

uneven cloud
#

Have you actually profiled and found that the sight sense is causing problems? Or is this a premature optimization? The sight sense has a lot of optimization already built in including early outs and time slicing.

#

We don't use the parallel composite node, because I find that a service works better in nearly every case. However I have never actually needed to have two behaviors run at the same time and put them into the tree, if that makes sense. If an NPC needs to move while attacking, that's in the attack ability and not the BT.

#

There's a built-in plug-in called Common Conversation you might want to look at instead. It uses some of the BT tech to build a dialogue tree, but it'd be a much better option. There are also marketplace plug-ins that you can try. Building a dialogue tree using a BT is going to be really painful.

#

Dynamic navmesh is more expensive performance wise. When the geo changes only the tiles affected will be regenerated, but any path through those tiles are invalidated.

misty wharf
#

I need to try common conversation sometime 🤔 I replaced my janky BT-conversation with FlowGraph which works better

#

But at least out of the box I don't know if flowgraph is entirely ideal for it either

uneven cloud
#

RVO is only the avoidance part of BOIDS.

uneven cloud
coral mesa
celest python
uneven cloud
sand sail
#

New to this group. Was wondering if anyone has some resources that lead me to the answer to having vehicles turn naturally? My main use cases are vehicles (think cars) and aircraft (jets/helicopters). I'd just like them naturally rotate between each target point instead of just direct line of sight. Any help is appreciated.

dapper crest
uneven cloud
tough ermine
#

i have a playable character that i created its for a 2d fighter game and i want to test things in game on a dummy character i tried to duplicate the character but it seems to be working

#

what would be the best method for testing in game systems

stray bobcat
# uneven cloud Have you actually profiled and found that the sight sense is causing problems? ...

It's possibly premature optimization... but... I've found issues in the past where I didn't worry about optimization and then when it became a problem had to go back and design something completely differently and literally start over and wished I knew the better way to do it in the beginning. I don't need the sight to be checking on every frame so I'm just wondering if there is an option to reduce the frequency. Sounds like the answer is no so I'd need to build my own thing if I want that.

uneven cloud
#

Contexts have overrideable functions, one of which is to provide a single location.

uneven cloud
celest nebula
terse panther
#

just watching the AI with Blueprints course to see if i am missing anything or not.....
and one thing caught my sight..
he was using Perception Component directly on the AI Pawn,
i am there is nothing wrong in it, but its my first time watching anyone using Perception Component on the AI pawn...

so is there any reason for this? or its same whether we use it on controller or pawn?

uneven cloud
terse panther
terse panther
uneven cloud
terse panther
uneven cloud
terse panther
coral mesa
#

A question how do you exactly replace avoidance system with your own and make sure UE picks your own derivative?

#

I need to replace all these

coral mesa
#

There is two ways to access RVO system

#

that is Movement Comp and Character Movement Comp

#

No 3rd way

#

all internal

#

other way is making own Avoidance Manager but the question is where it is to make it call your own derivative Avoidance Manager

#

didn't saw anywhere at UE?

misty wharf
#

If it can't be changed, you may have to customize the engine code or roll your own CMC and such

spring scaffold
#

Hi Guys
I'm trying to spawn NavMeshBoundsVolume and RecastNavMesh during runtime using c++. I want to do it because my AI agent can be spawned in various locations on large map. Making NavMeshBoundsVolume big enough to contain whole map would be very computationally expensive. I was using this code to spawn NavMeshBoundsVolume:

FActorSpawnParameters SpawnParams;
FTransform NavMeshTransform = FTransform();
NavMeshTransform.SetScale3D(FVector(100, 100, 20));
NavMeshTransform.SetLocation(FVector(4480, 11360, 530));
ANavMeshBoundsVolume* BoundsVolume = GetWorld()->SpawnActor<ANavMeshBoundsVolume>(ANavMeshBoundsVolume::StaticClass(), NavMeshTransform);

UCubeBuilder* CubeBuilder = Cast<UCubeBuilder>(GEditor->FindBrushBuilder(UCubeBuilder::StaticClass()));
CubeBuilder->X = 200;
CubeBuilder->Y = 200;
CubeBuilder->Z = 200;
CubeBuilder->Build(GetWorld(), BoundsVolume);
BoundsVolume->BrushBuilder = CubeBuilder;

The problem is when I start simulation it is spawned and I can see it in outliner but I can't see it in scene. There is nor bounding box of this volume nor green texture on ground in place where this actor is spawned. I can also tell that it doesn't work because my character which can travel using NavMeshBoundsVolume which was added in editor can't travel using NavMeshBoundsVolume spawned in runtime. I did set Runtime generation to dynamic in navigation mesh.

misty wharf
harsh storm
#

What do you mean?

#

Why would a function have a built-in function?

#

(I know simple move to is just a K2Node!)

#

Okay, this is something completely different than your original comment

#

Also, what Laura said.

sick crown
#

Is there a way to get vertices of a nav mesh?

#

C++?

#

it would give you every face?

#

not just like bounds or something?

#

assumed they would come hand in hand

#

all I want to do is dump the mesh to an .obj

harsh storm
#

I think it does, might be like On Path Completed or something like that.

#

It's been awhile since I've looked

#

Just explore the component

#

That's the character movement component, not the path following component

misty wharf
#

I don't think it can cast your player controller to an ai controller any more than you can

#

The class hierarchy isn't there

#

Look at the else branch which handles the case where it can't cast it

spring scaffold
sick crown
#

Ah I see it does both. Thank you

uneven cloud
#

I believe that function doesn't work in a packaged build when debugging is disabled.

uneven cloud
sick crown
#

Ah. I assume the nav mesh is built as the game itself is built, as in it’s not like I could extract the nav mesh from a .uasset?

uneven cloud
# spring scaffold Hi Guys I'm trying to spawn NavMeshBoundsVolume and RecastNavMesh during runtime...

Making a nav mesh bounds volume for a large map isn't actually computationally expensive. It's just a bounds volume.

I do not believe you can add new bounds volumes at runtime without making engine changes. However any changes to the bounds volume(s) requires a call to the navigation system: OnBounds Updated.

Generating a nav mesh is what is expensive, which is why it's not usually done at runtime.

uneven cloud
sick crown
#

Do you know of any existing plugins to extract the nav data? I found one for ue4 but it’s not updated for 5.3 https://github.com/hxhb/ue4-export-nav-data, I’ve attempted to update it but get several error messages I haven’t been able to figure out. I presume a significant amount of the backend was changed between the two versions, and so it might actually be easier to remake the plugin from scratch

harsh storm
#

I doubt much has changed in the way of navigation mesh stuff to be honest

uneven cloud
#

Why are you trying to extract the nav data?

sick crown
#

Trying to learn about how it’s built

#

Should specify the mesh not the data*

uneven cloud
harsh storm
#

Yeah, that part. But the stuff Mophead is trying to examine, doubtful

uneven cloud
uneven cloud
sick crown
#

Yeah probably doesn’t make much sense without more explanation on my part. It’s a bit of a long story but I’m convinced that the mesh seen in the viewport doesn’t match what’s used in game. I just want to extract the mesh to prove or disprove my theory.

uneven cloud
#

You know it's not an actual mesh, right?

misty wharf
#

There are some bugs with the visualization of it but 95% of the time it should be displaying it correctly

sick crown
#

It has vertices, edges and faces does it not?

#

If it doesn’t it would be the first game engine I’ve seen which doesn’t

uneven cloud
#

The nav mesh also isn't how they move exactly. A path is built as a set of waypoints and it's moved by the movement component.

sick crown
#

And what data structure do these waypoints use?

uneven cloud
#

FNavPathPoint

harsh storm
uneven cloud
# sick crown Wdym exactly?

I mean that it's not what many people think of when they say a mesh. You'd have to extract the data and then draw it if you wanted to see it outside the engine. I don't believe that the data structures used are the same as a standard mesh.

I would recommend looking into the debug drawing functionality first, because as zomg said it's not actually precise.

uneven cloud
#

Why do you have an AI controller owned by the player controller?

uneven cloud
#

Why would you want client side prediction for pathfinding and behavior tree?

lyric flint
#

Hey guys, im new to ai and Im trying to test the decorator but the print not work at all how can I call the decorator?

uneven cloud
#

Client side prediction is mostly for making the local player feel responsive to input. AI do not have local player input.

If you have 10 players how would you even decide which AI is local to each player? You can't have them local to all of them.

#

Why does the local player have an AI controller?

uneven cloud
#

That's not how AI works. There is no client prediction built-in to the AI functionality as it's only run on the server.

#

The movement component has prediction built-in to it. It doesn't magically work. The path following component doesn't actually move the pawn, it uses the movement component to do it, so all the prediction is done by the movement component.

#

There is no prediction with the path following component either

#

Because non player characters are server owned actors

#

The AI controller won't even spawn on the client

#

It's not arbitrary. Players are the exception, not the rule. Anything that's not a player is server owned

#

Player bots are server owned actors

lyric flint
uneven cloud
#

Lol

uneven cloud
lyric flint
#

im not familiar with ue5 breakpoint soo.. yeah

uneven cloud
lyric flint
#

when I tried to received that event via Perform condition check it wasn't work well, am I have to use blackboard to use any decorator?

primal leaf
#

The only reason for possesing pawns by AI player is to use AI functions and features right ?

merry dust
#

/imagine car

fair zealotBOT
gusty trellis
#

Hey, im checking if a bench is available and assigning it for an npc to sit on it and i use a Native MoveTo task to reach the bench but if i block the npc and the MoveTo task fail the bench is already assigned and i dont know how to unassign the bench since i can't modify the Native MoveTo task to unassign the bench if failed.
I need the native MoveTo cause it have cool feature built in in cpp

Any idea on a better way to process the action ? Or React in an other way to the Task failing ?

latent geode
#

@harsh storm Hello! I've been on an adventure to find out how to modify state tree parameters, and I stumbled on your messages from 2022 haha. I saw you managed to have it working somewhat, I was wondering if you ever found a better way? At my previous job we also had a system for modifying state tree parameters, instead though we modified them inside state tree tasks themselves rather than outside of the state tree - our company has since closed and neither me or my colleagues who made the system remember exactly how we accomplished it 😄 So here I am on a new journey to recover the lost knowledge

#

In a sense, I also have the same interest as you once did - to make state tree parameters to operate as a blackboard of sorts

#

Honestly, a dumb idea and it's deifnitely better to store those variables elsewhere but still

harsh storm
# latent geode <@297744474703134722> Hello! I've been on an adventure to find out how to modify...

Nah, I didn't investigate much further because the editor was too buggy for me back then. Bindings kept getting lost and I couldn't set them back up unless I created a whole new state tree. But my goal also wasn't to have the ST itself update the params. I very specifically was curious how we could update the params from outside of the ST. Most of my reasoning stimmed from figuring out how to notify the ST about something with AIPerception. But because of the editor buggyness, I just dropped it and stayed in BT and/or custom state machine.

misty gale
#

StateTree does seem to have potential, atleast for me, but rather troublesome to get started with so far

#

Currently using a custom score based task system

harsh storm
#

I just use my own state machine personally. It's not all that difficult to build a rudimentary one.

misty gale
#

Does it handle ~5k checks per frame? 😅

#

Guess one can allow for some frame slicing , but not to much

#

I dont really need that many checks , was mostly stress testing it to see a 'worst case scenario'

harsh storm
#

In which case like...3 might exist at a given time.

misty gale
#

Sounds like a troublesome boss

harsh storm
#

3 bosses* might exist at a given time 😅

#

Not one boss with 3 state machines, lol

latent geode
#

We basically had to stay super up to date / backport state tree changes from unreal branches in order to fix those bugs

stable falcon
#

Hi guys, My AI shoots through walls, basically i am checking the distance to player for setting the IsInGunRange bool and i also have a strange behaviour were the AI simply forgets the player and romes around. THIS AI IS BUILD ON TOP OF EPIC'S AI TUTORIAL PLEASE HELP

neat summit
#

Sorry that it took me a while to get back to you on this. But I see you found an answer already! So with the PropertyRef, were you able to use the child state setup or multiple task in the same state setup? In my case, I wasn't aware of that setup, so I had a boolean flag informing that the results were ready in one task, and the next one would keep checking for that boolean, even though like you said they were running in parallel. But your solution seems to be very nice! Good find!

latent geode
#

Interesting. We have done a similar setup with my previous team in our project, basically if I am not wrong running the query is also async? You can prevent the task from finishing the state by having a tick checking some condition for whether the query results are ready. Same with the MoveTo task, you only return success inside that move to task once the pathing has been done (keep checking some condition on tick as well). Is that how you are doing it already?

And yes you can't have both running the query and move to in the same task. I'd make them into 2 separate states as well and don't make one be a child of the other

latent geode
harsh storm
#

Yeah, I saw that they said the parallelization has done like 50% perf improvements to the city demo 🧠

lament hemlock
#

I have a character BP that spawns 4 more characters, all the same character bp, but different meshes etc. When the game starts, I get 1 player character and the 4 alternatives fine. I can run around and they follow me. All follow code is simple AI Move To at the moment.
If I switch characters using "Possess", the new player runs around fine, but the old one stops moving and seems to never get an AI controller.
If I add "Spawn Default Controller" to its Event UnPossessed, it starts moving, although only at walking speed, but if I keep doing this and switch characters a bunch of times, I end up with lots and lots of AI controllers in the scene.
What am I doing wrong here? There must be a way to turn back on the old AI controller after it get possessed and then unpossessed again?

misty wharf
#

Yes, but you need to keep track of your controllers

#

Eg. when the char is possessed by an AI Controller, save it in a variable, so that next time you don't need to spawn a new one as you can just repossess using the one you stored

lament hemlock
uneven cloud
uneven cloud
misty wharf
#

Also looks like they're adding proper subtrees to statetrees 🤔

stable falcon
swift bolt
#

In NavLocalGridData.cpp I don't understand what PostProcessPath which gets called in FindPath is supposed to do exactly?

I would think in an uninterrupted path that it should include the PathIndices but it does not, instead it wants to only reference them if their is an obstruction. But the returned processed PathCoords with no obstructions is just the Start and End coord which is not the path to go from Start to end? @uneven cloud or @celest python Maybe some insight?

terse panther
#

can we create a blackboard key as type Vector Array using UBlackboardKeyType?
i am going to try it, but thought to ask first ..

#

but its looks like a long task....
i have to add getters and setters both in Blackboard component and BTFunctionLibrary....
so i proceed with it?
or is there any other way for this?

vague socket
#

@neat summit @latent geode I have the EQS and the Move task as sibilings, seperate states
The EQS task just checks on tick if it's done, and returns succeeded when it is. It then transitions to the NextState, MoveTo.
The FStateTreePropertyRef allows me to bind to a variable and change it from within the task. That variable can live in the parameters section of a parent state, the parameters of the whole state tree, or anywhere else you can access parameters.
The RefType tells UE what types of parameters it supports binding to.
That PropertyRef is also supported in blueprint. Pretty neat stuff.

latent geode
vague socket
#

I'm on ue5-main

#

I'll get the code

latent geode
#

Because I know it's possible, me and my colleagues have done it before but we don't have access to our source code anymore lol, and no one can recall exactly what we did

latent geode
vague socket
#

It's not supposed to be stable, but it's been shockingly stable for me for a few years

#

Here's how you use it in blueprint

latent geode
vague socket
latent geode
vague socket
#

As well as evaluators

latent geode
#

Sick, are you hosting your project on GitHub or something? Will also play around with this stuff in Lyra, convert their bots to use state trees and etc..

#

I will need to pull that branch I guess since I need that FStateTreePropertyRef stuff

vague socket
#

Not hosting this projecto n github, but if I find the time, I'd love to make an example that uses state tree for AI and SmartObjects, since the LyraExplorer update that has those isn't coming with 5.4

misty wharf
#

🤔

#

This seems pretty important for ST's, weird if it isn't in 5.4

latent geode
#

This property reference shit is massive for state trees

misty wharf
#

Yeah, it's kind of a pain to do data fetching and using otherwise

latent geode
#

And just in general state trees just need a blackboard

misty wharf
#

Nice :)

latent geode
#

I am so surprised that they didn't put them in the engine along with some sort of blackboard

vague socket
#

Here's how it's used. In this example, the ref can be a vector, actor, or an array of either.

EStateTreeRunStatus FStateTreeRunEnvQueryTask::Tick(FStateTreeExecutionContext& Context, const float DeltaTime) const
{
    FInstanceDataType& InstanceData = Context.GetInstanceData(*this);
    if (InstanceData.QueryResult)
    {
        if (InstanceData.QueryResult->IsSuccessful())
        {
            auto [VectorPtr, ActorPtr, ArrayOfVector, ArrayOfActor] = InstanceData.Result.GetMutablePtrTuple<FVector, AActor*, TArray<FVector>, TArray<AActor*>>(Context);
            if (VectorPtr)
            {
                *VectorPtr = InstanceData.QueryResult->GetItemAsLocation(0);
            }
            else if (ActorPtr)
            {
                *ActorPtr = InstanceData.QueryResult->GetItemAsActor(0);
            }
            else if (ArrayOfVector)
            {
                InstanceData.QueryResult->GetAllAsLocations(*ArrayOfVector);
            }
            else if (ArrayOfActor)
            {
                InstanceData.QueryResult->GetAllAsActors(*ArrayOfActor);
            }
            return EStateTreeRunStatus::Succeeded;
        }
        else
        {
            return EStateTreeRunStatus::Failed;
        }
    }
    return EStateTreeRunStatus::Running;
}
#

And this is the InstanceData.Result, that the MutablePtrTuple comes from

// Result of the query. If an array is binded, it will output all the created values otherwise it will output the best one.
UPROPERTY(EditAnywhere, Category = Out, meta = (RefType = "Vector, Actor", CanRefToArray))
FStateTreePropertyRef Result;
uneven cloud
latent geode
misty wharf
#

They're also adding proper subtrees to state trees in 5.4 which seems like a great feature

latent geode
#

but then again, just ffs introduce a blackboard for state trees KEKVV This is essentially what this is anyways

misty wharf
#

It seems the reason it works in this way is for optimization purposes but I can only speculate

latent geode
misty wharf
#

Yes

#

It's listed as beta I think so not sure how stable it's gonna be but at least it's a step in the right direction

latent geode
#

For sure. Ahhh, it's a pity that our team just started reworking everything into state trees too early as soon as 5.1 hit (where they were deemed "production ready"), but oh boy let me tell you, they were not 😔

#

We ran into all these limitations, and they are only getting resolved just now

misty wharf
#

Yeah

#

I only used it for testing since 5.3 and while it seems to work pretty well now it did have a lot of cases where the behavior was just very confusing and undocumented

latent geode
#

Imo state trees in their "perfect form" are definitely superior

#

Just the concept of transitions alone puts it above, not having to re-evaluate the entire tree if some decorator condition is not passed just to get to the right place, that alone is a massive advantage.

celest python
blazing ingot
#

Hi, my AI is behaving strange when i package the Game. It seems like the Pathfinding is off. My enemies which are perfectly able to find a path around walls in the Editor, are getting stuck in packaged game. I have a Drone that is spawned by my character and just follows him. In editor no issue. In packaged game its floating randomly around. The drone just moves to the owner. BB key owner is set and valid in the packaged game. It draws the debug sphere at his location but does not move to him, instead moving somewhere. Anything i am missing with AI, Navigation and path finding when packaging?

uneven cloud
blazing ingot
#

tried shipping (because thats the only way my gamepad works) as well as development. I already deleted the RecastNavMesh, created everything from scratch, played with some options for the navmesh...nothing helps. This cant just be me. Or i am doing a extremely dump error

#

I even disabled the Behavior tree and just used a simple AI Move to Task. Same outcome...so its not an issue with the BTT or BB, it has to be something withing the Navigation/Pathfinding

terse panther
#

YO
was thinking if anyone worked on cover AI kinda like The Division ?
i have a couple of doubts to ask..

latent geode
#

I used to. I used smart objects (i.e, you have predefined cover places around the environment that you specifically place), and then you code all the "take cover, crouch/uncrouch" logic inside the smart object itself

terse panther
latent geode
#

Well, you can always do an EQS query that will get you the nearest cover smart object

#

I think smart object system also has its' own way to search for them as well, need to look into the documentation again

#

As for the conditions - that is completely up you. Like, at what point do you want your AI to start looking for cover? Can be anything, low health, low ammo, that can even be the default behavior when they are aggro'd, and then fallback to some other form of fighting if there are no nearby cover smart objects

#

I personally like the last suggestion the most, but it's always subjective

primal leaf
#

Is Event graph disabled in blueprint is AI possesed it right ?

I update speed in event for blueprint so animation can play

terse panther
latent geode
# terse panther for condition i mean to say how will AI select a better cover?

That can get difficult. Again, up to you for how you want the AI to decide which one to take. I personally would not complicate this and make a small system for detecting whether the cover is partially or completely destroyed. I would not try to make difficult conditions for AI to choose which cover suits them the best, I would just make it random. And of course, smart objects already have the "reserved" system implemented so they should not choose covers that are already selected by other AI.

#

If the cover is destroyable, always keep track of how destroyed it is, and when it reaches a specific destruction threshold, you can send an event from that smart object to the AI agent that is using that cover - the AI agent gets that event, queries for another nearby non destroyed smart object cover - if there's none, again, fallback to another mode of fighting

#

That should be good enough?

terse panther
lament hemlock
#

I have 5 characters that all use the same BP class but have different meshes and animations. One of them is set to the default pawn, but in it's Begin Play it spawns in the other 4 and stores them all in an array that it shares with everyone so they all have a list of each other.
Using the Possess node I can switch between each character by pressing keys 1 to 5 and the ones that are not being controlled are set to follow the main player. This all works, except when I first start the game, the one that is set as the default pawn gets the wrong movement speed after it's unpossessed from the player controller. If I switch back and away again, it starts moving at the correct speed?
Any thoughts on why after possessing another character the original moves so slowly?

mighty imp
#

Hello, Is there a way to access a key from the BT in my AIController class?

I have a task that sets the Direction the AI is walking in but I don't know how to actually pass that direction key to my AIController!

dense owl
mighty imp
#

i need to get the direction key to update my direction vector

viral parrot
#

Hello everyone. I was curious if any AI guru can advise me on NavLinks. In the first image the nav link is set up and ready to use, however, if I drag the left position further away from the box, the NavLink is no longer useable. Does anyone know what is controlling this? I have delved into the NavigationSystem and RecastNavGenerator, but to no avail. Is it based on the agent step height? Sorry images, are in reverse. Right is working, left is not.

uneven cloud
# mighty imp how do i actually get the key tho from my AIController?

Like @dense owl said. You get the blackboard (which is a function) and then get value as (which is also a function).

Why are you calling move to on tick?! This is not how to use a latent function. I also don't understand why you are setting the direction in the blackboard, as that's an easy thing to figure out.

uneven cloud
viral parrot
#

@uneven cloud Yeah, digging into it it might be Id related? Still working on it. Also, in this situtation I posted earlier, I ended up looking at the NavMesh tiles and when I pulled the NavLink back onto another tile, it would disappear. Do you know if NavLinks only work on neighboring tiles?

uneven cloud
viral parrot
#

@uneven cloud Yeah, sorry, it is a SmartNavLink with my own custom component. Hmmm, then I am confused.

uneven cloud
viral parrot
#

@uneven cloud So I am using my own derived ANavProxy, using the point links to determine where the smart link points are by copying them, and then using the bSmartLinkRelevant flag on.

uneven cloud
viral parrot
#

@uneven cloud My custom logic has nothing to do with the rendering or the path. It is simply listening for when the SmartLink has been reached by an agent.

swift bolt
obtuse dome
#

Why is Unreal clipping the navmesh through the stairs so poorly? It's like a multimodal failure where 1) the navmesh can't find a connection from the top floor to the top of the stairs, so it leaves an inset (incorrect), 2) the navmesh generation recognizes that it should connect the stairs to the top floor, but because it is inset, it clips through the stairs (incorrect). As a result, NPCs can go up the stairs, but as soon as they try to cross from the stairs to the top floor, they decide it's impossible and try to find alternate routes

agile widget
#

Hi All, quick question, can I use RVO and Crowd Detour at the same time?

storm dust
#

hello I have a problem launching the games I created it tells me that I do not know how to build a game for win64 while I have a great pc

agile widget
#

Yeah I finally got it to work, thanks for the answer

lyric flint
#

I need to send a reference of a BTTask as self to the controller so the controller has a reference of current running task, ive done this before but forgot. Can anyone advise?

#

☝️ by using an interface message

cyan sigil
#

Why do yoy need to know the current running task? Shouldbt that be opaque?

lyric flint
cyan sigil
#

Shouldnt it be the other way around?

#

What's the event? I want to understand.

lyric flint
#

I dont know. I have an AI controller that possessed the player pawn when the race is complete so it drives the track for a race recap screen before exit. So that task is the default one that all my CPU drivers use to race but so its all running by default but i just need to trigger an event that overrides a bound event that was not assigned because that controller spawns in after the race has started.

lyric flint
#

Another reason would be to have ability to finish tasks from the controller using interface messages.

lyric flint
uneven cloud
cyan sigil
#

If you want to finish a task early you can use a decorator or setvice

#

Yeah, delegate is the better choice if you really want to respond to a gameplay event

#

Essential for making games that work well.

uneven cloud
#

It is unsafe to make direct calls to bt nodes from outside the BT.

#

To finish a task early you can also use a delegate. Or a decorator as has been mentioned.

lyric flint
#

Fine I will go with the event dispatcher, less moving parts, thanks

blazing reef
#

Greetings everyone, I have a question regarding state tree evaluators. Evaluators can either run on tree enter or on tick, but can they also run on demand? I would like to only run an evaluator on tree enter and if a specific task succeeds (find a target on tree enter and find another target if I successfully destroyed my target). How would I implement that? Should I define a global task instead of an evaluator and call that task once my other task succeeds?

glacial harbor
#

Is it acceptable to frequently change behavior trees during runtime? I wanted to divide my trees into "subtrees" so they're not all in 1 big behavior tree. But I wonder if running a new tree is still performant, especially if I have say 50 AIs in the level.

harsh storm
#

You can run subtrees

dim lynx
#

hi, I changed bland space 1D, I just copied the default one and set my animations and I don't know why but the lower part of the body (Legs) AI doesn't move them at all
someone can help?

#

someone can help?

misty wharf
#

this is more for the actual AI logic, not animation so much

unborn jungle
#

has anyone tried the improved navmesh generation for large worlds in 5.4? It sounds amazing

obtuse dome
#

nice to see navmesh generation doesn't respect the Can Step Up On property :/

dense owl
#

It’s likely just too close so the nav agent can’t fit, you need to make custom ones

lyric flint
#

I need this MoveTo to abort if the value changes. I think I know why this doesn't work, but I don't know a solution that would

#

That selected decorator needed to be on the sequence, not the MoveTo

warped solstice
#

any idea why ProjectPointToNavigation returns false on client every time when server return true?

stuck comet
#

how to use use blackboard actor as context?

odd tide
#

I am facing a navigation problem, Repath works correctly but it uses the old location to regenerate the path, I even tried deleting points but it doesn't help, Repath always re-generates points from where FindPathToActorSynchronously was originally called if the GoalActor changes location

bool AAIPawn::MoveToActor(class AActor* Actor, float TetherDistance)
{
    if (IsValid(Actor))
    {
        if (UWorld* World = GetWorld())
        {
            if (UNavigationSystemV1* NavigationSystemV1 = UNavigationSystemV1::GetNavigationSystem(World))
            {
                if (UNavigationPath* NavPath = NavigationSystemV1->FindPathToActorSynchronously(World, GetActorLocation(), Actor, TetherDistance, this))
                {
                    SetTargetNavigationPath(NavPath);
                    return true;
                }
            }
        }
    }
    return false;
}


void AAIPawn::SetTargetNavigationPath(class UNavigationPath* InTargetNavigationPath)
{
    if (IsValid(TargetNavigationPath))
    {
        TargetNavigationPath->PathUpdatedNotifier.RemoveDynamic(this, &AAIPawn::OnNavigationPathUpdated);
        TargetNavigationPath->EnableDebugDrawing(false, FLinearColor::Yellow);
    }
    
    if (IsValid(InTargetNavigationPath))
    {
        TargetNavigationPath = InTargetNavigationPath;
        TargetNavigationPath->PathUpdatedNotifier.AddDynamic(this, &AAIPawn::OnNavigationPathUpdated);
        TargetNavigationPath->EnableDebugDrawing(bDrawDebugPath, FLinearColor::Yellow);
    }
    else
    {
        TargetNavigationPath = nullptr;
    }
}
#
//On tick i remove point, if AI close this point
float ScaledCapsuleHalfHeight = RootCapsuleComponent->GetScaledCapsuleHalfHeight();
if (FVector::Dist2D(CurrentLocation, TargetLocation) <= 20.f && FMath::IsNearlyEqual(CurrentLocation.Z, TargetLocation.Z, ScaledCapsuleHalfHeight * 2.f))
{
    TargetNavigationPath->PathPoints.RemoveAt(0);
    FNavPathSharedPtr NavPathSharedPtr = TargetNavigationPath->GetPath();
    NavPathSharedPtr->GetPathPoints().RemoveAt(0);

    FPathFindingQueryData NewQueryData = NavPathSharedPtr->GetQueryData();
    NewQueryData.StartLocation = GetNavAgentLocation();
    NavPathSharedPtr->SetQueryData(NewQueryData);


    if (TargetNavigationPath->PathPoints.IsEmpty())
    {
        TargetNavigationPath->PathUpdatedNotifier.RemoveDynamic(this, &AAIPawn::OnNavigationPathUpdated);
        TargetNavigationPath = nullptr;
        OnMoveFinished();
    }
}
glacial harbor
#

Are there different identifiers for each cut off area in the nav mesh? Like if there's a gap or obstacle between them. I ask because I'm thinking I could use an A* pathfinding for AI parkour/climbing if I could just distinguish each separate section of the nav mesh.

#

Currently I can make my AI parkour using EQS. But it becomes less accurate the more obstacles there are between the AI and the target location

sonic garnet
#

Quick Question : I have problems with my AI enemies ( FPS drops by 2 for every enemy ). So im making a FPS game and all the enemies spawn via triggers. So just running around the level with 0 enemies gives me constant 80 FPS. When I start spawning enemies, the FPS decreases drastically. My enemy actor ( for testing ) has 0 blueprint logic except at begin play it has a command to walk to me. It has no animations, no shadows and is very low poly. Still the FPS drops. When 20 enemies are spawned, it goes to 40 and if you look directly at them, it goes to 30 making it unplayable. Am i missing something here? How can literally any game spawn 100+ actors that chase me and there is literally 0 change in FPS? I must be missing something. Chat GPT always suggests dooing LODs, easier animations, off lumen etc.. but none of those things help in any way. The problem lies in the movement of the skeletal mesh. If they stand still, I get almost no FPS drop, even when looking at them.. this only occurs when they start moving in any way. Did anyone have similar problems? Or am i the only one? Please help if anyone knows what could be chauseing this.. Im running a GTX 1060 6GB and i7-6700. Thank you so much:)

uneven cloud
uneven cloud
uneven cloud
uneven cloud
sonic garnet
uneven cloud
sonic garnet
uneven cloud
sonic garnet
uneven cloud
runic stream
#

I am trying to make a horror game with one of my friend and we are having a little problem with the enemy ai, can someone help me with it

harsh storm
#

Not without you stating the problem, no

runic stream
#

well the enemy doesnt stop following the player no matter what

#

it also follows us if we hide behind walls

#

which we want but not throughout 50 corners

#

this is the enemy ai code we put together

harsh storm
#

Ah - you followed Gorka Games tutorial eh?

runic stream
#

my friend does the coding

#

i do the modeling

#

let me ask him

#

yes

harsh storm
#
  1. You're using an outdated/deprecated sensing system (PawnSensing). You should be using AIPerception.
  2. You are always setting the Is Seeing Player to true. So the true branch will always execute.
runic stream
#

oh thx we will try to fix those two and report back if it worked

harsh storm
#

@uneven cloud Blog please 🙏

#

@runic stream Check the first pinned post in this channel and have your friend go through that course in order to actually learn the tools of AI in UE.

runic stream
#

ok will do

uneven cloud
runic stream
#

yeah we are both idiots

harsh storm
#

It's not your fault. Gorka Games just should've done a lot better research before pushing content.

#

But the YT algorithm is more important

#

¯_(ツ)_/¯

misty wharf
#

Gorka enjoyers having problems again? :D

#

We need a command on the bot like !gorka or something

#

lol

uneven cloud
#

Is it from a gorka tutorial? Cause I don't see how that could ever work, even in a short video

harsh storm
#

Yeah - it's his "make a full horror game" tutorial or w/e

#

He's the main reason for the resurgence of PawnSensing

misty wharf
#

I suspect it probably works if you set it up exactly like in the video and as soon as you deviate at all it fails

harsh storm
#

Per usual

misty wharf
#

so basically for anyone attempting to adapt it to their own project it fails :P

#

at least Gorka's new videos use AI Perception

uneven cloud
#

Tbf all tutorials use pawn sensing

harsh storm
#

I want to watch it to better be able to help people when they come in, but I also don't want to give the view. The conundrum

harsh storm
flat dome
#

Anyone using Statetrees?

Having issues with the Statetree just running an evaluator check once

#

If its hooked up to a blueprint and the evaluator is using things under Event Tick, it should recheck everything, no?

noble silo
#

hey so I have an AI that looks for certain objects in my world. currently it destroys the object and then runs an EQS to find the next one. I don't want to destroy the object anymore. how would I make the AI know it has already touched a certain object?

#

would it be a gameplay tag or?

#

I currently am setting a bool on the object and using a decorator to check that bool but it doesnt seem to work as expected

dense owl
zealous maple
#

Hello! I have an issue with an AI inside of my game, and I'm not sure what it causing it and I hope someone here can help me how to better debug or what the potential error could be.

I have an AI that spawns in-front of the player, and start running towards the player. In editor (and PIE), this works, the AI spawns and start running towards the player.

However, when I package the game for Windows and play the game. One or two of my AI's spawns but then does NOT move towards the player, and I can't find any reason why this is happening. The same AI works in other places and it works in PIE but not in the packaged game. Does anyone have an idea why?

odd tide
#

@uneven cloud i'm using Pawn, with self movement logic

zealous maple
harsh storm
#

Run the BT on possession and not on BeginPlay

uneven cloud
zealous maple
# harsh storm Run the BT on possession and not on BeginPlay

Tried changing to that, but the AI in this one particular spot still doesn't move. It feels (but I can't debug it since I can't find how) like the nav-mesh is broken in a packaged build but no when player in editor. Thanks for the suggestion though! Since that seems safer anyway. 🙂

harsh storm
#

Try recreating the nav actor

#

Should be called like recast or something like that

zealous maple
#

Sorry, how would I do that?

#

Not sure I know how to yet.

harsh storm
#

In the world outliner, search for it and then delete it. Then recreate the navmesh

zealous maple
#

Oh, yeah, already did that as well.

#

I tried deleting both the nav-mesh and the AI and place them again, but still same issue. That is partly why I believe it must be something there. but I just do not really know why.

odd tide
#

@uneven cloud What is the built-in pathfinding function? I'm confused, for my AI I use Actor, a movement written from scratch with movement replication based on data extrapolation, since the standard Character is not capable of delivering good performance

uneven cloud
glacial harbor
# uneven cloud No there is not.

I see. Would you happen to know how some people were able to setup auto nav link generation? Like detecting the edges of each nav section? That one seems to be related

safe wharf
#

I am having some slight issues with my Behavior Tree.

I have it finding a certain actor and setting that to the Blackboard, and it does find and set this correctly.

I then have it call the MoveTo and give it the key to that actor, however it is always aborted and then tries to restart the loop.

uneven cloud
wide lily
#

if that area is green, it's probably not an issue in your navmesh

zealous maple
#

The thing is that it works inside of the editor (playing in PIE and all of that) and the nav-mesh looks fine there. But once I'm inside of a packaged game it no longer works, and there I don't think P works?

wise sluice
zealous maple
#

Will do a test and see if I can make it work!

olive turret
#

Hey, I am trying to come up with a positioning logic in which the AI finds a position where there is nothing else between the point and the target(PlayerStart). I am doing this with a trace test. However, the points generated between the courier also get filtered out because it's self in between. So I basically need the Ignore self option for this trace test. Does anyone know a walk around this? And no I can't change the collision setting of the courier, then other AI's would position themselves on a wrong point.

dapper crest
#

Does Run Behavior use a copy of the same instance of the tree calling it? I guess I'm asking, is there a performance cost to using Run Behavior to structure your tree and avoid duplication?

terse panther
haughty tide
terse panther
#

i do the same whenever there is something missing from an eqs test

olive turret
haughty tide
#

do you have the AI_Module in your build.cs ?

olive turret
haughty tide
#

are you using public inheritance ?

#

e.g public UEnvQueryTest_Trace

terse panther
#

.h and .cpp

haughty tide
#

that will be helpful yeah

#

and also the compiler ooutput

olive turret
#

I can't, it is gone. I created another class which is almost 1 : 1 copy and on there I added ignore self option. So it is fixed but not with the most elegant way.

rapid obsidian
#

Is there a easy way to make an not clump up so much when they move to something to attack it

harsh storm
rapid obsidian
#

Ah yea that would be good idea

harsh storm
#

If there are no spots available, have them do something else. Like go somewhere and taunt or something.

rapid obsidian
#

What would be the best way to share the spot info between the ai?

harsh storm
#

I actually did a quick prototype a little bit ago, let me find it.

rapid obsidian
#

I'm trying to think how to implement it. I know how to do eqs but not sure how to not do it per ai

#

Awesome ty

harsh storm
#

You can follow that talking points in that convo

#

It's not exact because, again, it was thrown together in like 5 minutes

rapid obsidian
#

That is awesome and super helpful just glancing at it that makes a lot of sense

#

I appreciate the help

uneven cloud
uneven cloud
dapper crest
simple stump
#

Also a flocking calc to use as influence is quick n easy if you have a decent algorithm

#

probably as cheap as it gets too

sand sail
#

Is there a way to smooth out movement? I have a flying AI and it's just a straight shot to each target point, rotate, then on to the next. Left is what I see, right is what I want (sorry for bad programmer art)

#

This is mostly for airplanes/helicopters, they would bank after hitting their target point in anticipation for the next one

terse panther
# rapid obsidian Is there a easy way to make an not clump up so much when they move to something ...

you can create a ticket system for this....
every AI before attacking the player ask for a ticket, if the ticket is available assign that ticket to the AI, and then he will do an action and after that acting it will go back to its initial position and will release the ticket...

and for the positioning i was using donut eqs,

also you can implement a location reservation system, so like whenever AI moves to a point it will reserve that location, and now when another AI search for the location for standing it will search all those points which are x distance form the already reserved location by other AI...
you can store all the reserved location in a globally accessible array ( make a subsystem for this), and use that array to find out locations ...

https://www.youtube.com/watch?v=GiQJw3Mg0qY

this is what i created with using these systems.

rapid obsidian
terse panther
rapid obsidian
#

Oooh that makes sense

#

But that would have to track every single thing that's attackable?

#

Wonder if I could have the target have it's spots somehow and serve them out to people attacking it

silent hamlet
turbid escarp
#

Hi, i need some help with optimisation on my AIs, they are a lot of them (about 95 on the map but i'd say 30 present on the screen at the start). They make the game very laggy and it is because of the movement component and the animations (at least that what unreal insights says). Does anyone have an idea to optimize it?

misty wharf
#

Use Unreal Insights to find out where the time is being consumed

#

It's hard to say without information from profiling

terse panther
haughty tide
#

can I somehow make EQS debug not get disabled if I unpossess the player in the viewport (e.g hit f8) ?

keen crow
#

so I upgraded my project from UE5.3.2 to UE5.4 preview, and now when compiling I get these errors in built-in BT nodes. has anyone had these problems?

Also it seems these compilation error occur for nodes for which I have my own versions where I inherit the UE version and extend it in some ways. It's like the compiler demands me to override every virtual member of inherited nodes even if I don't need to wtf

misty wharf
#

Have you checked if they shuffled things around to new modules?

#

the unresolved external symbol often occurs if you are missing a dependency in build.cs

keen crow
#

yeah, everything seems to still be in the AIModule

proven elm
#

I am getting beaten by hehavior trees

#

i hope someone can helpe

#

i want this wait to ONLY trigger once the character is at the END of the spline path i have

#

instead of, every single time it reaches a spline point :8

rapid obsidian
proven elm
#

fixed.

uneven cloud
rapid obsidian
#

Context? I will look into that

rapid obsidian
#

looks like i can make a custom context and set it to the currently assigned target in the enemy AI, but then if multiple AI are attacking this target will they be referencing the same context or different instances of same context. does that make sense?

harsh storm
#

The assigned target will be a reference, so they reference the same actor instance

uneven cloud
#

It doesn't matter if the context is a different instance.

rapid obsidian
#

Okay I think I can figure it out

frosty quarry
#

for some reason he can catch me when i am hiding. Perhaps there is a way to make my character invisible or a simpler method to go about this?

terse panther
#

this is who i am using it

distant snow
#

I was adjusting some project settings for the High fidelity Nav Mesh resolution and at some point I had a crash.
Since then, all my nav mesh displays are gray instead of green and all characters fail (abort) when trying a MoveTo. Any idea what this might be and how one could fix it?

#

I've tried things like restarting UE(5.2), deleting the NavMeshBoundsVolume actor and the RecastNavMesh actor. Still generates a gray nav mesh that deosn't seem to work with MoveTo

uneven cloud
uneven cloud
terse panther
frosty quarry
uneven cloud
uneven cloud
frosty quarry
#

How would I go vaout doing that-?

uneven cloud
terse panther
uneven cloud
terse panther
uneven cloud
#

Plus you have to iterate over the list every time you update their location, so you aren't actually reducing how much you are iterating

uneven cloud
terse panther
uneven cloud
terse panther
hallow compass
#

Hello,
i got questions regarding IA related assets (Tasks, services, BTs and BBs) :

  • can you make childs of those ?

what i mean is (e.g.):

  • having AI1 and AI2 having a same BT
  • this BT has a task "do stuff"
  • but "do stuff" for AI1 would be "count to 100" and "do stuff" for AI2 would be "run towards player"

like overriding a function in BP

also, is there some place to better understand the pros & cons between BTs and STs ?

distant snow
distant snow
#

The issue seems to come from the presence of the "Low, Default, High" nav resolution settings in DefaultEngine.ini

NavMeshResolutionParams[0]=(CellSize=38.076923,CellHeight=10.000000)
NavMeshResolutionParams[1]=(CellSize=19.038462,CellHeight=10.000000)
NavMeshResolutionParams[2]=(CellSize=19.000000,CellHeight=10.000000)

^These lines become present when I try to adjust the nav mesh rez fidelity in project settings.
idk why but when these lines are in the .ini, the navigation aborts on MoveTo. I can live without it for this project, but would like to know why

verbal shore
#

So, today I was testing the State Tree.

  • I created a State Tree asset and then parameters.
  • I assigned this asset to the State Tree Component and saw that my parameters were exposed. That looked really cool.
  • Then I configurated these parameters through the component's default values.
  • I placed my character in the world, and these values were reflected in the State Tree properly.
  • Then I changed the default value from the component, namely, the animation I wanted to play for death.
  • The animation didn't change in the game. That was strange.
  • So I took a look at the placed actor and realized that changes in the class are not reflected in the placed actors for State Tree parameters.

Really weird. But I believe that's extremely prone to errors. Luckily, I noticed this sooner.

signal island
#

is there an easy way of enable and disable the behavior tree?

#

or somekind of resume

dense owl
signal island
dense owl
signal island
dense owl
#

What’d you do, ctrl+F in the solution instead of actually using them?

misty wharf
silent hamlet
uneven cloud
silent hamlet
hallow compass
#

i didnt know dynamic subtrees was a thing

uneven cloud
hallow compass
#

for example, lets says that i got a main AI that holds a gun
depending of the gun, he will act differently (movements, shouting, etc)

how can i make the used conditions, tasks changing depending of that ?

i cant warp my mind around the BTs and STs regarding reusability and inheritance

misty gale
#

Sounds like the same tasks just different anim blendspace, sound cues etc...

hallow compass
# hallow compass for example, lets says that i got a main AI that holds a gun depending of the gu...

another example :

for a prison game, lets say we have prisoners and guards AI
they have 2 state : "walking around" and fighting

those 2 state are then used for both, so i could make one BT/ST to hold this
but, the "walking around" and fighting rules wont be the same

guards have more area access then prisoners
prisonner can only fight wit hhands, but guards can get to the locker room to get guns to shoot

hallow compass
#

the last example shows it more

silent hamlet
hallow compass
silent hamlet
#

Taking your example in this case i would just have different (sub)trees. It seems that the array of tasks available to prisoners is different than the one available to guards. Then, let them do different tasks

hallow compass
#

i see

#

i guess i'll have to test some more

full oyster
#

hi we're having weird issues with a nav mesh in ue5.3
it works perfectly fine in the editor but once built it doesn't seem to generate properly. It's in a world partitioned map with dynamic nav generation around navigation invokers

#

there's nothing that should be able to block generation in these areas just flat landscape with some generated grass

uneven cloud
silent hamlet
full oyster
#

that's good to know, thanks! still super annoying

obsidian igloo
#

is there a way to set an AI focus to a point in 3d space? SetFocalPoint on the AI controller only sets the yaw and not the pitch. for example
if the AI sees the player up on a ledge and the player moves out of sight, I want them to lock their focus on the last known location of the player, but currently they look directly forward regardless of the Z position of the focal point location

uneven cloud
obsidian igloo
terse panther
obsidian igloo
#

I have yes, but the issue is I dont want to have to do 2 separate calculations if I can just set the focal point and have them look at something using the control rotation

uneven cloud
obsidian igloo
#

use controller pitch and yaw?

obsidian igloo
terse panther
obsidian igloo
#

sometimes yes, but most of the time no. either way they look straight forward towards the focal point, but there is no pitch

#

z position seems to have no effect

terse panther
obsidian igloo
terse panther
obsidian igloo
#

its been a thing since early versions of UE4 and ive always wondered why it doesnt include pitch. it would be so useful and avoid duplicate calculations lol

terse panther
#

i was about to go to sleep...
now i have to look into it 😅

obsidian igloo
obsidian igloo
#

heres an example video of whats happening. maybe this will help clarify the issue for others! 😄

hallow compass
#

is there a "good practice" number limit of subtrees in BT?

#

same for BB childs

hallow abyss
#

Hey, can anyone help me understand creating multiple enemies? I've created an enemy that attacks pawn on site but when I drop a 2nd instance they won't both attack, only one will attack, and the other randomly stops

misty wharf
#

It sounds like your perception setup could be incorrect and they are detecting each other as enemies as well, but it's kind of hard to say for sure

hallow compass
#

what is a good way to set BB keys value from a BP outside of the AIC ? for example, the game state

dense owl
uneven cloud
frozen swift
#

Hi, I'm having an issue with state tree evaluators not ticking between states? If a state's task doesn't tick more than once, ie enter's state and leaves, and goes to next state, the STE's aren't getting called between one state and the next.

That's leading to an issue of the state tree using the wrong state because when I reach the end of the state tree, and go to root, it doesn't read the ste and therefore acts on old information on deciding on course of action.

Without adding a state with a task that literally is just a slight delay to give the ste a chance to tick, are there other solutions?

hallow compass
silent hamlet
slender dock
#

It's true so why isn't it cancelling the others?

#

It runs Run EQS Query but Move To doesn't run. Then It picks another sequence. Can the EQS query fail and it selects something else?

slender dock
#

I'm a duffus. The blackboard key wasn't set to the correct value 🤦‍♂️

cyan locust
#

Does anyone know what would cause a navmesh to not work in-game, despite being fine in editor? (UE 4.27)

slender dock
#

What would be the best way for this to only heal if it's hidden? If it's not hidden then keep trying to move to a hidden place.

silent hamlet
hallow compass
#

is there a way to debug the "ai move to" ?

such as, drawing a sphere at the goal location, and having some draw lines to see the path of the AI

hallow compass
#

if its not built in, i would like to do it myself but idk if i can get the AI "path" from a "AI move to" request

misty wharf
hallow compass
#

where can i find it ?

misty wharf
#

Tools->Debug

hallow compass
#

ill check it ty

#

so you cant get the path that a AI is using ?

misty wharf
#

What do you mean? The Visual Logger should be able to display the path the AI is trying to take

hallow compass
#

i mean in BP

#

can i get an array of points or something like this ?

misty wharf
#

For MoveTo I'm not sure if it's exposed to BP's, but I think there should be a way to ask the navigation system to calculate a path which it can then return

hallow compass
#

okay ill try to find that

unborn jungle
#

Has anyone noticed any of the improvements to large world navmesh generation in 5.4? Diving in now to see if I can spot any myself

terse panther
misty wharf
#

Nice, that looks like it should do the trick :)

hallow compass
#

ty

terse panther
#

it won't change the pitch if focus is not an actor

obsidian igloo
#

is that in the AI controller class?

terse panther
terse panther
hallow compass
#

on editor utility widget, when i get selected actors and get AI controller it returns null

#

but i am selecting the AI character that is controlled by an AI controller

obsidian igloo
terse panther
harsh storm
hallow compass
harsh storm
#

When do you get the controller?

obsidian igloo
harsh storm
#

Does the AI move around?

hallow compass
#

looks like a editor widget issue

hallow compass
harsh storm
#

What are you trying to do exactly. Be as specific as possible and include as much information as possible.

#

Because you're talking about an editor widget and then referring to gameplay stuff

hallow compass
#

i am doing this through the editor utility widget

#

for debuggin purposes

harsh storm
#

I don't believe editor widgets are meant for runtime things.

slender dock
uneven cloud
obsidian igloo
hallow compass
uneven cloud
hallow compass
#

also, i cant find what the "gameplay debugger"

terse panther
dense owl
hallow compass
#

only some text

uneven cloud
hallow compass
#

the nav "section" shows big rectanlges, i was more looking for some lines

#

also, the "get path point" only returns 2 points (start & end), i though it would have more points if there is something blocking the way (e.g: a wall)

hallow compass
silent hamlet
uneven cloud
hallow compass
hallow compass
lyric flint
#

Hey guys, I'm trying to make the ai which riding some tree (Like, grab a branches of tree and jump) How can I do this with AI? Please gimme any idea

ocean wren
#

There's a GDC presentation about how Assassins Creed Devs did it for the one with the trees (american one?)

silent hamlet
#

or just give a better description of your overall goal if you want high level advice

obtuse igloo
#

Anyone have an idea as to the direction I could go to make something similar to a Sims Moodlet and Needs System? Any tutorials for some kind of start would work as well!

silent hamlet
#

If I get to my computer and don't forget I'll share it

obtuse igloo
obtuse igloo
#

🙏

obsidian basalt
#

Hey there, does anyone know how to toggle next AI character when debugging state machine on PIE? I’d like to use a keyboard shortcut rather than switching windows for selection if possible

agile stirrup
#

how can i get an AI to sense a chaos agent and walk up to it and destroy it ( i already have the attack logic done )

#

I turned the chaos agent ( geomotry collection ) into its own actor i just dk what i need to put into the components tab for it to be recongized

uneven cloud
hallow compass
#

can I create categories (or at least sub ones) ?

kindred zephyr
#

What sort of separation on concerns are people using for AI? If you have a character doing something it seems you need awareness of state in 3 to 4 places

#
  1. Behaviour tree blackboard or State Tree
#
  1. AI Controller
#
  1. Character Actor
#
  1. Animation blueprint
#

Now these don't all need exactly the same info, but there is still quite a lot of common info- so what's the best way to manage that without creating variables in four places?

#

The alternative is tighter coupling between levels- e.g. making everything read from the actor itself or the blackboard for example- but that tightly ties all four together

glass perch
#

I'm puttting an enemy ai together and i'm trying to get an enemy to move out of visibility of it's target (player) but it stopswhen its out of view leaving half it's body showing. Is there a way i can make an ai character takes its capsule radius into account or something? or something similar before i start hacking something together? lol

kindred zephyr
hallow compass
#

i have an array of points for a flying AI, i want the AI to follow the path

i got it working rn with "Move To Location", thge issue is that it isnt following the Y values, its staying on ground
setting up the AI Character to Can Fly didnt change anything.

what is the proper way to do that ?

glass perch
kindred zephyr
#

Just looking at it now- in the EQS trace there is an 'item height offset' setting under 'advanced'

solar oriole
#

how can i make a chicken ai for my game

#

I want it so the chicken will wander a little bit and if it sees the player it will chase him and try to kill him

dense owl
modest forge
#

How does one filter AI, animation physics for actors not visible in current scene due to distance or occluders.

uneven cloud
uneven cloud
uneven cloud
hallow compass
uneven cloud
hallow compass
#

i have more stuff inside then a simple move to

#

but this doesnt answer the original question that is about create categories

uneven cloud
uneven cloud
hallow compass
#

where do you put your AI stuff then?

#

in events in the AIC or Pawn ?

#

i dont see why i shouldnt do all my logic in BTs

uneven cloud
#

A significant amount of the logic is in the BT. Just organized a lot better. You don't need multiple movement tasks.

#

Using an object is a single task, regardless of the object

hallow compass
uneven cloud
hallow compass
#

should this be just a event on the AIC/AIP ?

uneven cloud
#

No that should not be an event. All of your tasks are ultra specific instead of actually using variables to make them generic.

hallow compass
#

this cant be done with vars

misty wharf
#

Well it seems to me that for example MoveToBed has no reason to be MoveTo Bed when it could just be.. Move To and the target just happens to be the bed

#

Same with move to player, is there some reason it can't be Move To with the player as a target?

kindred zephyr
# uneven cloud Depends on what you are doing. The character shouldn't need anything from the B...

Let's say we have a character and we want it to attack. The 'brain' bit needs to trigger the attack and know it is attacking- so either the controller, the behaviour tree, or both; the actor itself needs to play an animation and make sounds; the animation blueprint needs to do some work, listening for events on the animation, possibly firing events back to the character when the animation is complete, or when the 'lethal' bit of the animation is playing. So, as far as I can tell, all four of those need some sort of awareness of state

#

It's not exactly the same info and not the same logic getting run on all four, but it's the same mode

uneven cloud
kindred zephyr
#

But for all those things you need to be in the 'attack' state

uneven cloud
kindred zephyr
#

There's an attack task though

#

I'm not trying to recreate a state machine here btw

uneven cloud
#

Sure, but the character (body) doesn't need to know what task the AI is in. Just that it's attacking.

kindred zephyr
#

Again, I get that. What I'm trying to get at here is that each one of the bits needs to know, at some point, what it is supposed to be doing, and all those need to sync up

#

I'm probably just being stupid!

#

It just seems like there's either necessarily a fair bit of duplication of state along the chain, or there's a clever way of abstracting that out that I've not thought of

uneven cloud
uneven cloud
hallow compass
#

since its specific to that moment

uneven cloud
# hallow compass no

Then you either need to learn more about programming or trying to do too much in the BT. Probably a bit of both.

hallow compass
#

so tasks cant be specific ?

#

for e.g. the "drop player in bed" will never be used somewhere else

#

so i dont see how I can make it generic

uneven cloud
hallow compass
kindred zephyr
uneven cloud
hallow compass
#

to know what to put where

uneven cloud
hallow compass
#

if you want to redirect those actions somewhere else, i will probably end with event in the AIC or AIP or GAS or interfaces with player

dusty quest
#

is there any way to reset all the values in the blackboard?

quaint herald
#

Do these really work in a StateTree task? Unchecking "Should State Change on Reselect" still lets EnterState to fire repeatedly even though the state hasn't changed.

obtuse igloo
#

Anyone have a simple example of using utility ai with behavior trees? Idling, eat, sleep.. I'm also wondering if using enumerators would help or gametags for what state/action they'd currently be in

obtuse igloo
#

Did some more research, and realized a simple example tutorial is asking for a lot LOL

uneven cloud
misty gale
#

Which part is the hard part, if you dont mine elaborating some

#

Debugging feels a bit weird, and calculating/tuning weights can prob get tricky in larger setups

#

First one can prob easily be mitigated by some custom tools

uneven cloud
# misty gale Which part is the hard part, if you dont mine elaborating some

The vast majority of people want to do AI in a scripted way. If x is true, always do y. That's why you see a lot of BTs that are forced into FSMs or scripted AI.

With Utility, it's more thinking about it as "the utility is higher for x when y conditions are met" And express that with math. True utility is also used with curves. So instead of "attack when the target is X distance away" it's "the curve of the attack is higher the closer you are to the target". I see a lot of people trying to fight the system, because what they actually want is to "do X when y happens".

Utility really only shines when you have a lot of actions that are reasonable to do. It's perf is a lot worse than a FSM and a BT, so if you only have a handful of actions you're wasting a lot of perf.

misty gale
#

Im basically using utility ai, and can currently handle quite a fe æw task checks on some unoptimized tick,

#

I do limit the avaliable actions tho, and do early returns

#

Ty for elaborating 🙂

mint pine
#

Hello, i have a possibly supper beginner question, i am trying to use nav mesh volume in a paper-2d project, it seems to not work, using the show>Navigation (or clicking on P) i still dont see the green thingy

solution found: lower the RecastMesh-Default>Nav Mesh Resolution Params>Default>Cell size to 1,0

regal pendant
#

why is my nav mesh not picking up this area

storm sail
#

either your collisions/collision settings are incorrect, or some navigation involker is blocking that area

#

overall there's not enough information to give a clear response

sudden field
#

me again. months later. turns out yes, the navmesh was checking every single sprite in the group, because the GetNavigationPerInstanceTransfrorms method of PaperGroupedSpriteComponent is unfinished. if you ever have this problem, just disable 'can ever affect navigation' on your sprites, and use an instanced static mesh for collisions. or, fix the method below.

misty wharf
#

Interesting

#

I guess they didn't assume anyone to use a grouped sprite for something like trees spread across a larger navmesh

cursive tusk
#

Hey all! I'm wondering if somebody knows a good solution for 2D multithreaded pathfinding. I've seen a couple of plugins that are for 3D which I could adapt, but nothing very promising, to be honest. Any help here would be appreciated 😄

sudden field
#

you wanna know the best part? the fix was just && AreaBox.IsInside(InstanceToComponent.GetLocation())

#

at least, I think that fixed it. I did see huge performance improvements and my navmesh is still generating fine, but I'm still seeing some weird numbers

verbal shore
#

Is there a console command for AI debugger?

celest python
verbal shore
#

I guess what I need is named Gameplay Debugger, the one that you can view perception, behavior tree, nav mesh etc.

celest python
#

hmm, not that I know

verbal shore
#

Hmm, I couldn't find it anywhere as well. Thanks!

uneven cloud
frosty quarry
#

What would the easiest way to make my AI be able to Open doors?
The first image is my Door BP, All you need to do is press E to open the door. But how would i make the BP_AI able to open the door?

misty wharf
frosty quarry
#

do you need to see my AI blackboard or anything like that?

misty wharf
# frosty quarry do you need to see my AI blackboard or anything like that?

Well I can't really tell you exactly how to do it because it depends on how your character etc. works - but you would basically just set it up so that your character blueprint has logic that detects when it collides with something, and if the thing it collided with is a door, it would try to open it

terse panther
misty wharf
#

Yeah that too. Generally it depends on how much you want the AI to actually look like it's opening the door, or whether it doesn't matter so much :)

#

(Smart links are good if you want to do something like play an animation so it actually looks "right")

terse panther
misty wharf
#

Anyone using smart objects? I'm kinda looking at my SO systems again and I'm wondering if there's some intended way to use multiple different gameplay behaviors on it

#

Basically my SO slots support two different kinds of actions, but there doesn't seem to be any builtin way that allows you to choose from multiple behavior definitions (eg. if you have one per action type)

#

I had some workarounds for it but they're not great.... maybe I just need to make a custom behavior config type that allows defining a map of gameplay behaviors and when using the slot the appropriate one is loaded from the map or something...

sand trench
#

Hi guys! any good tool to work with behavior trees in 5.3? as far as I know state trees are still experimental

misty wharf
#

What exactly is it you're looking for? There's already a BT editor and everything in the engine as far as I can tell

#

State trees are quite functional, but have some rough edges you may have to be careful with

sand trench
#

and yeah I heard State Trees aren't production ready yet in 5.3

#

I was just curious about what tools are out there in the marketplace to improve BT, Task and services workflow 🙂

misty wharf
#

Ah I see, I've not really used anything from the marketplace for this. I think there's a few AI related tools there though

dense owl
#

We have a #fab channel

#

Or you can search the marketplace directly

median socket
#

It works like a charm.

#

IIRC the NavLink component isn't Blueprint exposed by default, but some wonderful person here created a little wrapper a while back that I've been using to great success.

#

Actually, we still have some issues with NPC:s getting stuck behind the now open door, so clearly doors aren't a very simple problem :D

tough ermine
#

ok

#

I am using paper 2d and want to create a nav mesh but it seems like the navmesh volume isnt picking up

#

any assistance would be awesome

amber saddle
#

Im working on a co-op rpg. I use behavior trees for my enemy AI, and GAS for abilities / attributes. So far so good. But im looking to create a more complex AI. But not really sure what the best practice for storing the relationships and data that I need to store would be. Ive been thinking about gamestate or perhaps the gamemode.

I want my enemies to be a part of a species. Some species will have naturual allies and enemies, but I want those relationships to evolve over time. For instance, if my player has positive interactions with one species they could gain trust, or if they attack species, eventually the game will send out bounty hunters after the player.

How would you go about storing the relationship data?
Currently, most of the data I have / need is either stored in the player state, the blackboard or on the actor/enemy directly.

honest mulch
#

i ahve a problem, my NPC sometimes always tuck in this place

misty gale
dense owl
#

Or make your npc smaller

dense owl
steel moat
#

is there any way i can get the switch case functionality in behavior tree? like selector will select on the value of enum. I tried finding tutorials for it but didnt find any if anyone knows any video or blog post about it that would be a big help too]

plucky hearth
#

my behavior tree detects correctly when Player1 (left) is close to Ai character (Right side)
as you can see, I have a Task that inside has a Ai MoveTo (because a normal MoveTo in the tree didnt work)

I think is something related to my ai BP, which works perfectly with Simple MoveTo
but I need to use Behavior trees etc

#

my Ai Bp, is the same BP for Both, normal for player and ai, this shouldnt be te problem, as the detection is happening, right?

#

I used my normal BP of the player just to test fast because everything is setup to spawn this BP and so on

amber saddle
terse panther
uneven cloud
amber saddle
uneven cloud
uneven cloud
uneven cloud
uneven cloud
uneven cloud
amber saddle
#

maybe the data might not even need replicated though... since it would be stored on the server anyways.

uneven cloud
amber saddle
#

Thinking more about it I think mostly just the server would need to know and store the relationship data. The clients would just need to be able to know if an actor is an ally or enemy. The actors behavior would be determined by it.

terse panther
harsh storm
#

Bad way

#

If you want a state machine - use a state machine

#

BT's are priority selectors pretty much

terse panther
harsh storm
#

Stop thinking in "states"

#

The first pinned post has a course on AI. It covers the theory.

#

You layout your BT according to behavior priority

#

You gate the branches via decorators really

terse panther
terse panther
terse panther
# harsh storm You layout your BT according to behavior priority

like if i want my AI to throw grenade, it will be become its priority to perform this task, or like if it wants to reload, then reload will become its priority...

so its like priority is changing everytime depending what AI whats....
to enum was the only thing that came to my mind to perform this

plucky hearth
uneven cloud
uneven cloud
terse panther
# uneven cloud In what way is that stopping of thinking about it as states?

i am thinking them as states like...
like in FSM if we select a walking state, means than the pawn perform the walking ...
thats how i am thinking it here...

like if the mag is empty, AI will switch to Reload State, and stop everything and will reload,
same goes for grenade, if i am selecting an AI to throw a grenade(based on certain condition), then i am switching it to grenade throw, so that it can perform certain action to throw the grenade...

plucky hearth
#

BP_ThirdPersonCharacter has a variable isBot?
by default is False
so when player spawn, is false
but my already in map BPs has setup this variable to true

#

this works like that

terse panther
# uneven cloud A BT is not a FSM.

so should i create separate BT's for each of them, and handle it from controller...
or make its something like...
during shooting check for bullet for each fire, if mag not empty then continue fire else abort fire and switch to next sequence of actions

#

as of now things are working, but i a doing them is a wrong way...

uneven cloud
uneven cloud
uneven cloud
terse panther
terse panther
terse panther
uneven cloud
steady quartz
#

Hi everyone. I'm currently making a game in which I push enemy AI via an impulse. I discovered that, sometimes, when pushed at the border of my level, enemies may fall off the navmesh and then they can't come back and follow me just because they were pushed to an area that didn't have it

Is there a function that gets triggered if an AI falls of the navmesh? so that I could maybe fin a navigable point in a radius and teleport my enemy there

misty wharf
#

I don't think the navmesh is scanned in that sense unless you're usinv NavMeshWalking as the movement mode

#

But when movement fails, you could probably either use the failure reason or test it there

#

Or potentially just test it after applying impulses

steady quartz
#

oh ok, thanks!

terse panther
#

@uneven cloud and thank you for pointing out my wrong methods of working...I'll work on them

tidal seal
#

Hello, with StateTree, does anyone know if it is possible to use an Output parameter from a task, as a bind input parameter for another task, on the same level ? I'm trying, but the binding contextual menu doesn't shows the variable I'm looking for

#

This is the ouput variable, which I would like to use in the Join Closest Patrol Location

misty wharf
#

It may also work if you put both tasks into the same state in order, but the behavior of this will be different than having them in separate states (they will run simultaneously)

tidal seal
#

Ok, so yeah my intended behavior is to have it as a child I guess then

#

Thx 🙂

inner zephyr
#

So the UserTagFilter on SmartObjectDefinitions is something we can't change at runtime?

dense owl
#

having a dynamic nav mesh change issue and build paths doesn't fix it, prly cause of the dynamic generation part.
Essentially, depending on how I scale the navmesh volume I get weird results. Too tall, and I get it on the roof, but not in the last 1 to 1/2 floors. Too short and it's either not covering the bottom or the top floor. I had it covering the floors fine when it was static but because I'm making the rooms spawn gradually, the dynamic generation seems to make it break.

#

better angle for the tall part, seems to start occurring on the last 2 floors

#

in the right image, the last room hasn't spawned yet, but that right part disappears once it's no longer a "roof" and it appears on the next room's roof instead

#

I tried deleting and readding the navmesh and making it even bigger but similar issues. Is there some kind of navmesh bounds volume height restriction?

#

I noticed that if I move those specific floors down while Simulating, the mesh dynamically generates on them again (but this doesn’t help me)

uneven cloud
noble silo
#

anyone had this issue? was working fine before idk why stop logic is none

#

This is called on death of my AI on the AI controller. how does this comeback as none? stop logic is a default node right?

cyan sigil
#

Hello! I have a node that changes the distance a character wants to stay away from their home base. I need to be able to run a node that randomizes it, then have that node not run again until a different node/branch (they get into a fight) is reached at least once. Anyone done this before?

dense owl
#

Show a screenshot of where the problem is. Based on that tho, your AICEnemybase is not set properly

quick oak
#

I've had my head down for a few years as I was stuck on a pinned engine version, so I'm a bit ignorant of the state of things in UE5.

StateTrees: What's the general thought of them? I grepped the last 6-12 months of conversations here and there's not a whole lot of substance to parse through.

StateTrees appeared to skip the experimental phase and popped out of nowhere in 5.0. My job tends to be a bit timid when approaching most of Epic's half-baked feat.. er, uh... whimsy. So, I'm curious about the general zeitgeist. Are they planned to supersede Blackboard/BT?

dense owl
#

Or better yet, a different tool for a different job

dense owl
fierce vessel
#

Hi, does anyone have any experience with the new Learning Agents by Unreal, I have already done the drive demo but there is nothing else online, and I still don't really get it

#

any help?

honest mulch
uneven cloud
honest mulch
#

this happen sometimes

uneven cloud
# honest mulch no errors

So it's just not finding locations that look good? Welcome to random. I prefer using the EQS for this reason. You can do more intelligent random instead.

honest mulch
#

only sometimes accros that place

uneven cloud
# honest mulch yes the walk location isn't good

With the EQS you generate a bunch of possible locations and do tests on them. Like filtering out points that are too close. It scores the locations based on the tests and then picks the best one.

uneven cloud
# honest mulch hwo to do that

You create an EQS query. There are BT nodes you can use to run them - Run EQS task and a service. There is documentation on how to set it up.

umbral relic
#

small bug, when ai walks into the player or eachother they kind of get sent flying, not sure how to fix this

dense owl
ornate onyx
#

anyone know why "Spawn AIFrom Class" would be ignoring "Is Spatially Loaded"?

#

manually dropping an actor bp into the world spatially loads and unloads fine, but spawning that same actor bp dynamically, from another bp, it stops working...

tight coyote
#

Hey guys, is it possible to attach an AIController to a non-character actor? I'd like to use a Behavior Tree+EQS for enemy spawning, and I want to run the BT off a basic actor that won't be moving around the level, is this possible?

harsh storm
#

Controller's possess pawns, so at minimum, it needs to be a pawn

uneven cloud
dense owl
uneven cloud
uneven cloud
uneven cloud
tight coyote
ornate onyx
nova prawn
#

Dumb question how would I possess a spawn based on a bool please ?

#

I have a AIController but am unsure how I get that Controller to possess this pawn if it,s an AI Character

#

thought would be something like this but not sure what i plug into the cast

uneven cloud
uneven cloud
uneven cloud
ornate onyx
#

also, my spawner is setup as an actor, and my spawned enemy is setup as a character (for the movement stuff), I'm assuming that's what it should be

uneven cloud
ornate onyx
#

yeah my spawner actor bp, I'm manually adding that to the level

uneven cloud
#

Once the owner is spacially unloaded, the NPC will be unloaded

#

It doesn't matter how you are adding that to the level

ornate onyx
#

it's not working for some reason, the spawner IS unloading spatially, and has spatially loaded checked

#

the stuff it's spawning still isn't unloading

#

I'm losing my mind

#

either way, I know the issue now is that the stuff spawned using spawn actor node puts it in the persistent level by default

#

and it's just not crossing over for some reason

ornate onyx
#

welp, that works, just needed to drop the "get owner" part, I guess that wasn't setup right

#

and plug self directly in, oi

uneven cloud
#

Do you not understand what Get Owner does? Of course it's not going to work when you pass in a null reference.

green epoch
#

hey guys, when im using the ai move to node is there a reason why the ai will not go to the correct z level until after it has gotten to the correct x and y and is there a solution. Im just using the Ai move to node

dense owl
green epoch
#

I have it set to ignore grav, an i put a nav link on every differnt level but other than that, no.

dense owl
#

The built-in navmesh does not include free flying movement, you’d need to either make your own solution or fake it

green epoch
#

yeah im currently trying to fake it but the more time that goes on the more i think i may just needto create my own pathfiding system

dense owl
uneven cloud
cold surge
#

Anyone here can help me with denbugging/troubleshooting why my NavMesh is not showing up in PIE or Packaged projects?
Below are a few images of comparisons between PIE and the Editor Viewport
The PIE has the Show Navigation command on.

More information: I'm using a Static Navmesh, I have several NavMesh Bounds in my OpenWorld level, level is World Partition Enabled, Nacmesh is NOT Partition enabled.
Also Screenshots of the RecastNavMesh settings.
I've used the Build Paths etc.

Would love to get some insight, if more info is needed, please lemme know!

green epoch
green epoch
dense owl
uneven cloud
uneven cloud
green epoch
#

Gotcha thank you

#

Idk what it could be as changes I’ve made is a nav link as it’s ignoring gravity

uneven cloud
opaque bridge
#

Hey guys, I'm new to unreal and I need some help. Is there any way to stop a Move to Blackboard node (thereby resetting the tree and try to find a new target) if the AI doesnt reach the location after some x seconds. Due to the smaller corridors in my level, the AIs are just hanging back trying to move to a location they cant anymore since other AIs have occupied the location they were trying to move to.

green epoch
thorny stirrup
#

Anyone run into an issue where actors move on a navmesh just fine in editor, but not in the built game?

terse panther
thorny stirrup
tidal seal
#

Hi, I don't know if I missed something, but I'm trying to develop a patrolling behavior with State Tree, but I don't succeed right now, the screen shows my setup right now, the issue is on the Join Closest Patrol Location (I think), I've added as a screen the MoveTo Task which is really simple. My State Tree is looping over the JoinClosestPatrolLocation state, never going into the Patrolling State, even if I reach the FinishTask on the MoveTo

nova prawn
#

Hi would someone be able to advise how I can use a Navmesh in a 2D project I have the Tilemap Thickness set to 200 but seems the navmesh cant seem to generate on sloped sprites or platforms

obsidian igloo
#

anyone have any tips for generating EQS points around a location instead of an actor?

misty wharf
#

create a new EQS context which returns the location you want to generate around

obsidian igloo
#

is there a way to update the location of the context at runtime?

#

Ie. currently im just getting a specific vector from a state machine, but would be nice to make it usable with any "input" vector

misty wharf
#

You can pull the value from somewhere else in the context, such as the querier actor

#

Unfortunately there is no particularly straightforward way to parametrize these things in EQS

harsh storm
#

Riot has a PR out there that apparently does. But its sittin' in limbo 😢

obsidian igloo
#

fair enough, I suppose making a context for each isnt too hard, just trying to give the AI the closest location to a point that may or may not be reachable lol

#

suspicion, last known loc, etc

misty wharf
#

Yeah you can manually insert it into a property in the context for in C++ and it'll work just fine... but that requires you to find the appropriate bits off the query which can be a bit iffy code-wise

#

I'm curious what the Riot PR for it does 🤔

harsh storm
#

A LOT of changes

misty wharf
#

Ah, dynamic context

#
TSharedPtr<FEnvQueryInstance> QueryInst = Manager->PrepareQueryInstance(SomeQuery, EEnvQueryRunMode::SingleResult);
 
UEnvQueryTest_WeaponLOS* LOSTest = Cast<UEnvQueryTest_WeaponLOS>(QueryInst->Options[0].Tests[0]); 

LOSTest->AttackTag = FGameplayTag::EmptyTag;
#

This is what I was doing to pass parameters directly into a test :P

harsh storm
#

It'd be nice if Epic would revisit this stuff

dense owl
#

Didn't see anything about it in Tim's tweet about Metaverse and flying unicorns and shit

dawn kiln
#

Hey yall I am just starting out with Behavior Trees and I imagine this is basic, but I'm having a bit of trouble with cooldown

#

What I expect to happen here is that it waits for 5 seconds, and then enters cooldown for 5 seconds, and does this on loop

dense owl
#

it waits 5s first doesn't it

dawn kiln
#

It does not

#

(At beginning of runtime) ⬆️

dense owl
#

having a Wait of 5s and a Cooldown of 5s is prly not ideal lol

dawn kiln
#

That's not really the point

dense owl
#

yeah ik

dawn kiln
#

This is just an example

#

There must be something I'm doing wrong beyond this graph?

misty wharf
#

The cooldown node starts in cooldown and only unlocks it after for one execution

#

I'd assume that's what your problem is although you didn't really describe what it is actually doing

dawn kiln
#

Yes

dense owl
#

just tested and it works as intended

#

I used different timings so it's actually clear what is going on

misty wharf
#

Yeah the cooldown starts in cooldown which is rather counterintuitive but that's just how it works

amber saddle
#

I created an EQS Testing Pawn, I then created an EQ that im going to use to spawn enemies depending on location / distance to the player. I want my enemies to spawn only if the player cant be seen. Ive done it before so I was trying to retrace my steps. BUT Pathing Grid doesnt render the orbs. Ive tried jiggling the actor because sometimes thatll make it render. Itll render all the other generators, just not this one.

dense owl
misty wharf
#

Really? I keep hearing people say it starts in cooldown and I vaguely remember having that same result 🤔

dense owl
dawn kiln
#

Was it broken in 5.3?

#

That's what I'm on rn

dense owl
#

well test with the code I posted and see what happens

#

Hard to tell the difference between the cooldown's 5s and the Wait's 5s as it stands, which was my initial point

dawn kiln
#

You can just tell based on looking at the graph though

#

Or am I crazy

dense owl
dawn kiln
#

Waits for 3 seconds, finishes the cooldown, waits for 1 second

dense owl
#

I also rmbr it doing what @misty wharf said and what you're seeing

#

someone prly forgot one ! in the code lol

dawn kiln
#

Okay thanks for helping me out, I'll update to 5.4 😄

#

I also have another question, if Test_Bool is not set here, should I expect the 20 second wait to run?

dense owl
#

have source control setup so you can revert if needed

amber saddle
hardy shuttle
#

How many AI Controller, Behavior Tree, and Behavior Blackboard files per enemy do you guys have?
Assuming each enemy is unique enough, doesn't that mean 3 files per enemy?

harsh storm
#

I seldom have entirely different BB's for each enemy

#

Find the commonality in everything and see how you can have it data driven more

#

Right now, I can have bosses with different functionality and regular enemies, all with like 2 data assets.

hardy shuttle
harsh storm
#

No, I mean I create a data asset and just define all the changable data in there.

#

I don't use multiple AC's either

#

Generally just one.

hardy shuttle
# harsh storm No, I mean I create a data asset and just define all the changable data in there...

I see, so like one AIC_Generic_Enemy, which uses BT_Generic_Enemy and BB_Generic_Enemy.
AIC_Generic_Enemy: Reads data asset, depending on a particular enemy
BT_Generic_Enemy: All behaviors of all enemies, using selectors for behavior determined by data asset
BB_Generic_Enemy: All variables of all enemies, some are unused, depending on data asset
That way all enemies share the same AIC, BT, and BB. But the data asset controls which behavior gets enabled/disabled.
Is what you what mean?

uneven cloud
uneven cloud
uneven cloud
#

Why is data driving so difficult for some people?

hardy shuttle
#

So 1 AI Controller, 1 BB, a few BT
These being controlled by Data Assets, is that right?

uneven cloud
#

Driven by data that is set up in a data asset

harsh storm
#

I have a BT for different actual types of enemies. The BT is in the enemy data asset. So the AC will get the BT from the pawn. Because the pawn is what holds the data asset. I do generally have one AC, but it's really just a vessel to run pathing and brain component logic (Keep in mind though, I mainly do zombie games 😛). It's my pawn's that actually do the actions and BT decide which actions should be done. And the tasks are designed in such a way that I can change the data based on BB values or w/e else I may need.

I also have sub-trees so general BT logic can be reused.

uneven cloud
#

Our AI definition data asset has things like the BT to use, the perception settings, team and any other variables we want to change on a per enemy type.

harsh storm
#

Yup. Same.

uneven cloud
#

We have a few different BTs, because some NPCs don't do combat and others do combat, but don't navigate (some bosses).

harsh storm
#

I also do use BB inheritance. Because there are some things that like, every BB will be using.

uneven cloud
#

We only have 1 BB.

harsh storm
harsh storm
# uneven cloud We only have 1 BB.

99% of the time, I do as well if I'm being perfectly honest. It does make things soooo much easier. But I have used BB inheritance in the past. So I just mentioned it so people know it's not completely outlandish.

hardy shuttle
placid halo
#

hey! I've been looking into giving a go at State Trees, and moving our Behavior Trees to STs. But there is a fundamental thing that is unclear to me. With BTs you can update the blackboard from outside of them (and it's a huge clusterfuck with the whole bbkey name in a string thing). With State Trees it seems the idea is to have an evaluator that "pulls data" from other places (like the context actor) on tick. Is that so?

misty wharf
#

This can be used or your tasks can pull data directly from outside as well

placid halo
#

what is confusing coming from a BT mindset is that there is no blackboard. Or at least there is no way to set the state tree schema parameters. but it seems like you can bind tasks inputs to other tasks outputs

steel moat
#

does the On See Pawn Function in Pawn Sensing Component gets called everyframe? I wanna know when ai stops detecting pawn

prisma sun
#

Hey,
I'm making an RTS game with auto fight mechanics
I have a lot of Units and I would like to know how to implement a good Enemy detection / fight system
Today I have a Sphere collision and I update an array of detected enemies on Overlapped event.

But maybe AI perception is better or tracing or anything else ?

misty wharf
misty wharf
prisma sun
misty wharf
#

Hard to say what would be best in terms of perf tbh

#

The spheres should use the engine's internal collision detection stuff which I think should be fairly well optimized and avoids doing lookups on stuff that is far etc.

prisma sun
misty wharf
#

Hard to say what's going on in that thread because there's a ton of information missing about the other tasks and no debugger info or anything... but I don't think there are bugs related to this really, the execution flow of the state tree seems to just be kinda confusing if you don't know how it works

#

Iirc if a parent state's task finishes, then it can finish the entire subtree

#

there's some completely unobvious things like that which can cause confusing behavior like in the thread

#

It should be fairly easy to test if you set it up so that you have a parent task which finishes immediately and look at the ST debugger and see how the execution goes

#

Basically there are some situations where you need to have tasks that never finish

#

But yeah I don't think there are any bugs related to the state/task execution, it's just... super confusing because it's poorly/confusingly documented

#

Yeah because of how the node selection behavior works I think

#

The parent state is never entered alone, it immediately also enters the first leaf state

#

And the parent completing can trigger the whole subtree to also to consider it as complete

#

Ah, yeah I don't recall how those affect the behavior

#

I didn't play with the options for that so not sure

#

I vaguely recall there's an explanation of the behavior if you hover over the option, but it could be poorly worded just like every other piece of docs related to this seems to be

#

Best bet is to check the C++ code for it :P

prisma sun
#

Good or bad idea ?
Refact my behaviors trees to StateTree, I don't like blackboard 😇

misty wharf
#

Refer to discussion above

#

Be prepared to be confused at least somewhat and ideally know C++ to figure stuff out from source

#

also note that things like support to run state tree assets as subtrees is only available in 5.4 and unclear how good the support is at the initial release, so if that's something you want it might not be ideal just yet

#

But if all of that is acceptable then go for it, at least in my testing project it works pretty well

prisma sun
#

The idea of StateTree is way more cleaner and make way more sense for me I guess
Will use it for small actors first

steel moat
#

cuz i saw few videos and they all adding it to the controller

misty wharf
#

It's intended to be in the controller but if you must it will work in a pawn, although this will generate warnings

#

I would recommend putting it in the controller as who knows they might deprecate the pawn support at some point

#

(plus warnings should usually be heeded and fixed)

west gorge
#

How do I increase the avoidance radius on the Detour crowd avoidance AI controller? Enemies not running face first into each other is an improvement, but they really need to stay further apart than the radius of their hitbox. 🤔

#

I'm not sure what it uses to determine the dimensions of the character on the navmesh...

misty wharf
#

iirc it uses the collision capsule by default

west gorge
#

😦

misty wharf
#

You can override the function GetCrowdAgentCollisions and set it to whatever I think

#

I think this in the AI controller by default

west gorge
#

Thanks 🙂

dense owl
serene hollow
#

Hey @lyric flint , sorry to tag you directly but I saw that you've been fixing some state tree binding issues (e.g https://github.com/EpicGames/UnrealEngine/commit/526060671189fcc8bff1671e138e697a675c1538).

I'm running into the same issue that was described here: https://forums.unrealengine.com/t/state-tree-any-enum-doesnt-work-with-any-enum-enum-compare-in-ue5-3-2/1406962.

If I just create a blank state tree and create an enter condition on the root node, set it to Enum compare and then pick any enum to bind it to, the editor crashes. Just as an example, you can try setting it to the "Role" enum in the Context actor.

If I just "run" the editor from source, it doesn't crash and instead shows a red warning "Property is bound to Context 'Actor' property Role but binding source type 'ENet Role' does not match property type 'State Tree Any Enum'.

However usually I run the editor from source in "debug" mode and in that case, anytime I select an enum in "Enum compare" or select a state that already contains an Enum compare it crashes on this line in StateTreePropertyBindings.cpp:

ensureMsgf(false, TEXT("Couldnt determine property copy type (%s -> %s)"), *SourceProperty->GetNameCPP(), *TargetProperty->GetNameCPP());

Looks like this is similar to a lot of the issues you've been fixing in the last 6 months or so. Do you know if this is one of the cases you've fixed? If so, do you happen to know what the commit was? I'm hoping to be able to pull in just that fix without upgrading to 5.4 (I'm currently on 5.3.1)

uneven cloud
uneven cloud