#gameplay-ai

1 messages ยท Page 55 of 1

uneven cloud
#

There are lots of resources that you can Google. It's an advanced architecture that is not necessary for most situations. It's also not easy to use, so I'd be very concerned if you need a tutorial for it.

#

No there is not.

misty wharf
#

I'm updating some of my path check code to make sure it uses hierarchial checks since it's faster... but is there ever any reason to not use hierarchial mode? ๐Ÿค”

#

(Just for TestPathSync ie. checking if a path exists at all, not for actually getting a path)

#

Oh wait I just noticed it says "hierarchial mode ignores query filter"... guess that's what it is then...

#

And also that means I can't use it lol

nimble smelt
#

Is there a good way to see what a pawn with the character movement component is TRYING to do?

#

It's supposed to stop before it reaches something and, well, it isn't

#

So I gotta figure out if it's got a logic bug or it's just shitty at stopping even though it's trying

potent stone
ruby granite
#

how can i combine multiple arrays

#

or make it so anything spawned by an actor is a child actor

rare ruin
rare ruin
ruby granite
#

I just ended up grabbing 3 seperate "get all actors of class" and linking them to destroys

#

For simplicity

dense owl
#

Sounds terrible ๐Ÿ˜€

ruby granite
dense owl
ruby granite
#

@floral compass every line of dialog is just this

#

thousands of cases long

dense owl
ruby granite
#

lol

#

true

floral compass
ruby granite
jaunty cairn
#

guys I want to make a AI,he will always follow us. but when we look at it he'll stop,I couldnt find a good tutorial for that. can anyone help me? probably I'll set "ai move to" to our fps character but

dense owl
jaunty cairn
dense owl
jaunty cairn
dense owl
#

AI perception

jaunty cairn
#

what should I add?

dense owl
#

You should watch that video I mentioned, it covers pretty much your exact use case

#

Youโ€™ll just need to modify the behaviour slightly

dense owl
jaunty cairn
#

In the video, it is said that I need to add blackboard. but there is no need. Because artificial intelligence will have 2 behaviors, chasing and stopping

#

what can I add instead of this?

dense owl
jaunty cairn
#

Im watching AI perception part...

jaunty cairn
#

but even in there it's shows blackboard

oblique basin
#

If your behaviour is that simple, you could just do a dot product between the player (character being chased) forward vector and the directional vector between the characters (ai location - player location). If the result is > for example .7, the player is "looking". You can adjust this value until you're happy with the results.

#

However, games are very rarely that simply so understanding and implementing BTs and AI perception early is a good idea

jaunty cairn
oblique basin
#

You'd use a collision channel that the wall doesn't block. I think default is visibility which is generally everything in the world with visibility set to true.

#

It sounds like you should do a rudimentary AI course before jumping in. There are some basics you need to know before trying to make a functional game.

jaunty cairn
#

ok I made it

mortal magnet
#

Hey guys, have an issue with my AI, where the enemy after losing sight of my should go into seeking state, but instead its going to attacking state and following. You can see in the bottom right that the state is indeed Seeking, but in the behaviour tree its running Attacking State

floral compass
#

Inb4 another scolding about modeling state machines with behavior trees :ยฐ)

floral compass
#

It makes it extremely hard to do what you're trying to do

#

But I think what you might want to do is look into interrupting that "Move ToTarget" node. That's what's keeping you stuck in that branch.

mortal magnet
#

@floral compass thank you! I will look at that move to target node

#

though state aborts though when interrupted

dreamy surge
#

I want to put a chat gpt learning program inside my game is this possy

#

Like can my character use chatgpt to learn and use things like scenexplain

#

I would think it would just need a plugin ?

dense owl
uncut rune
# mortal magnet lol is this bad?

Different people different opinions. If the game is quite small and you are not planning or you are 100% sure this is not gonna evolve into 159 subtrees, then I would say if it works, it works. The problem most people are talking about is when you are working in team or on a bigger project, you start doing something like that, and then someone comes, tells you to change the system, and you are like, uhmm i have to write it all from the 0 if you want these changes. So it's really honestly up to you. Still good to know the good methods to approach.

manic sphinx
#

What's the most efficient way in to find the closest k actors of a certain class (or tag, whatever can be done most efficiently) from a certain point? I have to run a kNN algorithm for my AI, but I'd rather it didn't run in N^2 time

#

I'm new to UE5, but not to programming

uncut rune
#

probably use Sight Ai sense to detect actors and then in code make it to only sense specific class

manic sphinx
#

That sounds like it comes with a lot of overhead and probably updates it every time any AI goes in or out of sense range of another AI, though

#

I only need the 4-5 closest ones

abstract yarrow
#

Hey guys. I'm super stuck on this very final bug in my game. I'm having issues with the enemy AI stopping himself from chasing the player after only a few seconds. I'm not sure where in the code this bug is happening but I put a print statement on the OnSeePlayer sensing event and it shows when the enemy loses sight of the player. I'm also having a huge issue with the enemy not roaming anymore. My AI Move to node that's connected to a GetRandomReachablePointinRadius keeps failing

manic sphinx
#

I should emphasize that I'm dealing with a very large number of actors.

manic sphinx
abstract yarrow
#

This is my enemy BP

uncut rune
# abstract yarrow

You have to change it so it will only LookForward when it has Target not set (make it as key), and, on the second branch, you dont have to put blackboard because if there are only 2, and first one will be true (has target, so it's not lookingforward), it will always choose 2nd selector.

uncut rune
manic sphinx
# uncut rune Any videos or more details? I can't picture it

We know a lot of factual information about the starlingโ€”its size and voice, where it lives, how it breeds and migratesโ€”but what remains a mystery is how it flies in murmurations, or flocks, without colliding. This short film by Jan van IJken was shot in the Netherlands, and it captures the birds gathering at dusk, just about to start their "perf...

โ–ถ Play video
uncut rune
#

so you are trying to make formations basically?

manic sphinx
#

No, I'm implementing an agent-based flocking behavior where each bird reacts to the movement of its k nearest neighbors

#

so for k=4, for instance, the bird needs to check what it's 4 nearest neighbors are doing

uncut rune
#

so you need to study EQS

manic sphinx
#

The hard part is efficiently determining which birds are closest for 1000 or 10,000 birds

manic sphinx
# uncut rune so you need to study EQS

I don't need EQS though. This should be some very simple calls. I don't need to worry about obstructions, I don't need to do anything special when a new object comes within range, etc.

#

I really just need to quickly find the 4 closest actors of a certain class

uncut rune
#

make collision spheres for each of bird with radius that you need for them to gather all actors from class in their collision range?

manic sphinx
#

That was my instinct, but I suspect it's rather expensive for the engine to track all of those collision spheres, and I wasn't sure if it's querying them at times other than when I use them.

uncut rune
#

i think it will be expensive no matter what since its a lot of numbers

manic sphinx
#

Yes, so the idea is to minimize that expense

uncut rune
manic sphinx
#

Thanks!

floral compass
#

Sounds like you need some custom octree search algorithm, otherwise yeah mass or EQS

#

But kind of smells like premature optimization. Mass can probably handle that, maybe.

abstract yarrow
#

@uncut rune I'm sorry I'm slightly confused. I also I was trying to build out a test version of my game and it keeps failing for some reason.

But you're saying I shouldn't use the blackboard/behavior tree? I also have code in each branch

uncut rune
#

run game and look what the behavior tree is doing and if its getting stuck somewhere

manic sphinx
abstract yarrow
#

He seems to be stuck at the chase player branch but it's telling me that he cant find the player

floral compass
abstract yarrow
floral compass
uncut rune
#

Read what I said in the first response. You don't need 2 decorators here. You need only one to check if it as target, if has no traget, it will lookaround, if has target will follow the target, if he has target, he wont look for target. You need only 1 decorator on 1 node and set them to self abort on key/value change.

manic sphinx
abstract yarrow
#

I get what you're saying but I just dont know how to do that exactly. I followed a guide to get the AI to this point and I get what you mean about it only needing one decorator but I'm unsure how to set that up in this tree properly

floral compass
manic sphinx
manic sphinx
#

Ugh, was hoping this would be much more painless

#

I'll make a note to take a look

#

Thanks!

uncut rune
#

or I see that you have boolean there? how do you set it?

abstract yarrow
#

Yeah I'm using AI Sensing and a HasSeenPlayer boolean

uncut rune
#

so just change HasSeenPlayer bolean, to the AttackTarget (actor type), and set the AttackTarget to be the actor (Player in that case), that it sensed.

#

and when it senses player, you set blackboard key to be the actor (player), and then it organically happens that if it has target, it will attack it, and when it loses target or has not (yet), it will do the look around*

uneven cloud
manic sphinx
#

But this is also something I'd like to call as often as possible

#

So for any number, it's important to be efficient

uneven cloud
manic sphinx
#

Is the Boids algorithm editable in Niagara? Can actors be stateful in it?

#

Er, can particles be stateful, rather

uneven cloud
potent loom
#

you need to use HLSL though

manic sphinx
#

HLSL?

potent loom
#

the shader language

#

same one you'd use to write a shader in unreal

manic sphinx
#

Ahh, I don't know how to write shaders.

potent loom
#

there's not really a direct way to do it with niagara alone then, boids is state free though

manic sphinx
#

Can you recommend a starter for HLSL assuming I know C-style coding?

uncut rune
#

Would it be clever to have different AIControllers for computer/enemy units and for the real player? What i'm thinking that I will have couple of things that are in common, but computer ai will have some things different and I guess it would be easier to implement that?

floral compass
uncut rune
# floral compass How would an AIController be used with a player?

For a base unit behavior so if the units are idle for example, they need to sometimes alone decide that they will attack if the enemy comes near them, so they don't get 1 shoted for free if the player is not looking. Basically something like auto-agro, that could also be switched on and off. Something like ''I'm ready to attack if enemy comes''. Does it make sense?

floral compass
uncut rune
# floral compass Oh, for an RTS or something right? Off the top of my hat I would use AIControlle...

Yeah I'm still thinking how to implement that, the simpliest and most clean what I'm coming to is to have 2 different AiControllers, probably with some copy pasted behaviors for both. That is why I want to make the AI simplier for the player, and at the same time I'm not sure if it's better to put ''behavior'' like if target is set then do: attack and this I guess I should do on Event Tick or with While? loop? That would make it also 2 different approaches for ''the same'' thing for computer and for the player, if you understand me. (player would use blueprints, while computer behavioral trees for the same thing).

#

maybe I'm actually misthinking AIControllers with behavioral trees??

#

I can have the same AIController but different behavioral trees for player and different for computer? That would be the point?

floral compass
#

And depending on the required complexity of your AI too

uncut rune
#

Do I remember correctly do I set Behavioral tree in the blueprint of the actor?

#

so it uses that tree i specified?

floral compass
#

On the AI Controller's BTComponent

#

Your actors should never interface with any AI code, ideally

uncut rune
#

hmm, so would I need to make switch in the AiController for different classes to use different trees?

#

this is the way?

floral compass
#

Many ways to do that

#

Can start BTs arbitrarily at runtime too

#

It depends

#

I do GOAP-lite and run a BT based on the selected action

uncut rune
#

Hmm, I guess in my case as I have 6-8 different units, where there are 3-4 types that would behave different, i would just create 4 behavioral trees and set them with switch based on class (just thinking out loud). Do you have any better ideas?

#

I guess there is no easy anserw ๐Ÿ˜„

#

all depends as I'm thinking about it

#

I will just have to decide and go with something

#

there is even a way to probably make 1 behavioral tree, but to check if something is ''warrior or archer'' and then choose that behavioral tree path, right?

#

or it's not really the ''good'' aproach?

#

because that would work, are there any nos?

floral compass
#

Keep it simple

uncut rune
#

so would I go with different decorators or different behavioral trees for different kind of units?

floral compass
uncut rune
#

I might be overthinking it with ''how different'' i wnat to make it for each unit, but I guess it's gonna almost all the same just different parameters which will be easy provided by each unit. And I would fit that in 1 behavioral tree.
So the only ''last'' thing that Im trying to make more clear is to separate computer units ai from player ''ai aka behavioral trees" would be to make 2 different behavioral trees and keep it simple.

floral compass
#

Again, not even sure you'll need any AI for player units

#

Since the player's telling them what to do

uncut rune
#

It's just easier for my head to imagine the attack, follow in the behavioral tree than inthe blue prints?

#

yeah but they need to keep attacking while having target

#

do I make it on tick then?

#

since I would need to have while loop (while target is set do)

#

and I would set the target for each unit by clicking with right button on the neemy unit

#

so what I was thinking I would just make it set state Attacking in behavioral tree and let it run in loop

#

at the same time I had idea that I would set bool to ''InAttackMode", and if the 1 target dies, and the bool is still set to true, it would look for the target next to it ๐Ÿ˜„

#

and it seemed right to do it with behavioral trees

floral compass
#

Putting states in BTs is a bad time

#

Check the pinned messages, you'll get a better idea of it

uncut rune
#

i watched them all 2 times ๐Ÿ˜„

floral compass
#

Huh

uncut rune
#

i don't get this concept of states

#

like what is the state in my example? xd

floral compass
#

You mentioned AttackState

uncut rune
#

yeah

floral compass
#

You don't wanna do that

uncut rune
#

i could set it by right clicking on enemy, and setting off by clicking anything else, then everything else would run

#

how else would I do it?

#

or are you saying that i should not use behavioral tree for the mechanic im trying to implement and just to do it in while loop / on tick?

#

or maybe even by timer? and invalidate timer when clicking somewhere else

floral compass
#

I'm saying you shouldn't try to model state machine behavior with a behavior tree

uncut rune
#

and state machine in my case is which part?

#

AttackState? like the behavior behind it that will do: AttackTarget, FollowTarget on the loop?

#

this whole thing should be done in blue print?

dense owl
#

State machine is a tool

floral compass
#

The behavior itself is fine for BTs I think
I just don't think you'll want to do the selection of which behavior to run in BTs

But again, depends!

uncut rune
#

maybe I'm calling my Attacking branch as AttackingState just wrongly?

#

๐Ÿ˜„

floral compass
#

Depends on what you call your other branches :^)

#

And how you do the selection

#

Because BTs are static priority
If you can't definitely say that there is a static priority to your behaviors then it can be tough to implement

uncut rune
#

if no target WaitForTargetToComeCloser xD, if target set (by player, or came into), GoAttack

#

so basically Idle and Attacking

floral compass
#

Well that can work
But it's rarely that simple

uncut rune
#

and GoAttack would be something like: FollowTarget, AttackTarget(dealdmg), maybe 1 more branch with ThrowSpell (with cooldown), and that's it

#

and maybe some units would have something like counter that if AttackTarget finished succesfulyl 3 times, then the next attack will be ''pro'' ๐Ÿ˜„

#

which I think it's similiar to the example from Epic Games where each time it went patroling, the hunger was increased by 0.1 and when reached 1 it had to go anjd look for food

floral compass
#

Try it and report back how it goes :p

uncut rune
#

and I can picture it beeing done with the behavioral trees, maybe Im wrong ๐Ÿ˜„

#

will report for sure ! ๐Ÿ˜„

nova prawn
#

Hi not sure what Im doing wrong here but my enemy is not moving at all.

#

I have assigned an AIController to this enemy and using a AIMoveTo node to move them but it always returns fail. Can anyone help please? ๐Ÿ™‚

cyan sigil
nova prawn
#

Yep

cyan sigil
#

Can you show us?

nova prawn
cyan sigil
#

Is that the blueprint you're using? It's using its own location as the destination.

nova prawn
#

Circled the enemy for ease ๐Ÿ™‚

#

Isnt it getting the player cahracters location on BeginPLay?

cyan sigil
#

Ah, it's just a sphere? Does it have a Character Movement Component? Is it marked as Static?

#

See how the nav mesh makes a hole under the enemy? that means the enemy's sphere component is marked as Static indicating it will never move.

nova prawn
#

Ohh ok never realised that I,ll check the Static Mesh settings.

cyan sigil
#

And does your character have a Movement Component to actually perform the move?

nova prawn
#

Yep so its set to Movable and has a Character Movement Component

#

can see why im a bit puzzled as to whats going on.

floral compass
# nova prawn

Looks to me like the sphere doesn't actually have a valid path to navigate
Uncheck "Can Ever Affect Navigation" on the actor to test

nova prawn
#

it is unchecked

floral compass
#

Uncheck it on the SM too

#

Or everywhere

#

It's affecting the navmesh somehow

nova prawn
#

Ok would this make it move to player character location ?

#

I have unchecked all the boxes there was 1 checked for Affect Navigation

#

so i,ll test again.

#

Nope no movement still

floral compass
#

Let's see the navmesh?

nova prawn
floral compass
#

Huh

nova prawn
#

Its showing the sphere is not "cutting" out the navmesh now.

floral compass
#

Well we've ruled that out

nova prawn
#

Thanks for the help ๐Ÿ™‚

floral compass
#

Is your player actually valid when you call that move to node?

nova prawn
#

I tried this to check

floral compass
#

Do a print string if its not valid

nova prawn
#

You read my mind i updated it ๐Ÿ™‚

#

The Player Is Not Valid does not print out

floral compass
#

Is the actor actually possessed by an AIController?

nova prawn
floral compass
#

Hmm

#

I'm out of ideas then ๐Ÿ˜„

nova prawn
#

Its very weird.

#

XD

#

Do i have to post a location in the AIMoveTo node or can you just use an actor ?

floral compass
#

I think it prefers the actor if you provide one

nova prawn
#

ah ok thank you

#

well i got an print out from the exec pin

floral compass
#

Now? Why not before? :S

nova prawn
#

this prints out the player character outliner name so it knows that.

floral compass
#

Oh ok

nova prawn
#

So it has the player actor which i assume means it knows where the player character is.

floral compass
#

What you could also try is to run that not on begin play but like 1 frame later

#

I think there's a delay by 1 frame node

nova prawn
#

Ok i,ll add a 2 second delay after Begin Play, (I thought about the Delay Until next Tick node)

#

ok with a delay node of 2s I get the print out of "Player is located" after 2 seconds but no movement.

floral compass
#

๐Ÿง

#

I'm done, off to bed ๐Ÿ˜„

nova prawn
#

lol thanks for the help nn sleep well ! ๐Ÿ™‚

dense owl
nova prawn
#

Ok i found out what was causing my issue not sure why though when I disabled gravity on the Character Movement component (Because its a ball levitating in the air) it would not move anywhere but when I enabled Gravity it worked. I am not sure if the Character Movement Component MUST have GRavity Enabled for AIMoveTo to function or if because its a levitating ball it has no contact with the Navmesh as its effectively not on the ground (Bit like Dodgems they have to be touching the electrical roof to move)

#

I am not sure if this is right though as this would mean that to create a AI Move To flying enemy you would have to sit something on a box and set visibility of the box to hidden in game and then the box would do all the moving for the Enemy on top of it. Maybe someone can shed some light on this please. ๐Ÿ™‚

misty wharf
#

If it's using CMC you would probably need to set its movement mode to flying, if it's on walking it most likely requires ground

#

Also using a Character as a ball seems kinda strange, it seems just a regular pawn with floating pawn movement would work better for that

nova prawn
nova prawn
#

Thanks!

misty wharf
#

I think AIMoveTo probably requires a pawn, since actors can't be possessed by ai controllers, but pawns can

nova prawn
#

I,ve not had much experience with these Simple Move To nodes they sound very easy to use but for some reason im managing to mess it up xD

#

Do i need to add a CMC to a Pawn to make it move through the AIMoveTo nodes?

misty wharf
#

CMC only works on Characters, try using floating pawn movement instead

nova prawn
#

wow i never even knew that component existed ๐Ÿ˜ฎ

#

Ok added that and added 250 to Velocity on X Axis Checked Can Fly and no movement

#

Sorry Im being so dumb here Im sure it,s not normally this hard.

misty wharf
#

I wouldn't worry about it, these are sometimes kinda complex

nova prawn
#

Im almostr tempted to look on the marketplace for a asset to see if i can reverse engineer it and see how others have done it am struggling to find up to date info on it. ๐Ÿ™‚

#
floral compass
nova prawn
#

I have used the behaviour tree before with Perception Components and done a simple chase, patrol search and roam freely ai system before.

#

I thought if i wanted to create a game similar to Gauntlet all i need basically is a if player in range chase them

#

So i thought a Behaviour Tree might be overkill for something as simple as that.

floral compass
#

So try a 1 node behavior tree with MoveTo and see if that works. At least that way we could rule out a few things

#

It might be, but at this point I would just troubleshoot the problem

#

Because I don't see why what you did wouldn't work

nova prawn
#

Did you see i found out why the CMC Component wasnt working.

floral compass
#

No, I was sleeping ๐Ÿ˜›

nova prawn
#

Ok i found out what was causing my issue not sure why though when I disabled gravity on the Character Movement component (Because its a ball levitating in the air) it would not move anywhere but when I enabled Gravity it worked. I am not sure if the Character Movement Component MUST have GRavity Enabled for AIMoveTo to function or if because its a levitating ball it has no contact with the Navmesh as its effectively not on the ground (Bit like Dodgems they have to be touching the electrical roof to move)

floral compass
#

Huh

#

Interesting

nova prawn
#

I had to change the movement mode to Flying on the CMC for it to work

floral compass
#

I avoid Character anything like the plague, another reason to keep doing so!

nova prawn
#

So with this in mind someone suggested maybe a Pawn with a Floating Movement Component might work better so now having issues with that

#

Just learning stuff and troubleshooting at least with all these issues its more likely to stick in my head for future projects lol

floral compass
#

Yeah, try a BT with a MoveTo node. If it doesn't work at least we can rule out that it's not a problem with the AIMoveTo node

nova prawn
#

So am trying to copy the Character + CMC move to random location using a Pawn and AIMoveTo with a Floating Movement Component.

#

Ok have learned a few things. ๐Ÿ˜„ I understand better now whats happening.

fierce sparrow
#

can anyone suggest how to get past this initial module setup to try to get the state tree component classes usable in cpp?

north oriole
#

does anyone how to know in c++ if a vector blackboard key is unset?i see that when unset it has a magical large value, but do i really have to compare with it to see if it's set?

floral compass
floral compass
#

I mean you can also just do this with the Blackboard decorator

fierce sparrow
fierce sparrow
floral compass
fierce sparrow
#

idk, can't get it working off a cpp fps template

#

include both state tree plugins, first thing is go add the modules, close rebuild etc

floral compass
#

Oh, wait a sec

#

You're trying to subclass UStateTree?

fierce sparrow
#

yea UStateTreeComponent I think

floral compass
#

Sorry about that, I got it confused with BehaviorTree

#

For the component you need GameplayStateTreeModule

fierce sparrow
#

I have that one too

#

StateTreeModule, GameplayStateTreeModule, and AIModule

floral compass
#

What happens if you just include #include "Components/StateTreeComponent.h" ?

#

And then build?

fierce sparrow
#

include it in the build.cs?

#

I'll try it

floral compass
#

No, in a cpp file

#

Or rather in a .h file

fierce sparrow
#

its greyed out

floral compass
#

Yeah now build

fierce sparrow
#

interesting progress

floral compass
#

Okay, I think Rider was still generating VS files maybe?

fierce sparrow
#

but doesn't have schema and such

#

lemme see

floral compass
#

Newer versions do that automatically

fierce sparrow
#

So I just need to hide includes somewhere in the project?

#

didn't think that I needed to do that after installing the module

#

idk tried it from scratch in 5.3 too, I'm doing something wrong. Started new cpp FPS template, added the two state tree plugins, then closed everything. Built CS project files, opened rider, added the 3 modules to the build.cs

#

unless I'm just failing to understand that yes it's necessary to still have the #include StateTreeComponent.h and StateTreeComponentSchema.h in addition to adding the modules.

floral compass
#

Which version of Rider are you on?

fierce sparrow
#

2023.3.3

#

If I remove the includes I lose the functionality to add the classes, is that expected?

#

Am I supposed to just have the includes somewhere in the project or was that a workaround to testing?

floral compass
#

No, that's bonkers, sounds like Rider fuckery to me

misty wharf
#

๐Ÿค”

#

Works for me

floral compass
#

Same

misty wharf
#

Without having to put random includes in there

#

Make sure you've opened the project from the .uproject file and not the .sln

#

I think some of this stuff doesn't work so well if you use the .sln

fierce sparrow
#

Hmm yea opening it correctly from uproject using rider

misty wharf
#

If you've been using Rider for a while, I would try clearing the caches for it... sometimes they get kinda wonky for some reason and it causes random erratic issues

#

from File->Invalidate caches

fierce sparrow
#

Dang thanks but no improvement

oak bridge
#

Guys I made 2 supported agents, one is the walk and the other is fly, basically I just set a nav proxy to fly so that only who's fly can use that proxy to "jump" between 2 platforms but I dont know how to set my ai character to use that fly instead of walk

light void
#

Alright, hopefully that can help someone else, although it is the very basics of AI and I likely do not have the proper names I am open to correction if I am wrong in something. Also leaving the Draw.io file if someone want it.
I watched the first 3 videos of this tutorial serie by Ali Elzoheiry and I realized that I did not really understand the order in which things happened. What objects where linked and how they interacts. So I made the following diagrams to try and figure it out after finishing the 3rd video.
https://www.youtube.com/watch?v=-t3PbGRazKg&list=PLNwKK6OwH7eW1n49TW6-FmiZhqRn97cRy

Please correct me if I misunderstood but it helped me understand the order in which things call each others better and I hope this can help others as well.

floral compass
#

Are there any good resources on designing good, less formulaic AI? Less from a technical perspective and more from a design or abstract perspective.
Like for example, instead of stupidly going if attack then do X; if block then do Y; if heal then do Z maybe having a more abstract aggression concept that dictates the next actions? Or a mood or something. Anything in that direction?

fluid summit
#

If you've built something simple like..chess or something like that, and you want to build simple AI for it, is it useful at all to use the builtin UE AI tools? Behavior trees and such?

rich pendant
#

Would anyone know why AI would take strange almost winding paths when using the move to even if there's a clear straight path the take. The image is an example of the type of path it's taking.

Edit: It's because I had them set at dynamic obstacles.

Edit2 : Scratch that, it looks like it still does this just less often.

uneven cloud
uneven cloud
sullen crater
#

Hello, guys!
Please tell me why this decorator can give true if Iโ€™m not in the navmesh at all? Chose to find a path from the AI โ€‹โ€‹to the player

#

And it triggers precisely when approaching a certain point (not zero coordinates)

bitter citrus
#

HI all!

I was watching an AI GDC talk and it mentioned some cool functionality that they did with their behavior trees, basically one-off "impulses" that they could shove in and out of the behavior tree at will based on different things (most likely pawn/controller feedback). I was wondering if anyone had any idea on a method for accomplishing this. I'm thinking of it basically like an abort but an abortion to a temporary BTT that's not always there.

floral compass
#

Never used it though

bitter citrus
floral compass
bitter citrus
#

Maybe UE6!

devout cave
#

I'm using the GenericTeamAgentInterface to distinguish between friendlies and hostiles - I wish to have my agents deal damage or heal allies based on situation, is the only way to keep checking GetTeamAttitudeTowards in my tasks for actors in range, or is there a better way to handle it? Maybe an equivalent to GetHostileActors?

shut ridge
#

Hi, I have a question, so the Env query system thinks there is no path to the location, but this is only because my character that is using the query is 600 units tall and the query therefore uses the actor's location as the centre, I think. How can I get it to use -300 as the centre?

spring jetty
#

Hey Any idea why would BehaviorTree execution stuck in RotateToFaceBBEntry ?

floral compass
#

Play around with that Precision maybe?

spring jetty
#

He Doesn't rotate at all, what is this code anyway ? the precision that I can pass to the task ?

spring jetty
floral compass
#

If there is no rotation at all I'd check whether your target is actually valid

floral compass
spring jetty
spring jetty
floral compass
spring jetty
keen spade
#

I'm having an issue getting this loop to stop. My AI investigates but then never stops.

#

I've tried adding timers to time it out that also doesn't work.

#

Ideally the AI investigates for a bit then goes back to idle.

#

If its being called over and over that would reset the loop, and the timer. So then how is it being called? How do I make it not do that?

floral compass
# keen spade

On first glance I think the branch is being reselected over and over after 3 loops.
When the 3rd loop finishes, what is the "ActionState" in the blackboard set to? It should be "Investigate" right? In that case that branch will once again be selected. Since you're never changing the "ActionState" within that branch.

keen spade
floral compass
#

I mean one "fix" is really simple:
Use a sequence node and move your "ReturnToDefaultState" into that. The sequence would execute the selector in your image, and afterwards return to default

keen spade
#

That worked!

floral compass
#

Well, you've just messed up the left part of your investigate branch tho

#

Because now your "Go to roughly where the sound was heard" will loop forever

#

What you want is:

Sequence
-> Selector
  -> Go to roughly where the sound was heard
  -> Test go to random
-> Sequence
  -> Wait
  -> Return to default
#

Because I assume you want to "return to default" regardless of which type of investigation behavior has been chosen

keen spade
keen spade
floral compass
light void
#

Anyone's got a good tutorial on how to handle non repeating movements for a few NPC?
I want a bunch of NPC to randomly select amongst points of interests on the map and chose a route between their starting point and their targets. Issue is that if I just tell them to go there, they will but they're gonne "optimize" the route and all go the exact same path.

keen spade
misty wharf
#

I do wonder what would be a good solution for this also. Pathing between A and B but allowing some inaccuracy in choosing the "best" path

#

The only way I can think of is having some system that tweaks navigation area costs between doing the navigation queries, or uses different navigation filters in the queries which have different costs... both those solutions would cause the pathing to be slightly different as a result

floral compass
#

At the same time you would also have to take into account that it makes little sense for an NPC to run through a monster-infested forest just because we tell them to have "variety" in their navigation

light void
# misty wharf The only way I can think of is having some system that tweaks navigation area co...

I had a few ideas but I really don't know.
First one was to manually define a few stopping points at the entry of every passageway (since in my case it's travelling inside a mall), find whichever is the "perfect" point (closest to it) then randomly select a point from the nearby points. Then you would have plenty of inaccuracies. That would mean defining a bunch of preset corner points and figuring out how to do that.

misty wharf
#

Yeah I guess you could have some kind of "smart" navigation in a situation where it's like that

light void
misty wharf
#

Eg. you know you want to get to a location that's on the third floor from the first floor, so you would then let the NPC choose randomly from nearby modes of transport to the third floor, for example an elevator or different escalators

#

In this kind of setup you wouldn't choose destinations to path to, but rather, you would choose the destination, and you would define objects that allow the npc to get to that destination, so the npc would then decide whether it needs to traverse through an object to get there or not

#

This could in theory be achieved also through just using nav query filters, for example if you have a choice between elevator and escalator, you could randomly pick a query filter that allows using one but not the other

floral compass
#

Like a chain of points of interest or smart objects
Have them stop at a map of the mall to check their path and so on

misty wharf
#

I had a slightly similar issue in my game where the npc's would always walk into the store and then into the nearest shelf in the same order... I just randomized the order to solve it lol

#

(it's a video rental store simulator of sorts)

light void
#

"Nav query filters" let me add that to the list of tutorial to learn.

misty wharf
#

essentially a query filter is just something that you can use to choose which nav areas are valid for the pathfinding query

#

it has a few other more advanced features also

light void
#

That actually look exactly what I need. Randomly affiliate them to different filter for each path of the map. I'm just worried if that is normal to have dozens of Navmesh or if I'm making a mistake in my understanding.

misty wharf
#

You can define them using different nav areas, I'm not sure whether there's any particular limitations to those other than not sure if there's an easy way to have nav areas overlap

uncut rune
#

If I want to have different behavior trees for different kind of units, but on one AIController I have to specify that logic in Event On Posses to switch BT based on class or any other specifier?

floral compass
#

Or you could just create blueprint AIController subclasses and change the BT reference in each of them

uncut rune
#

Great, Ill go with subclasses. Didn't check if it's possible.

midnight scroll
#

Are there any easy ways or delegates to detect when an AI is using a specific nav area?

floral compass
midnight scroll
#

Would prefer to do it without relying on overlap code. Physics area query stuff is insanely slow on some platforms.

placid halo
#

I was looking into the EQS code and it's somewhat tied to behavior trees. If I'm not using them, is it that worse to just pop a trigger volume when I need to and go through the hits myself?

harsh storm
#

You can run an EQS query devoid of BT's

terse glen
#

Hey all, I've since heard it isn't optimal to handle dialogue within a BT but I've implemented it now ๐Ÿ˜…
I've set a quest system up and basically once the quest is handed in the AI will move to a location I've specified
The problem I'm having is, the MoveTo doesn't work if its done after the EndDialogue task, but it does if i do it before the EndDialogue
I don't see any reason why a previous task should stop it from running?

placid halo
terse glen
#

Yeah that doesn't work either ๐Ÿ˜ฆ

dense owl
terse glen
#

I realised it's because it's calls a custom event which uses 'stop logic', sorry ๐Ÿ˜…

#

Can i run these two in parallel? At the moment EndDialogue executes after it's moved to the location

uncut rune
#

Need advice and feedback.

So I made this behavioral tree for my worker, and it works. I'm setting blackboard key WorkerState by clicking on Resource when unit is selected. When I click on the ground or anyewhere else, it's set to Idle. This is just prototype. I set this from PlayerController to AiController by interface.
I also have the same 'behavior' done in blueprints, and the behavior tree seems more clear to me what is happening. I can also add Tasks like Collect that will actually take out the resource from the node, and then deposit it to the building. Everything seems clear.

There is also function inside AiController, that looks for the closest building, but I think I might just put it into task at the end of the Collect sequence, so in case building got destroyed it will have task and a way to find it.

Are there any disadvantages in the future from this approach?

I guess it will be easy to make task to send info that something got collected so -1 from TargetResource and +1 to the amount in the playercontroller on contact with building?

misty wharf
dense owl
#

Switch ? ๐Ÿ™ƒ

misty wharf
#

Tbh probably never gonna release anything on console but I was always under the impression overlaps were reasonably performant lol

midnight scroll
misty wharf
#

Interesting

#

I'm using overlaps a lot for some stuff at the moment, mainly because it was less effort than setting up a system like djikstra/influence maps for it lol

#

but it's easy enough to replace if it was to ever become a problem

midnight scroll
#

To be fair we were optimizing a game with a ton of stuff going on in a game. But the overlap and trace queries, and things like physx vehicle movement and whatnot are stupid.

#

@misty wharfJust double checked. PS4 has line trace singles running anywhere from 30 to 250 microseconds. Not even the component moving but just the simple function call to update overlaps on components hits for 18 to 130 microseconds. It adds up really quick in a more complex game.

floral compass
uncut rune
# floral compass Aside from misusing selectors as state machines. You'll run into issues if it ge...

Yeah so this is basically gonna be it for the worker. I might add something like so if it's set by player to ''search for xtyperesource'' it will go to the closest resource of that type and auto gather (sets target). It's gonna be pretty simple for the worker bt. I find it a little bit easier to program whole thing with behavior trees than with the blueprint. Are there any no no to this approach or is it ok in general?

floral compass
# uncut rune Yeah so this is basically gonna be it for the worker. I might add something like...

I mean BTs (selectors) are good at selecting behavior based on priority and recovering from failure with fallback behaviors, right? That's their whole thing.
In your BT above you're effectively suppressing that functionality by introducing a very manual selection mechanism (states). So now instead of selecting by priority automatically, you have to tell your BT what to select. Your BT logic is "leaking" outside of the BT. Now your AIController needs to know that your BT expects a certain "state" and has to explicitly tell the BT what to do. If you switch BTs or change it you're forced to adjust your AIController logic as well.

Your example is great because it also shows how redundant a "state" sometimes is. You have a "TargetResource" in your blackboard. Why not make the decorator select based on that? If we have a "TargetResource" then execute the "Gathering" branch, else "Idle". You can ditch the entire state logic in your BT and AIController.

If you really want to work with states I'd recommend using StateTree instead.

#

Ideally, you'll always have a priority of behaviors in mind when designing your BT. If you want manual control over what is executed, injecting subtrees or starting a new BT would likely be less spaghetti down the line.

uncut rune
uncut rune
floral compass
#

It's like trying to go grocery shopping

#

But instead of the shopping cart you just take your entire car into the store

#

Works, but not what it's made for

uncut rune
#

ok ๐Ÿ˜„

floral compass
#

And likely will result in jail time

uncut rune
#

hahahaha, please nooo !

light void
#

Is it possible to replace the default pathfinding with some RRT based one?

nimble smelt
#
  1. This condition is supposed to abort this tree when TargetActor is set.
  2. TargetActor is set. (See BB keys on right)
  3. The tree is not being aborted.
  4. What the heck.
#

The AI starts in this patrol mode and CAN initially acquire a target. However, when it loses that target, it then breaks so it can no longer acquire any target

dense owl
nimble smelt
#

In any case, I kinda sorta figured this out? But the results are bizarre.

#

So "FindTarget" is what sets the TargetActor, and I put a check in there for when it's being called and TargetActor is already set. And it turns out that happens All The Time.

#

My current theory is that AI detection sorta "flickers" as it is gained and lost. My check for that continuing evaluates false on the right tree that's not in the picture, but when it gets over to the left tree, targetactor is immediately replaced on first run, and somehow that doesn't count as Value Changed for the condition?

#

It's a theory with a lot of holes in it, admittedly, but the behavior I'm seeing is pretty tough to explain

dense owl
#

or how are you updating

nimble smelt
#

...Shit, lemme open up unreal and check

#

This is the part which confirms I'm still detecting the actor, in the right tree

#

And this is the detection function. BUT HOL UP

#

"IsValidTarget", from that second function, actually wraps a call to CheckTargetPerception, the SAME function from the first one!

dense owl
#

btw there's a built-in perceived actors generator on the EQS composite nodes.

nimble smelt
#

That last part is particularly confusing, because what it means in practice is that "FindTarget" is necessarily more strict than "CheckTargetPerception", since it WRAPS the core part of CheckTargetPerception

dense owl
#

if you end up having more than one target to perceive, or if you have issues with perception updating, that will save your skin^

nimble smelt
dense owl
#

not for something like that anyways

#

but fair enough, if your way works

nimble smelt
#

hmm there was a reason. Does it tie in with the navigation system?

dense owl
#

you can use it outside AI entirely if you want

#

EQS is very versatile

nimble smelt
#

But yeah this version is working. Well, notwithstanding whatever the hell race condition I'm running into now

#

Anyways I'm technically on vacation lol so I'm gonna see if I have any bright ideas over the trip. I actually "fixed" it for now with a hack where "FindTarget" checks whether the target is set and if it is, it forcably clears it again, so that the next tick it can "update" the field in a way the tree actually notices

#

And it works! Though in theory it makes the AI 2-3 ticks less responsive than it should be.

dense owl
#

enjoy your vacation

celest python
#

yes

#

pathfinding is a func ptr that you can replace

#

that you need inheritance to do so... ๐Ÿ˜„

safe harness
#

can someone tell me how to make ai hit targets with things like grenades or artillery?
i know that i can predict projectile trajectory, im wondering how to use it for correcting aim of npcs
im pretty new to ai programming
you can write either here or pm me, i would be grateful for any tips

misty wharf
light void
#

Is it possible have multiple AI sight and define what the character will do depending on which sight is working?

misty wharf
#

If you mean multiple sight senses - yes, but you need multiple perception components, one per sight

#

This also means it will do twice the linetraces etc. so keep that in mind

sage walrus
#

Hey guys, how can I find a specific smart object to use? I've seen many tutorials, but they all use the "FindSmartObjects", and let a NPC interact with any smart object. However, I want to find a specific smart object to use, as my NPC has a reference to the actor that contains the SmartObjectComponent. However, I can't seem to find a way to get a slot handle with a specific object reference, neither identify a object from the "FindSmartObjects" result, as it does not return any actor reference.

light void
#

Any way to handle detection of particular parts of teh body? I want to know if a character can see the hand of the player.

#

After checking it seems these kind of functions were not available to Blueprint. Is it still the case?

floral compass
spark locust
#

it was just some version control dumbfoolery most likely so removed my question ๐Ÿ˜„

languid shard
#

does anyone know how to filter output in one generator by output of another one (using custom test class) in EQS?

misty wharf
misty wharf
nova prawn
#

Can someone tell me why when I spawn a AI Actor it doesnt move when the original Blueprint its based off works fine, I have Auto Possess set to when Spawned or Placed In World, The enemies are spawning in but they arent moving at all when the original ones do move.

#

The 2 circled in this image have moved to the player characters location upon start of the game

#

The others rotate to face the player character but dont move.

rapid atlas
#

Hey! I've been having an issue with getting AI to move in standalone vs in editor. In editor, the ai moves in all rooms with a dynamically generated navmesh/room. In standalone, the ai only moves in the first room generated, but subsequent rooms cause the AIMoveTo node to cycle failures. I am spawning these enemies after the room has been generated. Any help would be very much appreciated!

nova prawn
#

This is the code spawning enemies

misty wharf
#

if they are rotating but not moving that suggests the logic is at least running

nova prawn
#

Its odd that the Blueprint they are based off work fine but the dynamically spawned ones dont

nova prawn
misty wharf
#

You have to first press Start for it to start logging

nova prawn
#

Ahh thanks ๐Ÿ™‚

#

Not sure what im looking at though tbh so much info

#

can see all the AIControllers

misty wharf
#

any red bars would indicate errors of some variety

nova prawn
#

no red bars that i can see

#

in the Path Following it says Moving when its not so the game "thinks" its moving. (I guess)

misty wharf
#

Are the ones you've put into the level manually which work set to use flying also?

nova prawn
#

The ones i put in level are set to flying as well

misty wharf
#

If you're using BTs I'd check what's happening with those next

nova prawn
#

Im using the AiMoveTo node

misty wharf
#

Otherwise it seems it's trying to move but for some reason is unable to

nova prawn
#

Doesnt make any sense as to why manually placed BP,s work but spawned ones dont seem when the spawned ones are just duplicates of the manual one. XD

misty wharf
#

I would verify it's actually in the correct movement mode and not in walking mode

nova prawn
hearty niche
#

I have baked my world partition navmesh but it does not show up when I play my game, my npc does not move. What's happening here? I did get the actors to generate.

nova prawn
#

I even checked they are the same Z-Height as the manually placed ones.Capsule Collision is set to No Collision so that cant be stopping it from moving

floral compass
misty wharf
# nova prawn

This is just the default, not the actual one it's currently in

#

Also check the return value from the moveto node, I recall it might give a status code or something

nova prawn
#

In the Enemy BP

floral compass
#

Is that not the issue?

#

AIController?

#

Should that not be some BP_MyAIController or something?

nova prawn
#

Isnt that just the Basic AI Controller class instead of a user created one.

floral compass
#

Because by default AIController does not have any BehaviorTree assigned

nova prawn
#

the manual ones are using the same controller as that.

misty wharf
#

If your logic is all in the pawn then it doesn't really matter which ai controller

nova prawn
#

There is no behaviour tree for this

floral compass
#

Oh, gotcha, blueprints

nova prawn
#

Yup just using the simple AIMoveTo node

#

well not so simple it seems xD

floral compass
#

How do you call the AIMoveTo node again?

#

On BeginPlay?

nova prawn
#

Yes

floral compass
#

Ah sorry, got it now, missed it earlier

nova prawn
#

Begin Play -> Delay 2s -> AIMoveTo

#

thats all there is to the code.

floral compass
#

Really interesting

nova prawn
#

Ok lets see what status result outputs

rapid atlas
nova prawn
#

Ok so it spawns an automatically resuilts in SUCCESS

#

The manual 2 do the same thing but then print out GOT YA when they reach the player

#

The spawned ones never print out GOT YA so they never reach the target

harsh storm
harsh storm
#

By default, automatic AI possession only happens on placed.

nova prawn
#

Ohh on the controller not the pawn ?

harsh storm
#

No, that's the correct setting

#

Also, do it on possession, not BeginPlay

floral compass
#

Good point

harsh storm
#

Check the visual logger as well. Check logs in general.

nova prawn
#

I looked at the logs there was no red bars, I think if these were "ground" enemys it,ll probably work fine xD

#

I,ll make a custom AI Controller and then do the OnPossession instead of doing the AIMoveTo inside the pawn

floral compass
nova prawn
#

same thing they rotate to the player but not move.

#

OnPossessed

#

Ok odd... I used default blueprint and just added a cylinder mesh no changes to CMC and it all just works.

#

the cylinders all were converging on me, So it,s something to do with trying to do flying enemies, I might just use ground enemies and put "flying" enemies on top of an invisible box lol

floral compass
#

That's good to know

#

Although weird it would work for manually placed ones, then

nova prawn
#

Indeed bit puzzled to say the least.

olive prism
#

How i can activate a Task only when i have a true variable in my BPI Character?

I made a decorator that is looking at a bool type variable in my character in a decorator and then I made a task that I gave it what it has to do (nothing for now) but it doesn't stop the execution flow of the BT even if it is true

misty wharf
north oriole
#

What is the difference between a nav modifier area class set to None, NavArea and NavArea_Default?

misty wharf
#

I don't recall for sure but if you look at the navmesh generation when you use those you should see the effect... None might've been effectively disabling the navmesh from that area

#

Otherwise you might need to use nav query filters for them to have any effect

north oriole
#

None seems to keep the default navmesh under the modifier, and the others as well. Only difference I found is that NavArea_Default seems to prevail over other modifiers and use the default navmesh under them as well

narrow python
#

Is there simple free flying navigation plugin?

uneven cloud
uneven cloud
uneven cloud
north oriole
olive prism
uneven cloud
uneven cloud
north oriole
uneven cloud
north oriole
olive prism
#

Yes, I want everything to stop being done to execute only the BTT of the Roll when the bool that the decorator observes, when it is set to false, continue executing all the rest of the BT

uneven cloud
olive prism
#

It is to the far left, but before the Wield Sword and before the Death.

Should I put a blackboard? how would it be?

Should I put a status?

#

I could do it

#

Thanks!!

uncut rune
#

Is there any other way so I don't have to use casting? Theoreticaly I already have resource reference in the blackboard value as actor but since it's set as actor and not exactly building I don't have access to these things without casting

floral compass
uncut rune
floral compass
#

Then it's inevitable ๐Ÿ˜„

uncut rune
#

Ok ๐Ÿ˜„

uneven cloud
uncut rune
uncut rune
#

So anything that I call from Task, but the event itself is on the Actor, it will be called as server? That's briliant actually.

#

I try to use interfaces in every place, but I'm not able to get interface from the blackboard value.

uneven cloud
#

It's only players that can use client and server RPCs.

uneven cloud
#

The AI controller and all of it's components only exist on the server.

uncut rune
#

I have 1 more idea but it doesn't really work and I'm not sure why ๐Ÿ˜„ I'm trying to call Get AIController, from the OwnerController or Pawn (of the unit), and in the Ai Controller, I actually have ResourceTarget variable, which I could get from, but Get AiController doesn't really cast to the owning unit?

#

this is In AiController of the unit that is usit this AI

uneven cloud
uncut rune
#

Okay, so in this case still takes casting. Got it!

uneven cloud
#

You need to cast anytime you want to access the things you added.

uncut rune
rapid atlas
#

Could someone help me? In the viewport, my spawned ai moves in all dynamically generated rooms. In standalone, the ai moves in the first room generated, but in subsequent rooms the AI MoveTo node is executing, yet not moving. If I have enemies placed in a room then those will work, but spawned ai won't unless it's the first room. The ai will start moving if I show or hide navigation via the console using "show Navigation".

uncut rune
#

Check this in bp of your actor that you are spawning

rapid atlas
# uncut rune

Yea that's set to world or spawned, spawning works in the first room, but not subsequent rooms when in the standalone game

real arrow
#

does anyone know if AI Perception works from a 3D perspective

#

oh, it just uses a line cast doesn't it, so it would work

narrow mason
#

Yes it does. But you may run into an issue where if the object location is behind cover, but some of the body is visible it still wouldn't see the object.

Don't know if it's fixed now but it used to be an issue with sight perception

celest nebula
#

I'm using shooting as a service and would like the interval to reflect an AI's rate at which they apply a firing input. Guessing that must be done via cpp but it feels jank since you'd essentially set a default interval that doesn't actually affect the node. Any suggestions?

Probably just need to think of shooting as a task then.

uncut rune
#

Im brainstorming one thing. Let's say I have a lot ostats like UnitRange and others, which I want to use in the tree behavior to check if unit is in that range of something. What is the best way to get that data from BP_Unit to AIController_Unit? It get's funnier the more data you have, or I don't get something? What is the simpliest way? Make interface that gets all the stats and use possesed pawn as reference for these stats ? So If I need something I just reference from possesed pawn, GetUnitRange and set it inside AIController?

hot compass
lunar cedar
#

any idea what would prevent my AI from moving in a packaged build? in editor everything works as expected but in a packaged build the spawn points i have selected will spawn the ai correctly, but they will not move as if they have no nav mesh. the spawn points inside of the building work just fine though. this is all one large nav mesh (minus the little guy in the right corner) and im not sure if its related to world partition or whats going on

languid shard
lunar cedar
lunar cedar
light void
#

Alright, I was not happy with my NPCs line of sight that would rely on the AIsight which end up looking somewhere around the crotch area. Which mean that any random obstacle would stop it with line trace. Currently, it can now look at the hand (will change later. Wanted to check how precise it is).
How can I allow Line trace to go through ranslucent objects? And how can I allow it to go through certain objects I'm going to define manually because I don't think they should obstruct vision?
How could I make it so my own body will break the line trace?
And finally how can I optimize it? Currently it will be running on tick for all NPCs, so how can I do some fuckery to ensure only NPCs within a certain distance (That I can modify with a stealth variable) even have the opportunity to detect? So that NPC 200m away don't get a perception check to save on performances?

misty wharf
# light void Alright, I was not happy with my NPCs line of sight that would rely on the AIsig...
  1. IAISightTargetInterface can be used to customize exactly how the sight sense checks are done.
  2. To make the traces go through stuff you need to adjust the collision profiles just the same as with any other trace. You can configure the default trace channel used for sight checks in project settings, or if you have a custom line trace setup then yeah just change that. Overlap or Ignore should let the trace to pass through. Same with the player blocking it, configure it to block the trace channel you use
  3. AI Perception has timeslicing for this purpose. I recall it also does a distance and sphere check of sorts to see if you're even in range
light void
# misty wharf 1. IAISightTargetInterface can be used to customize exactly how the sight sense ...
  1. Not enough. Or at least nobody has been able to explain to me how to. I need to check if particular bodyparts are visible, but as far as I know there is no way to attach a Stimuli to a particular bodypart. All stimulis are within the main body and target only at waist hight. Did not manage to change it and repeated attempt at asking around have only be met with "Use Line trace instead".
  2. I'll check the trace channel thing, it's not something I know about. I'll look it up.
  3. I wish I could make AI Perception check works, but I really didn't manage.
misty wharf
#

You just override the CanBeSeenFrom function and do your own linetraces, you can choose where to trace with your own logic etc.

#

If for some reason you can't get it to work, for #3 you can use similar methods as the perception system does to optimize

light void
#

I guess I'm not gonna escape diving into the C++ code editor for it if I want to make it work.

misty wharf
#

Not if you want to use AI perception unfortunately no :)

light void
#

How do I have to go to find these functions and open them with Visual studio?

misty wharf
#

You would need to make a new C++ base class for the actors where you want to use this

#

and have your BP actor inherit from that

light void
#

Got any good tutorial to get started with that? I know how to code, I just don't know where to get started with codes in UE5

misty wharf
#

Check the pins on #cpp

safe harness
sacred shale
#

Is there a way to observe a specific enemy behavior tree in real time without the need for spawning in only one enemy? I want to see what one of my specific enemies are doing but I'm not sure which enemy it is observing

dense owl
sacred shale
dense owl
#

I would also open the AI debugger to make sure that AI is now the self

#

Then you can be certain

prisma sun
#

Hey,
I have a Pawn with a Sphere component (to detect enemies and create the range of the Unit)

I have an issue for Navigation, MoveTo etc.
This issue here is that the Sphere Size is added to the radius of the Actor/Pawn so when I do a move to there is a lot of issues. (Overlap is not well calculated because the sphere is already overlapping)

My sphere is having a custom channel for Collision

misty wharf
prisma sun
prisma sun
misty wharf
#

Depends on what you're doing. AI perception is a fairly straightforward system and I wouldn't worry about it being overkill unless you have some very specific requirements

prisma sun
misty wharf
#

As long as you configure it correctly it's probably just fine

#

Ie. if your AIs need to only detect the player, make sure it's set up to only do that, which would reduce the number of line traces it needs to do quite significantly depending on number of AIs within distance

prisma sun
misty wharf
#

Well it all really depends on the numbers and you probably would need to test it to really find out. It does have time slicing by default which you can tweak, meaning it can limit how much time it will spend per frame doing sense tests

lyric flint
#

anyone know how I can ensure my AI doesn't jump over a sub tree in their main behavior tree

#

I think my AI is skipping over it or something

misty wharf
#

It won't jump over it unless there's some reason for it such as the sequence it's in failing

#

although it wouldn't really look like it just jumped past it in that case

lyric flint
#

it must be going thorugh sub tree super fast then

#

I think i might know whats happening, so I have this question probability thing and well it's super dynamic in that it's super hit or miss if it's actual does the question thing, I think issue is it's not doing a question so zipping through the sub tree and back to the main one

lyric flint
#

my issue at moment is it seems the AI is going from Moving to Table and going over to Paying

#

even though the Current Guest Journey does go to ordering

#

and as you can see theres a 60.0 second wait there yet it's not doing any of that for some reason, any help would be great cause it wasn't until I added in the paying and leave table on right it's started to play up

dense owl
#

Also if the center branch is skipping, it prly means that current guest journey is not equal to ordering

#

You can use the AI debugger at runtime (;) to see what the blackboard keys are currently set to

trail python
coral mesa
#

is there any discord which talks about making game AI from scratch?

floral compass
#

From scratch meaning using assembly?

#

Or custom tooling/models in UE?

coral mesa
#

im making one in ECS architecture but not sure what to do where

floral compass
#

But ECS + FSM sounds... challenging... ๐Ÿ˜„

coral mesa
#

FSM in Unity

#

pretty sure can do one in Unreal in traditional OOP approach

#

but ECS making it a bit tricky

floral compass
#

Especially considering that there is already a very performant state machine in UE anyway

coral mesa
#

also even thinking whether i should use GOAP instead because ill design diverse ai system

#

for starters I would make a state

#

an enum integer or something

#

then always check. If same enum then ignore otherwise do OnEnter

#

that's FSM I can do but what if player input is there to override the behavior?

floral compass
#

At this point I'd recommend checking out StateTree instead

coral mesa
#

actor system doesn't have a good memory management tho

floral compass
#

Not sure what you mean?

coral mesa
#

i mean memories aren't packed together

#

compared to ECS format

floral compass
#

What do you get out of making your state machine ECS then?

#

Especially when there is also an ECS system already built into UE

coral mesa
coral mesa
#

used flecs from Github

floral compass
#

Hmm, well good luck, hope your implementation does the job!

lyric flint
#

It's since I added the stuff to the right it then started skipping the central bit

coral mesa
#

can you keep switching between Behavior Tree during runtime?

floral compass
#

Although it might be better to inject BTs instead, not sure about the technicalities behind restarting an entire tree

#

Actually if someone knows what is better switching or injecting I'd appreciate some insights on this

coral mesa
#

already spent months on other stuffs

#

maybe something for future instead

floral compass
#

You mean your state machine?

coral mesa
#

yeah. Currently doing Hybrid approach to work on ECS

#

i can communicate between ECS and Actor system

#

now worried about performance. xD

#

however i still got another problem yet to solve

#

i got pathfinding working but no local avoidance

floral compass
#

#mass has it I believe? Not sure

misty wharf
#

I'm not sure if there's a big difference between switching and running subtrees... switching would potentially just set up a new blackboard and a few things like that could in theory have a very very minor performance difference

#

If you need to keep BB state, subtrees would probably be a simpler option

#

Although I'm not sure whether the BB would get reset if the switched BT has the same BB type

floral compass
#

Yeah currently I do a full switch, but so far no issues. Although injection seems wiser because it enables you to have like an archetype BT and then customize individual sub-behaviors

light void
#

What is the "clean" way to define a place NPCs need to move to? Do I create some sort of invisible actors and ask it to move to that actor?

misty wharf
#

That's what I would do at least. Seems like the simplest way to do it in a way that's also easy to modify

random cedar
#

Hello friends why the KI is running aways from his patrol system when i hit him in the -x direction?

Here all you need to now
event tick activated my handle movement
Handle movement activated the patrol system
also event begin play activated the patrol system

i think it must something in the "Event AnyDamage" because there i have an select that should be change the rotation of the ai in the direction of the player...

haughty tide
#

Is there a way to get the current cost of a location in the navmesh. ? I would like to influence the score of a generator by setting a low score for generated points that have been generated on top of nav_areas that are of high cost.

gentle widget
#

Good morning, I'm having some isses understanding behavior trees, was hoping someone could help me out a bit.

#

I have a custom node that just set the AI state (and an equivalent value as a BB key so I can control states with the tree), What I want to happen is the AI see's the player, does an action (in this case screams) and then proceeds to chase. I've tried playing with different variables to see what the outcome is as well as refactoring the tree (this is the latest spaghetti I've come up with) to try and make this work. I'm obviously not doing something right I just haven't been able to figure it out.

#

While in PIE the graph get's stuck in this state, the left tree for chase player executes a single frame and then returns to this state. The scream nodes should be setting the AI state to chasing, but it's getting stuck.

floral compass
gentle widget
#

It's setting the enum state value on board the enemy actor and the blackboard key.

#

Here's the task

gentle widget
floral compass
# gentle widget Maybe I misunderstood the question, it's setting the state to "Scream"

Yeah that was the question ๐Ÿ™‚
Then I understand, it's doing exactly what you designed it to do!
It's executing the "SetAIState" task which sets the current state to "Scream".
Then it moves to the next branch and checks if it can "ChasePlayer". According to your decorator, the state is not "Chasing", so that branch fails and it falls back to the rightmost branch.

gentle widget
#

I see. I think I understand. Let me see if I can fix that.

#

Thanks!@

floral compass
#

Just a general question: why do you feel you need to incorporate "states" into a behavior tree?

#

There's a different tool for exactly that: StateTree

gentle widget
#

If you're referring to the animation state tree, then it's mostly because I want different AI behavior based on the enemy state, so I needed to incorporate it one way or another anyways.

#

This is my first time trying to program AI so I'm sure theres a better way to go about it. Mostly just brute forcing my way through the engine until stuff works anyways lol

floral compass
# gentle widget If you're referring to the animation state tree, then it's mostly because I want...

No I'm referring to the more recent (geared for AI but not exclusive to AI) StateTree plugin that enables exactly what you're trying to describe!
https://dev.epicgames.com/documentation/en-us/unreal-engine/state-tree-in-unreal-engine?application_version=5.4

It's a common mistake to try and model a state machine inside of a behavior tree. BTs are definitely not designed to do that. They work very much with priority of behaviors instead of states that are switched at will ๐Ÿ™‚

gentle widget
#

I did not know about this

#

Let me look into that, might be why I'm not getting the behavior I want.

floral compass
#

Although your example clearly has a priority, so BTs should work, too!

#

Just have to get rid of the states and restructure a bit :p

gentle widget
#

I'm still learning the blackboard and behavior tree's in Unreal, seems like everytime I turn around there's something new to learn lol

#

But state tree's look exactly like what I want. Hopefully I can figure out how to make it compatible with my c++ code, but I'm a bit less worried with that part.

#

I figured out how to do it in BT's lol

floral compass
#

StateTrees are quite compatible with C++, similarly to BTs
You can implement tasks conditions etc. all in C++ or BP ๐Ÿ™‚

#

But since the plugin is relatively new it tends to be a bit buggy for advanced use cases

gentle widget
floral compass
dense owl
floral compass
#

True, that's the wrong wording

#

More attractive? I lack the vocabulary for this

misty wharf
#

State Trees could be more beginner friendly if the documentation was less confusing :P

gentle widget
#

State tree does seem like the way I might need to go. Not havinga defined flow for behavior that flip in and out of certain states when necessary is pretty much exactly what I want.

digital spoke
#

Hello everyone, could you tell me the modules and the CPP class to derive a task for the state tree?

floral compass
dense owl
gentle widget
#

My game has a single AI enemy, so I only have to worry about one actor.

floral compass
celest python
#

@uneven cloud are you affected from layoffs

sturdy sun
#

Searched everywhere cannot find a way to create my own BT Composite Node, it just does not compile at all. Not even a new Empty class. Tried ue4 and ue5, both give me error, just cannot create BT Composite Node in C++?
please any help

#

did not find Docs, Tutorials or Examples of Custom BT Composite Node anywhere

#

(I'm trying to Create a simple "Random Selector", instead of it always executing left from right) But not even an empty class compiles
PS: I've added "AI Module" in my public dependencies, but it did change anything

floral compass
sturdy sun
#

#pragma once

#include "CoreMinimal.h"
#include "BehaviorTree/BTCompositeNode.h"
#include "BTComposite_Test.generated.h"

UCLASS()
class ENEMIES_API UBTComposite_Test : public UBTCompositeNode
{
GENERATED_BODY()
};
Same code

2 Errors:

Severity Code Description Project File Line Suppression State Details
Error LNK2001 unresolved external symbol "public: virtual void __cdecl UBTCompositeNode::InitializeMemory(class UBehaviorTreeComponent &,unsigned char *,enum EBTMemoryInit::Type)const " (?InitializeMemory@UBTCompositeNode@@UEBAXAEAVUBehaviorTreeComponent@@PEAEW4Type@EBTMemoryInit@@@Z) Enemies F:\Unreal\Projetos\Enemies\Intermediate\ProjectFiles\BTComposite_Test.gen.cpp.obj 1

Severity Code Description Project File Line Suppression State Details
Error LNK2001 unresolved external symbol "public: virtual void __cdecl UBTCompositeNode::CleanupMemory(class UBehaviorTreeComponent &,unsigned char *,enum EBTMemoryClear::Type)const " (?CleanupMemory@UBTCompositeNode@@UEBAXAEAVUBehaviorTreeComponent@@PEAEW4Type@EBTMemoryClear@@@Z) Enemies F:\Unreal\Projetos\Enemies\Intermediate\ProjectFiles\BTComposite_Test.gen.cpp.obj 1

sturdy sun
#

just cannot compile it

light void
#

Can Sight Radius and Lose Sight Radius be manipulated from Events or something?
I want a "Stealth" stat which act as a multiplier to it. Like if you've got the stealth upgrade, the detection area get smaller.

harsh storm
floral compass
#

In 5.3 at least they're exported, what version are you using?

#

Also make sure you really have "AIModule" as a dependency and generated your VS project files

floral compass
#

Or have another distance check based on the stealth stat of the perceived thing

light void
copper grotto
#

If I want to have AI behavior for my player character under certain circumstances, would I hold off calling RunBehaviorTree until I need it to run, or do I run it on event begin play and then set some sort of bool flag to prevent any logic in there from running until the desired time?

floral compass
floral compass
#

But a bool would do, too

#

It depends what else is in your tree and whether you need it or not!

sturdy sun
copper grotto
# floral compass Check "RunBehaviorDynamic"

Where would I find that? I don't seem to see it anywhere? I don't need anything else in the behavior tree when the player is in control. This is only for use in certain instances when control is taken from the player.

floral compass
floral compass
copper grotto
#

Any ideas on why my blackboard might be turning up null? I'm trying to set some values on it from the blueprint that's using the AI controller for it. Everything i've checked looks correct (comparing it against another AI setup I had done in another project). But whenever I try to call GetBlackboard, I get this error: PIE: Error: Blueprint Runtime Error: "Accessed None trying to read property CallFunc_GetBlackboard_ReturnValue". Node: Set Value as Vector Graph: CalculateScreenCenter Function: Calculate Screen Center Blueprint: BP_ThirdPersonCharacter

sturdy sun
floral compass
sturdy sun
sturdy sun
gentle widget
#

Hmm

#

I can't get the state tree AI to work at all. I created two C++ tasks for the state tree (one that acts as an evaluator since I haven't figured out how to make an actual c++ evaluator) to find the player location and another that should just log the player location.

#

Doesn't seem like the state tree is working at all, I verified to make sure it was attached to my AI character correctly.

uneven cloud
gentle widget
#

Still can't figure out how to make an evaluator in c++ but using a global task to achieve the same result seems to be working so far.

copper grotto
#

So it seems like I need to call Possess from the AI Controller to get it to take over the player character, but the Possess node says it's only called on the server? I don't see an alternative and my game is not multiplayer so.. what am I supposed to use?

copper grotto
#

Could someone take a look at these bp's and tell me if they look correct as far as making the AI controller possess the player character, and then getting a reference to the controller in the second bp? It seems like it's all debugging right in the first bp, but in the second one I try to get the controller and it comes back as the BP_ThirdPersonController instead of the Ai controller. I've tried using the GetPlayerController node, GetAIController node, and even trying to find the Ai controller by using the GetActorOfClass node since I can see it in the Outliner... but when I do that it doesn't find anything. I'm not sure what I'm missing? https://blueprintue.com/blueprint/36tpbqbs/ , https://blueprintue.com/blueprint/u92e6fzr/

fathom dome
#

So I tried to reparent my AI character fromt he standard BP Character to the standard C++ character

#

there's only oen issue. They no longer seem to move, they only rotate in place

#

I checked the visual logger and after a little finagling it seems that it is actually claiming to successfully be moving, it just doesn't happen in game.

#

any ideas where I should look next?

#

The nav mesh is there and perfectly fine too by the way

#

i'm really kind of lost at what could be different between the blueprint and c++ character classes to cause this

#

or maybe I need to change a reference somewhere?

dense owl
floral compass
# sturdy sun UE5.4 do not let you compile even an empty BT Composite Class. Seems Like two f...

Indeed, looks different, in 5.3 those functions are not overridden

5.4 BTCompositeNode.h

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

5.3 BTNode.h

    /** initialize memory block */
    AIMODULE_API virtual void InitializeMemory(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, EBTMemoryInit::Type InitType) const;

    /** cleanup memory block */
    AIMODULE_API virtual void CleanupMemory(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, EBTMemoryClear::Type CleanupType) const;

I don't know C++ well enough to say what exactly the problem is, but this seems to be the only difference. Don't know if the overridden functions would need AIMODULE_API as well

celest python
random cedar
#

Hello guys how can i check it out here when ever the X value falls down or goes up i need to connect the return value of the X from actor location in something that can measure that

dire fable
#

Hi guys ! How can I block AI movement without blocking character movement component (I want to continue to apply root motion) and without blocking rotation ?

random cedar
random cedar
dire fable
#

i want to prevent the ai from moving

floral compass
#

No I mean you can abort the AI's MoveTo if you're using behavior trees
Not sure how it works in blueprint

dire fable
#

I'm using BT

#

I can disable "movement input" from my player with

#

but I don't know how to do it for AIs

floral compass
#

Using StopMovementImmediately will stop all movement I think, so root motion too maybe? Not sure
And your AIs have no input. So you'll have to abort the MoveTo in your behavior tree instead

dense owl
#

You can also use StopLogic to stop the tree from running entirely but Iโ€™m not sure how that would affect the CMC

dire fable
#

I can abort current AI move to and current root motion, its ok. But I want to prevent new ai move to/movement

#

StopLogic stops the behavior tree. If my AI is in trap, he can no longer move but he can still attack and rotate

floral compass
#

Decorator IsInTrap on the MoveTo node?

dire fable
#

I can try this, but why if I have 15 Behavior trees with 3/4 ai move to tasks in each of them ?

dense owl
#

I want to say youโ€™re trying to apply states to behaviour trees

#

Which is not ideal

floral compass
#

I mean technically a trap would set your movement speed to 0 instead of disabling the movement request of the AI

floral compass
dense owl
#

Trapped or not trapped seems stateful?

floral compass
#

Unless I'm confusing something

dire fable
#

yes, we don't have "isTrapped" or "isFrozen" or "isStunned" in our game, we have State.MovementBlocked, State.RotationBlocked, State.AttackBlocked, State.AnimationBlocked tags

dense owl
floral compass
dire fable
floral compass
#

I find it weird to put the responsibility of "I am trapped" into the AI

#

Probably belongs elsewhere

dire fable
#

I'll try to set the walk speed to 0

floral compass
#

That's what I would do right now if I had to implement that
Apply a gameplay effect that nulls your current speed for example

dense owl
#

Soโ€ฆ GAS? ๐Ÿ˜€

dire fable
#

Yes, we have GAS. I was going to make an effect that overrides the speed attribute

floral compass
#

Seems the most straightforward solution to me.
I mean, players don't manually have to stop moving when they're trapped right? So why would the AI

dire fable
floral compass
#

Also doesn't sound right to me

#

๐Ÿ˜„

dire fable
#

yes it makes more sense

#

ok it works ๐Ÿ‘Œ

harsh storm
#

You either wait for Epic to fix it, don't update to 5.4, or make source edits and export the methods yourself.

floral compass
harsh storm
#

Looks like it broke because they weren't overriding the method in 5.3, but they are in 5.4

#

It has since been fixed though

#

Have to wait for the next major release it seems.

#

So you'll have to patch it yourself.

#

Unless @crystal hatch can try to get it approved for a 5.4.2 release (if there is going to be a .2 release that is)

weary bone
#

Qestion: i know its kinda stupid but :
How to make AI to react to bool value changes in blackboard?
Also how change Bool value in black board from false to True.
I'm asking because i tried and searched every where - It just doesn't want to work at all.

#

Just incase Event Call SetIsDead is working fine

floral compass
weary bone
floral compass
lyric flint
#

So don't know if anyone can help with this so in the screenshot it's paused

#

You can see the Current Journey Enum is on ordering

#

However if I step into you can see it's then set to leaving

#

and I've found this is why it's skipping over the ordering part

floral compass
lyric flint
#

I found the issue

#

I had somewhere a move on Journey which was moving it on twice

undone stream
#

Guys why my AI is not flying

#

When its so far away by the ground its not working

#

But when it closer it works

regal drift
#

Anyone have any suggestions were how to start getting access to the navmesh and request Async Pathfinding? In C++

Most samples or tutorials use the standard AIController. I want to try and batch numerous Pathfinding requests on Async threads. So i can move plenty of AI agents.

have searched a bit in the following files:
NavigationSystem.h
AbstractNavData.h
AIController.h

Just need some sort nudge me in the right direction. Maybe which functions that would be needed?

misty wharf
#

I don't remember the specifics, but look into the existing navigation functionality that gets paths

#

there are async functions to calculate paths already in there also

regal drift
# misty wharf I don't remember the specifics, but look into the existing navigation functional...

Thanks for the response

In the AbstractNavData.h i found this FPathFindingResult AAbstractNavData::FindPathAbstract

In NavigationSystem.h there is FPathFindingResult FindPathSync and uint32 FindPathAsync

There were some more when i was searching in the engine files. But these two was those that sounded the most correct.

Guess i should try the NavigationSystem.h and see if i can get it to work.

misty wharf
#

Yeah FindPathAsync would be where I'd start for this

fathom dome
#

@dense owl

#

you see it doesn't really tell me anything

#

it thinks everything is going fine

#

the AI thinks it's moving on the navmesh, it's just not actually doing it.

#

at least that's my understanding of what i'm reading

dense owl
# fathom dome

Are you sending the move to request more than once? Also are you clicking on each of the AICon frame and reading the log underneath ?

fathom dome
#

So the log just says "LogPathFollowing (Log) Moving directly to move goal rather than following last path segment" which is fine

#

it is sending a new attempt to move to every 5 miliseconds

#

I'm not sure if I'm reading this right but it seems like it's trying to move to, think its doing it, then updates 5 miliseconds later trying to do the same thing since it hasn't actually moved

#

if it was working it would be a solid bar and stop checking right?

#

i'm going to change back the parenting and see what its output looks like in compariosn

#

ignore the first red part, that's just before I turn on the navmesh invoker

#

I have it on a toggle for testing reasons

#

so the log is the same, but it definitly shows up differently, you can see it forms a solid bar

#

the navmesh seems to be pinged more frequently too

#

could the problem be elsewhere than the AI?

dense owl
#

if you keep saying move,move,move, the moveTo task will keep restarting every time and failing to do anything

fathom dome
#

mmm

dense owl
#

it's a latent action you need to allow it time to complete

fathom dome
#

but the other version does that and works

#

so I think it might be something else, and that's just something I should change

#

at least I think that's what I'm reading, since the code is not different

#

only the base class it is a child from

#

that seems like some bad practice I picked up from a bad tutorial rather than the issue at hand I think

#

I guess I could try and fix that while I'm looking for the solution though

dense owl
#

what does the first green frame show?

#

also Luthage would prly encourage you not to use invokers if avoidable, since they are quite expensive perf wise

fathom dome
#

Yeah I am aware of the downsides of nav invokers

#

but i havn't finalized my decisions on them yet and they're not too hard to swap between

#

for now they're very useful for testing

dense owl
#

ok. so when the move first happens in that separate frame, what does the log show there

fathom dome
#

I'm not sure what you mean by green frame

dense owl
#

you have a lot of red, followed by 1 green or blue w/e

#

with a space, and then a solid bar prly due to the attempts on tick

fathom dome
#

oh the yellow one?

#

on recast navmesh?

dense owl
#

no

#

on Ai Controller

#

first frame that is not red

fathom dome
#

I don't see a green one sorry

#

the first frame that is not red says the same as the others

#

moving dirrectly to move goal

dense owl
#

that's it? ๐Ÿค”

fathom dome
#

yep

#

this is the first frame witht he nav invoker on

#

and the first green one

#

er blue

dense owl
#

click on each of the first few frames and see if you find anything like this

#

if not, look at the last red ones

#

basically more than just one line

fathom dome
#

they're all blue

#

the red ones are just because the nav invoker is off so there's no navmesh

#

once the navinvoker is on the nav mesh errors go away as expected

#

the log never says anything different between the AI that works with the normal character class and the C++ character class

#

just their behaviour in the game is different since one can't move

dense owl
#

especially on the bp class which is working as intended from what you described

fathom dome
#

WAIT

#

I FIGURED IT OUT

#

oh i'm a dummmy haha

#

it was the movment componenet

#

since I was using a custom movement component I forgot that it emptied out the walk speed values

#

ok now i'll just go and follow your earlier suggestions on ai

#

thanks so much for helping me out and I did learn a lot about the visual logger ๐Ÿ™‚

#

so I'll do some more research into good AI movement goals, but basically the idea is that they should move all the way to their goal then reassess?

dense owl
#

np

dense owl
#

ideally you don't want to keep requesting a move when it's still going

#

if you're using a BT it will do the work for you and wait for it to complete rather than ticking away

#

otherwise you should prly use the onSuccess/onMoveFinished pins to continue your execution path, if using the regular nodes

fathom dome
#

ok that makes a lot of sense to me

dense owl
#

having said that if your goal location is a moving target, then you probably want to make the multiple requests ๐Ÿ˜…

fathom dome
#

that makes sense, in this case it's the player character

#

but I think it would be too bad if it didn't ping too often anyways

#

It doesn't have to course adjust every 5 mili seconds, once a second is probably enough for a basic AI

tacit nimbus
#

Any ideas as to why Get AIController returns none in this environment query context provider? The Querier Actor definitely has an AI Controller

misty wharf
gentle widget
#

Hey @misty wharf, Do you know how to create a state tree evaluator in C++? I tried following a similar template to the STTask, the code will compile but it won't actually show up as a selectable evaluator in the editor. I'm thinking there's a naming convention that's not inherently obvious.

#

Also to anyone else that might be able to help, I can't get my state tree to execute more than once. I'm guessing I don't have the correct transition logic setup or my tasks aren't coded properly.

misty wharf
#

Each state tree has a "schema" which defines which types of evaluators and tasks are valid for it

gentle widget
#

I'm using StateTreeEvaluatorCommonBase

#

Gotcha, I'll have to dig deeper into it

misty wharf
#

There's the StateTreeComponentSchema (or whatever it was called) which is used when running it from the ST Comp

#

The other one is StateTreeMassSchema or something like this

#

you probably want to look at the component one I'm guessing

gentle widget
#

Ahh ok. Yeah let me see what I'm doing, that should at least point me in the right direction on Evaluators hopefully lol

#

I'm using a global task as a work around in the meantime which has been working fine

#

lol

#

My other issue is the state tree is not executing more than once.

misty wharf
#

You may want to use the visual logger or the st debugger to see how it transitions between states

gentle widget
#

Do tick functions execute every frame in a task?

misty wharf
#

It's also possible that if your global task finishes, this can cause the whole ST to effectively freeze