#gameplay-ai

1 messages ¡ Page 43 of 1

misty wharf
#

By AI Task you mean a Behavior Tree Task?

visual sluice
#

yes

misty wharf
#

because "AI Tasks" is a separate concept :)

visual sluice
misty wharf
#

Usually for behavior tree tasks, you would create a Blackboard Key Selector variable in your task

visual sluice
#

the first time lol srry if i was confusing

misty wharf
#

If you mark it instance editable, it will then be available to modify in the BT editor view and you can assign a BB value to it

#

You can also just add the logic to find the object directly in the task. You don't have to use the BB if you don't feel it's a good solution

#

(In one of my projects the NPC's search for objects and store the information about them internally and NPC-related tasks use the NPC's internal "knowledge" instead)

visual sluice
misty wharf
#

Basically the NPC itself has a variable which stores a list of objects

visual sluice
#

oh like create a array of that object that i want to move to

misty wharf
#

Yeah

#

If you want to keep things simple, you could just put the logic to find the object into the task itself

#

The main benefit of using the BB is that you can share information between nodes, and for example decorators can abort based on BB value changes easily

#

but if you don't need any of that then there's less reasons to use it

visual sluice
#
Epic Developer Community Forums

Hello. I am wondering the best way to get and store references to characters/objects in a behavior tree. I suppose I could either grab them in the AI Controller or Task and assign them. But my question then is… how do I retrieve the reference? Or is it more efficient to just cast for references every time in each task? There is the node “Get Bl...

misty wharf
#

That seems fine

visual sluice
misty wharf
#

You have to check what the problem is that's causing it to not move

#

Is the variable not set or is there some other issue

visual sluice
tepid sail
#

Hi! I'm wanting to build a simple village simulation that includes gathering and retrieving from nodes and bringing them back to the village "center". I'll be using this as my learning project but am not sure where in Unreal Engine to begin that learning.

Should I be looking at the blueprint system?

The only things I really know how to do right now are to create the physical assets that will be my developer art representing the stuff, and add those to the world. I haven't gotten to executing code yet; just creating objects and lights. TYIA!

misty wharf
# visual sluice its not casting

That can mean multiple things, the value could be null or it could be a different type of actor. You need to check the value to determine the root cause

uneven cloud
tepid sail
# uneven cloud No one is going to walk you through building a game. I recommend starting by do...

Thanks for answering! I may have not stated my question clearly enough - I'm wanting to build the simple prototype. What I am wondering is if I should be looking into this with a mind of using the blueprints system as I don't have any context for coding in UE specifically and am intending to focus my learning in the areas of the engine I will be using. 🙏

But if there is a specific starting point you would recommend instead, in the learning library, I'm absolutely about hearing that recommendation.

tepid sail
#

Having thought about it, my question can really be boiled down to: "New to UE, should I jump right in to blueprint system or add that to the workflow after I have been successful with C++ alone?"

Was asking here because I felt that my application might be relevant.

#

Grrr... Rubber duck effect in full swing. 🤦‍♂️ I actually need to be looking into animation next and following the rabbit trail ended up answering my original question. Yeah, blueprint system is going to be relevant for me.

misty wharf
#

Full games can be built on BPs but using C++ will certainly help you make your project more robust

#

(plus various features which are C++ only)

tepid sail
#

This makes sense. I wasn't sure if I was in this universe, or the one wherein any serious prospective dev masters C++ before adding blueprint otherwise it's a recipe for disaster. Y'know? 😅

#

Thank you, and you also Luthage.

#

I'll be back in a few days with that prototype to woot about it, hopefully. 🤞

real loom
#

hello i'm trying to make a simple turret. so far i got it to successfully rotate towards player but it instantly snaps to it. i want it to be smooth and also give some leeway for the player to escape the line of sight

#

i know the main issue lies in here

#

i'm calling this function in the turret actor in a behaviour tree task

#

and i can't have timelines in functions

#

and i can't get delta time either because this is not event tick

#

for interps

misty wharf
#

One way to do it would be to have a target rotation value on your turret

#

You can set the target rotation from the BT task, or set a target actor from the BT, and then calculate the target rotation

#

Then the turret actor itself would rinterp towards the target on its own tick

real loom
#

i mean i do have the reference. i am sending the reference from turret to behaviour tree.

#

i feel like i want to seggregate all the processing to the behaviour tree otherwise i can just not have a behaviour tree for a simple turret

misty wharf
#

If you really want to do it in the BT then you could have a ticking BT task or a BT service

real loom
#

the few videos i've seen on yt do it on event tick

misty wharf
#

It's fairly normal for the BT to not do the specific actions though - it would be fairly reasonable to put the logic for rotating towards a target into the turret blueprint, where the BT simply tells it what its target is and it figures out the rest on its own

real loom
#

thing is i know i don't want an event because that would be tooo many event calls when player is in range and moving.

misty wharf
#

How many turrets are you going to have

real loom
#

idk maybe 5-6 per level might be more

misty wharf
#

Yeah that's nothing, you can do it on tick just fine

real loom
#

i mean i know most pcs can handle event ticks

#

i just don't encourage it

misty wharf
#

There's no point in avoiding ticks for things that you clearly need to do on tick

real loom
#

i feel like that's bad programming practice imo

misty wharf
#

A timeline is exactly the same thing as ticking in this type of usage

real loom
#

yes but timeline ends at a point and that gives me assurance that it's not going to run forever

misty wharf
#

You can turn off tick after you've rotated to the target too

real loom
#

?

misty wharf
#

There is a node to turn tick on/off :)

real loom
#

this is the task i have

#

so run me through it again what's the best approach?

misty wharf
#

Personally I would make it so that you set the target actor on your turret, and the turret then ticks to rotate towards its target actor

#

But you could also have a tick event in your BT task which handles the rotation if you want

real loom
misty wharf
#

Yeah

real loom
#

i'm sorry i'm just being dumb but i do need the root scene reference in the task

#

cause i can't rotate it otherwise

misty wharf
#

You could get it from the turret actor I guess

real loom
#

and this is just me prototyping
when i get the model it has 2 moving parts one only rotates on the z axis and the other(barellels) move up and down

misty wharf
#

I'm not quite sure why you want toe BT to do all of the work though :) It's going to couple your AI logic to how the turret handles its own logic

real loom
#

why i don't want the turret to do the logic is because we might scale it

#

maybe have different turrets and stuff

misty wharf
#

That sounds exactly like a reason to have the turret do the logic

real loom
#

one turret might just be slow and do z rotation first then adjust barell while other turrets might do them parallely

#

so having them in tasks i can just change the sequence node to parallel

#

although now that i think about it i might need to have different bt for different turrets then

misty wharf
#

Well, if you have different kinds of turrets but they all have similar logic then you could share the BT

real loom
#

or i can have mini bts one does handle only the z rotation while another does only up down and maybe i can run behaviour trees within behaviour trees?

misty wharf
#

But if your BT task has the logic to do the rotation, then that would get in the way of sharing it because each turret could need a different way of handling it

#

as you said they might rotate in slightly different ways, so your BT task would need to be able to handle the different turret types

#

but if the logic for rotating is in the turret itself, your BT task can simply tell the turret to rotate and it doesn't need to know what type of turret it is

real loom
#

my brain is being an amalgam right now

#

i can't process what i need to do anymore

#

:p

real loom
#

as player is moving

misty wharf
#

Well how else are you going to do it

real loom
#

and idk why but i feel like i shouldn't be doing it

#

i'm not as opposed to call a function that many times

misty wharf
#

You do realize that if you call a function on every frame you're doing exactly the same thing tick does

real loom
#

yes

#

but idk why i have this bias of not wanting to call an event over a function

misty wharf
#

As I said there is no reason to avoid tick for things that need to be done on tick

#

there's no difference with event vs function in that sense

#

the reason you want to avoid calling events is because you've seen too many tutorials that tell you to not use tick without understanding lol

real loom
#

ok i did this

#

and i'm calling the event rn

#

but the turret although rotates smoothly is still very fast and player doesn't have leeway to escape

#

the timeline is like 5 seconds

#

wait no i made it 10

#

it's occationally snapping to player and stopping for some reason

misty wharf
#

It kind of depends on how often you're trying to rotate it

#

Because of how the timeline works, if you change the rotation target while it's already rotating, it will simply continue from where it left off rather than continuing from the start of the timeline

real loom
real loom
#

ok so the issue i have now is that the turret instantly rotates(idk how or why it does it but it rushes through the timeline) and i need a return node which i can't have in an event flow

real loom
#

💀

#

i didn't think implementing a simple turret would be soo painful

dense owl
real loom
#

this is the task currently

dense owl
#

Are you just trying to make an AI turret face your player ?

real loom
#

yes

dense owl
#

You don’t need all of that

real loom
#

i need to know when it's facing player so that i can finish the task so that i can move onto the next task

real loom
dense owl
#

There is a rotate to face bb entry task

#

Prebuilt

real loom
#

💀

dense owl
#

You can adjust the speed by changing the CMC or floating pawn comp rotation speed

real loom
#

it has no parameters

dense owl
#

Ik

#

You don’t need them

#

You do it from the char itself

real loom
#

only blackboard key it accepts is self

real loom
dense owl
real loom
#

what does it need?

dense owl
#

Or you’re using a location vector rather than an actor ref

dense owl
real loom
#

huh?

#

i have it

#

do i need to override it?

#

i mean i have an actor key

#

other than self

dense owl
#

Is it being used by any other BT node right now? Cause if you can’t select it it usually means you haven’t exposed it properly

real loom
#

what?

#

i deleted every other node these are the node's properties

#

details*

dense owl
#

Hang tight, I’ll pull up my project in a min, gonna need some coffee first

real loom
#

ok

dense owl
#

Can you show the details of your bb key?

real loom
#

so the issue was base class of my key was object

#

instead of actor

dense owl
#

Haha yeah I was just gonna say that

real loom
#

ok so how does this node work?

dense owl
#

Basically does what it says it does

real loom
#

like will it automatically face towards player and stop executing once it's done?

dense owl
#

Yes

#

You control the speed of the turn from the actual character settings

real loom
dense owl
#

Char movement component

#

Or floating pawn movement comp

#

Is your turret a char or a pawn?

real loom
#

also my turret will have different static meshes/ have one skeleteal mesh which will have seperate bones that need to be rotated

#

so how does that work?

real loom
dense owl
#

I’m confused. You said it’s a pawn but before that you said it’s going to have an SKM which implies char

real loom
#

i don't have the mesh right now artist will provide it to me. so i cannot have a skeletal mesh if it's a pawn?

#

well i do have 2 skeletal meshes temporarily in the actor

#

so...

#

the guns are skeletal meshes and the cube is a static mesh which i'm using as standin

dense owl
#

It should be a char

real loom
#

the actual mesh will have like 3 parts non moving base the top part that only rotates in z axis and the barellels which will have limited movement up and down

dense owl
#

That’s fine

real loom
dense owl
#

Cause it already comes with a skeletal mesh for starters

#

And a char movement component

#

It’s easier to do this now rather than risk breaking stuff when reparenting it later

real loom
#

well i'm just gonna ignore the current skeletal mesh because i don't have one right now

dense owl
#

and it comes with this, which you'll need in order to adjust its rotation speed

real loom
#

it's snapping

#

not doing a smooth rotation

dense owl
#

did you read above?

real loom
#

if you mean by this i set this to 5

#

it was at 360 before

#

it's till snapping

dense owl
#

try 90

#

and make sure you got rid of the old code

#

since that one obv didn't work

real loom
#

yeah i mean this is the only node i have in behaviour tree

#

soo

#

it still snaps

#

do you wanna hop into a vc?

dense owl
#

I don't do that

#

not sure what's going on on your end, this is what I have and it's even using a location instead of an actor, works fine:

real loom
#

it will be easier for me to show you rather than record a video or send pics continously is why i'm asking

#

i'll screen share

#

we can still message

#

had to disable yaw rotation

#

ok but how do i make something similar for the barllel rotation

#

which will be clamped

#

or do i need to have a task for that

uneven cloud
#

There are a lot of technical issues. First you have the navigation problems. Dynamic generation doesn't just have a perf cost during generation, but also a memory cost. You also lose the ability to see in editor how the navigation is built, which is a big hindrance. As someone who's done procedurally generated games, this is a big dev cost.

Next you have the problem of multiple people working in the same map. UE5 improves the workflow, but not completely. File contention is a big problem for every team.

Then you have the issue of the more stuff you have in a map, the longer it takes to load.

There are probably a lot more than I know about, because I haven't tried it.

uneven cloud
uneven cloud
dense owl
#

too heavy ?

uneven cloud
# dense owl por que?

It's completely unnecessary extra expense and turrets don't rotate like a character does.

dense owl
uneven cloud
#

They also don't usually move. Outside of rotation.

dense owl
#

yeah fair point

dense owl
#

I rmbr you mentioning dispatchers to make a BT task wait for something to complete a while back but never did get a chance to test it

#

so you wouldn't use rotate to face bb key for a unit that doesn't move? ig it's meant to work off chars eh

real loom
#

Ps: i shut down my computer so I can't test/play around it right now just trying to imagine and remember stuff. I'll do it first thing tomorrow.

real loom
#

Because i thought it's all going to be simple rotations but it turned out this complicated.

uneven cloud
uneven cloud
real loom
#

I'm also not asking majority of the vector math issues I have I'm trying to play around and figure that out myself because I'll just embarrass myself asking them and someone saying just go learn/watch some tutorials about basic vector math. :p

dense owl
#

there's even an EQS test built-in for it

#

and also we have #game-math if you need more advanced help

real loom
real loom
uneven cloud
real loom
#

Oh

#

Ok

real loom
#

And I do use the node set actor relative rotation for the actual rotation correct?(in this case I'm using actor rotation because i don't have a base that doesn't move but I will change it to mesh rotation later on)

uneven cloud
real loom
#

Ok thanks

#

I'll ask if i have any more issues tomorrow.

rain stream
#

I got an issue with EQS. I want to get the node/dot or whatever the green points are called that is closest to the querier. In the pic the winner is the dot that is furthest away, but i want the one that is closest. If i change the Distance test to inverse linear, it prefers smallest, which flips the green dot numbers.

dull harbor
#

ends up running into walls when trying to stay out of range lmao

uneven cloud
dull harbor
#

😭

uneven cloud
#

AI don't automatically act intelligently. You actually have to do the work to make them have reasonable behavior

rain stream
#

How do i get the closest point?

uneven cloud
#

You use a distance check with inverse linear

obtuse igloo
#

Hey all! Trying to figure out how to get my AI to not switch targets after they've already perceived the first one? Currently they'll see one player, but then when they've perceived another, they'll switch to that target instead or sometimes just completely ignore both targets and i'm unsure why.

uneven cloud
obtuse igloo
fathom dome
#

what kind of things can make an AI move to node fail?

#

I made a simple task for a random location and it's getting a random location fine, and the AI move to was working but now it always fails.

#

I'm scratching my head as to why

#

nvm

#

haha i confused radius and acceptable radius

#

they're very subtly named

#

that would definitly make sense as to why it would fail

real loom
uneven cloud
real loom
#

so with the timeline what's happening is it changes rapidly. it does majority of the integer in like an instant and at the end it does the precision points which is barely visible so it feels like the turret is moving instantly then has a delay/wait

#

the precision points takes alot of time for it to lerp

#

idk how to fix this

visual sluice
#

Ive been doing alot of research of how to reference non player actors in ai behavioral task node for the use of the ai moving to it, for the purpose of npc management games. I look through several forums, used several assets from the unreal store. All of them either use eqs, the get all actors of class, get all actors with interface, get all actors with tags. Is that all the methods for this type of thing?

dense owl
real loom
dense owl
real loom
#

i even tried just the normal 0-1 linear 2 point curve

dense owl
#

And sorry is this a char now or back to a normal pawn?

real loom
#

back to pawn

#

using task

#

which calls the event

dense owl
#

Does a pawn have control rotation settings I can’t rmbr

real loom
#

i wanted to do it using rotation movement component but that was

#

even more complicated imo

dense owl
#

Also, why use the scene root component for this rather than self?

real loom
#

idk it throws error when i use self

dense owl
dense owl
real loom
dense owl
#

Yeah makes sense so it’s likely not being overridden

#

Since you’re doing all of this on the root, you might as well rotate the whole actor then

real loom
#

yeah i changed those nodes

#

but later on i will have to change those back

dense owl
#

But in the interim, I would right click, watch value on your Z values and see what comes through at runtime

real loom
#

as i will only be rotating part of the actor i.e a mesh

dense owl
#

You’ll need to select a debug object to see them

real loom
#

oh wait

#

maybe it's because alpha only needs values from 0-1

#

and my timeline is 3 seconds

dense owl
#

It needs values between 0 and 1 but unless you’re feeding it the time it shouldn’t be a problem

#

Your track is between 0 and 0.5 as far as I could tell

#

Actually, you should prly end on 1 so you don’t stop half-way, else so will the lerp

real loom
#

yeah i changed the timeline to 1

#

second

#

but like.. what if i want to slow it down

dense owl
#

No, not the time

real loom
dense owl
#

Keep it at 1 tho

#

The time can be anything, your end value should be 1 tho else you’ll never reach B

#

You said you’re calling this event from a task?

real loom
dense owl
#

Have you tested the event in normal circumstances (i.e. press P to call it)?

real loom
#

when it comes to the end it slows down to adjust the floating points

dense owl
#

Why use the Floor btw?

#

Shouldn’t be needed here

real loom
dense owl
real loom
#

also i found this bug right now

#

it chooses to go all the way around rather that go the other direction

dense owl
real loom
#

normalize seemed to fix it

#

but yes

#

look at how much time it goes to update but how quickly it rotates

#

what i'd expect is the rotation to be spread out until the finish is called

dense owl
#

Looks about 2 seconds

real loom
#

i changed the length of timeline back to 3 seconds

#

but anyway coming back to ai. i'm unsure of what to do

#

do i have like 2 aiperceptions?

#

because the current ai perception that i have is 360 degree sight

#

but i also need to know when it's facing the player so that it can stop rotating and shoot at him

#

also i don't know how i would do the barellels

#

let's say the turret was on the wall

#

:/

real loom
#

dot product only tells if the player is in front or behind

#

or on the side

dense owl
#

That’s for location

real loom
#

but how do i know if the player is in within range for shooting

real loom
#

for what and what?

dense owl
dense owl
real loom
# dense owl Get distance to actor

no by range i mean if the barell is pointing at player or if it's pointing to the side and player already moved out of it's line of sight

#

i'm guessing ray cast is unavoidable

#

or another collider

#

or another ai perception

dense owl
#

EQS solves most of these problems

#

And you can run a service that checks it’s in range and right rotation etc

uneven cloud
uneven cloud
visual sluice
uneven cloud
visual sluice
visual sluice
uneven cloud
uneven cloud
#

If you use the EQS, which I recommend doing, you don't even have to make a service. One is already built in.

visual sluice
uneven cloud
visual sluice
#

Cool

deft mural
#

When using EQS, how do I apply my on custom checks on GetActorOfClass task?

#

Can I make my own EQS Task in C++ that inherits from that task and apply my own checks to each actor?

misty wharf
#

Sure, or just use a test which filters out unwanted actor types

misty wharf
#

"EQS Node Reference" is the name of that page, they are just called tests lol

#

But yes one of those could be used so you don't need to create a whole new generator for it

deft mural
#

Thank you.

misty wharf
#

You are correct

#

Usefulness of BT's depends on what you're doing and how you want to structure it

#

They're not a silver bullet for every imaginable scenario

#

In the type of scenario you describe they could be useful for higher level behavior selection, such as choosing targets or whether to pursue, run away, or some other such behavior

#

And you can have a node like "Attack" or whatever which then just delegates the actual attack logic to the controller or whereever it is

misty wharf
#

iirc there is some kind of eye height / head height value somewhere that it uses

#

for visualization you can use the gameplay debugger during gameplay at least

deft mural
#

How should I get the State Tree context in my Finish EQS query callback in C++?

misty wharf
#

there's some builtin tasks which use delegates maybe check those? Such as FStateTreeTask_PlayContextualAnim

deft mural
#

Thank you.

real loom
#

ok i think i figured out what was messing the lerp up

sudden citrus
#

I think I don't know how to make a cooldown StateTree condition. Which is pretty funny

#
  • ST conditions cannot hold state, aren't notified of task execution
  • data flows downwards, so if the state gated by the cooldown condition runs and I wanted to save out a timestamp, it cannot produce an output that the condition can then read next time
#

external data storage for this kinda stuff?

sudden citrus
#

You can override GetActorEyesViewPoint in your pawn or controller subclass, but it can only be done in C++.

misty wharf
#

I wonder if you would have to make the cooldown a task

sudden citrus
#

I could do that, but my tree is:

  • CombatRoot
    - CombatIdle (stand around target)
    - Attack

If I want them to idle while waiting for an Attack cooldown, it won't really work (the above formatted wrong, Attack and CombatIdle are siblings)

#

I'm going to make a squad manager where cooldowns are handled for everyone, but it's a bit strange that I can't fudge it for now

misty wharf
#

Yeah there's a few bits like that in ST which are a bit clunky

sudden citrus
#

maybe in Mass it's more straightforward but this is the actor level

misty wharf
#

Why would it make a difference if it's Mass? 🤔

#

As far as I can tell Mass just makes things more complicated if anything but I've not really looked at it

sudden citrus
#

being able to read/write to arbitrary fragments maybe? I'm just theorising

terse panther
#

hey there everyone 👋
Is BT nesting a good thing to do or not?
i mean it looks clean and easier to read when doing the nesting , but i don't know if there is any performance cost to it...

dense owl
#

Assuming you mean using subtrees

terse panther
dense owl
#

Yeah

terse panther
#

got it ...
as the behavior tree grows bigger it hard to read so i thought to create sub tree for each section

sudden citrus
#

that's why it's there 🙂

#

but they should use the same type of blackboard

terse panther
#

one more question..
lets say i have this BT structure and right now my wait task is executing....
but something happened somewhere because of which i want to re-run my section "2.2",
one way i am thinking is to restart the whole brain logic (because i know that if i restart the control wil skip all the secton before "2.2" and direcly execute this section) ...are they any other ways to do something like this?
i hope i am not sounding dumb 😅

dense owl
#

The engine gets really mad at you if you try 😀

sudden citrus
terse panther
# sudden citrus Why do you want to restart your current branch?

there is a logic in that branch that i want to re-evaluate when my AI takes damage...
so even if my AI doesn't takes the damage then also this branch execute, but if it takes Damage, then i want to instantly re-evaluate it so that my AI can take new position

sudden citrus
#

if you find yourself trying to break the pattern then it's likely you've not found the best way to fit into it

late turtle
#

learning state trees, the "Shoot At Target" and "Move To Target" states are never run but the "Turn Towards Target" state is. Im not sure why this is the case because my understanding is that the "Shoot At Target" state will always run after "Turn Towards Target"

terse panther
visual sluice
#

Should I use eqs because wht I’m trying to do is when my Npc gets tired/sleepy I want the ai to if a bed is around to go for that bed but if it’s not pick a direction and follow that direction untill it detects one of tht makes sense

#

Or do all actor of class

#

I also want it to update anytime an actor spawns in or is loaded in

#

Or dragged in

misty wharf
late turtle
#

ah I see, thanks!

uneven cloud
nova cargo
#

I've got a BTTask that changes the walk speed(as im trying to implement a run). This works but then I'm not sure how to reset it when they leave that task/sequence.

#

basically it keeps stacking the increase

rain stream
nova cargo
#

ok yea, so there isnt a way to have an event when its complete? i guess since its on a tick?

rain stream
#

Do it like this, when it is done with the task, you cue up next task that resets it, kinda like i do here, but with speed:

uneven cloud
nova cargo
#

interesting, still new to bt i will look into services

uneven cloud
rain stream
#

Yeah makes sense, i haven't looked into services yet

#

I have an ai that i want to go to the nearest node. How can i go about to do that? And at the same time make sure it doesn't go towards the one that is on the other side of the wall?

uneven cloud
uneven cloud
nova cargo
#

hmm not seeing them on the list, I have "set default focus" and "Run EQS query", guessing i have to make a new service.

#

Thank you @uneven cloud

rain stream
uneven cloud
visual sluice
#

how would i do the eqs percieved actor generator there seems to be no tutorial on it

visual sluice
#

Never mind figure it out

#

But I don’t think I can’t use eqs because I have to switch on auto register as source which crashes my game any game like even if I get a new game

#

Yep can’t use perception at all

sudden citrus
uneven cloud
visual sluice
#

I knew of othe generator

uneven cloud
uneven cloud
visual sluice
#

Cause what’s do item generation from actors and do item generation

uneven cloud
uneven cloud
dense owl
#

There is a built-in perceived actors generator you can put on an EQS composite node

uneven cloud
dense owl
uneven cloud
autumn ravine
#

Hey everyone I need help I need help I want to make car reverse when it's stuck and get unstuck how do I do it? I'm also using pawn sensing please help me

uneven cloud
autumn ravine
uneven cloud
autumn ravine
#

Well there's an intersection so basically when the car is going to turn left and the other one coming straight they collide face to face making each other stuck because they keep detecting each other

#

And here's the code of my pawn sensing

uneven cloud
autumn ravine
#

Well that's what happened to me I don't think it ever waited 1 sec

#

It doesn't move forever and that bothers

uneven cloud
#

You are also only detecting when you first see something, which is one of the many issues with pawn sensing.

uneven cloud
#

But also, you need to fix your logic.

real loom
#

so i have an issue again. i got the mesh. but rotating seperate parts of it doesn't work as it does not rotate ai perception component

#

they are going to rig it and animate it so it will be a skeletal mesh even

vague flame
real loom
#

yeah but the problem is ai perception doesn't rotate

#

so i'm thinking maybe i need to have the static mesh of the base seperate and have a child actor for just the rotating turret skeletal mesh with ai

vague flame
#

It rotates with actor rotation

#

So yea just have a seperate non rendered sphere collision

real loom
#

issue is mesh

#

not the collision

#

the base should be fixed

#

but i can't have that in the same actor as the turret if i use actor rotation for ai perception

#

or i'll have to rotate that in the exact opposite direction for that to work

vague flame
#

Nah just have the AI be its own bp and send targeting data to the turret

#

U can have two child bps in one master BP

real loom
#

either way that's 2 actors no?

vague flame
#

I mean yea but if it works it works

real loom
#

so i have base as an actor and just removed the base from the turret i currently have working and made my working turret as child actor in the base actor

#

the turret does work as intended but i can't seem to see it's perception debug

#

and i'm super confused

vague flame
# real loom and i'm super confused

Okay well that’s kinda what I meant, but more like a spotter/sniper relationship between two seperate bps, so just have an empty pawn with aiperception to send data to the turret that just points at the location the spotter tells it to

real loom
#

i'll have to make connections between both the bp actors in that case and i don't know how to and it's more work than what i currently have

#

i have it working where everything else apart from the base is in one actor

vague flame
#

Good deal

autumn ravine
#

Because also don't forget there are traffic light so basically if it's red I want them to stop behind the car and not hit the car

#

Also I'm using ue4

rain stream
#

I want this EQS test to prefer greater, but if i choose Linear scoring value, the value of the dots change at the same time. So it doesn't matter if i choose Linear or Inverse Linear. Anyone know why? Or what i am doing wrong?

#

He doesn't go to the dot closest, but always furthest away

rain stream
#

If i turn on Reference value and put it to 0, i get the results i want, however, some locations far away get a score of 1, which i can't figure out why

unkempt pulsar
#

Hey if I make capsule half height of an NPC Character higher than 250 the "DoesPathExist" decorator fails, why?

unkempt pulsar
#

I've tried fiddling with the nav mesh settings but didn't work

uneven cloud
autumn ravine
#

Mines stops forever until one of them moves the other will start moving

uneven cloud
autumn ravine
uneven cloud
autumn ravine
uneven cloud
autumn ravine
#

And is pawn sensing and ai perception the same thing?

harsh storm
#

Just act like pawn sensing doesn't exist

#

Genuinely don't know why you're hung up on this piece of the puzzle

#

AIPerception replaces pawn sensing

autumn ravine
harsh storm
#

I also don't know why there has seemingly been in uptick in people using pawn sensing lately.

dense owl
harsh storm
#

I mean, you really have to be reaching into the depths of aged tutorials to come upon this

#

Like...2nd page of Google depths

dense owl
harsh storm
#

Well yeah, you're on Youtube and you're probably watching Gorka Games

misty wharf
#

There was a few humble bundles selling UE courses recently I think

#

Could be a factor?

#

The quality on those can be a hit or miss :P

rain stream
uneven cloud
misty wharf
#

Unsurprising. I'm pretty sure I've seen Epic employees retweet Gorka Games videos

#

Only reason I paid any attention to them being RT'd is because people are saying they are bad lol

rain stream
uneven cloud
vague flame
#

R u trying to do a EQS thing or what are u scoring

visual sluice
#

So i have a enum that sets an action for the npc ai such as Travelling, or fetching stuff from inventory or going towards an object to either work, eat, sleep, etc. that i can set with parameters in a service node in the ai tree but i was wondering if its possible to set that enum in a eqs

#

hopefully im making sense

rain stream
uneven cloud
rain stream
uneven cloud
rain stream
uneven cloud
rain stream
#

Yeah that's this one

uneven cloud
rain stream
#

Yeah that's what i've been doing. This is with only filter on the trace test.

visual sluice
#

not to be difficult or anything is there a difference between eqs and what other programmers do with doing like a npc ai thing?

harsh storm
#

The first part of the question is something concrete, the 2nd is quite broad. What do you mean "like a npc ai thing"?

#

EQS is used to query the environment for things. Like a place to go, an item to find, cover to find, etc...

#

You then use that information to make a more informed decision for your AI

visual sluice
#

and like you said place to go, item to find,

harsh storm
#

EQS itself doesn't have any behavioral logic. It's used to grab information from the world so you can make more informed decisions for your AI in regards to the world itself.

#

So they work together

visual sluice
harsh storm
#

Do what? Query the world?

visual sluice
harsh storm
#

Sure?

#

It's just code at the end of the day

visual sluice
harsh storm
#

But why would you when you have a pretty good system with decent enough tooling built around it that is purpose built specifically for this?

harsh storm
#

Easy - need to query for information in the world? EQS is going to be what you reach for

rain stream
#

Although, it still provides those random far away winners when using the batch and not just pathfinding

uneven cloud
# visual sluice not to be difficult or anything is there a difference between eqs and what other...

Why do you continue to ask this question? You seem to be searching for the "best" answer when there is no such thing. If you are completely against using the EQS, then do it whatever way that you want.

I'm a professional AI engineer with over a decade of experience, most of which is in UE. I'd use the EQS, because that's literally what it's built for. If you don't agree, then do it however you want.

visual sluice
uneven cloud
visual sluice
rain stream
#

Can the EQS trace test, test the entire mesh and not just center?

misty wharf
#

You would need to implement a custom test for that I think

#

There's no simple way to test an entire mesh to begin with since you can't exactly trace to every single point on it in a reasonable way so how you want to handle that is kind of up to you

rain stream
#

Yeah, that's what i feared. Custom test is doable tho. Maybe add a buffer sphere to get the AI enemy all the way behind cover, and not just halfway there

rain stream
#

I made it into a BT task and chose the second location picked from the returned array, which works pretty good!

visual sluice
#

is there a way for eqs to switch actor classes for an action, for example if the npc is sleep it will change to bed, hunger change to plant or something, work to workstation, so i dont have to make a eqs for each one.

rain stream
lyric flint
#

Anyone able to help here

#

for some reason wether the AIState changes to Combat for example the behaviour tree won't move to other one

rain stream
#

Text too small, can't read anything

lyric flint
#

this is bassically what I have these sequences coming from a selector

#

combat is most left, invesitgating mid and right patrolling

#

its kind of working it's just bit wierd as it's waiting to complete it's task before it'll abort out of the branch to run the combat one

#

even thought the decorater is bassically saying it shouldn't be doing anything in there

rain stream
#

Tried setting it to abort self instead of lower priority? Idk, i'm fairly new to BT

rain stream
#

I'd look into where you are setting the states

#

Or are you setting the states in the tasks?

lyric flint
#

sorted it

#

I have Lock AILogic ticked

#

it ends up locking anything happening until it's done it's move to thing which is good but not for my case haha

visual sluice
rain stream
#

Look up the AI tutorials from Ali Elzoheiry on youtube, they are pretty good

uneven cloud
lyric flint
rain stream
#

I think it's because BT is not suited for setting states

lyric flint
#

I'm confused I'm not setting states?

#

The decorators are just blocking entry into it unless the enum state is set correctly from outside the BT

#

There a set bb key thing in there but that's to basically force it to go through a particular way

dense owl
#

The enum what now?

lyric flint
#

I have an AIstate enum that's all

dense owl
#

Sounds… stateful 🙂

lyric flint
#

That it is

visual sluice
visual sluice
#

And i did it somewhat but with set variables not get

uneven cloud
timid sapphire
#

How can I make AI path through other pawns? I've turned off Can Ever Affect Navigation and set collision to ignore pawns on every component, but they will still try to path around eachother rather walking through eachother.

uneven cloud
timid sapphire
magic juniper
#

Hello everyone, I'm implementing the node blueprint "Simple Move To Actor" but an error like this appears, and the target character doesn't work.

UNavigationSystemV1::SimpleMoveToActor called for NavSys:None Controller:None controlling Pawn:NULL

Does anyone know the solution?
thank you, please help.

lyric flint
#

In terms of I'm simply resetting a value to ensure it goes into a specific place ?

#

Everything else is being set outside of the BT so in the controller each

#

Apologise from my part but I'm struggling to understand how I'm using BT in completely wrong way which is what your kind of pointing out

rain stream
#

Is it possible to place an AIC with AI sensing on the player character? I want reactions from when the player is seeing certain actors

#

I tried, but it's not posessing or updating on the percetionupdate event

misty wharf
#

It's possible but complicated

#

You can use an AI controller to possess the player pawn, the player pawn is just a regular pawn afterall

#

But you can't have the player also possess it at the same time, so if you want to control it, you would have to set up some kind of system where the player "controls" the AI controller

proven flint
#

Hi, I'm learning StateTree. So far i understood everything, but one thing bugs me: How can i enter the leaf states AFTER the parent state succeeds/fails?

I need to run a query first before going to leaf node, so i can access the OUT variable that's a Location the query found (and the query works asynchronously so i don't have the requested location right before going instantly into leaf states).

I guess it shouldn't be the leaf state but a sibling, but then i can't bind into the value from the querying state.

I tried Changing Selection Behavior from "Try Select Children In Order" to "Try Enter" but it behaves practically the same way- the "Go to queried location" state is getting entered before the query finishes.

The result is the Player going into location 0,0,0 and Aborting the previous move to request.

misty wharf
#

Doing something like that is kinda complicated with ST's unfortunately

#

It would indeed be easier if you could just have it as a sibling state, but there's nowhere for you to put the results in that case so it would be accessible for the next one

#

It might be possible for you to set it up so that you add a "waiting" state before the actual state, where you have a task in the waiting state or transition which keeps checking whether the value is set

proven flint
#

Ohhhh okay, i think i have an idea how to solve that! As you said, I can make a leaf node that binds into the query and Succeeds/Fails when the Query finishes!

rain stream
magic juniper
#

Hello everyone, I'm trying to use Simple Move To Actor, well my BP is Pawn.
When I run it an error appears, namely "PIE: Warning: SimpleMove failed for AIController_0: movement not allowed" can anyone provide a solution? Unfortunately I don't want this pawn to change into a character.
Or is that the only way? thank you.

proven flint
#

Okay, now i'm confused.

  1. EnterState won't even trigger on task in B if the task in A doesn't succeed. I thought that by default states that aren't leafs just execute their tasks, but they select the child states regardless of the task state

  2. The whole tree behaves like it executes on tick, B gets called basically every frame (when A succeeds), i want B to "stall" the tree logic and not transition until it gets to the destination, but it doesn't work like that , the logic kinda goes back to Root the moment you enter the state

#

A isn't latent in any way, it just checks actors currently percieved actros from AIPerception

rain stream
haughty edge
proven flint
#

Yeah, it does, if it finds a percieved actor, it finishes with success, if it doesn't find, it finishes on fail

haughty edge
#

if it is one of the tasks that are just along for the ride, you don't have to call finish task

#

in this case, the go to task should call it

#

I think that way, the state tree will wait until the move to is finished

proven flint
#

oh, okay, gimme a sec, i will test that

magic juniper
rain stream
# magic juniper Sorry i'm newbiew, what is EQS?

I said wrong, Behavior Tree (BT) is what you want to get started with. EQS is a querrying system for the AI to gather data from the environment. BT and EQS combined can tell where pawns/enemies should go. I highly recommend to check out Ali Elzoheiry's youtube tutorials on "smart enemy ai"

paper flower
#

I'm attempting to 'drive' (without simulating 4 wheels) an actor between different locations in my world (drive actor within firing range of other actor). Originally I tried dumb logic, now I am turning towards trying to use AI. So looking at a few approaches (c++ oriented):

2. Approach 2: AIController + *MovementComponent --> maybe there is some way to of using these in concert: (AIController->SetControlRotation(x), and movementComponent->SetMinSpeed() (its odd I see GetMaxSpeed() documented, but no way to Set it? wtf?
3. Other, lots of movementComponents include NavMovementComponent, again I suspect this does not magically handle turning for me.```
any Thoughts/Pointers as to the flaws in my approach?
proven flint
haughty edge
#

Np

uneven cloud
lyric flint
#

What I done wrong here

#

what I've trying to do is that it's do the FireWeapon Task but also run the sub tree at same time

#

if I set immediate it bugs out and the sequence there sticks on the move to location

#

if I set delayed it obvs does the sequence and then fires the paralel task

uneven cloud
# lyric flint What I done wrong here

Is the fire task returning immediately?

Your service to find a move to location is not going to find one by the time the move to task starts. Services start when the branch below starts and the EQS doesn't return immediately. You need to use an EQS task to find the first location and then a service to update it.

lyric flint
#

thats kind of make sense then cause if I use the delayed for the paralel then it works fine like the move to location and then wait

#

having immdiate at the min is not letting the move to location move on wait, but you've explained why thats happening

uneven cloud
#

Delayed isn't always going to work. The EQS is time sliced, so if you have a bunch of AI using it, then it might take a bit to finish.

lyric flint
#

so could I remove the service completly you think and just do a task for eqs ?

uneven cloud
#

Does the target move? If so, then you need the service on the move to task to update it as well as the EQS task.

harsh storm
#

Why are you messing around with "states" btw? IE - AIState.

BT is better used as a priority selector. So behaviors that take the highest priority are the furthest left. And you gate that stuff with decorators.

lyric flint
lyric flint
uneven cloud
lyric flint
harsh storm
lyric flint
#

in terms of setting it etc thats being done outside of the BT

harsh storm
#

Yes. So you're still treating it as a state machine pretty much

lyric flint
#

from most of stuff I've seen this is literally what I've learnt in terms of ways to block going into that branch

#

as well as other ways

harsh storm
#

You can literally just remove this decorator and only use the "Can See player" or w/e to gate this behavior

harsh storm
#

Then, depending on the priority of the behavior, you arrange it in the tree appropriately.

lyric flint
#

can't rely on simply can see player to protect AI going into bits

uneven cloud
#

Lots of tutorials show this way of forcing the BT into being a state machine, doesn't mean it's right or even good.

harsh storm
lyric flint
#

obvs if I remove the Enum thing

harsh storm
#

The crux of the issue is that you are gating behavior based on state. Which means you are using both a logic state machine & BT

lyric flint
harsh storm
#

While, not wrong in of itself (you can certainly combine multiple AI designs)

lyric flint
#

if I remove the enum

harsh storm
#

It's how you're doing it

harsh storm
#

IE - "does have ammo" or "is within range", etc...

lyric flint
lyric flint
#

and I'll be honest I will prob do stuff like that

#

further down the line

#

There isn't any way is there to like have two brances going at same time ?

#

like I know the parallel allows a main task and then other stuff but I'm thinking it might not work well for this situation

#

I'll be working enum out the situation as well now I got a better understanding but yeah any ideas on this one

#

would it be good idea for it to like run another behavior ?

#

like Weapon Behavior or that just going to far where it's not needed

misty wharf
#

What are you trying to achieve by running two in parallel?

uneven cloud
#

What behavior are you looking for? Not how you are trying to achieve it, but what is the AI supposed to do?

lyric flint
#

Obvs with that does have ammo there it don't call the fire weapon cause the reload isn't happening to allow fire weapon to happen

#

I could use a service maybe to check if weapon has ammo but

lyric flint
harsh storm
#

Also - why do you have a custom move to location task? What wasn't working with the built in one?

misty wharf
#

Depending on how the logic works I don't know why you would need to have parallel for shooting/reloading and moving

#

If it's possible for the character to do both at the same time, then you could let it

lyric flint
#

I to be fair may return to the inbuilt one to be honest as slowly I'm using less of the stuff I added

lyric flint
#

as in the fire weapon was reloading if it needed

#

but obvs with whats been mentioned above about moving away from using the Enum for a gate I'm finding the function will need to be seperate

#

like in the BT

paper flower
#

I feel like when I query the Navigation System with Agent Properties, they are being ignored, as I am getting nav points that collide with that supplied radius? what am I doing wrong? here is the sample colde: ```ANavigationData* navData = navSystem->MainNavData;
FNavAgentProperties AgentProperties;
AgentProperties.AgentRadius = 250.0f; // Adjust based on your agent's size
AgentProperties.AgentHeight = 150.0f; // Adjust based on your agent's size
FPathFindingQuery query;
query.StartLocation = GetActorLocation();
query.EndLocation = final_loc;
query.QueryFilter = navSystem->CreateDefaultQueryFilterCopy();
query.NavData = navData;
query.SetNavAgentProperties(AgentProperties);

query.NavData = navSystem->GetNavDataForProps(AgentProperties);
FPathFindingResult result;
result = navSystem->FindPathSync(query);```  Any ideas what I'm doing wrong here?
uneven cloud
lyric flint
#

also if they have no ammo they retreat to a location which is in cover whilst reloading

uneven cloud
lyric flint
harsh storm
#

@uneven cloud Curiousity question - so, I use decorators as a simple bool check in like 99% of scenarios, IE - the bb key valid one or w/e it's called. What's the most interesting way you've utilized a decorator outside of that?

lyric flint
#

I've got that bit already on a branch of screen which is higer priorty then roaming but under priorty to the combat stuff which is what I'm putting as my container as it were

uneven cloud
uneven cloud
lyric flint
misty wharf
#

I also use a lot of decorators that access actors directly, but I think the most "interesting" use I've had is ensuring that when a branch of the BT exits, the actor goes into a certain state

#

Although I've not really decided whether that would be more of a service thing

uneven cloud
#

I put that as a service, but only for clarity

harsh storm
#

A vast majority of the time, I'm just smoothbrain about it and like "bb key is valid" and don't even think about what else I could do with them 😅

uneven cloud
#

Because we are using a utility/BT hybrid a lot of things are driven by the utility state. So it sets a lot of the BB keys.

harsh storm
#

Yeah, I've seen some use cases of decorators being what provides the score to a utility system

uneven cloud
#

That's not how I'm doing it, but that is a valid way to do things.

uneven cloud
lyric flint
uneven cloud
lyric flint
#

Guessing that would be a service on the move to cover task ?

harsh storm
#

Now for the more important question - what program did you use to whip that up?

#

That is really purrty

lyric flint
#

and the code within that bassicaly be same as what my EQS is doing or not ?

uneven cloud
#

I could have made it prettier, but I'm a bit lazy this morning.

lyric flint
harsh storm
#

I know you prefer to use a service to update the location during the move to task - but is there a particular reason instead of relying on the Observe BB value for the Move To node? I use the latter and it has worked out fine for me personally.

#

Just curious if there is some gotcha that I am unaware of or some edge case, etc...

uneven cloud
lyric flint
#

that

uneven cloud
uneven cloud
# lyric flint

You can put a generator on the left to get the current move to location to validate it. So you aren't always generating a lot of points.

harsh storm
# uneven cloud As opposed to what? You need to update the BB for observing the blackboard chan...

In the Move To task, when you select to observe the BB value (or w/e that field is called) if the target actor is moving, it still correctly moves to the actor. So you'd have, in task order, "Find Location -> Move To (location) -> Wait". Or if you have the actor as the thing to move to, it'd just be "Move To (actor) -> Wait". Parenthesis represent the BB value btw.

And if either of those values change, Move To updates its target destination correctly (at least in my tests).

lyric flint
harsh storm
#

EQS - generators are EQS things

uneven cloud
lyric flint
#

found it

uneven cloud
lyric flint
#

So you mean like this ?

uneven cloud
lyric flint
#

found it and i'm guessing I simply take in the current location and spit out a new one or ?

#

you'll have to forgive me never made my own generator before

#

like ever haha never went into that area tbf

harsh storm
# uneven cloud Moving directly to the actor is gross. It gives you really bad behaviors.

Sure. But my main question is...okay wait - I think I understand your flow now.

You need a service to update the target position because you pretty much always pick a location to go to (instead of Actor or location). And you use EQS to pick that location. Now, that location obviously won't change when the actor moves even though it is based on that actor. So you have to rerun the EQS to always have the most up-to-date location.

uneven cloud
harsh storm
#

Right right

#

I fully processed the flow as I was typing my reclarification of the question 😅

lyric flint
#

So what I doing in here ?

uneven cloud
#

You can do frequent EQS with a bunch of AI. It's time sliced.

#

First of all you don't need it that fast. Human reaction time is slower than that. Otherwise it depends on what your EQS is doing.

harsh storm
#

Yeah, I know. My question was specifically on why Luthage prefers her setup. I know about all this stuff and how to use EQS and etc...

#

Always take the opportunity to poke the brain of a 10-year veteran 😅

uneven cloud
#

Then you need to turn on use acceleration for paths.

#

Faster updates is not even remotely needed. The zig zaging shouldn't be mimicked.

upper forge
#

guys i use the node move to of ia and the IA does not move even when i setting up everything what is the cause of this?

#

i test with a cube and the cube just go to the ground and no move around anymore

#

yes

#

i press P to debug

#

yes

#

the cube moves one time

#

but my character does not

#

the cubes move to the ground and stop not move anymore maybe is the Z of vector?

#

the character i use character default the cube i simply create a pawn and append a movement component

#

the cube yes move to the point but him dont have a gravity

#

this 3 character even when i use one of them nothing happens

uneven cloud
#

That depends entirely on how you set it up. You also need to tune the acceleration and declaration values. The default is really high.

upper forge
#

the behavior tree is the most simple as possible

uneven cloud
upper forge
#

oki

uneven cloud
#

They don't move that far when decelerating. Don't over think and come up with problems that might not exist.

paper flower
#

Wondering if anyone here has actually gotten the NavigationSystem findPath* methods to actually honor AgentRadius in its queries? looking at the source this does not seam possible (source code does not appear to honor the passed in values), rather it looks like the only AgentRadius supported is the one defined by the actual NavMesh (recast). NavMesh Modifiers, but I have not looked into that yet, as that doesn't seam useful for my usecase.

rain stream
#

Does this not work? Trying to update the location while it's walking there in case there is a better location

timid sapphire
#

Hello,
I'm using a detour crowd ai controller for my ai. I recently made some smaller ai spiders that I want other ai (including the spiders themselves) to be able to walk/path through, while retaining the detour logic for all others. Is this as simple as using a different ai controller base class or is there another method I should be going for?

lyric flint
#

just wondering

rain stream
#

No, query task is a task of its own, the service can run simultaneously as the task

#

If i run the query after move to, it will finish move to before running the task

lyric flint
rain stream
#

But i am seeing what the issue is. The move to function doesn't look for a new updated location, and it doesn't seem to have an update function while it's running

timid sapphire
misty wharf
#

Just don't use the crowd controller on them

#

The detour crowd controller registers them with the crowd system, if they aren't registered, then they won't be avoided

timid sapphire
misty wharf
#

Yes, but not sure if it's exposed to blueprints

dense owl
#

Shouldn’t be that difficult to choose a diff AI controller class

#

Or reparent it

misty wharf
#

I guess it depends on how much code he's got in there :P

lyric flint
#

Anyone know best way to stop a behavior tree completly log not even have it run anything ?

#

currently trying to use Stop Logic function on the AI Controller but Behavior tree still appears to be running

uneven cloud
#

So don't wait a second to update. That's not hard to tune.

uneven cloud
timid sapphire
# dense owl Shouldn’t be that difficult to choose a diff AI controller class

It shouldn't be but thats what you get for using a plugin off the marketplace. Theres a lot of casting to this specific controller for BT Tasks and EQS queries. Maybe I'm not thinking about it correctly but I would need 2 ai controller classes, one parented to the crowd controller and the other parented to a plain ai controller, and then replace all casts to an interface function or something.

#

I've made this function to unregister an actor from the crowd manager but I can't get a reference to the UCrowdManager class (Identifier "CrowdManager" is undefined)

void UMyFunctionLibrary::UnregisterActorFromCrowdManager(UObject* WorldContextObject, AActor* Actor)
{
    UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
    UNavigationSystemV1* NavSystem = UNavigationSystemV1::GetCurrent(World);

    if (NavSystem)
    {
        UCrowdManager* CrowdManager = NavSystem->GetCrowdManager();
        if (CrowdManager)
        {
            CrowdManager->UnRegisterAgent(Actor);
        }
    }
}

Is there another import I need besides #include "NavigationSystem.h"?

uneven cloud
uneven cloud
timid sapphire
#

any references to the "bits" it adds that I can replicate?

uneven cloud
timid sapphire
#

The ai controller I'm using is in blueprints or I would

uneven cloud
#

Gross

uneven cloud
paper flower
#

@uneven cloud For the Navigation system to use the best nav data based on AGent properties it needs to look at the agent properties...if you follow the the function, it doesnt actually look at the agent properties associated to the query!

uneven cloud
timid sapphire
# uneven cloud The crowd manager needs to be included

I was having trouble finding the path but #include "Navigation/CrowdManager.h" seems to work. Now I'm stuck on UnregisterAgent which expects a ICrowdAgentInterface* as the argument. Is this expecting the character pawn to remove or the controller?

timid sapphire
#

How do I convert that to an ICrowdAgentInterface pointer?

uneven cloud
#

You shouldn't need to

timid sapphire
#

I get the compile error: argument of type "AActor *" is incompatible with parameter of type "const ICrowdAgentInterface from this line: CrowdManager->UnregisterAgent(Actor);

paper flower
#

@uneven cloud The function is navSystem->GetNavDataForProps(AgentProperties); In my use case it ignores the AgentProperties entirely, apparnetly because my NavMesh fails this test: if (SupportedAgents.Num() <= 1) { return MainNavData; }

#

but regardless of that, the next logical call after that, is to perform the query with the AgentProperties, the problem is the findPathSync (never acctually refers to Query.AgentProperties that I could see).

#

Is there a config to flag the NavMesh to support multiple agents?

uneven cloud
timid sapphire
#

Would it work if I just cast the actor? ICrowdAgentInterface* CrowdAgentInterface = Cast<ICrowdAgentInterface>(Actor);

uneven cloud
uneven cloud
paper flower
#

@uneven cloud ahh, I was not aware of the agents array 🙂 thanx for that tid bit.

#

When performing the Query do you specify the 'Agent' by name?

#

and/potentially build out different NavMeshes based on the agent properties? like if the radius is significantly different?

uneven cloud
timid sapphire
#
UPathFollowingComponent* PathFollowingComponent = PFC;
CrowdManager->UnregisterAgent(PathFollowingComponent);

Returns the same error

argument of type "PathFollowingComponent *" is incompatible with parameter of type "const ICrowdAgentInterface *"
uneven cloud
timid sapphire
#

Maybe I need the CrowdFollowingComponent?

misty wharf
#

iirc the controller is the crowd agent so you need to cast the controller to the interface

#

one of them certainly should be

uneven cloud
paper flower
#

@uneven cloud hrm, I have no 'movement' component atm, atm I'm simply err moving the agent myself based on the returned path. (since I need the agent to NOT snap its controlRotation).

misty wharf
uneven cloud
uneven cloud
paper flower
#

RotationRate is only available on ACharacters I believe.

uneven cloud
#

Oh it's a pawn?

paper flower
#

yeah, a 'driving pawn', but I'm not using the built in vechicle stuff, not trying to simulate a car...

#

so for not, I'm primarilty looking for the path with a 'large enough' radius to ensure I can turn the vechicle

uneven cloud
#

I'd still move that functionality over to a nav movement component or a pawn movement component.

#

The way you are doing it is going to need a lot of redoing a lot of work already built in to the engine

paper flower
#

I'm still doing collisions tests during movement, and will fetch a new path if its hits a another pawn..thats was my reasoning, but I do think I likely need look into the DetourCrowdAvoidance stuff

uneven cloud
#

Yeah, you really should avoid doing collision tests while navigating.

paper flower
#

yeah, I think tomorrow I'm going to try and switch my test project and do some tests with the Crowdcontrol, but still not sure how that will work with my having to turn the actor.

uneven cloud
#

If you have source, I'd look into how the CMC does the rotation rate. It works really well

paper flower
#

I will take that into consideration 🙂

harsh storm
#

Ahh - another satisfied customer from Luthage

#

Straight holdin' down the fort in #gameplay-ai. Answering multiple people's questions/problems.

paper flower
#

I think what has me a bit befuddled, If I have an Actor, and that actor has a AAIController on it, how does the AAIController know anything about the MovementComponent? Does it query the Actor for all components, searching for a UNavMovementComponent?

timid sapphire
lyric flint
#

I have a really wierd thing happening where my AI seems to continue out the task even though on Behavior Tree is clearly shows they should be doing something else

paper flower
#

indeed, I'm learning new things 🙂

lyric flint
#

Can I flip these around ?

#

the Move to and the fire weapon so I can have a wait once it reaches the move to location before moving again ?

timid sapphire
#

I got my function to compile and run but if I unregister the agent from the crowd manager the ai no longer moves 🫤

uneven cloud
uneven cloud
timid sapphire
paper flower
#

This feels like a odd question, but..When I create an AIController in the UE editor, I see it comes with certain components, but I do not see a movementComponent by default (rather UNavMovementComponent) included, I also do not see a way to add a NavMovementComponent where does this actualy exist? (I see an InterpToMovement with a 'tag' see UMovementComponent)

uneven cloud
paper flower
#

Wait, PathFollowingComponent Caches of the MovementComponent (the one presumably added to the Actor?)

uneven cloud
uneven cloud
uneven cloud
paper flower
#

Got it, u mentioned earlier (since I don't have a Character, even though maybe I shoudl just make my 'car' a character), that maybe I should use someting based off of UNavMovementComponent, but looks to me there is no way to add this directly in the UE editor? I suppose if I create a c++ class using that as the base, then I can add it....

lyric flint
lyric flint
uneven cloud
paper flower
#

what the wheels were legs? 🙂

uneven cloud
lyric flint
#

well you can only have one thing from the pink tab

uneven cloud
#

Characters use a capsule component as the base, which doesn't fit with a car.

lyric flint
#

mainly a task but from the grey tab you can have sequence etc

uneven cloud
#

I would not make shooting a main task. So no, I didn't say you can switch them.

paper flower
#

ok, I think I have the direction I need to start playing with custom Movement component attached to my actor, and controller by the AIController, 🙂 thanks much for the pointers.

lyric flint
uneven cloud
lyric flint
#

So this is what I have

#

the way I understand what your saying is have another parallel next to the one I have with wait as the pink and shoot the grey connection ?

timid sapphire
#

Any ideas why UAITask_MoveTo::AIMoveTo would stop working after calling CrowdManager::UnregisterAgent for a DetourCrowdAIController?

lyric flint
#

maybe I just thought having multiple Parallel node on one sequence was good idea

uneven cloud
timid sapphire
celest python
#

groups are packed into single int32 and operating are done via bitwise operators

#

though its very late at night and have to sleep, have no opportunity to dive into codebase and confirm that

#

nevermind comments confirm it

timid sapphire
timid sapphire
# celest python nevermind comments confirm it

I'm just confused about how to set these exactly. It seems like you set the avoidanceGroup on the actor that you want to avoid (ie my spider controller), and set the groupsToIgnore on all other actors. I'm not really sure what "groups are packed into single int32" means exactly or how I should be setting what I would normally expect to be an array.

celest python
#

you can put values into each bit with c++

#

this is both because its more optimized (cache coherency on CPU) and easy way to see if something exists or not in C++ realm

#

it expects you to imagine each 32 bits as an element, i.e. a group

#

group 0 is A, group 1 is B etc.

there is a special syntax to interact with bitfields

#

but I expect there is a helper function in the engine to set and remove groups

celest python
#

this is a very fast operation to array lookup which is something like path following system should implement, thats why its not an array

timid sapphire
celest python
#

i remember a completely random video visualize this for a few seconds... even though its not related directly 😂

#

there was an YT channel analyzing AIs in games

#

dont recall its name

#

they have a half life 1 AI breakdown

#

where there mention this bitfields

#

and how they used in state machines etc

#

other than that random thing, not much that I remember

magic juniper
uneven cloud
# timid sapphire Thank you for that explanation, I think I'm beginning to understand. I'll probab...

I found it really helpful to draw it out when I was learning it. Each bit represents either a 1 or a 0. Where 1 is on and 0 is off. So 1 = 1. 2 = 10, 4 = 100, 8 = 1000, 16 = 10000. On up by the power of 2.

Since we are talking about an unsigned 32bit int 1 actually looks like this:
00000000 00000000 00000000 00000001

And 2 is:
00000000 00000000 00000000 00000010

Let's say I want to ignore group 1 and group 2. That would put a 1 in both the 2 and the 1 spot. Which looks like:
00000000 00000000 00000000 00000011

#

Technically that int now equals 3, but since it's a bit flag, we do bit checks on it instead.

uneven cloud
harsh storm
#

I enjoy Ai & Games channel.

uneven cloud
uneven cloud
#

It's a good channel

harsh storm
#

I figured it was a typo.

uneven cloud
#

Nah, I had misremembered the name.

magic juniper
uneven cloud
magic juniper
uneven cloud
#

Controller is the brain and does all the decision making and Character is the body that does the actions. It's a lot easier to do things if you keep the separation.

#

States also generally follow an interface of OnStartState, OnUpdateState and OnEndState. So your moving to should be in OnStartState.

magic juniper
#

Could you provide me with a reference or a video to learn this? I think because my knowledge is still limited, I am still confused about processing your answer.

Actually, the goal of what I am creating is if the player touches the trigger box, then the AI ​​will walk to the same trigger box.

uneven cloud
#

I highly recommend going through the AI with Blueprints course on the learning library. It will go through all of the AI systems. Like what an AI controller is.

#

You can also Google a Finate State Machine if you want to keep going in that direction.

magic juniper
timid sapphire
#

So after reading up on the CrowdFollowingComponent and realizing the Avoidance variables on the component are deprecated, I was led to using RVO and their avoidance system which includes the same GroupsToAvoid, GroupsToIgnore and AvoidanceGroup variables all on an interface inherited by the CharacterMovementComponent and included in blueprints. Works like a charm, thank you @uneven cloud and @celest python for your guidance.

timid sapphire
timid sapphire
#

So yeah, I exposed these functions to blueprints and got it working for detour too:

void UMyFunctionLibrary::SetAvoidanceGroupForCrowd(UCrowdFollowingComponent* CFC, int32 GroupFlags)
{
    CFC->SetAvoidanceGroup(GroupFlags);
}

void UMyFunctionLibrary::SetIgnoreGroupForCrowd(UCrowdFollowingComponent* CFC, int32 GroupFlags)
{
    CFC->SetGroupsToIgnore(GroupFlags);
}

void UMyFunctionLibrary::SetGroupToAvoidForCrowd(UCrowdFollowingComponent* CFC, int32 GroupFlags)
{
    CFC->SetGroupsToAvoid(GroupFlags);
}
bold hemlock
#

FNavPathSharedPtr

celest python
#

you should set int32 to BitMask on UFUNCTION meta

#

iirc

celest python
paper flower
#

Good Morning all, trying to get my new AI Agent/Car working today. I have setup an Actor, AAIController, and UCarMovementComponent (extending UNavMovementComponent). I have verified, all 3 are created, and for now my car's eventgraph will drive to random point on the map at game start. I see: RequestDirectMove() being inovoked, and I can apply smooth rotation,a nd my cube rotates nicely. What has me a bit confused, is, should I also move the car here? (makes sense to me), but I'm also seeing that maybe movement component should be doing that already (well thats what chatgpt says)? even though it is clearly not moving, only my rotation is being applied, hence I'm guessing I should in fact be doing setActorLocation..yes?

#

which I guess is fine, I've already been doing this in tick, just makes me wonder what I'm really gaining vs just using the AI to get the path, and having my tick do the move/turn.

timid sapphire
dawn schooner
#

Hey! I'm working on navigation, my goal is to be able to add custom shapes (polygons) into the navmesh at runtime.
I am looking into nav modifier volumes/components, from reading the source code I get the impression that, in order to function properly, the brush has to be set in editor, I don't see an easy way to set it at runtime.
I think I can also set the area class for collision components, but those are limited to boxes, capsules etc.

dawn schooner
spring sphinx
#

I have a RecastNavMesh, if I set my Agent Radius to 5 it seems to correctly make a path inside it, but using dynamic runtime generation it always disappears. Any tips?

raw tundra
#

Hey! I'm trying to get a grasp on Behaviour Trees.
How do I interrupt a MoveTo? It seems to lock the Selector or Sequence until it has reached its destination.
En enemy generally needs to have a general destination, like a patrol route. But then, when it spots the player, it should chase the player. That's about what I'm trying to achieve.
I've tried achieving this with decorators, but it doesn't seem to be interrupting the moveto when it is already in progress. Is there a standard way of doing this?

#

Most tutorials I can find always allow the move to to finish. Usually by moving short distances at a time.

timid sapphire
#

Which brings me to my issue, I'm trying to debug this EQS Query but am not sure where to start. Why would it be failing and looping like this? This works for some ai and not others.

raw tundra
uneven cloud
timid sapphire
# uneven cloud Use the visual logger to debug

I didn't know about that, thank you.

LogEQS (VeryVerbose) Executed EQS: 
 - Name: 'EQS_FindRandomLocation_RandomBest25Pct' (id=0, option=0),
 - All Items: 0,
 - ValidItems: 0

Does this mean it's not finding any valid locations?

uneven cloud
bitter wyvern
#

is there a way to work with behavior trees in c++ (im guessing the answer is no)

dense owl
#

The engine is built with cpp

bitter wyvern
#

yay

dense owl
#

Whether you should limit yourself to not having visual scripting is another story 😀

haughty edge
#

hey guys, I'm currently trying out state tree with linked state and subtree. Since state tree can only have up to 8 active states and if I understood it correctly, using a linked state will cost an extra active state compared to simply duplicate the states in the subtree?

civic canyon
#

So I have a Behaviour tree and a blackboard, for my NPC, and i want the NPC's first action to be to move to location X. Indicated by a TargetPoint in the world. Now, since this is such a simple task, my idea was to just use a Move to and then use a blackboard key for the casino entrance. But how do i make that blackboard key correspond to a spesific actor in my world? Is that possible or am i going about this entire thing incorrectly?

civic canyon
#

my initial idea was to do something like this, but i still need to get a reference to that spesific actor in my world

civic canyon
#

There's no way this is even remotely efficient right?

#

nvm i made it worse

rain stream
#

Which object is this? The npc or the casino thing?

ashen trail
#

Does anyone know how to get the result enum from this node (On Move Finished result)? Or is the result only available from C++ and I have to make my own with multiple exec nodes for each result (Success, blocked, etc)?

uneven cloud
uneven cloud
ashen trail
civic canyon
civic canyon
rain stream
#

I mean, getting all actors is kinda overkill yeah, but you only have 1 actor of it so eh

harsh storm
#

Get all actors of class is fine in a lot of situations. Get all actors with tag not so much. While I haven't looked at what the code does exactly (don't bonk me Luthage!) - I'd imagine it pretty much just checks the bucket for Actors (so every actor in the world) and then checks each actor if it has the passed in tag

misty wharf
#

That would be my assumption also, but I don't think it should be worse than using get all actors since the tag comparison oughta be pretty cheap

#

although it does seem the fname based tags is a legacy feature and should be replaced by gameplaytags

harsh storm
#

It would be worse - iterating over potentially 10k actors is more expensive than iterating over 10

misty wharf
#

Ah true, if it doesn't have a class filter then definitely

harsh storm
#

I checked - that function doesn't have a class filter 😭

civic canyon
#

do behaviour trees loop forever by default?

misty wharf
#

Yeah. Iirc there is a "single run" mode for them but I don't recall if that's available from BPs

civic canyon
#

Ait thanks!

uneven cloud
ashen trail
uneven cloud
harsh storm
#

I see no way to filter for actor class.

uneven cloud
harsh storm
#

Ahhh

uneven cloud
#

Get All Actors Of Class With Tag is the node.

harsh storm
#

Ah - I don't think I've even seen that node

uneven cloud
north oriole
#

Does RunBehaviourTree reset the blackboard if the tree were already running?

olive prism
#

Is it okay to manage the states of my AI through a Service?

#

Like this