#gameplay-ai

1 messages · Page 42 of 1

dusty vigil
#

how do I go about an enemy AI actually turning to face the direction they are moving in

tough tulip
#

Just coming back to this, check out the screenshot. Why is the move to task marked as Priority 0, and the decorator as priority 1? This would explain why if the selector fails, it wouldn't affect the move to task

tough tulip
waxen portal
#

guys can i spawn AI with an eqs??? afaik we can spawn mass entiies with it

harsh storm
#
  1. Run EQS to find a spawn location
  2. Get the selected location and spawn the AI
#

EQS itself doesn't do the spawning logic. Just the logic to find a place.

mild bobcat
#

is the Epic AI dev course still largely up to date?

#

gonna start trying to code first enemies

harsh storm
#

Don't know - but Luthage recommends it and that's good enough for me to recommend it as well

mild bobcat
#

everything I read about navmeshes is largely related to 2D planes; does anyone have exp with 3D movement in a zero-g sense? Picturing defending a sphere that you are walking on mario galaxy style from space invaders

#

and how the AI navigates/pathfinds

misty wharf
#

Navmesh is for walking on ground

#

If you need 3D you need to come up with some other solution

terse panther
terse panther
dusty vigil
terse panther
dusty vigil
#

yeah

#

just not rn

#

in around 20-30 minutes

dusty vigil
#

alright

#

maybe it was a bit more than that

#

but here

#

@terse panther

#

I got a bit confused for a moment

#

and yeah I know the move node is unhooked, and that AI move is in a bp task named find navigable location, it was basically me trying to fix it yesterday and forgot about it

uneven cloud
# mild bobcat gonna start trying to code first enemies

It doesn't cover the new systems (Mass, state tree and smart objects), but those are still under development. What it does give is a solid foundation with some AI theory, which helps no matter what system you decide to use.

uneven cloud
# dusty vigil

You need to turn on Use Control Rotation, either on the character or the character movement component. I prefer the latter, but either works.

You are also ending the BT task before the movement has completed which is going to cause bugs and perf issues.

faint carbon
#

Hi all, I'm just getting started using State Trees for my AI, maybe I'm not fully understanding the concept, but why is it that each of my states gets run on every tick? Why doesn't the tree wait for each state to 'succeed' before moving to the next one? Is there a way I can make the tree function that way?

misty wharf
#

Can you give a more specific example? States definitely will wait for a task to finish before moving onto the next one

faint carbon
#

find actor

#

move to actor

misty wharf
#

I think the issue is that you're returning success

faint carbon
#

o, wait, does that succeed the whole tree, including children?

misty wharf
#

Yeah if the Find Actor task returns success, it means the task is complete, which in turn causes the state to trigger its success transition

faint carbon
#

aaahhh ok

misty wharf
#

if you don't call finish task at all that should keep it in the running state, meaning it won't exit

faint carbon
#

works fine now

misty wharf
#

Yeah I spent a while trying to figure these same issues out as well lol

faint carbon
#

so is it universally true that only leaf states should have succeed states? Or are there cases for branch / parents to have succeeds? @misty wharf

misty wharf
#

Hmm

#

I don't know of any examples off the top of my head, but I could imagine there could be some reason to use it on a parent too

#

Like maybe in certain conditions you want to be able to skip the leaf or something

faint carbon
misty wharf
#

I find it generally is as I suggested on the page I linked - you usually have tasks that either get data or do actions and the ones which do actions generally want to success/fail, while the data getting ones don't

#

At least so far that has seemed like a decent rule of thumb

harsh storm
misty wharf
#

I almost never read anyone's profile so I didn't think of that but I'll put it there

waxen portal
#

can one put custom curves in eqs tests?

latent trail
#

how do i make my player not register as a stimuli source for the npcs?

misty wharf
misty wharf
#

Still being sensed? With AISense_Sight?

latent trail
#

yup

misty wharf
#

You don't have a stimuli source component on your player I hope?

latent trail
#

I don't

misty wharf
#

Hmm

latent trail
#

added these lines

misty wharf
#

Try changing it so it just says AIModule.AISense instead of AISense_Whatever

latent trail
#

nope doesnt work

#

someone said here its deprecratedhttps://forums.unrealengine.com/t/how-to-make-a-pawn-stop-registering-with-ai-perception/368928/5

Epic Developer Community Forums

Confirmed, UE4.27.2: [/Script/AIModule.AISense_Sight] bAutoRegisterAllPawnsAsSources=false [/Script/AIModule.AISense_Hearing] bAutoRegisterAllPawnsAsSources=false In DefaultGame.ini works.

misty wharf
#

Really, that would be weird... maybe try also adding bWantsNewPawnNotification=false

misty wharf
#

What abotu if you put it into DefaultEngine.ini?

#

(with the original way you had it, with AISense_Sight)

latent trail
#

same 😢 \

#

i'll try the unregister from stimuli again

misty wharf
#

That's peculiar 🤔 I don't see any reason why they would deprecate that

#

And yeah if you manually call that function that definitely should do it

dark topaz
#

I've got 200 zombies

#

and this is the node I use to have them move

#

but the zombies will get stuck on each other

#

is there a way to make them avoid walking into other pawns?

misty wharf
#

You can try adjusting the avoidance settings in the character movement controller, or try using the crowd avoidance system

dark topaz
#

you mean this?

misty wharf
#

Yes

dark topaz
#

this doesn't actually do anything

#

I tried it already

misty wharf
#

Did you check the box that says Use RVOAvoidance?

dark topaz
#

it's as if their collision capsules are bigger

#

well now it's turned off

#

but I tested it already

misty wharf
#

Yeah try using the crowd avoidance system then and see if that works better. It might not be a perfect solution either if your NPC's are trying to converge to the same point

dark topaz
#

this happens with rvo

dark topaz
#

lemme try crowd avoidance

misty wharf
#

in DefaultGame.ini with AISense_Sight

latent trail
misty wharf
#

Nope

latent trail
#

alright lemme try

#

okay it works now

#

thanks!

misty wharf
#

np

dusty vigil
#

bro tysm

fathom dome
#

my casts keep failing

#

despite the AI clearly outputting my character through updated characters

#

am I missing something obvious?
they use to work fine

misty wharf
#

I would suggest using on target perception instead so you don't need the loop

#

Either way, the cast should work if the class is correct

fathom dome
#

the issue seems to be that it can't see the correct class when I use the cast

#

i'll have to just try a different way

#

this was a way I saw in a tutorial a while ago, the one i'm following now uses the way you suggested

#

I just don't understand how perception works and why this is failing now when it use to work fine

dense owl
#

For me, onTargetPerceptionUpdated wasn’t firing reliably so I ended up using EQS and a built-in generator

fathom dome
#

interesting

#

well i'll try some of the other tutorials i've seen

#

i'm new to using AI so tbh i'm in the dark on what is good or not

#

Do some people just ignore the built in unreal perception and AI stuff and just make their own in code?

#

I want to learn the unreal way first either way

dense owl
fathom dome
#

ok i'm glad that that's at least good

#

i have seen a tutorial where the guy tries to ignore all the unreal ai stuff and make his own basic AI and it seemed like the wrong path to me

#

yeah the new tutorials and stuff I'm looking at use ontargetperceptionupdated (AIperception) so i'm going to follow that until I have my head around some of the basics more

#

thanks

dense owl
fathom dome
#

thanks

lyric flint
#

Question about EQS + contexts:

I want to create an EQS query that scores points off-screen higher. I want to use the dot product between the Camera's rotation vector and the querier -> item vector. My thought was I simply need a context for the Camera.

However, my camera is a component (not an actor). What's the best way to pass an actor back with the rotation of the camera so I can use that in the test?

dense owl
#

so...my recast lets me change agent radius to 15 but it seems to reset to 35 when I restart the engine (not necessarily every time tho). It's set to 15 in project settings as well, so idk why it's doing this. @uneven cloud you mentioned something about minimum having to be 35? How else can I make the navmesh snug enough around the walls or increase the tolerance of the path's projection to navmesh?

uneven cloud
stuck cape
#

Last night when i went to bed my AI was going to me, attacking, then chasing again.

Now they do the same thing, but with no animation while moving. I have tried everything, even removing the behavior tree and redoing it all locally on the AICharacterBP event graph. Everything works besides the animation while moving

#

Did i click something dumb right before going to bed? lol

uneven cloud
# fathom dome my casts keep failing

Are your casts actually failing or are you perceiving more actors than that specific class? I'm guessing it's the latter. You should debug it before assuming it's a bug.

uneven cloud
dense owl
lyric flint
#

@uneven cloud If I send them as vectors, they have no rotation attached so the Dot product just receives a zero vector.

uneven cloud
lyric flint
#

Ah, my bad! But theoretically I don't understand. How can the dot product test use the context's rotation if it never knows about it?

fathom dome
#

shouldn't it run through one actor at a time? It definitly is percieving more actors than one

lyric flint
#

specifically thinking about this

fathom dome
#

i've found a different way of doing it and it's working

#

though

uneven cloud
uneven cloud
fathom dome
#

yeah but i'm looping through the array?

#

shouldn't that be one at a time?

dense owl
#

Point being you will likely see the cast failed print several times, one for each actor that is not a match

fathom dome
#

oh yeah I don't dispute that

#

but it should succeed at least once, which is what's mysterious to me

#

and it use to succeed at least once

#

well it's moot now i'm not doing it that way anymore

#

thanks though

#

The new way is working and does not use casting

stuck cape
#

So I have gotten my AI's 'run' animation to work while moving, but ONLY in the AI's event graph. But from the behavior tree I still cant seem to make use the run animation. They just come at you stiff then do the auto attack standing still as intended 😦

stuck cape
#

I would be happy! Just give me 20 minutes to eat. If you are still around cool, if no i get it ❤️

dense owl
lyric flint
mild bobcat
lyric flint
#

Not sure if this is the correct spot for this, but does anyone have any tips on running Build Paths for the navmesh on a build server (Python maybe)?

uneven cloud
lyric flint
terse panther
mild bobcat
stuck cape
#

Can actors create Nav mesh on construct or is there anyway to have AI nav mesh bounds attached to an actor and spawn in along with it? I am making an infinite runner game, and I need the floors that spawn in to contain the nav mesh.

Every X floors is a town the AI shouldnt enter, so attaching the nav mesh to my characters location does't work.

uneven cloud
foggy sequoia
#

Im Not sure why I can't Set this EQS BB to Target as its a value I can set everywhere else . Only seem to be able to set it as its self which is not what I need.

misty wharf
#

What is the type of Target?

#

I assume it's object, but have you specified it's an Actor in the submenu?

#

If not that could be preventing it from showing up in that list

foggy sequoia
#

The target and self actor are the same Object type, And If it was only looking for either then Why does Locations BB values also show But not My Target 😦

#

In The EQS its looking for My player character

misty wharf
#

iirc SelfActor is by default an Actor

#

so you may have to specify Target is an actor because if it says just Object it means it could be any UObject type which may not have a position for the EQS query to use

#

it's a bit hidden, there's a small arrow thing to expand the object type selector which allows you to then specify the more specific class of object

foggy sequoia
deft mural
#

It's weird how tasks are given automatic display names but services do not receive the same treatment.

lyric flint
#

I'd like to create a custom Blackboard key type. How do I register that (or do I have to) with the Blackboard system so that it knows about it?

#

(And side question. Is it possible to customize EQS generators to return something that isn't an actor or a location (e.g., a struct)? Is this a fool's errand?)

misty wharf
#

I vaguely recall BB keys are defined in some kind of structure that looked like it could be extensible

#

I think gameplay tags didn't use to have one in UE4, so maybe checking how that's defined would be a start

lyric flint
#

I took a look at Smart Objects and they define their own type that inherits off of BlackboardKeyType (or something like that). I was curious if I needed to tell the type system about it somewhere of it's some reflection magic? I suppose I should just make the class and see what happens, though. 😄

misty wharf
#

I suspect that you need to register the key type somewhere

#

That's usually how it works on these things

foggy sequoia
#

Need advice. I have a EQS to find a weapon spawner and move there which is working, but I noticed that Once the weapon was taken by a bot The other bots that picked is as the move to goal were still doing so and just standing there 😦 So I added a bool to the spawner to set when the weapon was taken and when it was respawned. and added only those to the array. in the context. Also tested and working. But the other bots still go here probably because it has not updated quick enough and it was valid when they first searched . so I put the eqs in a eqs service on a selector and set the interval to .2 seconds but its still the same 😦 I want the other bots to quickly search for another if the weapon was taken. what to do ?

grizzled mulch
#

I have this weird issue where my AI just start glitching out randomly in the map, I first though it was something wrong with the nav mesh, but it seems fine too (Show below)

#

The Move to node keeps getting called , so its somehow having problems moving?

#

Any help or guidance in what the issue could be woulld be appreicated ❤️

dense owl
uneven cloud
sudden field
#

I need a sanity check here, is there any reason that I should not scale a NavMeshBoundsVolume and should instead change the brush size? or should brush size always be left alone

#

I've profiled the navmesh generation but like, it's just slow. I don't see how there's anything it could be doing incorrectly. So at this point I just need ways to make it faster. right now the cell size is quite high, tiles are 64 cells square, but there has to be something I'm missing that makes things faster

#

like my level is essentially just a big chessboard, it's not a complex environment in the slightest. my only guess for why it's so goddamn slow at this point is that it's because the trees across the entire level are all in one Paper Grouped Sprite, and the bounds of that grouped sprite are causing an issue? like the navmesh is doing redundant checks against every single sprite in the group for some reason??

sudden field
#

does this code actually need to be in Tasks on your behaviour tree? if you want background processes then you should probably be using a Service or just running the processes on the AI Controller, not in the behaviour tree

jagged mesa
#

Does anyone know how to deal with the error "Cannot open include file [...]. No such file or directory." when trying to #include "DetourCrowd/DetourCrowd.h"?

sudden field
jagged mesa
#

Yes, I added the folder to PublicIncludePaths, would that be the right place?

uneven cloud
sudden field
#

if you set up your keys and tasks right, you can have a Move To task (the built-in one) that tracks your player. your random abilities can be fired off with a Service on that Move To - you can even do the random timing this way, since you can set a random deviation on the tick time.
when set up that way, the Move To task will only finish when within range of the player. so, after it, put your melee attack task there. assuming that the rest of your tree is set up right, this whole block will loop, chasing the player and firing off abilities until it's in range, then melee attacking. you'll probably want a Wait task after the melee attack just so it can't fire off on every frame

foggy sequoia
#

Not sure why But MY AIs are not detecting each other while using the gameplay tags , Both have ai perception in the AI controllers and A stimuli in the character. what did I miss

umbral wave
#

Hi guys!

The lack of combat and ai videos on youtube is frustrating!

I would really love to get advices from you all, im at that point that i know the barrier us about to break but still stuck in the "how to approach" the combat system which will include various types of attack etc.. and to combine it with a nice and fine ai behavior that will react correctly to hits or hit back or any desicion and logic it will have.

please give me light guys ❤️

misty wharf
#

Your question is very vague and I don't know if it can be answered. That's why you can't find videos about this topic either because it's very complicated and depends entirely on how you want it to work in your particular game

#

Generally the way you build these kinds of more complex behaviors is by combining simpler behaviors to form larger ones

umbral wave
# misty wharf Generally the way you build these kinds of more complex behaviors is by combinin...

of course, im not expecting to get an answer of how to build a full aaa game system, i just need a direction of how to combine simple attack with a simple reaction of an ai, in the form of a clean simple system.

the problem is that every tutorial is all about how to play a montage and make it look cool with a huge sword. it doesnt make any sense of how to approach and start building a simple system and thats why it frustrating

#

seeking the direction of how to start a system as such 🥹

misty wharf
#

I would try to approach it from the perspective of setting up the building blocks in a sense

#

For example, give your character class a function to perform an attack, and give it some logic that can run when it gets damaged that reacts to it

#

Then you can create some behavior tree nodes to start building logic to for example run up to a player and trigger the attack function

#

At that point you would want to test how it reacts to being hurt to test your logic for that, so you can make sure it works the way you want with the BT logic you have for it

deft mural
#

When I pass in the controlled pawn in my State Tree task the return value is always null.

#

The controlled pawn is valid.

#

I will send some more code when I get back.

misty wharf
#

Print the querier value, print the return value, and check visual logger for any EQS related messages

deft mural
#

Okay. I wil when I get back.

#

The return value is unknown in Blueprint debugger.

#

I will move to C++ once I get it working in Blueprint.

misty wharf
#

BP debugger is kinda iffy, best to print it or use an actual node to check it, like Is Valid and then print the output from the branches

deft mural
#

Okay. I also used is valid and it never went through the valid exec pin.

misty wharf
#

That suggests the Querier could be null for some reason, but I think either Output Log or Visual Logger should have warnings/errors from EQS in any case if it doesn't return a valid result

deft mural
#

I will send again this afternoon.

subtle dome
misty wharf
#

Looks good

subtle dome
# misty wharf Looks good

Thanks! Still lots of iteration to do on everything, but I'm fairly happy with it so far. Going to park it for now and focus on level design

signal island
#

im a programmer in a hack n slash project, how costly is having each basic minion running bt? since this kind of ai is basic, shoud i put the logic in the ai controller using pawnsensing?

harsh storm
#
  1. Do it and then profile
  2. AI doesn't use a player controller, they use AIController
  3. Pawnsensing is old and outdated, use AIPerception
signal island
harsh storm
#

No

#

Do not use that

#

Again. It is old and outdated.

#

AIPerception does what it does, but better

#

Ignore it

#

It might as well not even exist

signal island
#

Thanks! AIPerception then!

dusk pewter
#

the BT

#

the service, but I doubt it is a service issue:

foggy sequoia
#

What's the best method to disable ai perception if the AI is either dead or unconscious , I only came up with this

#

or by doing this. Its there a better method?

vast heart
#

Do we know if anybody / any co.'s etc. / are trying to deploy the new RL/IL systems that came out in 5.3? (learning agents).

bitter wyvern
#

so I have a ledge right here, is there a way to make it so ai will be okay with jumping off the ledge if it knows there is a navigable surface below?

tawny locust
# foggy sequoia or by doing this. Its there a better method?

only potential thing to note with this is that you are fetching the component twice, since its all pure functions. once to read "Dead" and then again to read "Downed". its not going to matter much since component fetches are pretty fast, but I usually make small utility functions in cases like this, that just take in a component, do whatever calculation and return, so the component is only fetched once.

visual dawn
#

hey guys

#

morning

#

am scripting a muliplyaer shooter

#

the ai aims from the client POV

#

but on the server it does not need help please

dense owl
dawn edge
#

has anyone tried or know of someone who tried to do some LLM style and hook it up with a game made in UE?

#

something like, let the AI play your game and see what it does, something like that

ivory matrix
#

Hello, how do i find and addthe AI_Classic the AnimClass that, has the idle and running etc animation in it cuz i dont have it here

mild bobcat
#

I think those just work with the CMC

ivory matrix
#

With abp manny hes just straight going around in the room im stuck at the animations thing idk how to make it so when the character moves, he has a walking anim, when he runs another and when hes just standing still an idle anim

dense owl
ivory matrix
#

idk if i didnt search it correctly or not but i didnt find what i want

stuck cape
#

Could someone help me with this issue in the video above? I am moving my NavMeshBounds with my character, however it does not update its bounds untill i move it after pausing the simulation.

uneven cloud
stuck cape
#

So i am new to UE5 and everything i read about this situation for people is the same. Specifically; using nav mesh in an infinite runner. All dynamic options in nav mesh generation that i have seen are still restricted by the nav bounds.

#

would it be feasable to just make the bounds a MASSIVE length in size (I only need it the width of the playspace)

uneven cloud
#

For an endless runner, you move the bounds when a new tile is added, so that the bounds covers the current tile and the new one.

It should not move with the character, but when tiles are added/removed. This is because you don't want it to constantly be rebuilding, because it's expensive. Then you need to call On Bounds Updated on the navigation system to trigger that rebuild.

stuck cape
#

Luthage, you are the woman!

#

That works! I will get away from moving the bounds on tick and only doing it on next tile generation

#

but thanks for that node name! looks forever and no one mentioned that

uneven cloud
#

You're welcome!

terse panther
terse panther
# dusk pewter

try making the SetRandomLocation a BTtask and then try if the issue still exists

marble mortar
#

hi
when i spawn my ai with level blueprints pawn sensing does not work

#

what to do?

misty wharf
#
  1. check if it actually has a controller
  2. don't use pawn sensing, use AI perception
#

Pawns have a setting for "Auto possess AI" or something like this - by default it's set to "placed in level", if you want it to automatically get an AI controller when spawning via blueprints, you have to change it to "spawned or placed" or whatever the option was called

#

(or alternatively you can spawn the controller for it manually, or use the spawn AI node)

dusk pewter
#

@terse panther If I use a character class with cmc it doesn't happen

keen crow
#

I have a big NPC which uses separate nav agent type for navmesh (with bigger radius), now I need this NPC do ignore specific actor (small breakable fences) when doing pathfinding so that the NPC would just go through them. Is there anything to override to ignore some actors based on collision object type or maybe just TSubclassOf to achieve such behavior?

terse jay
#

Is it possible to reuse the traffic lights system used in city sample with ZoneGraph? I've been searching for it but couldn't find anything

misty wharf
#

I've not tried it with navmesh for a specific agents but maybe you can get it working via some method like that

keen crow
# uneven cloud Nav areas and nav filters.

i was thinking about it. I was thinking to make the actors bCanEverAffectNavigation to false, then add nav area component which sets infinite value for all nav query filters which are set in the controller and for my big NPC I set I don't set it at all

#

were you implying that?

keen crow
# uneven cloud Pretty much that.

but aren't there any classes/methods to override like in ARecastNavMesh or UNavigationSystemV1 to ignore actors based on object collision channel and for some specific agent type? It just seems to me that approach with nav area components is like... it will work, but it doesn't seem like a clean way to do it

misty wharf
#

You would have to test the actors based on some rule of your own

#

The function mentioned in the page I linked can be used to filter them out based on any kind of check you can perform on the object

#

Whether it's a better approach than what Luthage suggested, I don't know

#

I'm using a custom recast mesh which ignores certain specific actor types in my game to create a separate navmesh which is used for certain specific types of pathfinding checks

#

And at least for that the approach works alright

stuck cape
#

While working on my back up file testing things out of no where my AI started to stutter when trying to get to me, walking on outter edges of nav mesh tiles. I gave up fixing it and went back to original file. But the AI there is also doing the stutter step, are there ANY perams that will travel between projects?

stuck cape
#

I copied the files to a new one GameNameBackUp

#

They are jittery and walking the edges between nav mesh tiles.

dense owl
#

Well if you copied bad code to a new project, it’s still gonna be there hehe

stuck cape
#

well it was working when i copied it XD

dense owl
#

Try using visual logger to see what’s happening

stuck cape
#

and for a while while i was testing things

misty wharf
#

You could always revert from source control, always an easy fix

stuck cape
#

Made another project and carried in the assets. Seems to work now, thanks for helping ❤️ Sorry so many questions. The AI has been the hardest thing so far for me. It seems to have more areas for missing up XD

polar rose
#

Uh. Dumb question, but this is my first time using Nav bounds in UE5. How do you build paths? Like... I'm using the build > build paths option in the menu, but it's not updating.

#

Just doesn't update.

#

0s to buid paths.

#

Just had to delete my recantnavmesh and now it's working fine....

dense owl
polar rose
#

I've just built paths in my UE4 projects hundreds of times and never had that happen, so I thought something had changed. Good to know though. Thanks.

arctic crag
dense owl
#

It’s prly generating under them

arctic crag
#

Yes it is. How do I get it to generate on top of those meshes as well?

dense owl
arctic crag
#

The nav bounds is high enough

dense owl
#

If that’s on, try toggling off CanEverAffectNav and if that doesn’t work I’m all out of ideas 😅

arctic crag
#

ah, they don't have collision

dense owl
#

That’ll do it

#

Makes sense given I’d expect there to be holes in the navmesh around them when can ever affect nav is on

north oriole
#

Is a nav modifier that moves with the player very expensive?

patent hornet
#

Its not ideal

north oriole
#

I want to put some kind of nav modifying cone in front of the player (mimicking the fov of the player) so i can make nav mesh more expensive there and force enemies to circumvent the player

patent hornet
#

Use EQS queries for that

#

Not navmesh

north oriole
patent hornet
#

Additional negative score for point/paths that go infront of player

north oriole
#

So i can make the enemy follow that?

patent hornet
#

It can evaluate a path

#

But generally, no

#

This way your nav is dirties every time player moves

#

It will be nav tick under stat gsme

north oriole
#

So i can't just do a moveTo but i have to constantly compute the next point of the path and make the enemy go to that?

north oriole
patent hornet
#

And every time player moves AI have to run pathing again

#

Your goal with AI is never to make a perfect system

#

Its to maximize the chance for y good outcome

#

They can sometimes go near player, but as long as thats rare, its a functuoning system

keen crow
patent hornet
#

Can you cherrypick it?

keen crow
#

we don't have an established process of applying engine patches, so cherrypicking in my case would be just copypasting pieces of code from UE5 to UE4 🙈

north oriole
patent hornet
#

I did have to make a small engine mod last time i manipulated path selection with EQS

keen crow
#

is it like a normal practice to backport features from UE5 to UE4 either manually or via git? because to me it seems like doing a surgical operation with a plastic spoon

patent hornet
#

Basically, pull the cost in engine pathfinding queries into separate virtual function

#

So i can reuse engine pathing query with my custom cost algorithm

patent hornet
#

Its not always feasible though

#

If they just extended functionality, your golden

#

If they completely refactored the system snd changed half the API, youre fucked, basically

misty wharf
drowsy raven
#

Guys, How can I disable AI's chase when the character dies?
The Unregistered Perception or Unregistered from sense did not work.

misty wharf
#

If you unregister the character when it dies, this should trigger a perception update on the AI with successfully sensed = false

#

If this for some reason doesn't work, an alternative would be to add an event dispatcher to your character class which is triggered when it dies, and have the chasing AI add a listener to it

drowsy raven
misty wharf
#

is your code checking the successfully sensed value from the stimulus struct?

drowsy raven
#

'LostTrackOfTarget' creates a function about 'ForgotAboutTarget'. So when the times out, the key is reset.

misty wharf
#

Right- not sure what's going wrong with it, but you could try using the event dispatcher approach then

drowsy raven
#

"add an event dispatcher to your character class which is triggered when it dies, and have the chasing AI add a listener to it"
I didn't quite understand this. Is there any chance you could explain a little more, please?

misty wharf
#

You'd create an event dispatcher in your character class, such as OnDied, which you would trigger from the code on the character which detects when it's dead

#

In your perception handling logic, you would cast to your character class, and add a handler for that event dispatcher

#

This way you can get a notification when the character is killed

drowsy raven
#

Okay, I'm trying. Thank you

lyric flint
#

Anyone able to advise me what the purpose of this is for and is there any point with me using it ?

#

I was looking for a find path to location like a thing that check if there is a path there

uneven cloud
lyric flint
#

I've never used it before so weren't sure if it was a good thing to use

uneven cloud
#

It's not great to use to check if there is a path, but the good function is not available to BP.

mild bobcat
#

Just starting with AI; what do I use for a crowd of enemies to keep them from crowding, i.e. detecting nearby objects?

potent loom
#

avoidance or sensing, depending on what you mean

mild bobcat
potent loom
#

might need to do everything custom then

mild bobcat
#

if I can just get lcoation of nearby enemies I think I can roll something with that

obsidian igloo
#

anyone familiar with state trees? im trying to create a looping state where the AI will find a random location, move to it, wait, and then return to the root, but it doesnt actually transition back for some reason. is there something im missing? this is UE5.3

#

they will walk to the location, wait, and then nothing after it is called even though it should return to the "Roam" root

#

so my move to task is printing hello when the AI move to succeeds, but its spamming it. and its also not finishing the task even though the FinishTask node is plugged in, so im super confused lol

dense owl
#

All this sounds like something you should maybe use a BT for instead

obsidian igloo
# dense owl All this sounds like something you should maybe use a BT for instead

these are intended to be much more complex and state trees are much less headache than BT. but I cant get past why finish task wont actually finish task. it works fine on the previous node, and ive tried remaking the node to no prevail. I hear its an issue in 5.1 and 5.2 but they said its fixed in 5.3 so either they didnt fix it or im just not understanding lol. but I feel like it should work as I cant find any logical reason why it wouldnt

dense owl
#

State trees are alot more buggy afaik

#

And BTs are pretty straightforward if you watch the one video

#

That being said idk enough about STs, maybe zomg will see your question

obsidian igloo
#

well personally im able to understand them better is what i meant. behavior trees get messy fast and ive used them previously and understand them well, I just think state trees are what i need for what I want to do. both can do the same things, but state trees are much easier to follow and manage

dense owl
#

For starters, BTs have a built-in MoveTo task so you wouldn’t need to make a whole task for it

#

It’s like 3 BT nodes and you’re done

#

Find location, decorator to check if it’s set, move to it, done

#

You don’t need to make everything a BT

#

You can simply make a small one and run it when needed

obsidian igloo
#

no i understand I use BT as my main currently and I understand them very well but it gets so messy, BT is not something I like working with. state trees are contained well and makes things easy to follow, create more complex parallel tasks and is easy to avoid logic spamming

#

the way state trees contain variables and pass them on to other states allows you to have really good control over what is happening, and you dont have to worry so much about the flow of a BT or manage a BB cuz you can jump through states to your liking with ST and simply have states inherit variables from other states

hardy skiff
#

Hey guys, I'm trying to understand how the last of us 2 did the AI play random animations in their patrol

example:
https://youtu.be/0hGdU_ngMOc?si=ebhP2ULaDBemKCMY&t=41

I tough about 2 ways:

Way 1 - my NPC character have own motion matching animations, so I can rotate his body in behavior tree in the "ai move to" task and make investigation animation only on the upper body in random locations of the patrol path

Way 2- play montage in random location on patrol path of investigation but it means the montage would not be part of his motion matching, feel like later in process it would make me some problems when I would be want to scale things

Any suggestions or other ideas how to make it right?

A deep dive guide into the behaviours and combat options for both Ellie and Abby for Humans as found in 'The Last Of Us Part 2'.


The Complete guide to AI in The Last Of Us Part 2
https://youtube.com/playlist?list=PL121RGLbnrKxR2kCrX4p3HPkZ-sk6Mvoe

Survivor+ Stealth Walkthrough Guides for The Last Of Us Part 2
https://youtube.com/playlist?l...

▶ Play video
signal olive
#

From what I've heard, doing AI outside of Unreal's built-in stuff and and pathfinding stuff beyond simple nav mesh movement is kinda scuffed with blueprints, is that right?

faint carbon
faint carbon
#

the details panel to the right is what really matters for your question, can you show that?
Also I think the wait task should just be a sibling of the preceeding task, you;re not passing data so it doesn't need to be a child.

faint carbon
dense owl
vapid night
#

I'm working on units for a colony building game, they are pretty simple and there are around 500 of them, all of them are managed by 1 subsystem that tells each one what to do and where
they are stateless and managed by a large switch statement on tick
idk if this is the way to go but I can push 1000s of those with out sacrificing visuals or performance
So anyway about that switch statement, should I switch it to a state tree? isn't it essentially the same thing but with a nice overhead and nice editor?

hot narwhal
#

Hey, Do you know if there's a way to ask the navmesh to rebuild just once at runtime. For the moment i've set the nav mesh to dynamic and it works but i really need it to rebuild just once so it's poor optimization to set it to dynamic

dense owl
#

There’s a dynamic modifiers only if you’re using nav modifiers, that can prly help you get what you want

hot narwhal
#

I can't use dynamic modifiers because i need the nav mesh to rebuild entirely

#

I'm creating my map proceduraly

#

So i need to rebuild the nav mesh once the map is created

#

And i dont need it to rebuild after the map has been generated

#

Because the map generate on multiple floors so i need the nav mesh to rebuild to take the stairs and 2nd floor

uneven cloud
dense owl
#

If it is, make sure you don’t have something moving around with can ever affect navigation turned on

shadow furnace
#

it should be possible without a custom class but if you need to stop certain things from dirtying it you might have to

deep grove
hot narwhal
dense owl
shadow furnace
#

actors and collision meshes can choose to not dirty the navmesh but many things can

#

streaming levels loading etc

ashen trail
#

Does anyone know how to show ALL navmeshes at runtime? Cvar show navigation only shows the main one

misty wharf
#

iirc there's a setting for the navmesh which enables the debug draw for it... by default only the first one has it enabled I think

ashen trail
#

Found it, thanks

#

Does anyone know how to debug Blocked when using AI Move To? I can't see what the char is being blocked by

misty wharf
#

check visual logger, otherwise you might need to look at the logic in the movement comp or character or path following comp which fires when blocked

#

forget which one had the particular logic for it but I think it was one of those three

ashen trail
#

Visual logger also just logs "Blocked" but nothing more :/

keen crow
#

does it make any sense to have LoseSightRadius less than SightRadius in AIController's PerceptionComponent? I've stumbled upon it in one project and thinking if it's that was an error or if that can actaully lead to some specific behavior? 🤔 the enemy itself seems to be "seeing" targets good overall, so I can't say like it looses sight of player inside this lose sight radius or out of it

misty wharf
#

and I'm fairly sure CMC or Character has a function that gets called when the character is blocked by something

#

because I'm pretty sure I wrote some code that makes the character open a door if it gets blocked and the blocking actor is an openable door lol

ashen trail
#

Thanks I'll check it out

neon basalt
#

Hello everyone, I am trying to use SmartObject with Behavior Tree, the scenario is:

Imagine a scenario that I am on saloon, and the customer (AI) arrives on the saloon, see what chair is free and he pick up, sitting, talk with another customer (AI) and that, after 5 minutes (I am in this moment) he will see if some Beer is available on the machine, if yes, he will stand up (he can or lost the chair or mark as occupied whatever), pick the beer and search again the chair with beer on the hand and sit. (if don't have any chair available before or after beer, he walks random on the saloon)

I was watching a tutorial from youtube and he says to Disable the "Enable Auto Blend Out" from Animation Montage that I am applying on SmartObject, because I want that AI stay sitting on the chair waiting for 5 minutes, but he is stuck on Play Montage (GameplayBehavior Class BP) and also stuck on "Move to and use smart object with gameplay behavior" (Task Tree Behavior)

And I am new on the Unreal Engine, I am learning little by little with subjects necessary to do what I want.

Someone have some suggestion to do or something wrong that I did?

ashen trail
#

Does anyone know how to do non-cube based nav mesh bounds? For example, for spline roads etc?

misty wharf
#

The navmesh bounds is a volume, volumes can be modified in various ways in the brush editing mode of the editor

vapid night
misty wharf
#

Huh?

#

I mean you can use the brush editing mode to adjust say the individual edge of the volume, or extrude one of the edges, move only one corner, etc.

vapid night
#

ya but u need multiple bounds fot stuff like that

#

ya see?

#

it will just use the bounds of the shape

#

not the actual shape

#

its pretty much always a cube

misty wharf
#

Ah interesting

#

I never tried complicated shapes with it so didn't run into this

vapid night
#

ya the shape is a lie

#

it also wont effect the get random reachable point

#

imagine learning that you need to use the stairs builder to perfectly align the mesh to stairs and stuff

#

instead of just using 1 cube for the entire scene

#

also I'm pretty sure that you suppose to use nav links for stuff like stairs

misty wharf
#

I don't see why you'd need it for stairs unless you want some kind of special behavior for navigating them

vapid night
#

ya I'm pretty sure that nav mesh doesnt work with stairs

misty wharf
#

It depends on how big the step is

vapid night
#

it just smear the poly on to them

misty wharf
#

You could effectively treat it as a curving ramp really

vapid night
#

ya

vapid night
dusty vigil
#

my AI is being stupid, if I place an instance it doesnt work properly, cant move at all, but if I copy the instance i placed originally, then it does work

uneven cloud
dusty vigil
uneven cloud
dusty vigil
uneven cloud
dusty vigil
#

well

#

I did

uneven cloud
#

And?

dusty vigil
#

the location it should move to is being set

#

and the move to node is being executed

#

although a bit oddly

#

and not properly at all

uneven cloud
#

What do you mean by that?

dusty vigil
#

its in the video

#

at around 2:40

uneven cloud
#

That is not debugging. Try using the visual logger. It will give more data on why the move to is failing.

dusty vigil
#

what now

dense owl
#

Also, right click and type vis log and find the shape debugger node for it

#

It’ll show you where your goal is on the nav mesh and where the pathfinding is trying to project

dusty vigil
#

behaviour tree

#

the find navigable location task

#

code for setting the keys up

#

code for the attacks

dusty vigil
dense owl
#

it's a bp node so it would have to be in a task

dusty vigil
#

oh gotcha

dense owl
#

VisLogBoxShape

dusty vigil
#

right

#

thats it?

#

what to put for the shape

dense owl
#

sry gave you the wrong node

acoustic valley
#

Hi all I hope your well. I have a very specific problem with the AI perception. I followed Gorkas perception turtorial. Basically my main actor has an ability where he can swap out with another Actor and I want the enemies to chase the current actor that is being controlled. The way I have it set up in my Ai controller works for a little bit but the enemies stop chasing the other actor after a while. If I switch back to the main actor the enemies start chasing again. Also if the switched out actor leaves the level and comes back the Enemies dont detect him at all. Ive provided blueprints and a GIF to better explain what I mean below. Any helps appreciated. Thanks

#

I believe this is the issue as I need the enemies to target the player controller and not the actor

dense owl
acoustic valley
#

Heres a GIF of the issue I mentioned

#

any helps appreciated

dense owl
#

I had to use EQS and the built-in perceived actors generator

acoustic valley
#

I dont believe thats the issue

#

The problem is the enemy needs to switch targets to the other actor

#

Please read through my issue. Thanks🤗

dusty vigil
dense owl
dusty vigil
#

wait

dense owl
dusty vigil
#

think i found it

#

yeah

#

let me just change some settings

#

or not

#

perhaps I could try with the gameplay debugger?

dense owl
#

try increasing the radius of the sphere

#

I had to make it 50 to show up

#

to see it, you'll need to click on the right frame in VisLog (click on each to find the right one)

dusty vigil
#

oh i see

#

alright

#

so it seems to be correct

#

the position is, like has been shown since, being set correctly

dense owl
# acoustic valley Please read through my issue. Thanks🤗

It's a good idea to not #include condescension when you ask for help. So far you've shown a screenshot of nodes with pins that are not connected at all (i.e. actor). You can't MoveTo a PlayerController afaik, maybe you need to use tags/gameplay tags and add/remove them dynamically whenever you want to switch target. You can then grab that actor pin you didn't connect to anything and check if has the right tag before proceeding.

acoustic valley
dense owl
dusty vigil
acoustic valley
dense owl
dusty vigil
#

well maybe i overincreased it

#

but anyhow

#

other than a drop in fps, no change

uneven cloud
uneven cloud
dusty vigil
#

chasing the player

#

neither work actually

#

i am pretty sure it just isnt able to move for some reaosn

dense owl
#

I saw a task in his tree that finds a location in navigable radius, so I figured he's using a location

uneven cloud
dusty vigil
#

wait wtf

#

i didnt even notice that

uneven cloud
#

When debugging, you actually have to read what it says. Not what you assume is happening.

dense owl
dusty vigil
dense owl
acoustic valley
#

Thanks, I think I found another solution. I notice in my other actor the below wasnt ticked, but since I ticked it it seems to have resolved the issue:

#

This isnt going to conflict with my main actor though is it?

dense owl
#

it prly will

acoustic valley
#

I dont get any error messages

dense owl
#

no, but your perception updated will fire inconsistently if you have multiple potential targets so you're likely to experience weird behaviour like I did

#

I wasted hours trying to figure it out before I found out about that generator from Luthage 🙏

acoustic valley
#

where did you look for the info on that? Was it on Youtube?

#

Also sorry if i offended you earlier

dense owl
#

google, youtube, tried to wrack my brain to find ways to sort the updates which was tedious af and had limited success. and np

desert lark
#

@dense owl your profile picture is so cute

dense owl
#

you can add as many tests to it as you need to. just reminder that to use gameplay tags with it you need to expose that to bp (but it's fairly easy to do)

obsidian igloo
#

is there any way to smooth an AI's rotation when they are pathing around corners or diagonal movement? not talking about the snap that the default AI does as I already have smooth rotation, but it seems when an AI is walking around a corner they like to jitter to the left and right like they cant quite walk towards the target accurately or the control rotation goes crazy. any ideas?

dense owl
#

CMC/char rotation speed settings might help

neon basalt
#

People, maybe the question is really really "I don't believe he did this question" but..... The trigger for animation or setup animation for IA it's different from Player/Normal setup?

dense owl
#

Did you mean AI? And I don’t believe it’s any different

neon basalt
#

Hummmm gotcha

#

Thanks

dense owl
#

You do have some helpful play animation nodes in BTs if that’s what you mean

neon basalt
#

Was a mistake beginner, I am learning yet

hexed flame
#

this subtree is not being set, and I can't figure out why. I tried printing the display name of every involved variable, and they're all correct...

uneven cloud
hexed flame
#

the pawn has a BT component, and it has an asset variable to replace with their own behavior
the component, I figured it's necessary per pawn so they can actually reuse the tree

#

couldn't find a definitive answer on its necessity

hexed flame
#

welp I tried setting it to the controller and it works. Gotta test with multiple actors (edit, does work with multiple actors)

subtle dome
#

Team of one so I don't have anyone to high-five 😄 https://fxtwitter.com/dgoodayle/status/1731744536299270348

It might not look like much, but this is the first successful test of my AI simulation system. Both the on-map and off-map versions.

When the AI is off-map, the are fully simulated with their movement. When they come into the same level as the player they are visually there.

▶ Play video
misty wharf
#

Ah yeah saw the tweet :)

#

I had a bit of a similar "simulation" of AI in my game but it's currently turned off because I scaled it down a little bit because of noticeable scope creep lol

#

Basically in my game you run a video rental store, and previously we had some random open world'y aspects to it where you could sleep during the day and stuff.... so of course if you sleep and the store is open, there should be some evidence of customers having visited. So when you sleep it would do a bunch of simulation to pretend like customers had visited and stuff had happened

subtle dome
#

Nice!

obtuse igloo
#

Are there any decent tutorials that demonstrate how to make an AI modular with behavior trees?

ex. Base AI uses basic melee attacks but the children of that AI use special attacks. Would I just swap the behavior tree they use, or is it too heavy to use many different trees? Should I just use an Interface? What if their attacks are ranged instead of melee, etc...

harsh storm
#

Have a generic task "Perform Attack" that just calls an attack method on the base AI

#

Let the specific class override the method to do w/e they want

obtuse igloo
#

📝👁️

#

noted! Thank u

lyric flint
#

Is there a way to build this BT such that it doesn't have little Wait nodes scattered as default fallbacks?

For example, the EQS service gets a combat position. If that succeeds, it moves into the default reposition/attack behavior. But if it fails (even the first time), I need a Wait node to re-evaluate the branch.

In my mind these are my options, but I'd love to be corrected:

  1. Keep the Wait nodes.
  2. Replace the Wait nodes with actual behavior. In this case, if you can't find a combat position do... something else.
  3. Remove the Wait nodes and enable Call Tick on Search Start.
  4. ...?
dense owl
lyric flint
#

Logically that makes sense. Aesthetically, my body rejects it.

dense owl
#

Even if you were to have other behaviour, if your AI starts instantly doing something else when a behaviour fails, it’ll prly start looking janky af 😀

#

So even when you replace it with actual behaviour you’ll prly still need a bit of wait

uneven cloud
# lyric flint Is there a way to build this BT such that it doesn't have little `Wait` nodes sc...

You have several problems with this behavior.

  1. The run EQS Service doesn't complete by the time you are requesting to move. It should be run EQS task and then move to with an update move location EQS service on the move to task. The way you have it, the NPC will move to an old location if you leave this branch and then return to it.

  2. You are only shooting while moving. What happens when the player stands still?

  3. You never unset running. This should be in a service instead of a task so it can be unset when it leaves that branch.

lyric flint
#

Brilliant, thank you! I'm going to go reconfigure it now.

#

re: #1 and updating the move location, can I use Observe Blackboard Value in the Move To task instead of a update move location EQS service?

stuck cape
#

solved 🙂

uneven cloud
lyric flint
uneven cloud
halcyon dagger
#

Is there any way to limit patrolling area? For example I have a big NavMeshBoundsVolume but I need my enemy to patrol only some fixed area of NavMeshBoundsVolume?

I use UNavigationSystemV1::K2_GetRandomLocationInNavigableRadius to find next patrolling point

halcyon dagger
#

ok, so thre is a RandomPointInBoundingBox

neon basalt
#

Hello people! I am trying to spawn a SmartObject but I am getting UE5 crashed, Someone have some tip?

#

The idea it's a barman spawn the beer SmartObject on the table to the customer get these beer and after 5minutes they destroy the beer

misty wharf
#

Hard to say. You would need to provide more info on the crash log and such

neon basalt
#

Let me see here

dense owl
#

Crash log, using debug symbols for more info

neon basalt
#

Assertion failed: OwnerController->GetPawn() [File:D:\build++UE5\Sync\Engine\Plugins\Runtime\GameplayBehaviorSmartObjects\Source\GameplayBehaviorSmartObjectsModule\Private\AI\AITask_UseGameplayBehaviorSmartObject.cpp] [Line: 311]

#

Is it like this?

misty wharf
#

If you launch from your IDE with debugging it should break where it crashes

#

At least that one sounds like the issue is that you tried to use AITask Use Gameplay Behavior Smart Object with a controller that doesn't have a pawn

neon basalt
#

With debugging you say with breakpoint on the node?

tawny flume
#

Which sight method is more expensive? I mean like the pawn sensing component or maybe a few raycasts?

misty wharf
#

You don't need a breakpoint on it if you launched from VS with the debugger enabled, it will automatically break on where it crashes

neon basalt
#

Okay, let me see here

misty wharf
#

AI perception is timesliced so it will avoid it taking an excessively large amount of time per frame

#

But you won't have that issue unless you have a fairly large amount of NPC's trying to perceive stuff

neon basalt
#

I am using blueprint

#

I don't use VS here

misty wharf
#

Ohh okay

#

Then it's probably what I said, you tried to use the AITask Use Gameplay Behavior Smart Object somewhere in your BPs, and whatever you're using it with is a controller that doesn't have a pawn

neon basalt
#

Huummm

#

I don't have any idea lol

#

Why almost doesn't have tutorial about SmartObject? 😦 sad

misty wharf
#

Are you using that node somewhere?

neon basalt
#

yes yes

#

I am

#

but I am trying to understand

misty wharf
#

Right so the node has a pin for controller on it I think?

neon basalt
#

Yes

misty wharf
#

What are you passing into that pin?

neon basalt
#

Alot of information '-', but it's an AI I think.

misty wharf
#

Right

neon basalt
#

It's running by Behavior Tree

misty wharf
#

If you add an is valid node before the use gameplay behavior node, and use it to check controller->get pawn, will it still crash or no?

neon basalt
#

let me see

#

Still crash, one thing that I realized is, the actor that have smartobject (The chair) that already in the world and exit while Gameplay Behavior, don't crash.

But if I spawn while simulating the world and exit while gameplay behavior, it crash

misty wharf
#

which version of UE are you on?

neon basalt
#

5.3

misty wharf
#

hmm

#

hard to say why it would crash like that then, you would need to debug it on the C++ level I think

neon basalt
#

oh boy hahaha

#

it's strange because it works normal, but If I close while the function that some AI is using the actor that have smartobject, it crash

misty wharf
#

Oh so it only crashes if you exit PIE during the execution?

neon basalt
#

I don't understand why the plugin SmartObject it's not popular for tutorial on the internet

misty wharf
#

Ah okay... could be that the pawn gets destroyed and the smart object ai task isn't handling it correctly or something like that I guess

#

the system is pretty new and kinda complicated which might be why there's not much info on it out there

neon basalt
#

maybe if I convert the pawn as variable, and set on the blackboard?

#

and then on the function, get the pawn?

misty wharf
#

Hard to say, if it happens only on PIE exit, then I don't think doing that would help assuming my guess about why it crashes is correct

neon basalt
#

understand

misty wharf
#

Basically all actors are destroyed at the exit, and it sounds like there's a check for it somewhere that isn't taking this into account correctly

neon basalt
#

Yes

#

it's strange because this only happens when it's spawned while PIE

#

if already exist, and I exit, don't crash

#

crazy

misty wharf
#

Yeah there's probably some kind of situation where things are cleared in a certain order due to some internal workings of the engine and if it's spawned in the level it happens to happen in a slightly different order and it doesn't crash

neon basalt
#

gotcha

#

Well, I am begginer as well so

#

maybe something I am not doing correct also haha

#

But, thanks for the help! @misty wharf

misty wharf
#

Unless you're doing something really weird I don't think it should be causing a crash lol

neon basalt
#

Hahahahaha

#

Yeah yeah, I don't think I am doing something weird

#

hahaha

tawny flume
misty wharf
#

You'll want to be sure to set up either the detection by affiliation thing or turn off auto register pawns as sources

#

You probably don't want them all perceiving each other because with that number it would definitely start having a perf impact - might still be ok if they only detect player

tawny flume
misty wharf
#

Well depends on how many of them are going to be doing that at the same time

#

But with perception sight, the system will linetrace to every single perceivable actor within the perception radius

#

so if you have 300 pawns, this means 300 * 300 linetraces

#

assuming they were all within their sight radius at the same time

#

at that point you might need to find some way of optimizing it for example by increasing the time between sight traces - but I don't really know why they would need to see each other tbh

stuck cape
#

How bad practice is it to attach collision boxes to weapons sockets of an ai and 'enable collision' during an attack only for hit detection? XD

worldly warren
#

Does anyone know the best way that I can go about having a zombie AI crawl through a window?

Am I able to use Nav Link Proxy to accomplish this or is that only for having the AI jump far distances to reach the player?

Or can I do this by making an actor with the window as mesh and then using ref boxes on either side of the window. (I'm also running into an issue of the logic for running the shortest path to the player while taking the window distance into account.) Then when the AI reaches the trigger box it plays an anim montage that shows the zombie crawling through and then landing on the ref box on the other side.

Does this sound right? Does anybody have any resources for this kind of thing? I'm currently watching a Matt Aspland video on having an AI interect with a door and I'm going to try and use parts of this to make a window like how I explained.

languid agate
# worldly warren Does anyone know the best way that I can go about having a zombie AI crawl throu...

That is how I would do it. I would look up vaulting tutorials and then just apply the same logic to your AI when they enter the window box. In regard to the shortest path just check distance to windows as well as the player. If the distance to the player is longer than the distance to the nearest viable window they should use the window.

I would set some method of defining which building the player is in for this so they don't just hop into a random window thats closer than the player. You could do that with an integer and colliders for each building. So your first building collider sets player building interger to 0 the next building collider sets player building interger to 1 etc. and then tie all the windows in that building to the relevant building interger using an array or something.

Then the zombie checks if the player is further than the window, if it is true it checks if the nearest window is part of the players occupied building by checking the player building integer if it is true it goes through. If the nearest window is not a part of the player occupied building it will ignore it and continue to the player.

languid agate
worldly warren
mild pawn
uneven cloud
neon basalt
uneven cloud
uneven cloud
neon basalt
#

Do you remember what version was it?

uneven cloud
#

I haven't looked at it since they added them in 5.0. I had to build my own system, because it didn't work in the way that I needed it.

neon basalt
#

I know that some functions changed 5.1 to 5.2 and to 5.3

#

so I don't know, sadly the documentation is not updated

uneven cloud
#

Unfortunately, you need to go look at the code most of the time.

neon basalt
#

but, thanks for the tip

worldly warren
# uneven cloud I would do it with a nav link proxy and not collision boxes. Your zombie needs ...

Sorry if this is a dumb question I know literally nothing about nav link proxy and need to do some research this weekend, but can I swap out the jump animation for a crawling one? This would be the best way imo that way the collsion doesn't get weird when using reference points and an anim montage, that way I can still shoot the zombie the entire time its climbing through the window. Also this way the navigation logic is already built in and I dont need to write as bulky logic to specify where the ai needs to navigate to, it can just path to the nav proxy link instead of checking boolean building relations.

neon basalt
#

maybe to spawn is not working and to destroy is working

uneven cloud
uneven cloud
neon basalt
inland umbra
#

Is it me or bDoFullyAsyncNavDataGathering is broken inside the ARecastNavMesh, it's fine in the editor window, but as soon as I start playing in standalone, many chunks of the level miss the navmesh...

dense owl
tawny sage
#

Hey all. So I'm using my blackboard to navigate my units. And I have a jump ability that launches my character to a specified location. But my AI is being extremely dumb and doesn't realize it's extremly close to the location and decides to go back to its OG pathway. Is there a way to refresh the AI's pathfinding?

Here's a video kek

uneven cloud
uneven cloud
dense owl
#

Ah mb

mild bobcat
#

What's the domain of an AI controller versus the pawn itself? Confused about what logic lives where

halcyon dagger
#

can you say what is the difference between:

GetRandomPointInNavigableRadius
GetRandomReachablePointInRadius
K2_GetRandomLocationInNavigableRadius
K2_GetRandomReachablePointInRadius

all of them gives us random point/location

misty wharf
#

Did you read the comments on them?

#

I'm fairly sure they have an explanation. The difference is in navigable vs reachable. Navigable point is not necessarily reachable (eg. it could be a point on the navmesh which cannot be reached due to obstacles)

#

Functions with K2 prefix are generally intended for blueprint usage, not sure why they would have duplicates of these two with K2 prefixes - could be they do something slightly different. Best way to find out is to simply open the function and look at it.

dire fable
#

Probably a dumb question, but I can't find an interesting answer on the Internet. How do you get an AI to run parallel tasks? The BT "Simple Parallel" node doesn't solve the following problem: I have a boss that executes consecutive actions. But at any moment, if the player gets too close to the boss, the boss executes a Gameplay Ability in parallel with what he's doing (he doesn't interrupt his current attack). 🤔

misty wharf
#

If the goal is to make it so the BT runs this ability in parallel, then you would probably want to use a service

#

You can put the service in your BT in some branch where you want it to be possible for it to activate, then the service can choose when it's the appropriate time to do so

dire fable
dire fable
#

Is this the original purpose of the services?

misty wharf
#

I don't know about "original", but it is one way you can use them

pallid mica
#

Does anyone know if there is a setting for the height diff between 2 path points of a NavMesh Path?

#

I have a slope that has NavMesh built, and it's quite steep. It works for the NavMesh generation, but Paths along that Slope cause the AIs to hover in mind air, cause I think the "slope" of a path is not allowed to be that steep?

#

Sideview - Floor is Black - NavMesh is Green - Path between 2 points is Orange

#

The angle of the slope is not as steep in the actual level. Paint image is mainly for reference

dim gull
#

maximum walkable slope maybe in the CMC

#

though I guess that wouldn't affect the nav mesh would it

pallid mica
#

Idk maybe it's pulled when doing the query from the agent

#

The NavMesh generates fine

#

It's just the path that is too low

#

Also, there is no CMC here

#

These are #mass agents actually

#

Maybe it counts as step height?

pallid mica
#

Na, step height doesn't matter. Moved it to 500 units, still the same

dim gull
#

the mass agents don't use the CMC at all, but still use the navmesh? hmm

#

I'm learning

#

hmm

pallid mica
#

NavMesh is not tied to CMC

#

Mass Agents can just query a path and then be coded to walk from point to point

dull harbor
#

does anyone know how to make an ai moveto me but like 2 metres away isntead of right next to me?

harsh storm
#

Set the acceptance radius to 200

dull harbor
#

also heres a little picture

tawny flume
dull harbor
#

thats why im asking here

harsh storm
#

Use the visual logger to see what is happening

#

Because that is the purpose of that value

inner zephyr
#

I got some SmartObjects in my world and AI is choosing one randomly. The SOs are sometimes separated by a door, which can be locked by AI or the player. I got a very bad implementation where the door BP will check if the claimed SO is assigned to it (I put an Actor Tag on the SO and check on the door if it is the same) and if the door is locked and the AI wants to enter the claimed SO will be freed. But there has to be a better way. Anyone that had a flash and knows how to gracefully handle it?

#

I think I had one myself right now. Maybe someone with some experience with them can confirm. I had one actor with one SO-component and one slot, so one room had multiple actors with SO-components but I think I could just place one actor and multiple slots in each room. When the door gets locked I can somehow exclude the SO-actor from that one room from the search

uneven cloud
uneven cloud
uneven cloud
inner zephyr
uneven cloud
inner zephyr
#

I have one on it because I think it wouldn't be able to find a path otherwise (to the door).
Thinking about it, if I disable the nav-link, how would the AI inside be able to leave?

#

I'll go and play with it a little more. If anyone gets a flash ping me

uneven cloud
tawny sage
#

This is the function that changes the blackboard value.

#

And this is the Behavior tree using the blackboard

#

And these arre the details on the node.

uneven cloud
tawny sage
#

It's an input that fires the "Apply Ability" after it caches the location under the cursor

#

Does the trajectory calculation.

#

Is there a way to Force update the AI controller to rethink its path after I launch its ass?

#

"Stop Movement" node doesn't seem to do anything :C

uneven cloud
tawny sage
#

Ok that makes it more understandable.

sudden citrus
#

Is StateTree's ContextActor supposed to be filled with the Pawn (when running as brain component)? I'm getting a nullptr there within tasks for some reason, and don't see an obvious code path where it gets filled. Context Actor class is selected in the schema

tawny sage
#

That did it! So what I did is I actually utilized the On Launched and On Landed events to clear and then set the blackboard values on landed location, and voilah!

sudden citrus
mild bobcat
late pivot
#

Hey everyone, I have a question maybe y'all can help with.

*Ive currently got a grid based tactical game that spawns AI actors as attachments to each unit actor that requires AI

*The flow path is... the Unit actor (theres lots of these) waits its turn (float in seconds) and then calls an event that another blueprint sees (the combat system, which there is only one of) which tells the corresponding AI actor to use A-star pathfinding to decide where it should move on the grid (the grid is also its own blueprint)

*The issue is, once I reach about ~40 unit actors with attached AI doing this the game slows down.

My question is im sure theres a more performant way I can approach this, im pretty new to game development so im sure theres some way I could improve this. Let me know your thoughts!

P.S. I tried working this through with Behavior trees in unreal but because the grid is int index based and I cant blackboard those values it wasnt working out.

uneven cloud
late pivot
#

Great questions, I was building off someone elses work for the first one, and when I searched through what was available to store for BB it will accept location data, or an int, but not the int index data type the grid values are stored in.

uneven cloud
#

What is in the int index that is not an int?

late pivot
#

nothing? maybe... its a set of ints like (0 , 1) to denote what grid square its on and as I was attempting to make it a blackboard key it wasnt having it. As I mentioned im not well versed in any of this but I was able to set keys with a single int, a location vector, but not the grid int index

lyric flint
#

Can you not just set IndexX and IndexY separately?

lyric flint
#

@uneven cloud I've updated the BT from before. If you (or anyone!) has any more advice on how to improve it or best practices, I'd really appreciate it. The comments from the other day were incredibly helpful.

raven pawn
#

Hi all, I'm trying to work on navigation for a basic ai. How can i make the ai navigate around an object placed during runtime? I allow the player to build a wall, but the ai just runs into it instead of trying to get around it. The wall actor has can ever affect navigation set to true:

raven pawn
feral stream
#

Assuming I need to use Decorators, but not sure the correct approach

obtuse igloo
#

Hi guys! I'm making a zombie-like game where there's generic ai that chase the player when seen but also want special ai that do different things based on conditions and have different perceptions. (Ex. zombie that explodes near player, baby zombies that attach to the player and deal damage while attached, or zombies attracted to light or sound, etc.)

Would it be better performance wise to do this with multiple different behavior trees and ai controllers for the special zombies? Is it better to work with less varying ai controllers or less varying behavior trees?
The AI currently use one shared character blueprint with a data asset variable for what kind of zombie, overridable attack function, and a behavior tree variable that the ai controller grabs

misty wharf
#

@obtuse igloo There's no right answer to this question. It depends entirely on how everything is structured. I think you approach with this sounds reasonable as it allows reuse and you can easily specialize via the data asset. I would suggest using Unreal Insights to profile, it will show BT performance details also, so if it looks like a big hit you can look for things to optimize

obtuse igloo
agile widget
#

Hi guys, I have a bit of an issue with a Blackboard key right now, I have created the Key to be a object type for my target, and I'm trying to assign it to my Default Focus or to a Rotate to face BB Entry, but when I expand the blackboard key selector, it's only allowing me to select the SelfActor, any ideas of what might be the issue?

misty wharf
#

Your BB key is not set to actor

#

Object keys are by default just plain UObjects, expand the key from the little arrow icon next to it, it will allow you to specify the subclass. If you select actor (or another actor subclass), it should allow you to choose it in the nodes

agile widget
#

Thank you @misty wharf that was exactly the issue, I had forgotten all about that

misty wharf
#

Yeah easy to miss it

agile widget
#

Is there anyway to see why my EQS is not setting a target on my BT?

#

it seems to be executing correctly but the Target actor is never Set

misty wharf
#

Visual Logger should have details on EQS query results, maybe check that

agile widget
#

how do I look at the Visual logger? I do have a test pawn for EQS but first time I have heard of the vissual logger

misty wharf
#

It's in one of the menus, maybe it was in Tools under Debug or something like that

#

Open it, click on the record button, then play your game so that the EQS query would trigger, and it should show you a bunch of stuff

agile widget
#

so base on the logger (which is really awesome) It did find a winner for the EQS

#

but I don't see the Target getting assigned

#

maybe I'm missing something on the BT Task?

#

or should I make my own custom BT_task has I have done before

misty wharf
#

Seems it should work. Check the settings on the run EQS node

#

If you have it on all results mode instead of the individual result options that would cause it to not set it I'd imagine, but not sure why else

agile widget
#

Yeah I have it has single best item

#

but still no dice

misty wharf
#

Are you sure that's the problem?

#

You are using a selector node on the second branch which would cause only the first child node to ever execute

agile widget
#

ok, so the issue is that I have the selector with the Is not set decorator, I should simply set the decorator on the execute EQS and point it directly to the first selector?

misty wharf
#

No I mean on the second one where you do rotate to face target etc.

#

That one is a selector, so if rotate to face target succeeds, none of the following nodes will execute

agile widget
#

Ok, I changed it to a Sequence

#

So I updated it to this

#

but it's still not populating the target:

misty wharf
#

If it's red like that it seems to suggest the EQS didn't succeed, that should show up in the visual logger also for the behavior tree logging part

agile widget
#

it shows but I don't see anything indicating that it failed

#

plus has you can see in the screenshot before, you can see who the winner is for the EQS execution

misty wharf
#

I mean it should have a separate logging category in visual logger for the behavior tree where it mentions which node is being executed and the execution results etc.

agile widget
#

I can't seem to find that window

#

but o well no problem, I will just build my own BT_Task for this and use that instead of the standar, since I can't seem to make it work

#

Still thanks for all the ideas and help @misty wharf

misty wharf
#

alright hope it works better, this looks like it should be working so not quite sure why it isn't doing so

zealous maple
#

Hello! How do I change the height for an AI to look for the nav-mesh. I have these flying enemies and my nav-mesh box is covering them, but when I place them at a certain height they still don't move. 😦 Any that can help me what I'm doing wrong?

agile widget
#

@misty wharf I found the issue from before, I wont be needing my custom BTTask, the EQS wanted to give the value has a Vector and not a Actor, so once I changed the type from Object(Actor) to Vector in the Blackcoard, it started working has needed

misty wharf
#

Ooh, yeah that would do it

#

Didn't even think of it - that might be the cause it looked like the EQS node was failing

agile widget
#

yeah I had to build the custom and then I tested all the GetItemAs functions to see what the real issue was

sudden citrus
#

What's the point of StateTree linked subtrees if I could just group everything under a common parent?

#

I must be missing something

obtuse igloo
#

Anyone know why my AI are still attacking my Player with the State.Dead tag even though its being told not to attack them if they have the tag? Do I have to make my own custom decorator separate from the one the engine already gives us to make it abort?

misty wharf
#

@obtuse igloo does the actor implement IGameplayTagAssetInterface?

#

the builtin gameplay tag related bits generally require that for them to work correctly

misty wharf
#

Okay not sure in that case 🤔

obtuse igloo
smoky zodiac
#

Heyo I started UE5 a few days ago and got a question regarding AI movement. I created an enemy AI that moves around and chases the player. It works fine on default shapes (cubes,planes) but the enemy wont move on landscape, what am I missing? Thanks in advance 🙏

uneven cloud
late pivot
obtuse igloo
uneven cloud
uneven cloud
late pivot
#

Im most likely doing just that Luthage. I guess the question im trying to ask is generally speaking, do you have any tips or design choices that have dramatically improved performance in projects youve worked on?

obtuse igloo
uneven cloud
shy zealot
#

So I followed the Behavior Tree Quick Start and my Enemy AI just stands there. I don't know where to put the "Player" tag because that image doesn't load, so I'm lost there.

covert fable
#

Howdy all, just wondering if anyone could have any input to a concept i have:

So, its AI Hide and seek - as im just attempting to understand AI more its less player involvement.
We got a Hider - who will stay in a location unless panicked (IE Sees a Seeker) than it will find a random place and go there and try to loose the Seeker.
We got a Seeker - Who will go around looking for the Hider, unaware of the Hider's position at first and upon seeing them will give chase.

I know i could make a simple AI move about randomly using a custom Task or random navigable location, with a Boolean like "ifSeeTarget" that'll activate either a chase or runaway EQS and than the Move To in the Behaviour tree, so i thought to try and make it a tad bit more complicated but maybe doable for my current skill level.

I want to try and make it that there are "rooms", that are defined as hiding spots and searching spots for the AI, at first i thought it could be a Collison box that simply is in the middle of a room and the radius around it is the search / hide radius, but than in my research i heard of smart objects and wasnt too sure which one would be good to pursue for this concept.

But i hope that's enough information to atleast share the intention of what i want.
Any input on it would be helpful, or avenues to look at to figure it out on my own - just unsure what to focus on instead of possibly wasting time on stuff that wont do any help for my intention.

uneven cloud
covert fable
uneven cloud
covert fable
feral stream
#

What would be the easiest way to have an AI that is chasing a player, move to cut the player off instead of moving toward the player? I'm guessing you need to use the velocity/direction of the target player to calculate an intersect point and move toward that? Curious if anyone has done this or has any helpful videos. Vector math is not my strongpoint 😄

harsh storm
#

It's literally that though really.

#

Just do Target->GetActorLocation + Target->GetVelocity() * predictionTime; and move towards the resulting vector

#

(Assuming Target is valid btw)

shy zealot
#

Any help with my problem?

#

I don't get this at all.

uneven cloud
shy zealot
#

My AI Pawn won't move and I followed Epic's tutorial.

#

But right now, I'm gonna take a break. I'm not in a good mood.

feral stream
#

I have had AI working without a problem for quite some time now. Randomly today they just stopped moving. All other nodes execute correctly except the moveto. This is across multiple behavior trees which lead me to think it was a navmesh problem, but I have rebuilt the navmesh multiple times and the issue did not clear up. I didn't change anything I can think of to account for why my AI wont move. Any ideas?

misty wharf
#

check visual logger

#

it usually shows more info on why navigation fails

subtle shoal
#

Wondering, is there a way in Standard UE for a decorator / selector node to know how many children are in it’s direct flow path? I want to give random chances for sub nodes to run

dense owl
signal island
#

is anyone using state trees?

dense owl
#

Don’t ask these questions, just present your issue and someone will help if they’re around and able to

signal island
#

just want to know how is it going. is it buggy?

dense owl
#

From what I’ve heard, it still has some kinks but it’s generally pretty stable

signal island
#

does it perfom better over bts?

#

i really like that you can send and receive events

dense owl
#

I believe most issues stem from having debug tools that are less good than BT ones for example, so it takes a while to troubleshoot

dense owl
signal island
subtle shoal
willow talon
#

How can I modify the pathfinding system so it chooses a path slightly differently depending on circumstances?
For example I have a melee enemy that needs to attack a ranged character. I want the enemy to try and avoid line of fire as much as possible, so he'll need to walk behind cover to get closer
How do I do something like this? I know about EQS, but is there a way to modify pathfinding with it?

misty wharf
#

Modifying pathfinding for that would be kind of tricky I suspect

#

You could use EQS to calculate points towards the target that are away from the line of fire, and use them more as waypoints or something like that

visual sluice
#

can you have an ai perception detect objects that doesnt have the auto register as source on? Because the register thing is causing me to crash so is there any other way around it? A tutorial?

#

because it seems every tutorial ever that relies on perceptions needs it turned on

#

because im trying to do is if my ai see an object it goes to it

misty wharf
#

Sure. You can add a stimulus source component to anything and it will register it as a source

#

Or you can register it manually with the perception system at any point during gameplay

#

If it crashes it would probably be good to debug why it crashes, because it shouldn't.

bronze grail
#

hey i am pretty new to really trying out AI for my projects but i now have a project that is the same as call of duty zombies max 32 zombies spawned per round and i have very simple AI that just goes to the player no matter where on the level i have 32 max spawn per round and my performance is terrible i have enabled update rate optimizations which does help a fair amount for my fps but the fps is still really bad

misty wharf
#

At least based on that it looks like the CMC is taking a big chunk of the time

#

But you should probably use Unreal Insights to profile and find out better

bronze grail
misty wharf
#

Tick Time looks pretty high and that might be separate from the CMC ticking so you might have some expensive blueprint ticks

bronze grail
misty wharf
#

Insights might tell you more so you don't have to randomly turn off stuff

bronze grail
#

i did make a multithreading plugin but it does NOT like using multithreading with trying to get the characters location i end up craching which is pretty obvious why

#

well thanks a lot i will try to familiarize myself more with unreal insights 🙂

misty wharf
#

This is probably the basic things you need to know about it :)

bronze grail
misty wharf
#

It should work in the editor just fine

#

It is worth noting PIE does generally run a lot worse than standalone, but at least the game bits should give some ideas on what you can optimize

bronze grail
misty wharf
#

that button starts a profiling trace

#

and the trace menu next to it can be used to open them

bronze grail
#

apparently this little part of code was causing a lot of issues all this code does is if there is zombies spawning inside each other it will make them have no collision to each other until they leave the collision

misty wharf
#

Yeah depends on how many are being spawned at the same time it could run that a lot I suppose

bronze grail
#

it was correct though removed it and went from 22ms on game thread to 16-18ms

#

lol apparently the collision was causing 1.3s added RIP

misty wharf
#

I would have expected it to stabilize after the spawning had finished but I guess if the Box component is big enough it could keep triggering overlaps on a lot

bronze grail
misty wharf
#

Something I'm doing in one of my projects is the spawn point has a box of its own which is used to detect when the spawn point becomes free

bronze grail
#

not sure which is better for performance but i use line trace to check how close a zombie is which i will be changing at another point but i did use a box collision but it kept making mistakes

misty wharf
#

traces aren't too bad as long as you're not doing too many

#

overlaps are ok I think, but yeah you need to configure the overlap settings correctly to ensure only the ones that you want will overlap and the logic works correctly

bronze grail
#

any way to filter it by my zombie ai and not myself i don't know which this part is saying it is for but it is draining the game thread

#

my character isn't really using animations it is using IK for everything but not sure if unreal clases it as a animation still

misty wharf
#

if it's a skeletal mesh using anim bp probably

#

but most likely if you have just one player, it isn't going to have a significant impact on the total

#

since it sounded like you have like 30 other skeletal characters around

bronze grail
#

i want to put my multithreading blueprint node to some use see if that helps i tried it on my first AI setup which was running on event tick RIP but i am new to multithreading and me being me put the multithreading on event tick for the code that gets the players location and yeah it crashed but now i just use the behavior tree

#

kind of surprised me my pc didn't crash when using multithreading on event tick lol

misty wharf
#

Unless you're doing some expensive computations I'm not sure if you'd gain much benefit from using multithreading

bronze grail
#

i did look up AI agents the ones with people showing off huge AI battles but that's in c++ which is a shame

#

it seems the AI's character movement component is causing most of the performance issues i set the tick rate of it to be every 3 seconds and the game thread went to 12ms and 70-80fps

#

should i just turn off things in the movement component i don't need or?

misty wharf
#

Yeah turn off everything you're not using

#

Physics interaction iirc is one at least which will run a bunch of extra checks

#

Changing walking mode from Walking to NavMesh walking can also be a lot cheaper but you may have to check for any jank in movement as it can affect it

bronze grail
#

oh that's where nav mesh walking was

visual sluice
misty wharf
#

Then your code is probably doing something wrong

#

If you look at the stack trace you can find out what's going wrong to give you some ideas

shy zealot
#

Ok, I'm trying the tutorial again, but when I look at my blackboard variables, it says that the Patrol Location is invalid.

shy zealot
#

Ok, I got the patrol to work, but the AI never chases the player.

shy zealot
#

What all does an AI need to "see" the player? I looked at other tutorials and help threads and according to one, the tutorial on Epic's website is broken.

misty wharf
#

The AI perception system is usually used for that

shy zealot
#

Ok, how do I use it?

misty wharf
#

I'm sure there's plenty of tutorials for it if you google for AI perception

#

unreal ai perception component, unreal ai perception system, something like that

shy zealot
#

Ok, the tutorial I was following did cover that a bit. Searching lead to documentation on the debugging of perception, and using it, I figured out that the AI can see me, but it never chases me.

misty wharf
#

Okay so you checked that you get the perception event correctly or what did you do?

shy zealot
#

I did this.

misty wharf
#

Okay, at least it looks like it's doing something. You would need to check your BP logic that sets the blackboard key then to see why it isn't being set

shy zealot
#

Figured it out. The variables weren't updating the keys because it didn't know the key names. Whoops.

uneven cloud
#

There is nothing to "turn on".

#

Are you using UE4 (world composition) or UE5 (world partition)?

#

UE4 is a lot trickier. I don't know if any guides that actually give the right steps, but I can type them out in about an hour.

worldly shard
#

Using state trees, is there a way to write to variables, so far I can read/bind but having no luck writing back to them.

pine steeple
#

@unborn jungle couldn't get it to work reliably

misty wharf
worldly shard
misty wharf
#

Are you using BP or C++

uneven cloud
#

The steps are weird, but trust them. I've shipped a couple of a games in UE4 streaming static nav meshes.

  1. Turn off auto generate navigation in the editor settings. This will break things if it's turned on.

  2. Make sure there is a nav mesh bounds volume in the persistent level. It doesn't even need to cover anything on the map. It just needs to exist or it won't build properly.

  3. You can put bounds volumes in the sublevels marking the areas where you want navigation.

  4. Load all your sublevels.

  5. Delete all recast actors. If there is one in a sublevel, it will not work.

  6. Make your persistent level to be the current level.

  7. Build paths. And save. You can unload the sublevels and save again.

  8. You should now have a recast nav mesh in the persistent level. This is not the nav data. That it automatically saved in the sublevels. The nav data will now be loaded when you load the sublevel.

  9. You can make a commandlet that builds your navigation when you change the map. I have a build server that does this anytime a map is checked in, but they can also be run locally.

#

Nope. You need to load them all into the persistent level. It will not work to build paths in a specific sublevel. The Recast nav mesh actor is not the nav mesh. It's an actor holds all of the nav mesh chunk data.

#

The nav mesh actor can ONLY exist in the persistent level or it will break.

#

No. The navigation chunk data will be saved to the sublevel. When the level is loaded, the recast actor stitches the chunk data (stored in the sub level) together.

#

Yes, it goes through all sublevels that are loaded and builds the navigation data.

#

I don't know how to explain in a way that you understand. You will SEE one nav mesh building on all the loaded sublevels, but that's not where the DATA actually lives.

#

You see it, because all the nav data is loaded. It's not a workaround. This was Epic's own workflow. They improved it a lot in 5.

feral stream
#

EQS question (created a query grid to find spawn points. It’s returning locations correctly which is great. Next part is I wanted to do a distance score where it’s calculating distance from the grid point to a specified actor. How can I accomplish this? I don’t see anyway to pass a variable into EQS or something so that I can set the actor it’s calculating distance to.

#

I know how to add a distance test, just not how to pass in an actor to calculate distance to.

misty wharf
#

You typically would do this via an EQS Context

#

The context can pull the actor from somewhere, such as a variable on the querier actor

feral stream
#

Perfect!

#

Thanks

uneven cloud
#

There are not overlapping nav meshes. When the nav data is stitched together it's 1 nav mesh. I don't understand why this concept is confusing.

It's like a quilt that is made out of squares stitched together. When the sublevel is unloaded, the square is removed.

#

That is why it doesn't work. You really shouldn't do that, but if you are convinced that's how it should work the trade off is you can only use dynamic generation. Not sure why you thought static nav mesh would work.

uneven cloud
#

Most games that are small levels that are loaded in and out are built as separate maps. Not sublevels.

stuck oar
#

Anyone have any ideas on why the "MoveTo" task in behavior trees doesn't work with vectors? I was stuck on this until I switched it to an object

stuck oar
dense owl
#

You prly just didn’t set the bb key properly

mild bobcat
#

There is another basic movement component, the floating pawn movement component

#

but still pretty basic

#

You can use Add Movement Input

visual sluice
#

Okay how does one reference an actor in an ai task for it to move to, like i see ppl say use blackboards but still confusing because you have to reference the object. Ive seen ryan make his video on ai but it still confusing me because its towards the player and not a random object. Also i dont like using the get all things because it will effect fps.

misty wharf
#

The get actor of class node is entirely fine to use if you understand its limtiations. It isn't going to affect FPS unless you call it on tick many times.

visual sluice
misty wharf
#

Right - so you would need to decide how the npc would find nearby objects to consider

#

For example you could search all beds by distance, do a sphere overlap test for beds, or use smart objects, etc.

visual sluice
#

Like im trying to find other ways to references because its bugging me mentally

misty wharf
#

The ones I mentioned are probably the typical ways to go about it

visual sluice
misty wharf
#

Searching all beds by distance is pretty fast unless you have a lot of them, a sphere overlap can be reasonably quick as well. The Smart Object system does some internal optimizations to find smart objects by location and things like that