#gameplay-ai

1 messages · Page 61 of 1

harsh storm
#

I concede. I did not read that line 🤣

uneven cloud
#

I didn't do that part, so I don't remember how it was determined.

vivid fern
#

count the lights the player can see and add their brightness together x_x 😄

harsh storm
#

I've always been curious how people have gone about it. But I also haven't worked on a stealth game, so haven't put too much effort towards it.

vivid fern
#

there are 4 lights.gif

uneven cloud
#

It also checked distance to the light, if I remember correctly

harsh storm
#

Now, divide by a magic number and add another magic number. Don't comment it.

vivid fern
#

yeah i mean if you want to calculate light fall off as well as intensity

uneven cloud
#

It was the graphics programmer who wanted to do it, so it wasn't as simple as I would have gone

vivid fern
#

its hard to not be tempted by crunch puzzles hehe

uneven cloud
#

Turned out being really cool

vivid fern
#

im sure!

harsh storm
#

I bet it was. Challenging as well I bet

#

Wonder how accurate it was 🤔

vivid fern
#

sometimes high work cost stuff is also pretty valuable

uneven cloud
#

Weird thing to do for basically an in studio game jam, but he had fun with it.

harsh storm
#

lol

#

It was a game jam???

vivid fern
#

oh thats different imo! O_O like those are totlaly the times to crunch on those sorts of problems

#

then when it comes up later in production you can be like "it was terrible" or "well i have a thing that does this..."

uneven cloud
#

That studio would do 2 week game jams to generate ideas for future projects and to help with burnout

harsh storm
#

Sounds fun honestly

vivid fern
#

last studio had "do stuff" kind of jams.. lots of folks did games, but like i would do things not in my job, usually go do art, etc

uneven cloud
#

It was good and bad

vivid fern
#

usually around winter holiday since lots of people were out anyway around that time

#

it was nice doing like sculpting or blender or something tho

uneven cloud
#

People could pick their roles, so you could do things outside your job title

harsh storm
#

I guess it depends on the person.

uneven cloud
#

The last one I did the team's designer wouldn't do anything

vivid fern
#

thats why our jams didnt rely on teams i think, like you could go off and just paint, or just make whatever on your own

#

lots of table top game designs popped out too

uneven cloud
#

He'd sit there all day playing video games, so we were blocked on him all the time.

vivid fern
#

"paper prototypes"

#

wow that sucks

uneven cloud
#

This was structured. Anyone could pitch a game, a handful were chosen, and the teams formed by leadership.

vivid fern
#

nodnod i guess if it was to plan new projects it would be

harsh storm
#

That sounds wack

#

The designer being lazy that is

uneven cloud
#

To be fair we did get to prioritize the projects we wanted to work on, but leadership had the final say.

#

What's even worse was that our project lead did nothing about that designer. It was a stealth puzzle game and I'd made a bunch of systems on the first day, but he never made a puzzle or tried out the systems. It was the first time I made a smart object system, so I did learn some things.

vivid fern
#

i dunno if i'd enjoy that as much as just jammin on whatever heh, it was a nice break to just not do my focus you know? heh

uneven cloud
#

Yeah, that's why I said it was good and bad.

vivid fern
#

nodnod

pastel moth
#

I'd feel tired enough doing my day job not sure how people can just do game jams on top of the stuff they have to get done

vivid fern
#

game jams in studio are during normal hours typically

#

so you arent doing it on top of your normal work

visual dawn
visual dawn
#

hello please how do i make my ai face where it is going to while shooting ...

#

because mine just faces the enemy does not straf atall

#

but it moves

obsidian wolf
#

Hello. I'm struggling how the decorators work in BT.
What I want (can be seen in the image), is for the decorator to always check the distance between NPC and Target.
If the distance between NPC and target is below < 5000, run the second Sequence, else run the ChaseEnemy task.
Atm, the decorator is closing the root selector and jumps to the second selector (GetLastKnownLocation)

It's possible to check inside the decorator the distance between my NPC and target?

misty wharf
#

move the decorator to the chase enemy task

#

the decorator failing will exit that branch of the selector, which then will try to look for another branch to activate

obsidian wolf
#

Indeed. This solves my problem 🙏
Thank you

lyric flint
#

Hey, I just started using EQS recently.
I have multiple NPCs running the same query, and often times they'll choose the same "winning spot" when chasing the player.

#

Any way to get spots "reserved," or otherwise mitigate the problem? As of now, they're basically fighting each other to get to the same spot.

pastel moth
#

Im following the smart object quick start guide... but this "claim node "never appears when I drag off of the subsystem node

#

Any ideas?

#

I've tried the other claim nodes and they are different than this one

misty wharf
pastel moth
#

I figured it out

#

I had to split the node and use "Mark smart object slot as claimed". I think this is correct. I'm on the latest version of UE.

#

I didn't have to reference the subobject system for this node either. I think that's handled internally now?

pastel moth
visual dawn
#

am also curious which delegate i should bind to when i want to be notified immiedietly out of radius and come in radius again

#

because i am testing and when i come into radius everything goes fine but when i go back out and come back in ai dosent start fireing me

#

jsut stays dormant

#

thats the deleagte am currently bounded to

vivid fern
#

your animation bp needs to support strafing movement and the character has to be configured to do so.. def out of scope of AI tho

visual dawn
#

how do i set the" forget stale actors" variable in ai perception component since it is private

#

and am not seeing mutator function

#

int the class

vivid fern
#

Its in project settings

visual dawn
vivid fern
#

¯_(ツ)_/¯

uneven cloud
uneven cloud
uneven cloud
vivid fern
#

honestly ultimately in a bigger game you probably want to define the target lost behavior anyway, which i guess is why its off by default

#

granted i would kind of expect that option on the perception component

visual dawn
pastel moth
#

Can smart objects not be objects that are moving?

misty wharf
#

They can be moved as of 5.4 I think but not sure if they can actively be moving

#

It was always (I think) possible to create and destroy them at runtime, at least that's what I always did and it worked

pastel moth
#

The reason I ask is I have a bunch of items that spawn midair that I want my AI to interact with once it reaches the ground but it looks like the smart object box thing isn't traveling with those items as it reaches the ground?

#

oh I think I might see what to do I need to update its interaction point, maybe? Not sure if thats even a thing haha

misty wharf
#

If this is a problem you could create your own "smart items" thing I guess - you can use Gameplay Behaviors reasonably easily'ish with some custom system where each item has a behavior assigned to it and the using actor just runs it

pastel moth
#

Tried it and it didn't work 😦 guess Ill go back to my dumb object system

misty wharf
misty wharf
# pastel moth Tried it and it didn't work 😦 guess Ill go back to my dumb object system

btw you were asking the other day about the claim node being different - I was looking into it as I'm working on SO stuff today, and I think the reason it's changed is the system now differentiates between claimed and occupied. Claimed is when an actor is saying "I'm going to use this slot" and Occupied is when the actor is actually in the slot interacting with it. The system didn't use to allow querying for claimed slots, so it looks like you can do that now, but it won't let you query for occupied ones now.

#

I don't know why they keep having these weird limitations to it, I can think of usecases where occupied slots might need to be queried

plucky knot
#

Is it possible to have dynamic ai pathfinding?

#

I believe unreal ai agents navmesh have to be pre baked?

#

With focus on procedural generated maps I thought it would be a feature

pastel moth
#

I think you can set your navmesh generation to dynamic in the project settings

#

I'm trying to have my pawns be able to find objects as they spawn in the world at runtime but I'm having some trouble getting it to work. I thought that would solve it but I think I'm missing a few things.

woeful charm
#

Does anyone know how to do AI locker search with behavior trees?

uneven cloud
woeful charm
uneven cloud
woeful charm
#

The ai to open the locker and deal damage to the player

pastel moth
west schooner
#

is it possible to make a vehicle ai using blueprints only? i have a tank blueprint which can aim to specific direction and can be driven using moveForward and moveRight axis variables

#

i wanted to make it navigate a map, doing objectives, fighting enemy tanks and so on

mortal magnet
#

Hello, does anyone know how to fix my AI switching tasks before finishes an animation which causes it to slide

wooden coral
#

Could someone please explain what's wrong with my Blackboard decorator?
I'm trying to catch when the "Interlocutor" BB object gets NULL and I wanna abort other nodes to re-evaluate the tree, but it doesn't trigger

You can see that 'Interlocutor' gets None approximately at the 2nd second of the video, but the tree doesn't jump to the "Just stopped communicating" decorator, what am I doing wrong?

dense owl
sterile tide
#

Hi guys! I'm using Simple Move to Location. Something ingame happens and I need to stop movement and make the character immediately face somewhere.
I'm using Set Actor Rotation but the character's rotation rate is "still active that frame" and so the character doesn't face the exact place, but an interpolated direction.
Any suggestions?

wooden coral
vivid drift
#

Does it highlight the other nodes when you click on it? My mental model says it shouldn’t abort anything that would have required it to go up the tree

#

Just right or down

dense owl
#

You keep clicking on the just stopped communicating one

#

That left decorator can only abort once it’s been evaluated

uneven cloud
uneven cloud
uneven cloud
uneven cloud
# sterile tide Oops, typo

Does that mean you are calling set actor rotation? Are you cancelling the move to? What do you mean by the "character's rotation rate is still active that frame?"

wooden coral
uneven cloud
wooden coral
sterile tide
# uneven cloud Does that mean you are calling set actor rotation? Are you cancelling the move ...

Yeah, I'm using set actor rotation! Before that I've already called stop movement. It sets the rotation to the desired one, but then on character movement component's next tick, it still has acceleration and overrides that rotation with one based on character rotation rate cause I have orient rotation to movement on.
I'm working around it by setting orient rotation to movement on/off, but it's a bit clunky.

visual nymph
#

Anybody using StateTree know what the Category "Parameter" is for?

visual nymph
#

Solved. It's the default for if you don't specify Input, Output, or Context. In short, don't worry about it.

uneven cloud
alpine rover
#

is there any possible way i can implement formation ai to pawns without c++ or purchasing something on the marketplace?

blazing reef
#

Hi everyone! Is there a way to set the RNG seed for EQS (environment queries)?

dusty fox
#

Just wondering, is it possible to use AI perception with Statetree or is there any other node in blueprint to use within statetree to achieve the same thing? If so how do I do it?

misty wharf
dusty fox
#

Having trouble at first, but managed to find a solution now. Thanks for the info btw

misty wharf
#

👍

wooden coral
#

I'm a bit confused by how Composite decorator aborts nodes. If I combine two Blackboard decorators using AND and want it to abort only when both conditions are met, is it enough to set up "Observer aborts" only in the first Bb decorator?

#

when I test it, it seems to discard any settings I make in the second one

wooden coral
marsh fog
#

Hi, so I spawned multiple zombie and once the state of one zombie changes the state of all the other zombie changes as well, does anyone have any asnwer

uneven cloud
uneven cloud
uneven cloud
marsh fog
visual dawn
#

does eqs work with dynamice nav mesh?

harsh storm
#

Of course. EQS works without a navmesh as well

glossy swan
#

State Tree question.
I am trying to write a simple C++ task (STT_SetValue) which would set a desired float value to a selected float property.

I jave a value to set property like this:

UPROPERTY(EditAnywhere, Category = "Parameter")
float ValueToSet = 0.0f;

And it even allows me to bind this property's value to any float variable of my Conext(Actor) class.
However it reads from that property and I need to write to that property

I found a new class FStateTreePropertyRef and defined the reference like this

UPROPERTY(EditAnywhere, Category = "Parameter", meta = (RefType = "float"))
FStateTreePropertyRef FloatVariableRef;

However when I click to bind that property nothing happens.

misty wharf
glossy swan
misty wharf
#

Ah 🤔

#

Never tried that so not sure if that's even possible to do

#

Looking at it it does seem like FStateTreePropertyRef would be for a purpose similar to that... but I've had some issues with nested props even for reading where the ST editor won't let you bind into them correctly

#

One workaround is to make a task which sets the value in the actor you want. You can bind the value from the other task's output into an input on that one

glossy swan
misty wharf
#

I'm guessing it wasn't intended for you to write stuff out of them

#

Or if it was maybe there's some way with the property ref but like every other slightly more advanced usecase it's up to you to figure it out :P

hushed crag
#

My nav mesh isnt generating anymore and i have no idea why

#

i don tthink i changed anything

hushed crag
#

im generating the nav mesh on a new terrain

#

nothing is being generated.

#

no green

wooden coral
# uneven cloud That sounds incredibly hacky

~~I'm trying to back up from state machine-ish form of my tree but don't know how to properly interrupt actions

It's pretty clear how to instantly enter "retreat" sequence when an Enemy BB value gets set, but unclear how to setup as instant check for leaving that state when the Enemy becomes None

Same problem with "communicate" sequence, I need to instantly reevaluate the tree when Interlocutor gets None

Here I tried to rework the tree using conditional loops and more goal-oriented structure, but there's no instant backup when the BB value gets None. Or this still looks like wrong thinking?~~

wooden coral
hushed crag
#

how would i format this BTso that if is On Fire is Set, run the Sequence

dense owl
hushed crag
#

every which way i connect it nothing happens. I tried a sequence and a selector to connect both and they dont move

#

and i tried moving Is On Fire to the left side

#

because of order of execution and what not

#

it only functions with the root straight to the Sequence with the service

#

Sorry, i should have provided that context

dense owl
#

There’s also the gameplay debugger that’ll show you the BB keys in use and whether they are Set or not

hushed crag
split vale
#

Been working on complex Nav Area Modifier shapes that work at runtime (shapes on the left are with actual PCG nodes)

#

In the above screenshot the following is happening:

  • Use StaticMesh simple collision
  • Use each StaticMeshInstance simple collision
  • Use spline points as polygon shape
  • Use spline as path with width shape
  • Use PCG Static Mesh Spawner output with respective StaticMesh simple collision
  • Use PCG points as polygon shape
neon atlas
#

hi there! What are the reasons why a behavior tree is "inactive"?

misty wharf
#

You didn't start it or it was ran in single run mode and it finished

finite iris
#

Anyone else having issues with AI Perception?
Works fine with 1 AI in the level, but the moment I add 2 AI everything seems to break down...

#

The AI seemingly randomly sense the player again, but then lost is just as quickly. I have no clue what the issue is here..

safe wharf
#

The MoveTo task in my Behavior Tree is failing constantly.

-The actor is a Pawn with no movement component
-There is a NavMesh
-Both the Pawn and the target Actor are within the NavMesh
-The Behavior Tree is running and only fails on the MoveTo task
-The target Actor is valid

plucky hearth
#

What am I doing wrong?** I need to fully debug the PathFinding**, sometimes works, sometimes is incomplete, maybe is a basic logic that I am droing wrong? maybe is my for each loop?

vivid fern
# finite iris

did you check visual logger, ai perception debug visuals, etc? my bet is that there's some bad logic in how your ai track targets rather than the perception system itself

finite iris
safe wharf
#

Just figured it out, turns out that I needed to use DefaultPawn instead of Pawn since it has a movement component

uneven cloud
safe wharf
#

Yeah, figured that out and that's why I swapped to the DefaultPawn `which has one lol

uneven cloud
plucky hearth
vivid drift
#

oh, nevermind. I guess "DefaultPawn" is a specific thing

bleak drift
#

hey guys, I have a custom C++ ACharacter, from which i derive. I'm currently adding the AIPerceptionStimuliSource directly via blueprint. But the AI won't perceive it, but if I create a new Character BP and inherit from ACharacter directly it works fine. What could be the issue? My custom Character does not have any speacial things i can think of, that would change this.

vivid fern
#

how are you adding the stimuli source on your custom character?

misty wharf
#

(a similar but more flexible result can be achieved by using IGenericTeamAgentInterface but it sounds like you're not using C++)

finite iris
visual dawn
misty wharf
#

If you are using one of the features of it that project points to navigation, yes, those do work with a dynamic navmesh as well

visual dawn
#

hmmmm

#

thanks

dusty fox
#

Has anyone encountered issues with AIPerception debug lines not showing? I activated the debug in play, but the lines for sight vision is not displayed.

harsh storm
visual dawn
#

i have done it works fine now thanks

vivid fern
keen crow
#

so i'm trying to find something in crowd following component that returns true/false if an NPC currently has an active MoveTo task. And I stumbled upon this. Is this even legal - just return true no matter what?

vivid fern
#

what do you mean legal?

#

as far as c++ goes, thats totally allowed

crimson yarrow
#

can you gain performance by handling ai behavior yourself instead of using a behavior tree?

#

I want to have like upwards of like 100 enemies, but when I spawn in about 50 some of them just don't move or anything and the ones that do start moving slow

#

and I have a feeling it has an issue with the behavior tree ticking or something, but idk. I don't lose any fps performance, just the ai itself having performance issues.

misty wharf
#

BT's can have an impact on performance, but it depends 100% on what you're doing in them

#

There are various ways of optimizing it as well, such as using C++ to write custom nodes instead of BP's

#

However without using tools like Insights, you're just poking in the dark and it's going to be difficult to fix any issues

crimson yarrow
#

ok I will look into trying that to see what could be wrong, but all my ai does is move to the character, if it gets there it attacks.

#

so that's where I figured performance was taking a hit, constantly getting the player's position and updating their destination location or whatever, but I will have a look at insights

misty wharf
#

Is it choosing where to go for that via perception?

crimson yarrow
#

no its just straight up an object var in the blackboard

#

and a move to node

vivid fern
#

ime in shipped games, perf cost of enemy units is often in the assets

misty wharf
#

I see, yeah was just guessing since perception can impact the speed of reactions if you have a lot

vivid fern
#

animating 100 dudes is gonna be a bad time

crimson yarrow
#

I looked into Mass, but didn't rly get it, and was attempting to do Niagara with static meshes and someone said in general it's bad and just meant for like birds and stuff

#

so then I just swapped back to a BT

brittle steppe
#

Hi everyone, not sure exactly which channel to post this but I have a simple "chase the player" AI powered by Blueprint/BT, and C++ controlling everything else, I'm trying to apply an impulse to an actor hit by one of my projectiles, but I noticed for my AI it only gets knocked back if it's idle, if it's moving at all the impulse does not affect it.

#

I am moving the AI in BP using "AI MoveTo"

vivid fern
uneven cloud
uneven cloud
brittle steppe
#

I followed a tutorial for setting up BT and it used BP for the tasks?

#

I will try to stop the movement from the AI controller before applying impulse

uneven cloud
#

There's a built-in move to task that you lose a lot of functionality if you make your own. Especially aborting the task.

AI tutorials are very bad. It's highly recommended to do the intro to AI with Blueprints course on the learning library. It's pinned in this channel

brittle steppe
#

I'll see if I can use the built in MoveTo method, thank you

brittle steppe
#

I'll go through the course at some point, but skipping forward to navigating the mesh it looks like they are making the exact same kind of custom event I have except using Simple Move To Location

#

The above is the one from the course

#

Except I use a wait event outside my random move instead of putting a timer inside it

vivid fern
#

behavior trees have a built in move to

#

which is what luthage is probably referring to

#

from epics's docs

brittle steppe
#

I'm working on implementing the built in one now rather than the custom one I have, hopefully that helps

brittle steppe
#

Okay so I updated to use built in Move To for chasing, and also in my C++ where I'm launching the actor I got the controller and called StopMovement() and now I am able to always knock back 🙂

brittle steppe
#

Only issue I ran into using the built in Move To is I can't reset the HasLineOfSight variable if the Move To fails, but in a custom task I can easily branch off the failure. This means if I jump onto a platform the enemy can't path to they just stand there (or push against the bottom of the platform depending on setting), where before I had it reset the variable and they would return to roaming.

#

ie idk if there's a way to do this with the built in move to

vivid fern
#

abort the branch the move to is in if line of sight fails and do a different branch

#

honestly its all in that example above heh

#

def familiarize yourself with how behavior trees work as this can be solved with how your design your behavior tree

pine steeple
#

😦

#

insteadof how they are meant to be used

vivid fern
#

nod let the tree control logic flow

#

thats what the whole point is

dense owl
wary ivy
# vivid fern animating 100 dudes is gonna be a bad time

Quick update on my Niagara GPU Compute Zombie game. All bullets, enemy, AI, collision detection and response occurs in a single persistent Niagara Compute shader. I decided to go with Synty assets which are awesome. Also started to utilize a "height map cache" inside compute to help with map collision.

▶ Play video
vivid fern
#

well there are options to do it just fine tbh, clearly 😛

#

what im saying is that understanding the performance metrics of your game and optimizing those hot paths is really the way to do it

#

but also that BTs are usually not the thing that costs

misty wharf
#

There it was - the guy doing this used to hang out on #cpp , maybe he still does but don't recall seeing him much

#

Always had really really obscure questions about changing something because he's doing crazy stuff like this lol

misty gale
#

The lad is mad, for sure 😅

shadow sierra
#

I'm a bit confused as to how to get the AI to aim similar to a player.

At the moment, i'm using interp to gradually rotate (pitch and yaw) towards the player. However, there is this code in the AIController, which seems extremely restrictive and is stopping the AI from being able to aim downhill:

        // Don't pitch view unless looking at another pawn
        if (NewControlRotation.Pitch != 0 && Cast<APawn>(GetFocusActor()) == nullptr)
        {
            NewControlRotation.Pitch = 0.f;
        }

I've tried setting the player as the target, but the AI instantly rotates, which is not good enough. How are you meant to implement this without modifying the engine?

dusty fox
rotund dock
#

morning peeps, interesting issue I haven't seen before. I have a spawn point (actor that just spawn an ai) that is generated (not placed) in my level when a trigger occurs (a door opening). So it goes trigger >> Actor spawns >> AI spawns from actor. They all spawn without issue. But the AI doesn't update its rotation to 'face me' when it starts moving. It just shuffles sideways or runs backwards while maintaining the rotation it was spawned in. But if I spawn the AI separately, they update their rotation just fine so it isn't the ai but rather something is getting lost in translation between when the Actor is spawned and it spawns the AI. Any suggestions?

shadow sierra
rotund dock
#

not seeing a node that would do that... what is it called?

rotund dock
crimson yarrow
# uneven cloud It's more likely the movement component than the BT. BTs are actually very perf...

it was, the profiler showed it. It was not taking too long to process it, and wasn't really a big contributor to the game time size, but it was being called like 200 times. I then discovered the plugin that is free for the month currently, and it's sorta like lightweight mass I guess. I also created my own move to task. Anyways I now can have like 80 or so enemies on screen before I drop about 10 frames or so, which with the tools of the plugin having 80 is more than enough to fake thousands.

#

and that's way better than having no frame drops but half the enemies don't move past 50

vivid fern
#

profiled in editor or in build?

safe wharf
#

I have been working on adding cars to my game for NPCs to drive.

However, my current Behavior Tree will have the car turning instantly instead of gradually.

I have been trying to think about how I will have the AI make turns and driving like a car instead of 'walking' to the target location, but I haven't been able to come up with any good way to do it.

Does anyone have any suggestions on what I could try to get it to behave properly?

vivid fern
#

the simple non carlike solution would just be give the ai's pawn a rotation speed that isnt instant

#

but car like steering is way different than bipeds, so you probably would have to approach the problem differently if you want that

#

like cars move in circles right, turning the wheel creates a circle in which the car moves, and changing that steering changes the shape of that circle

safe wharf
#

That's kind of what I was thinking however, I don't know how I would change the logic for it.

What I was thinking is that I could have certain actors in the world to use as check points of sorts. So that when the car decides on a path, I can use that path to tell the car how it should drive. But I don't know how I would be able to find the path the AI is wanting to take in order to do that. I am thinking that I will need to make my own MoveTo task but I still don't really know how to get the path that the AI should take.

I could just be overthinking it but yeah

safe wharf
#

So I have found there is a node that is called Find Path to Actor Synchronously

It contains an array of vectors for the Path Points. So I should be able to use those to line trace for a certain actor between them and then go from there.

vivid fern
#

does the ai even need to steer really? the BT should set destinations and you can use a "path follower" component that understands car steering to do that work

#

just like the default path follower stuff drives biped agents down a path

vivid fern
#

literally "two feet"

biped
noun

  1. an animal that uses two legs for walking

Example: the iconic predator Tyrannosaurus Rex was a biped

zinc sky
#

Does anyone know why my AI is not moving outside of PIE mode? it works fine while in the editor but when packaging or running standalone the AI does nothing?

vivid fern
#

.. why not use the built in move to

zinc sky
#

what am I using then?

vivid fern
#

why not use the built in behavior task

#

in the behavior tree

zinc sky
#

This?

vivid fern
#

its not why its not working but seems weird to use this instead of that

#

yeah

zinc sky
#

the reason is I want it to stop at a certain radius

vivid fern
#

ok but thats what it does?

#

also you can use the bt to drive that logic

zinc sky
#

its working now I needed to place a new navmesh. I am not too familiar with using the built in stuff that's why I did it this way

vivid fern
#

(what im saying is it doesnt make sense to make a new node when the tools out of the box already do this heh)

zinc sky
#

makes sense

#

the tutorial I followed a long time ago did it this way so I am just used to it

vivid fern
#

apparently there are tons of wrong tutorials out there 😄

zinc sky
#

yep

#

so realistically will my method mess with performance?

#

cause replacing it seems easy enough

vivid fern
#

its more that the bt node version is probably functionally better, you're more or less duplicating work that it already does

#

i think what a lot of new folks to BTs dont realize is that the tree itself is kind of like a big function, some nodes control execution flow, selectors, sequencers, decorators, some execute singular tasks, move to, etc So you end up with what more or less would look like a big if then else if you were to write it straight .. with a lot of convenience functionality built in, and easy reuse to help you be more descriptive of the behaviors you want

#

generally too BTs themselves arent usually the perf sink, but everything that an AI touches is a potential problem because unlike with a player where its like, just one action for one actor, if you have systems that dont expect 10s or 100s of ai to hit them at the same time and do it repeatedly over many frames.. you'll have a bad time

zinc sky
#

ah okay

#

my trees are rather short otherwise it was just this one issue which I thought was caused by my move task and or the auto posses behavior

vivid fern
#

glad it was just generating some navmesh

zinc sky
#

yeah I am glad too haha, I am a little too deep in this project to be rewriting entire systems or my enemy base lol

plucky hearth
#

which setting decide the amount of offset of the navmesh to the border of my ground?

vivid fern
#

afaik its just a visual so you can see the navmesh, the actual navmesh is more tightly bound to the ground, if thats what you mean

#

why do you need to change it

plucky hearth
#

it was the cell size and the Agent radius

#

is the ai navmesh system able to calculate the "route" based on how much some tile will slow down the character?

#

based on the friction for example

#

or the ai will go in "straight line" only unless an obstacle that changes the navmesh

#

is it possible to add "weights" of areas to the navmesh?

#

for example an area would be with snow so characters will go slower, is shorter distance but maybe take you more
or is with clay etc

vivid fern
#

you can use nav modifiers to change the cost of the area within the volume

vivid fern
#

yeah that works

plucky hearth
#

why my modifier navarea is not blue?

#

ah, just reset made the fix🥲

gleaming horizon
#

Is it just me or all AIMoveTo functions have a major issue in HasReached check?
The issue is that HasReached is adding Target Actor's Capsule Radius * 1.5 to AcceptanceRadius which is by no means is a good behaviour, its conflicting and counter intuitive.

Scenario 1: AIMoveTo Target Actor, Acceptance Radius - 600. Distance between actors is greater than 663 (600 + 42 * 1.5).
Result 1: Function works as expected, the AI will move to a distance of 497~ or other close value to 500.

Scenario 2: AIMoveTo Target Actor, Acceptance Radius - 600. Distance between actors is less than 663.
Result 2: No move at all. Not until the distance increases to >663.

What I'm trying to make is a very simple thing - Right Mouse Click should make Character move to exact distance to the target, which should equal to Attack Range (standard behavior for top down games).
But this AIMoveTo behavior completely ruins it. Has anybody found a good work around? Really don't want to download source code just to edit one line.
(which is this as far as I could tell (the GoalRadius thing))
const FVector::FReal UseRadius = RadiusThreshold + GoalRadius + (AgentRadius * AgentRadiusMultiplier);

uneven cloud
gleaming horizon
#

In the source code? Yes I can, but I don't really know how to properly do it (afaik I need to download source from Git and then build it and use it as a new UE version for my project, thats a lot of work for an experienced user).

#

I've submitted a bug report. I feel like thats an unintended behaviour. It doesn't make sence for the very same AIMoveTo function to use different AcceptanceRadius under different conditions, resulting in dead zones.

misty wharf
#

Tbh chances are that isn't going to get changed because that's such a fundamental node and if its behavior changed a lot of stuff would break

#

I'm not sure if I fully understood your issue with it so can't really say - but either way, you can write your own logic to replace AIMoveTo

gleaming horizon
#

AIMoveTo from Self Actor to Target Actor. Acceptance Radius = 600 (the Self Actor's "AttackRange").

Scenario 1: Distance between Actors is >663.
Result 1: Expected behaviour, no issues. Self moves exactly to a distance of 600~.

Scenario 2: Distance between Actors is 600-663.
Result 2: Unexpected behavior! Self doesn't move as if its already there.

Scenario 3: Distance between Actors is <600.
Result 3: Expected behaviour. Self doesn't move as it is in fact already there.

I wouldn't mind AIMoveTo to take target's capsule into consideration, thats totally fine. The problem is that it only takes it to decide whether to start moving or no ("if >663"), but doesn't take it when it moves to ("to 600"). Its conflicting behaviour, they both should be identical.

#

The whole purpose of the function is to move to the target actor with exact distance acceptance. Which it does, unless you are in a dead zone. I don't see any reason for this dead zone to exist.

misty wharf
#

Hmm, I feel like it has actually moved up to the radius and not up to the exact coord for me 🤔

#

Which was infact something I kinda disliked - I would rather it treats the radius as the "acceptable range from the point" in the sense that it would always try to go to the exact point, but it would only count the move as failed if it couldn't reach at least radius distance from the point

#

Instead of moving up to radius and calling it done

gleaming horizon
#

I'm fine with anything as long as its consistent. Problem is that it isn't. AcceptanceRadius works completely different for when AI decides whether it should move and for when AI moves to. Both happens in the same function call.

#

To me that effectivelly makes AIMoveTo (with Target Actor) completely useless and I don't see any apparent reason why it was made like that.

#

Made an ugly, yet a working solution where I just use low Acceptance Radius and 0.01 check to see if the target is in range.

green vault
#

Anyone knows why the thirdperson character can walk outside the nav mesh when you hold move? When i only click once it doesnt path there, but when i hold it just walks over everything thats not too high even if its not part of the nav mesh

misty wharf
safe wharf
#

I'm having a slight issue with figuring this out, but is there any way to have an AI not only able to path find through a certain direction.

For example, making a one way street and not allowing them to go the wrong way while still allowing them to go the correct way

misty wharf
#

Not sure if there's any very good way of doing that with the builtin navmesh stuff at least

#

You could in theory set it up so that at the start of your one way street you have a nav link which connects it to the end, and you would only allow navigating through the link in one direction

#

but if your pawns can for example stop along the way for some reason and then need to continue navigating, this might not work as they can't re-enter the link from the middle of it

safe wharf
#

Hmm I will take a look. I hadn't thought about nav links

#

That looks like it will work. Many thanks.

misty wharf
#

👍

safe wharf
river storm
#

hey, i'm trying to get a UAIPerceptionComponent to detect a vehicle, but the vehicle needs to be a lot closer than it should be to be detected.. i'm pretty sure this is because the vehicle's origin is basically at the floor level so the perception system's linetracing is easily blocked... is there a way to offset the origin for perception system? possibly on the actor the has the UAIPerceptionStimuliSource component?

#

hmm something to do with IAISightTargetInterface.. guess its source code readin time

misty wharf
copper dawn
#

What is the most optimal way to have 100's of simple AI actors on screen at once?

misty wharf
copper dawn
misty wharf
#

You need to use Unreal Insights to find out what's actually causing the performance impact

#

It could be character movement components, skeletal meshes, BT tasks, and various other things

copper dawn
#

Okay I will look into that, thanks. Generally speaking though, is it possible to have highly performant simple AI's with just Behavior trees?

misty wharf
#

Sure, it can depend somewhat on how you set it up though

copper dawn
#

Awesome Ill check it all out with Unreal Insights, thanks for the help and awesome site too

copper dawn
#

Would this be more efficient as a State tree?

uneven cloud
uneven cloud
gleaming horizon
#

Oh you mean Stop on Overlap. No, that won't work. If true, it will add some other unkown value (which is not Capsule Radius*1.5) to the Acceptance Radius value.
BUT the new Acceptance Radius will behave just as conflicting as before, just with a new value. It will not remove the dead zone if true nor false.

gleaming horizon
uneven cloud
copper dawn
#

Im really just trying to figure out best use cases for different AI systems. Ive got a firm grasp of BT's and like using them, but I'm just worried if they are less optimal in general for a large number of actors. Sorry if I'm asking really basic questions here, but I can't find a lot of info on best practices with AI. Also I'm quite new to UE and this discord (obviously)

misty wharf
#

If BT's initially look like a better fit and you take care to encapsulate logic in a good way, so that you don't put too much of it into your BT tasks and services, it should make it reasonably straightforward to replace it with a State Tree if it turns out that it would give you something you can't achieve with BT's

copper dawn
misty wharf
#

Yep. Insights should tell you if there's a particular BT node which is being slow, or if it shows "BT Search" this usually means your BT is spending a lot of time trying to pick the appropriate node which also has various solutions

vivid fern
#

and in incredibly prototypy grey box levels with simple "move on a patrol path" type behavior with non rigged meshes, i've run 500 with no significant frame drops. again not UE, but the point here is that behavior trees themselves arent super expensive. The cost usually comes from elsewhere

#

or poor tree design (as in how you arrange nodes in the tree)

vivid fern
misty wharf
#

Tbh the acceptance radius seems kinda useless most of the time because of stuff like this lol

#

It really should work the way I described it I think... Eg. the radius is how close it must get for the move to be considered successful even if it can't reach the exact goal point, but it would always at least make an attempt at reaching the exact goal point

vivid fern
#

it exists because of how moving works...

#

in basically every game i've ever worked on unreal or not, you dont know if you are there to a pin point precision, you have some velocity, you are going toward some destination, your speed may cause the point you want to get to to happen "mid frame" (your position this frame and your position next frame cross the destination point).. and it takes some moments to stop

#

so you detect when "you are close enough" and begin the stopping sequence

#

like the CMC uses breaking to stop the character, so if you stopped precisely when you arrived at the point (assuming that was possible anyway) you would then over shoot because the character has to apply the breaks

#

in general this is fine ime. the only times it really becomes a problem is if you live in a tile based world and need to stop dead center in the tile... which at that point you have some stopping mechanic that lerps you to the final point

#

if you really wanted perfectly accurate movement, use a lerp 😛

vivid fern
#

thinking acceptance radius is how you should stop "around" your target, is probably a mistake, you need to have a system that picks destinations and it uses that radius instead to decide destination points

#

the advantage of that too is now you can have a more complex destination picking logic rather than purely just distance based.

coral mesa
#

what's a good AI architecture for RTS?

coral mesa
#

i am still not sure what to go for

#

and how to design it

gleaming horizon
# vivid fern thinking acceptance radius is how you should stop "around" your target, is proba...

Yes I thought about that method, using MoveToLocation and Vector destination instead of MoveToActor and then setting a low Acceptance Radius of 5-10. But that would work only if the Target won't move. If it will move while Self is moving, then the destination will not be incorrect. The biggest advantage of MoveToActor is that it will allways follow the actor until AcceptanceRadius is reached.
Imagine League of Legends. If you right click an enemy unit, your unit will first run in range of attack (close for Melee, far for Ranged champions) and then proceed with an attack. MoveToActor with AttackRange as AcceptanceRadius actually works perfectly for this task, if only there wasn't a conflicting deadzone behaviour.
My best solution so far is 5.0 acceptance radius and 0.01 sec interval check for custom made HasReached. Works as intended, but will have to examine profiling now, since low-interval functions are never good for performance.

vivid fern
#

moveto allows for updated locations.

#

(the behavior task)

plucky hearth
#

why my RecastNavMesh-Default is duplicated and says "(Unloaded)" and I cant delete those (they are grey out)?

plucky hearth
round palm
#

Hey guys - I’m running into a major issue with my navmesh not working with only three days left in a game jam… Can anyone help? I’m desperate at this point!

I’m having an issue where the navmesh doesn’t do anything at all because it’s loading in with level streaming. I’ve tried all of the fixes I could find online, with no luck:

  1. Setting runtime generation to dynamic didn’t help.
  2. Unchecking the box to unload sub level nav data didn’t do anything.
  3. I can’t just make the navmesh part of the persistent level because the location of the streamed level that needs it is completely variable (randomly placed).
  4. Just making the navmesh massive in the persistent level isn’t an option due to the distance from the origin at which the streamed level with the enemy ai could be placed.
  5. I even tried placing a navmesh in the persistent level and teleporting it to the location of each new streamed level, but that also has no effect.
gleaming horizon
misty wharf
gleaming horizon
#

well ye, for Target Actor its always updates, thats why I use it with Target Actor)

#

I think Acceptance Radius 5.0 and 0.01 peridodic check for IsInAttackRange does the job. Just gotta make sure that the check isn't tanking fps.

misty wharf
#

I think for my project I might make a custom AIMoveTo at some point which actually behaves the way I described earlier because I have a lot of cases where that behavior would make more sense :)

#

It's thankfully very easy to just copypaste the moveto C++ code and make your own mods to it lol

round palm
solid wedge
upper compass
#

Hi, is there a way to make a state active as a condition trigger in StateTree? I Could db it by adding that condition to all the states Transition but I want a better solution I want to cancel any active tasks and go to the task I want

misty wharf
#

You mean no matter what state you are in, if condition X occurs you want to go to some specific other state?

misty wharf
#

Hmm, I think if you have the condition on one of the parent states, then it should trigger on all the child states as well. I don't remember if you can put conditions on the root of the state tree though

upper compass
brittle steppe
#

Hi everyone, I am trying to get my AI to sense damage and having some trouble. When my AIPerception perceives I have it set to print the type in On Target Perception Updated - I am seeing the "AISense_Sight" printed when sight perception triggers, but when damage happens I don't see that coming up.

I have added AISense_Damage config to the AIPerception component on the enemy BP, and in the C++ for my projectile I have added a damage report event below where I apply damage in the projectile's OnHit like this:

UGameplayStatics::ApplyDamage(OtherActor, Damage, MyOwnerInstigator, this, DamageTypeClass);
UAISense_Damage::ReportDamageEvent(GetWorld(), OtherActor, MyOwner, Damage, GetActorLocation(), Hit.Location);

The damage gets applied (I am logging that), but the report damage event is not causing the AI perception to pick up in On Target Perception Updated

#

I have a workaround for this where I can just set some blackboard keys in C++ to make the enemy AI "see" the player when the damage happens and that works, but I feel like the proper way to do it would be with the damage sensing in the AIPerception

visual dawn
#

hi guys

#

so am having a minor issue with my eqs the contect is to return a single actor but for some reason it doesnt work any one has any guid regarding EQS here?

#

maybe am missing something

brittle steppe
visual dawn
#

this wah my eqs looks like lol am just trying to get a comfortable distance away from enemy ship

#

dont know if am doing it right

dense owl
visual dawn
#

it doesnt even execute lol

#

the thing just stays there runing

#

are simple grids only to be generated around quarieres?

vivid fern
vivid fern
dense owl
visual dawn
#

it doesnt even move to the wait node

#

just stays on the eqs

dense owl
solid wedge
visual dawn
vivid fern
#

if you need prefect stopping lerping does the trick, though cant say how friendly that is to multiplayer

solid wedge
#

What are we lerping exactly

#

I have basic 3rd person template character & ai. But i added nav proxies to enable jumping across gaps & up/down ledges. I have to toggle "can fall off ledges" during parts of the nav proxy navigation to prevent too many self deletes. Lol...

#

If i dont make the ai pause and lose momentum before and after jumping across/up/down, they fall off a lot. But this slows down the ai speed and its not challenging at all when you can outrun them easily across gaps & verticality. No ledge grabbing or vaulting mechanics btw.

vivid fern
#

you can give them higher breakin gpower maybe?

#

i dont really know your game tho

nova prawn
#

Hi, Can someone tell me how i can get the Sight Sense from the AIComponent as I am trying to set it during runtime please

#

When i drag off the AIPerception Component Reference it doesnt give me an option to get the Senses Array

vivid fern
#

i just do this in c++, but the main thing is you just apply new sense configs to change the behavior of the sense

#

no idea how thats done in bp

nova prawn
#

Ahh ok thanks, Maybe its something i,ll have to look at C++ to do as I know some things arent possible within Blueprints.

misty wharf
#

Iirc the sense configs and related bits are not available in BPs to read or write

#

They are fairly easily accessible in C++ though

modest otter
#

Hi, Can I create blackboard and behaviour tree but in c++?

#

I want to create the entire my AI in c++

vivid fern
#

so ultimately the structure of your bt is just data, and the blackboard too.. im not super sure what the advantage of making either of those in c++ is (in UE anyway)

#

the nodes themselves can be c++ and that's what ultimately is doing your work anyway

#

so if its a performance thing, thats where most of your savings would come from

#

i guess, what problem are you trying to solve

modest otter
#

No, I'm just masochist and want to create the everything harder and always in c++

vivid fern
#

maybe you should just write your own engine then?

modest otter
#

😄

vivid fern
#

like UE is definitely designed to do some of its work in editor

modest otter
#

yeah, I know, but I really like UE5 and writing my own engine will take me a lot of time

#

but thx for response 😄

tidal seal
#

Hello guys, I've an issue with State Tree that I can't understand, I've this really basic setup where ST tries to find the Closest Patrol Location, and then MoveTo Task (Join Closest Patrol Location). My Task FindClosesttPatrolLocation has a FinishTask node at the end, like all task should have I guess ? But when I add this one, my tree just keep repeting, if I do that, I need to explicitly setup the transition "OnTaskSuceed" to go to the child state or I'm just looping over the FindClosestPatrolLocation

misty wharf
#

At least this is a pattern what I've found works reasonably well in my state trees

tidal seal
#

Oh ok thx... there is no way to make sure that let say a parent group test has it transition "Succeed" triggered, when every child got executed without a fail ?

misty wharf
#

iirc if you don't have a specific success trigger on the state where the task is, it would trigger its parent's success

tidal seal
#

alright OK, I just need to be careful that basically only the very leaf node has a succeed or fail basically so right ?

misty wharf
#

Yep

#

As mentioned at least for me, splitting tasks into ones which get data and those which perform actions generally makes this easy to do, where only the ones which perform actions call Finish Task :)

#

There's usually no reason to use the get data type tasks without a task which uses the data to perform some action so they pair up well

tidal seal
#

Yeah indeed, amazing thx 🙂

wild storm
#

Hi ,in behaviour trees , is there any way to execute a specific task as the execution enters or leaves a branch? Suppose , if there is a sequence that is looping continuously , I want to perform a task just one time when it enters that branch and a task if it stops looping that sequence. Any ideas?

harsh storm
#

Use a service and then there are two methods. OnBecomeRelevant and OnCeaseRelevant - or something like that.

#

Put the service on the branch.

wild storm
visual dawn
#

heyu guys i have a minor issue so i implemented a behaviour tree and put two ai in the level one is executing the tree properly the other is not

harsh storm
harsh storm
#

Can't know without more details. Share more info rather than less info.

#

Just saying "it doesn't work" gives nothing to go off of

visual dawn
harsh storm
#

No one can know what "properly" is in your case

visual dawn
#

one is executing the BT right

#

the other one doesnt even move

#

infact i duplated the ai in the level

wild storm
# harsh storm For BP, you'd use the Activation and Deactivation AI ones.

But they are being fired each time the sequence is executed. I have a chase sequence for my enemy. I want him to change to a particular form when he is chasing the player and he maybe in whatever form he wants when he is not executing the chase sequence. The problem is that the Shapeshift function is being called everytime the sequence loops giving undesirbale results. And I want to call the "Unlock Form" function as the BT leaves that sequence entirely.

harsh storm
visual dawn
#

its Ai so yes it has a controller

#

i duplated same ai in the level

#

one is working the other one isnt

harsh storm
#

Just because it is AI doesn't mean it has a controller

wild storm
harsh storm
#

Don't need to yell

visual dawn
wild storm
harsh storm
#

And have that do your shapeshifting stuff.

visual dawn
#

i dont understand

harsh storm
#

In your pawn class

#

There is a dropdown that determines how the spawning works with ai controllers

visual dawn
#

place in world and spawned

wild storm
#

Can you once again check if the 2nd AI you just duplicated has the Same Ai controller ? In the world , click the 2nd AI instance that doesn't move and search for AI Controller Class in the details? @visual dawn

harsh storm
#

When are you calling to start the BT?

#

Is the BT running?

harsh storm
#

Did you do a custom loop? How are you running this in a loop?

visual dawn
#

the other one just stays at a flow

#

i dont knw the reason

wild storm
harsh storm
visual dawn
#

from the ai controller

harsh storm
#

That does not answer my question

#

Show the code

wild storm
visual dawn
#

this the ship class on posses

#

this the controlelr class

wild storm
# visual dawn

Why not run set some break points and run through the debugger? Or use print strings to check the flow at the cast failed pins.

vivid fern
#

or the visual logger

harsh storm
# wild storm Just the Blackboard condition for the Chase Player boolean. It moves to the play...

The usage of your booleans looks like you're using this like a state machine. Which is bad juju. If you want a state machine, use a custom state machine, State Tree, or Logic Driver plugin. Behavior trees are priority selectors more or less. Read Luthage's pinned post about the differences for a quick summary.

For your immediate problem, the service is working as expected. Your BT design is the problem. There isn't anything in the BT toolset that only executes one time in the lifetime of the branch. If you want the character to shapeshift, essentially when it becomes aggressive, you can do it when you make it become aggressive (most likely through perception). Could also have a ticking service on a branch above the Chase Player sequence I guess. So the selector that is right after Root.

misty wharf
#

Honestly the "don't use as state machine" never gets any clearer no matter how many times people repeat it lol

#

I feel like there needs to be some actual solid example of this - eg. a state machine like behavior tree, and then a discussion or example on why it's not a good design and how to design it better

#

Like I kinda get it but also I'm not sure if I do? :P

wild storm
vivid fern
#

I think its pretty clear? like if you want a state machine.. use a state machine?

misty wharf
vivid fern
#

i mean BTs are essentially very specific kinds of state machines

misty wharf
#

Yeah hence the confusion as to what kind of design is suggested as poor for them

vivid fern
#

but i think most people are after the more traditional "here's some state" and "here's the transition to other states" and this isnt how bts work

misty wharf
#

My understanding of it is that forcing a transition from inside the BT is poor BT design

harsh storm
vivid fern
#

behavior trees dont have state transitions, instead the arrangement of nodes dictates what gets executed.. if you are done with some task, the BT just starts back at the root

#

and the arrangement of nodes dictates what task gets done next

harsh storm
#

State machines transition logic explodes in complexity

vivid fern
#

yeah state machines are really unweildy on complex behavior

misty wharf
harsh storm
#

The reason I said it looks like they're using the BT like a state machine is because of their booleans.

vivid fern
#

there are so many tutorials out there that try to apply state machine logic to BTs and it just falls flat

harsh storm
#

We only have one branch, so can't say definitively, but it happens often enough with that kind of setup that it was worth pointing out

vivid fern
#

and thats where this comes from im sure heh

#

granted at some point bools are going to dictate which branch you go down 😛

harsh storm
#

Absolutely

misty wharf
#

I've been using ST+BT in my game for some new stuff I'm adding. Seems to work alright so far

harsh storm
#

It is natural to gate a branch based on a boolean.

vivid fern
#

nodnod

misty wharf
#

The ST runs as the "root" of the system to choose the state the NPC is in effectively, and each different "task" the NPC can have comes with its own behavior tree

vivid fern
#

"can i see a target?" -> combat

#

hah

harsh storm
#

But naming conventions and other booleans in the example image can allude to how other parts of their system is designed (just based on experience with helping others)

vivid fern
#

seeing enums in there is a give away x_x

harsh storm
#

Absolutely that 😅

vivid fern
#

i seen that tutorial x_x

harsh storm
#

But there are still people who do FSM's with bools as well.

vivid fern
#

i've built plenty of games on hFSMs

#

state transitions are fun

harsh storm
#

I love HFSMs. "How do we solve the explosion in transitions?" "Simple boss, lets wrap this FSM in another FSM!"

vivid fern
#

FSMs all the way down

harsh storm
#

HFSMs are just design recursion.

vivid fern
#

hehe

#

all i can say is that it wasnt very modular due to the complexity of the transitions

#

but subtrees of a BTi can just jam wherever and its generally fine haha

#

i so bounced off HTN planners tho x_x

harsh storm
#

I honestly think most people using BTs in UE would be better served using STs.

harsh storm
vivid fern
#

i think thats what most of them are looking for

harsh storm
#

I agree

#

I love BTs though ❤️

vivid fern
#

they just werent reactive enough

#

which yeah they arent haha

#

but our games generally had no need for long term planning either

#

but might have just been the situation and the tools we had at that time (late 2000s)

#

i generally go for BTs and some extra stuff around the edges .. like some kind of manager that coordinates AI

wild storm
harsh storm
harsh storm
#

Errr - maybe not. I might be using that term too liberally 🤣

#

Just a missing step

#

As for using your BT like a FSM, take what I said with a grain of salt because we don't see the rest of your AI setup. I was only mentioning it due to how your booleans were named. Because this kind of naming often means people are using it like a FSM.

harsh storm
vivid fern
#

we never really used it, tbh

#

and i replaced it with BTs some time later.. i dont even think it made it to that version of the engine

#

basically it was someone's pet project in 2009, and then video game recession happened and they got laid off.. soon after i built BTs around our new engine language and that was that until that studio closed hah

random jay
misty wharf
#

I think that statement applies to state machines - as in, in the strict definition of it, where you only have states on one level

#

unreal's own StateTree is a hierarchial state machine for example, as it allows you to build a hierarchy of states, which alleviates the transition problem

random jay
#

Well sure generic SFMs are like the linked list of AI designs

#

Do state trees have any other functionality that makes them different then HSM or is StateTree just the class name

misty wharf
#

No idea tbh :) I think it's more or less a HFSM but I've not really used these so much in this context to say

fiery hollow
#

Hi, I'm trying to create a like game runescape where i either click on ground location or an interactable object. I used the topdown preset which for the most part works however I can't get the interact with object part working how i want it. I'm trying to get what i clicked on, determine if its an interactable if it is it should get the actor and move to it. I can't get that part to work. It only works a little bit when i use "simple move to location" but when i click the middle of the object it doesnt work. 😦

#

this is the result of just using simple move to, however this makes it so my clicked object tells me it's clicked rather than the controller knowing what it clicked on and also i cant get it to work consistently

radiant path
#

You probably just try to move where you do a trace to but there is no navmesh there so moving fails. You'll need to get a valid location nearby to move to instead of just moving to the clicked location.

vivid fern
finite owl
fiery hollow
# radiant path You probably just try to move where you do a trace to but there is no navmesh th...

I have a full green mesh, and there is a slight boundary around the object (I assume clicking inside the collision box which doesnt have navmesh causes it to fail then?). I thought AI MoveTo had a radius which i tried in order to stop before the mesh ends but still navigate to the object. How else would i interact with in game objects that have collision. I need to navigate to them somehow. Same with move to actor, are those not meant to be used for static meshes? Or what am i missing sorry i have been stuck on this for 2 days 😮

vivid fern
#

The point you move to has to be on navmesh, else a path won't generate

#

You can use an environment query to get a valid point, or your interact object can have some predefined position on the navmesh, etc

fiery hollow
vivid fern
#

In reality you probably want the interaction point to be on navmesh. The physical object doesn't have to be but the place you move to does

fiery hollow
#

Since the character can already can get close enough to the tree for an animation, I don't think i need to update the navmesh just need to make sure the character know how to get there

vivid fern
#

Nod

fiery hollow
vivid fern
#

Yep!

stiff matrix
#

Why cant I change avoidance group at runtime, you guys have any idea how to do it?
I tried the set avoidance mask node but it does nothing in terms of changing the group

vivid drift
#

I break the mouse hit into logic like this:

#

e.g. move to order location goes to the collision point found on floor:

#

If you want to do interactables where they go to a specific point to interact with it then make sure it's on the navmesh. If you want it to be an arbitrary point then you want to be using:

fiery hollow
fiery hollow
#

something like this? (will clean it up once it starts working)? @vivid drift

fiery hollow
#

This seems to work 90% of what i want so il keep it for now, problem is it uses the blue line when clicking on the box because aspparently thats the closest navmesh to the white box. Would like it to follow red line

misty wharf
vivid fern
#

tbh i'd just use an eqs that listens to path length.

fiery hollow
fiery hollow
misty wharf
#

What do you want to happen in that case instead?

vivid fern
#

its pretty straight forward, define an area, favor points closest to the ai, cull unpathable positions, and then take the points with the shortest path

fiery hollow
misty wharf
#

If you don't want the npc interacting with it from a position that's noticeably higher than the object itself, you could compare the Z value of each position and consider ones too far as invalid for the selection

#

also I think when you project points to navigation, you can specify how far it's willing to project them in terms of the Z axis which might help with this

fiery hollow
vivid fern
#

this also gets back to just predefining the point on the interact the actor should move to that is on th enavmesh by adding a FVector or something to the bp.

misty wharf
#

Ah right, yeah it doesn't matter whether it's an AI-controlled or player controlled pawn for this :)

vivid fern
#

its the least amount of work way..

misty wharf
#

At least in my game sometimes objects can be interacted with from any direction, although some of them also use smart objects for it with a specific slot :)

fiery hollow
fiery hollow
vivid fern
#

and path there when you click on it

fiery hollow
#

Yeah i agree, but i feel like if there are problems later on with that system and i want more control i have to use EQS anyway?>

vivid fern
#

depends on how your interacts work

#

if they always have a "spot to operate from" then this works, but if it doesnt matter, then you need something like an eqs

fiery hollow
#

For something like a smithing table etc i could have interact points but it would be weird to have them for trees

#

and I can definitely see myself needing to operate something from any angle so thats why i think i might need EQS

vivid fern
#

eqs fits pretty well imo, but i think yours there is a bit too mcuh

#

are you using a eqs tester pawn to see what its results are like?

fiery hollow
#

No, all honesty i couldnt find any resources that matched what i wanted to this is all made by Claude and a bit of my own ideas

#

My problem mainl;y is most tutorials are talking about NPC's and given my character is the NPC i have a hard time trying to translate that information to my use case

vivid fern
#

for the eqs its the same

#

this does a path limited eqs result

fiery hollow
#

I added the test pawn and circled an object which the query looks for when it is clicked

vivid fern
#

the query isnt looking for an object...

#

its looking for a place on the navmesh the player can move to

fiery hollow
#

Okay so it needs to get as close as possible to the object when it is clicked

vivid fern
#

yeah so generally its center point will be your interact target, the querier is the player

#

you want destinations scored highest if they points are close to the location and filtered out if they dont have a valid path.. then you can take the closest path

#

so you dont go up some ramp

fiery hollow
#

Yes, will i still need to get the point closest to the actor on the mesh? If i set the center point to be in the middle of the object with no mesh. Will that still generate a path closest to the object?

vivid fern
#

no just get the actor's location

#

the center of the eqs doesnt have to be on navmesh

#

youll need to set up an eqs context so you can place the eqs toward your clicked box, but in the pic above you can see the box cut out of navmesh and thats where my eqs context target is

fiery hollow
#

so it would move to the green point when the context is the box, it is clear i just don't know how to set it up in the engine, so i will take the time to learn the system and implement it. But for now everything you say makes a lot of sense but i don't know how to actually implement it because i'm not used to the EQS system

#

Do you know any good tutorials that are relevant to my usecase

vivid fern
#

at the core of it the idea is to put a grid of points (ideally as few as you can manage) and test the points for various conditions that validate the point, or score the point, then you can choose the highest score

#

i.. dont heh

#

this just behaves like other systems ive written in other engines hah

fiery hollow
#

I get the idea and logic, i understand pathing algo's. What I don't understand is where to click in the engine to get what i want. Just following the tutorial yesterday made me create 5 seperate files, how it all adds together is complicated. It will take some time

vivid fern
#

oh yeah i only created 2 files here (the actual eqs and the context, 3 if you count the test pawn, but you can reuse that to test other eqs

uneven cloud
misty wharf
#

Yeah I think there's sufficient vagueness in how these terms are being used across different fields in programming

#

The explicit transitions aspect seems to be what is the main distinguishing factor

vivid drift
# fiery hollow something like this? (will clean it up once it starts working)? <@47468562212087...

almost. Get Closest Point returns the closest point on the collider to the input point. You probably don't want it to be where you clicked, but rather where the actor is currently (which is fine outside the niche cases where a unit needs to route around something to get to the interactable and would actually end up arriving at the object on the opposite side (but maybe that's fine)) or trying to do something clever with routing towards it first but I think that's kind of unnecessary

#

Consider using the get random navigable point in a small radius too in case there's collision issues with the particular point you did.

#

That should work for 95% of cases on the first try, imo, and you can do some backup traces from different "closest point" origins if the navigable point request fails to find anything

uneven cloud
fiery hollow
#

Well i'm way down the EQS rabbit hole now, I was having issues with the fact that I can't really use a player controller and AIController at the same time and the method of using get closest point etc gave me some small bugs that i might have been able to fix but i felt like the options were limited if i went that route. So now i have detached my player controller from the character and let the AIcontroller take full control i then pass the instructions to the character via a ref. Also If i manage to get it to work i have better control over the pathing

fiery hollow
vivid drift
fiery hollow
#

Yeah that's what i'm doing, it also controls camera now etc. It's sort of working i just cant get the query to actually return something

misty wharf
#

This kinda depends on how much AI stuff you need on the player. Pathing can be done without AI controllers, but some of the builtins for that stuff assume one so it may require a bit more work without one

#

But in general having a separate player controller and an AI controller in control of the "player" pawn is probably a decent solution - and you don't necessarily need to have something as elaborate as structs to pass info, you can just have functions on the ai controller to call

fiery hollow
#

Also, the whole game i'm making (for fun) is kinda like a runescape type thing where the whole game is you clicking and the character pathing it felt like i needed to bite the bullet here since it's such a core part

misty wharf
#

Yeah that's a good plan

signal island
#

how do i catch a payload from state tree event?

fiery hollow
#

@vivid fern Well i kind of figured it out, it seems like i'm close but for some reason the get query results as locations always returns an empty list. I have had prints all over the place to confirm no garbage goes in. Any ideas?

fiery hollow
#

I DID IT, HOLYYY Thanks all

uneven cloud
vivid fern
#

^

sly saddle
#

Is there an elegant way to check if an AI agent has left the navmesh/become unable to move?

My fallback plan is tracking the time since the last successful move result and triggering recovery behaviour if it's been too long, but just want to check I haven't missed some OnFallenAndCantGetBackUp event somewhere.

fiery hollow
# uneven cloud Why do you think that you need an AI controller?

I don't remember i tried so many different things trying to get it to work. While trying I ran into the issue that I couldnt give AI instructions because I had to obtain the AI controller to do something and when i tried that it was always empty because the player controller possessed my character and not the aicontroller.

uneven cloud
vivid fern
wild storm
#

Hi , My nav agent Enemy is a bit big with a radius of 200. While taking turns near an obstacle such as a door or a wall , he is ramming into the obstacle and therefore taking slower turns. After the turn is completed ,he is returning to his full speed. Any ideas how to fix this?

misty wharf
#

You need to change your navmesh so it has the appropriate agent radius which should prevent them from hitting obstacles when navigating

mighty palm
#

Hello everyone,

I'm having issues with the landscape not being recognized as a navigational path. How do I make the landscape recognized?

wild storm
wild storm
misty wharf
#

One way to have multiple different sizes of agents is to have multiple navmeshes where they get generated with different agent settings, not sure if there are other approaches to this

wild storm
misty wharf
#

Right - then you have to add some logic to project the player's position to the navmesh so that the enemy can navigate to the closest point

wild storm
misty wharf
#

I can't say whether it's required, but it's one option that could help in your particular scenario, if you have different sizes of agents that need to be able to navigate

wild storm
misty wharf
#

You can do that with EQS yes - you can use the generator that projects the points to navmesh

wild storm
misty wharf
#

Hard to say, I think it should count as failure if the generator returns nothing so you could use a selector to choose a different action in that case

#

but try it and see I guess - note that you can run EQS queries in BT tasks also, so you could make your own task that handles it in the way you want

wild storm
misty wharf
#

Not sure but could be if you changed the settings in the navmesh actor directly

#

You need to change them in project settings

wild storm
#

What setting that could be?

misty wharf
#

I mean any navmesh setting. The values in the navmesh actor in the level are generated from the settings in project settings, it's under navigation or something like that

wild storm
misty wharf
#

🤔

#

Have you tried manually running Build->Build paths or whatever the option is called?

#

You might also want to try just deleting the navmesh actor entirely from the level and regenerating from scratch

wild storm
#

Can you please check if you can also change the agent radius and the other settings and see if they save on clicking Play?

misty wharf
#

Yeah it works for me

wild storm
#

Weird that only agent radius and agent height aren't working for me. Remaining works

misty wharf
#

Oh, have you tried changing it in the agent settings of the proejct settings menu?

#

I vaguely recall it has two places where you can configure it

wild storm
#

Some values keep having the default values while the other ones change to whatever I set.

misty wharf
#

Yeah I mean some of the agent settings have two places to configure them and one of them gets ignored

#

There's a separate list of supported agents which might've been the place where you need to set them up for it to work

wild storm
misty wharf
#

I don't remember what they're called

#

It should be in the same place as the other navmesh settings, it's called supported agents or something I think

wild storm
#

Yes, I can see a dropdown to add supported agents in the navigation system section @misty wharf

#

Lets test it\

#

Now , what to do with those ?

misty wharf
#

Right so you should just configure this to reflect the agent settings you want

#

I recall these values will then actually get used

oak bridge
#

We made some custom traversal mechanics like ledge grab, pipe climbing etc.. You think making AI do the same is possible or too hard? Because its like making a custom path manager, since it has to understand which path (on ledge grab situation) it can do to reach certain points faster and I dont have idea on how to make it, if its too hard I just make them do something else or they might just not be able to do it. In the situation of zipline and pipe climbing I thought I could do it with nav links but im not sure. Any help on tips?

misty wharf
#

I've not done anything like that myself, but navlinks is what I would consider for it because that works directly with the pathfinding system

sterile escarp
#

Hey how can I get my AI to use "turn in place" animations? Seems the AI is turning itself when I use the setFocus node on the AI controller and its rotating but not playing animations. "Use Controller Desired Rotation" is enabled on the actor.

fiery hollow
misty wharf
fiery hollow
misty wharf
#

What does moving have to do with EQS?

fiery hollow
vivid fern
#

EQS is just a way to find a point in space

#

thats all it does

#

you get a FVector out of it

#

you pass that into whatever moves your character

fiery hollow
#

Yeah i'm understanding i'm just confused because it works now and didnt before, but i'm starting to realize that maybe i did something else wrong and i don't need the aicontroller

misty wharf
#

You would only need the AIC if you use AI MoveTo or possibly the BT MoveTo task

#

since AI MoveTo requires an AI Controller to function

fiery hollow
#

basically i have this in my AIController, you are telling me that i can just do that in my normal controller and forget about the AI controller

misty wharf
#

The EQS parts of that should work just fine yes

#

all EQS needs is the Querier, which can be any actor whatsoever

fiery hollow
#

omg why do i do this to myself

vivid fern
#

have you looked at the top down template

#

the player there moves around via clicking the world

fiery hollow
#

thats where i started from

vivid fern
#

kk

fiery hollow
#

Well ill report back

harsh storm
#

Not with that little of information.

vivid fern
#

they deleted all their posts

#

¯_(ツ)_/¯

coral widget
#

if i want minions follow a path like league of legends what would be the best way? can someone tell me?

vivid fern
#

probably not that different from a patrol route/path/points tbh

coral widget
#

spline?

#

they need follow eactly they path

#

with curve

#

exaclty. in a line

#

spline ist the only way? or is there some better ways?

misty wharf
#

Spline sounds like the way to go

coral widget
#

but how can i handle minions that they dont lbock each other?

#

how do you would progrmam minions follow there path exactly? and then dont block each other

#

for example 20minion wave vs 20 minion wave...

vivid fern
#

i mean LoL dosent follow the line exactly.

#

they def have a route they want to go down but follow it via navmesh pathing

vivid fern
misty wharf
coral widget
#

in lol they follow excatly on line???

coral widget
#

in a line

#

or im wrong?

vivid fern
#

you are wrong

coral widget
#

and then the fing the path and dont block each other

vivid fern
#

they do not follow the line exactly

coral widget
#

did you play lol?

vivid fern
#

they will also move off the line for a bunch of reasons

coral widget
#

the follow exact the curve

vivid fern
#

they do not

coral widget
#

? o.O

#

they follow straight a line

#

not going through tower and curves

vivid fern
#

they move around obstacles, wander off the path to get targets, and then return to the route and move down it

coral widget
#

if they folloew a path they dont go curve on toplane adn botlane?

vivid fern
#

they do not follow it exactly but they want to be moving down it in their base most state

coral widget
#

in path the go line to other point#

#

but in lol they go curve

vivid fern
#

thats why i said: they follow a route but they dont follow it 100% exactly

coral widget
#

???

#

if you aht path points?

#

how can they walk curve?

vivid fern
#

i have no idea what you are trying to say.

coral widget
#

its only work with splines? o.O

vivid fern
#

there are tons of ways to do this

coral widget
#

how do you would programm minions exactly like in lol?

#

how do you will handle this?

#

not block each other follow path etc etc

vivid fern
#

i already said

coral widget
#

with pathpoints? o.O

vivid fern
#

i'd use something similar to a patrol route

coral widget
#

and how do you would handle this

#

they dont block each other and find exactly way to attack

vivid fern
#

with navmesh

coral widget
#

yeah but the ywill block each other

#

if there are 10 groups

#

They keep stopping and don't know where to go

vivid fern
#

? you pick clear destinations to move to, you nav around others via navmesh or crowd type logic, i cant write your game for you

coral widget
#

yeah i know

#

but you dont understand

#

if you use path pint avoidance and crwod... they will block each other

#

they stopp and dont know where to go

#

in leaugue of legends they dont stop... they exactly know where to go

vivid fern
#

you didnt listen

#

i said its a combination of finding clear destinations, using the navmesh to find a valid path to those places

#

ai have to pick a target, then figure out where to stand to attack them, then move to that location and avoid obstacles

#

you actually have to write that code yourself x_x

coral widget
#

they arleady know where to go

#

with avoidance and crowd ai controller

#

they block

#

and dont move around each other -.-

#

which code? which node will handle this?

bleak birch
#

I don't play LoL so my thoughts might be wrong but as Allora said, it'll have to start from some form of Nav Mesh / Crowd Logic. To spell it out in a bit more details.

But to achieve Navigation without avoiding each other, they need to be managed together so I imagine,

  1. There is a grid of some sort (nav mesh), that is shared by all AI.
  2. Maybe each AI would pick a particular path. (they write a custom path picker) and then another would. The next AI will pick it and hence no crossing over.
  3. Possibly re-evaluate the path at some point.

In that way, they don't avoid each other.

vivid fern
#

tbh the agents in LoL also have pretty small colliders

#

they can squeeze around eachother pretty easily

coral widget
#

idk how to programm this

#

i thought avoidance and crwod would do that

#

but that doesn't help at all. not even close

vivid fern
#

you actually have to do work on top of that, you cant just "drag drop" a solution without any specification to your use case and expect it to work

coral widget
#

but which node which code? would handle this?

#

idk where to start

vivid fern
#

AI is highly game specific so you wil probably have to write stuff that helps AI pick destinations, know when to pick destinations, and move to those destinations to attack while moving around obstacles

coral widget
#

i know this all

#

but how can i do that xD

#

which asset wich node would do that ^^

bleak birch
#

I'd suggest googling for tutorials, it'll be on YouTube or UDemy. They are good at How To. A skill you'll need to develop for future challenges.

coral widget
#

there is no tutroials

#

every where the same

#

ai move to thats all

#

ai move to stop anim montage

#

or avoidane and crwod

#

thats all

#

ai move to that and that ...

#

ai move to or behavior tree

#

but how can ai know which way to to find... and know where is the other ai

vivid fern
#

maybe you should follow tutorials in the pins tbh

coral widget
#

ist there a node? idea? or something that i miss

#

there are no tutroials?

#

no oen can say me a idea? how can i do that?

vivid fern
#

then you didnt look in the pins

#

like an EQS can help you find locations, that would help set up destination picking logic for example. You have mentioned move to, which would help find a path to said destinations.. and you already noted crowd tutorials you found.. that alone is enough to make a simple implementation

coral widget
#

it doesnt -.-

bleak birch
#

It's hard to help if you dismiss suggestions tbh.

It may be how you view development cycle as I don't know about your experiences with game dev. With development, you need to piece together many moving parts to create a bigger system. It requires you to sit down, try things out, fail and learn bit and pieces.

Anyways, I did a few searches and the base of what you need exists out there, have you followed through with any of these?
A few quick searches
Car Navigation: https://www.youtube.com/watch?v=3999HeBJ6K0.
Crowd AI Controller: https://www.youtube.com/watch?v=iYcDyJUByJg

coral widget
#

this tutorials iw atched many times

#

lol

#

all you said me i know after working 1month with unreal engine lol

#

i tested all

#

and splines work well for pathing!

#

you tell me splines wrong

#

i sit down and testes everything

#

but they will block each other

#

or stop sometimes and searching way..

vivid fern
#

no one said splines were wrong

#

just that there's many ways

coral widget
#

in lol they never stop they exaclty know where to go

vivid fern
#

yes because they have a system that picks destinations and manages where they go

coral widget
#

in this tutorial they run into each other too

#

in lol they never run in each other -.-

#

yeah how ths system work?

#

which nodes? which idea

vivid fern
#

literaly already said but you dismissed it

coral widget
#

you tell me waht every people know after 1 week with unreal -.-

vivid fern
#

clearly not if you cant do it

coral widget
#

there is ai move to node or behavior tree

#

how they know where is the other ai

vivid fern
#

The tools are there: EQS is a good place to start to look for destinations around targets or your self (as the ai) to see where you want to go, attacking something? maybe you need to pick a position around your target that isnt occupied.. maybe you need to manage how many things can be around targets, etc

#

once you pick a spot, you can use move to to get there.. maybe you will have to use crowd stuff to make sure they move around other ai, or use a customized path follower or custom path generation. really depends

#

you track ai as you create them so you can easily query where the others are, or you can use a cast or overlap or something

#

one thing that's important when building any game feature: break it down into smaller and smaller parts until its more easily understood how to do that work

#

then you keep building up the small easy to understand parts and together they'll build up your feature

bleak birch
#

The issue from my POV is you want an answer for a full AI system (to work exactly like LoL) without building it, that's close to impossible unless such tool exists already.

A close to complete system can look like this if you break down its components

  1. Be able to go from A -> B using Path Finding A* -> Learn how to tell an Agent to move to a location
  2. Agents has ability to avoid. -> Learn how to enable / disable crowd avoidance
  3. Agent Coordination-> Learn how you can coordinate their paths so the don't overlap. This is a layer on top of the foundation which is #1 and is often very custom to the game.

Some of what you mentioned, honestly sounds like a bug / problem for you to solve as a developer and moving past / understanding why they occur will give you a good starting point for further implementation.

but they will block each other
or stop sometimes and searching way..

vivid fern
#

It absolutely will take research and time as well these sorts of things are not instant you have to try things and see if they fit your needs

#

maybe zone graphs are better for moving down the lane, for example

dense owl
#

Kept asking the same question 5x expecting a diff response

vivid fern
#

i mean i get it some folks just want an automatic solution that they dont have to work for

#

but this a isnt realistic take for making a game

#

making games is some serious work.. researching, teaching yourself new stuff, trying stuff and failing and trying different other stuff and also still failing

dense owl
#

Yeah, hard to convince people of that sometimes

#

With today’s tech we’re trained to get that instant-gratification so anything that takes time is inconvenient, speaking from personal xp lol

plucky hearth
#

is there a tutorial that is purely using that plugin for a topdown type of game? or maybe just following the first part of the video is good to go?

olive turret
#

Does anyone know how to get the size of a specific navigation mesh chunk/tile/area?

cosmic stag
#

Is there any way to visualize the nav mesh in a packaged build?

wise sluice
#

If that's a non shipping build (Development Build for instance)

#

Open the console command

#

And type "Show navigation"

misty wharf
#

Does that work when you're possessing a pawn though?

#

I vaguely recall that's effectively the same as pressing P in the editor, and that doesn't show anything unless you detach from the pawn first

wild storm
#

Hi , has anybody gotten the nav supported agents to work for multiple agents? My enemy is always using the agent radius and height of other agent that isn't made for him.How to assign nav agents to the actors correctly?

#

@misty wharf Since yesterday , I searched through many forums and tutorials and found that if we modify the agent properties for the recast nav mesh which is there in the level , it will indeed never save and On clicking play , it will come back to the default supported agent . So we have to make the nav agent with the desired properties and it will act as default since it is the only one that will be there in the list. So that new agent will be used . But the issue that still remained is that if I make multiple agents for characters of different sizes , all of them keep using the same agent which is wrong for them. Any way around this ? I have 2 enemies , one smaller and one bigger .

misty wharf
#

@wild storm I don't remember the specifics but there's some way to specify which agent type each of them should be using and there's a way to generate separate navmeshes per agent

vivid drift
#

Is there a way to avoid patterns like this?

#

Like I want to be walking towards the nearest enemy at all times. So I have a decorator that resets the node whenever the nearest enemy changes

#

and a service that continually updates it

#

but this node can't be entered uinless the followed target is already set, so I feel the need to make a task (A) that sets the blackboared value initially. I'd love to not run (A)

#

edit, probably solved my own issue but curious if someone knows more specifically:

#

looks like receive search start fires in a service before a downstream node actually activates?

pastel star
#

How can i update the nav mesh in runtime?

misty wharf
dense owl
#

Dynamic navmesh generation. You can also do dynamic modifier only

shadow sierra
#

Maybe a stupid question, but I can't find how to do it:

I have an "Attack" task, but there are different parts of the BT that attack different targets. Is there a way to use the BB to pass an Actor into the Attack task instead of mimicking the target prioritisation logic from the BT in the task itself?
It seems to only allow me to pick from the scene or viewport, not sure why that would ever be useful.

dense owl
#

You need to expose that variable so you can use it from the drop-down

uneven cloud
wild storm
wild storm
uneven cloud
# coral widget ist there a node? idea? or something that i miss

There isn't 1 node that will make your AI for you. And no one is going to walk you through exactly how to make your AI.

You need to figure out exactly what behavior that you want, break it down into smaller problems and learn the systems to solve those problems.

uneven cloud
vivid fern
#

fair

wild storm
uneven cloud
uneven cloud
uneven cloud
vivid fern
#

you are absolutely right hahaha

uneven cloud
wild storm
wild storm
wild storm
uneven cloud
# wild storm Can it surely be done in c++? Have you ever found a way to do it? Can you give m...

I believe there is just a function you need to call. The easiest way to do it would be to make a blueprint function library class. In that class make a function like OnAgentSizeChanged that takes in a character.

In that function, you get the movement component of the character that was passed in. Then call the function to update the agent properties.

Wherever you change the size in BP, add a call to your new function.

wild storm
uneven cloud
wild storm
uneven cloud
wild storm
#

And the NavAgentProps struct which we set in the editor is being declared as private here.

wild storm
#

BoundRadius and BoundHalfHeight means Capsule Dimesnions??

wild storm
# uneven cloud Correct

Ok , I will try that. And what if we have to manually set some numbers in there?? (I am fine if it works with the capsule for now.) And it expects to set the "Update with Owner Collision" to be true.

uneven cloud
wild storm
uneven cloud
wild storm
uneven cloud
wild storm
uneven cloud
#

Any struct that is exposed to BP automatically has a make function.

wild storm
#

It is not a reference . It is returning a Copy. Isn't it.

uneven cloud
#

& means it's a reference

wild storm
plucky hearth
#

I wanted to show some fix in case anybody is having Frame Drop in turnbase-TopDown-BaseOnGrid games:
I am doing a game like AdvanceWars and I wanted to share my trick so far to avoid frame drop (Players dont possess, they are only PlayerControllers, and the "pieces in the board" are Characters with "Ai Move To" logic, that are selected on leftClick). I can be around 100fps, thanks to:
-Auto destroy when no navigation
-Dynamic Modifiers Only
-Observed Paths Tick Interval is 10

I tested so far and no bugs, if somebody think it could be problematic please let me know.

lyric flint
#

anyone worked with AI and spline movement in behaviour trees?

signal island
#

Guys im running a state tree inside a state tree, how do i get back to the root state tree?

dusty elk
#

I have a AI behavior tree setup where once the AI sees me music starts playing but the issue is, the music does not stop playing even when the player is no longer seen by the AI. I been trying at this for hours and I simply can't figure out how to make it work. Help would be amazing.

misty wharf
#

Have you considered using a service instead?

#

You can place the service on the part of the tree involved in chasing, and it will trigger when that part is entered, and it has another event which can trigger when the part is exited, where you could then turn the music off

dusty elk
misty wharf
#

You can think of it as something that sits on a particular node and can do stuff when the node activates or deactivates, or ticking while it is active

#

So in this case, you could put the service on the sequenc called Chase Sequence, and it can activate the music when it becomes active, and stop the music when it becomes inactive

#

That way as long as the BT is executing nodes within the Chase Sequence, the music would remain playing

dusty elk
#

as in like this?

misty wharf
#

Yep

dusty elk
#

now what about inside the service should that be setup in any special way

misty wharf
#

It should have events you can override similar to how you override receive execute in tasks, but the ones you want are called something else, I forget exactly what but the names should be reasonably obvious and if you hover over them, it should give you a description also

dusty elk
#

I am assuming I use either the receive activation ai or receive activation

misty wharf
#

Yeah, and the deactivation one for when it no longer is active

dusty elk
#

I have it setup like this so far the music does play I just dont how to add the deactivation still

misty wharf
#

If you use spawn sound 2d instead of play, it will give you the audio component that will play the sound. You should be able to use that to turn it off later

dusty elk
#

Ok I put the spawn sound 2d instead, do I need to add another service/task to cancel the sound?

misty wharf
#

No, you can just override the receive deactivation in this one and turn it off there

dusty elk
#

how does one do that lol, I am sorry I am still learning

misty wharf
#

Same way as you overrode the other event

dusty elk
#

Something along this line, still very confused

misty wharf
#

I don't remember the exact way to turn the sound off, but if you drag from the pin in the spawn node, you can probably do it on that object and just connect it to the deactivate part