#gameplay-ai

1 messages · Page 44 of 1

misty wharf
#

Sure if it works for you then it's okay

olive prism
#

Thanks you

dense owl
#

Idk tbh, haven’t tried it. What did your tests show?

north oriole
dense owl
#

The main tree should prly only be run once tho (other than when you use stop logic)

north oriole
dense owl
north oriole
paper flower
#

Should calling MovetoActor() on the AIController rebuild/recalc the path to the actor (especially if the actor we already being moved to, from a previous call to MoveToActor(). or is there another way to do this?

uneven cloud
#

Forcing a BT into acting like a state machine is really not recommended. You lose the benefits of a BT by doing that.

uneven cloud
paper flower
#

yeah, I saw it do that in the code, but then the 'new path' (I'm rendering all the points on path), came back exactly the same, even though its obstructed.

#

looking into perception system now, guess that may be a better approach anyways.

uneven cloud
paper flower
#

!! right, I there is setting on actors 'affects navigation' forgot about that!, digging into that now 🙂

#

nope, that was not it, they are configured to affect navigation (its the blue cubes atm in the ThirdPerson template), it does in fact initially route around them on the first path, but when I push them into the path, it never re-reroutes.

#

well, now I'm not sure, I see if I turn on the navmesh ,during sim, and move the blue cubes, the nav mesh does not adjust, even though the blue cubes have the 'can effect navigation set'

misty wharf
#

Is your navmesh set to dynamic?

paper flower
#

dynamic, is this a setting on the NavMeshBoundsVolume?

dense owl
#

No it’s in project settings

#

If changing geometry doesn’t affect the mesh at runtime it’s either not set to dynamic or you’re missing collisions/can ever affect navigation is turned off for said meshes

paper flower
#

ahh, ok I found the setting, and that did indeed make difference. I guess..my question is, typically is this enabled? (my world is static), but there will be other actors moving around, hence an actor may block a path, and the actor needs to 're-route' around another actor...I woudl think the 'can effect navigation' would be all that is needed in my case.

misty wharf
#

can affect navigation = will it be considered by nav mesh generation at all

#

if it's not enabled, it's as if it doesn't exist at all as far as navmesh generation is concerned

paper flower
#

ok, so..it seems like using NavMesh to go around dynamic obstables is not the solution, I suspect regenering the NavMesh each time an actor blocks a path/los on target would be too expensive in my scenario.

misty wharf
#

Yeah not really sure what is the go to method for that sorta stuff - how expensive it is depends on how often it happens at least in this situation

paper flower
#

I think crowdDetour AI is more inline with what I need, but that is mostly designed for actors that are deisgned to turn in place, which will for some of my stuff, but not for vehicle type actors, at least not with out modification

plush basalt
#

Hey guys, I'm trying to use the SmartObjects to create some eating zones around the map but the subsystem cannot find any of them, this is my blueprint code. Can anyone help me a bit, please? I followed the tutorial from the UE5 page to set them up (except the part where the map should be based on the ThirdPerson Template, it's based on the FirstPerson Template

olive prism
harsh storm
#

BT's aren't supposed to be stateful

#

They're priority selectors

#

Behaviors with the highest priority go on the far left in Unreal

#

And you gate the behaviors based on conditions

#

IE - can we see the player? do we have enough ammo? etc...

misty wharf
#

As much as people say "not stateful" usually the structure is very stateful lol

#

can we see the player definitely sounds like a state to me

uneven cloud
paper flower
#

yeah, working on the detour logic now.

uneven cloud
#

BTs are "stateful" but that doesn't mean acting like a state machine.

uneven cloud
misty wharf
#

If they didn't want BTs to be stateful they should have thought about it when they made it impossible to run ST's and BT's at the same time without massive amounts of work lol

#

Anyway yeah I mean I get the point, I just think they do work for states, you just gotta keep in mind it might not be the ideal way to use them

#

(which could certainly mean that if you do understand how it works you can build the states in a more BT-compatible fashion into the BT itself)

harsh storm
uneven cloud
#

The problem isn't being stateful. It's trying to force the BT into acting like a state machine. Tasks in the BT are stateful, but the structure is not a state machine. If you want a state machine, just make one or use the ST.

I highly doubt not being able to use the BT and ST at the same time has anything to do with being stateful. Likely assumed most people would pick one or the other.

olive prism
uneven cloud
uneven cloud
plush basalt
#

and i have more AI actors than SO slots and the majority was resolving to none found since all of them were already claimed

rain stream
#

I want my ai to either push the player to the side when the player stands in the way for pathfinding, or make the ai pathfind around the player. How should i go about those things?

#

I think i found out how to push with add impulse. But how would i pathfind around player if i want to do that?

dense owl
rain stream
#

What is RVO?

uneven cloud
#

RVO (reciprocal velocity obstacle) avoidance uses forces to push characters while they are moving to avoid each other. Detour works by updating the path to do the avoidance.

winter hare
#

Hey, is there a way to get AI to move across a body of water? basically trying to make an AI ship, but cant find much on it

unreal briar
#

Does someone knows what happened to the Brain Component logic?
It seems that the StopLogic function (in the c++ files) is empty 🤔
Now there's no way to stop the logic in the behavior tree

misty wharf
#

Are you looking at BrainComponent or BehaviorTreeComponent?

#

The stop logic function in BrainComponent is probably empty since it doesn't do anything I don't think. You would need to look at BehaviorTreeComponent because it extends brain

unreal briar
#

Well it used to work, maybe they changed it in the last UE version.
The BehaviorTreeComponent doesn't have any trigger function, is there a way to trigger it?

misty wharf
#

There should be a RunBehaviorTree function or something lik ethat

unreal briar
#

Oh, So you need to use the static function RunBehaviorTree and the BehaviorTreeComponent is just to control that specified BT ?
It's not that your running the BT from the component, because that function doesn't exists.

misty wharf
#

You can probably just use start logic on the component also

#

although the run behavior tree function does do some setup for the bb and such

#

in any case, stop logic should stop the BT

unreal briar
#

Yea that's what I thought, but the StartLogic does what it says, just starting the logic. But it won't run the tree from his root.
You can test that and see that only the RubBehaviorTree has the C++ function Trigger which start the logic from root.

dense owl
#

Use run behavior tree not start logic

unreal briar
#

Yep, after that I cant get the BrainComponent and cast it to the BehaviorTreeComponent.
Thanks guys!

safe vale
#

is there a way to draw a sphere when using report noise event to debug hearing zone?

misty wharf
#

you can use draw debug sphere to draw one manually

paper flower
#

What influencing factors do we have on a basic ai when it comes to generating path points? what I'm looking atm, is I have 2 pawns next to each other, and they are both headed towards the same point. (they both have a direct line), Agent Radius is 35, the pawns are over 160 apart. The very first points generated force each agent away from each at a hard angle, really those points should not even be there, I don't understand why the path points would be here, as they both have direct line to the target. If I turn on Draw Triangle Edges I do see that points line tend to line up the intersections of the triangles...do those represent the only nav points that the ai can use for path plotting?

paper flower
#

I tried adjusting the cellSize from 19 to 18, nothing works after that, setting back to 19 it works again, maybe I'm adjusting the size incorrecly?

cinder nymph
#

Hey all, haven't posted in here before but I was wondering if anyone had any resources on AI that can fly / move up walls, similar to enemies from games like Deep Rock Galactic? Currently looking into enemies with spider-like movement and is procedurally animated. I'm just not quite sure where to start on something like this in terms of how it pathfinds since it wouldn't really use a navmesh (or maybe it does? not sure). something like the enemies in this video here: https://www.youtube.com/watch?v=iNXzOuc9UWo

wise sluice
wise sluice
cinder nymph
# wise sluice <@144929080159109120> For the 3D navigation, i got this resource <http://www.ga...

thanks for the info! ill look into that github plugin. at the studio i used to work at there was a plugin we used called Mercuna (https://mercuna.com/) that allowed for flying AI and 3d pathfinding, but it's rather pricey for a personal project

wise sluice
cinder nymph
wise sluice
cinder nymph
#

ah nice, yeah this one is much more affordable. I might pick it up for my prototype 😎

misty wharf
#

You could get away with some simple custom ones too depending on how smart you need it to be

celest python
#

They're very cheeky and slow

#

their ai solutions are great though, almost everything is out of the box, from simplest things to very specific and complex systems

#

but then the price is insane 😄

wise sluice
#

Thanks for the details 😌

hushed dirge
#

Is there anyone in this thread who can help me with this situation? I am getting this error: "PIE: Error: Blueprint Runtime Error: "Attempted to access AIC_Enemy_Base_C_1 via property AIC Enemy Base, but AIC_Enemy_Base_C_1 is not valid (pending kill or garbage)". Node: Set State as Attacking Graph: EventGraph Function: Execute Ubergraph BP Enemy Base Blueprint: BP_Enemy_Base"

I have an enemy melee AI that uses an enum to determine the state in the behavior tree. I have it set for him to flag "interruptable" as false when he does an attack animation montage and, upon completion, back to true. At the end of the animation montage of hit response i, I use a function on the AI Controller to set the state back to attacking using the last known target.

dense owl
uneven cloud
hexed flame
#

I'm using AI perception for my enemies. They work perfectly, however, on a shipped build they won't detect the player at all...
Their behavior trees are working - they still patrol etc. They just won't detect the player, which was the duty of the AI Perception's sight sense.

patent verge
#

Heya folks, this is more of a generalized or I guess theoretical question about behavior trees: is it possible to have too much of a bloated behavior tree for an entity?

On the side in my free time, I've been working on a cartoony sandbox game that's almost like Slime Rancher + The Hunter. Player can upgrade their gear and hunt the wildlife, lure different species into pens instead, sell goods, etc. I'm up to the point now where it's time to start working on the AI and behaviors of the various wildlife creatures and I was going to approach it through blueprints, but a buddy of mine said that the best way to handle that is through behavior trees and blackboarding.

I've looked into it and it seems fairly straight forward, but my main issue is I'm worried about bloating a behavior tree with a million things the pawn has to work through to figure out what to do. Not expecting perfection, but the pawn would have to keep track of variables like hunger, thirst, sleep, etc. and act accordingly. Including edge case scenarios like what happens if the pawn is sleeping but is also thirsty. Or very specific situations like the pawn detected other pawns of its species and joining the pack.

So is it possible to bloat a behavior tree with all these different situations the pawn's brain would have to constantly navigate? Still new to the subject so the performance aspect of behavior trees is just something I'm a tad worried about

uneven cloud
uneven cloud
hexed flame
#

it works in standalone too. Just shipped/packaged that it stops

patent verge
uneven cloud
hexed flame
# uneven cloud Does it fail in standalone? Often things that work in PIE don't work in standal...

I can't really test it out without knowing anything;

  • in the IDE, it works. Get within their sight radius and they switch to attack mode, get away, they go to alert then back to patrol.
  • in standalone, it works as well. Can check prints traces etc. Same behavior
  • when packaged, regardless of it being a shipping, development or debug build, they can't see the player anymore. They perform their patrol routines as usual.
edgy solar
#

Hi, must we always clear memory nodes when aborting or finishing a Task/Decorator/Service?

#

or is it fine if we don't

bitter wyvern
dense owl
#

I am also curious as to what that is

misty wharf
#

C++ based BT nodes have a node memory thing but I've never really looked at it enough to say whether it needs resetting or not

celest python
#

Its a plain old type struct that is suppose to hold your variables instead of letting UBTTaskNode keep them

#

since UObject spawning has noticeable amount of overhead you put them into memory struct

#

this spawn spawning overhead reduced to allocating a raw struct

celest python
#

though its been around 1 year since I touched BT

uneven cloud
hexed flame
#

Nope but I inferred; everything else about the pawn (terrain line traces, overlap collisions, behavior trees) works. How could I test? Only trying to print stuff when the pawn is detected comes to mind. Does pressing ' + numpad work in the development build?

bitter wyvern
uneven cloud
fathom sun
#

Hello, I'm making an EQS which gathers all the actors around the AI, and navigates towards a random one that is at least 2000 units away from the character. I wonder how I can make so that the actors inside the 2000 units would be in the list, but with a lower score, which should be the same for every item inside the radius. In other words, I want all actors outside the 2000 units have constant score, like 1, and all the actors inside the 2000 units to have a lower value, like 0.5,

Does anyone know how I can combine the two behaviors? So far I've been using one distance test with a "minimum" filter type with a value of 2000 so that everything inside that radius would be discarded.

dusky lodge
#

Is there some stat or other info that lists Actors that are causing Dynamic Navmesh to be rebuilt?

unborn jungle
dusky lodge
#

Yeah I am familiar with that, but its not a feasable approach.

uneven cloud
uneven cloud
upper compass
uneven cloud
upper compass
edgy solar
edgy solar
fathom sun
# uneven cloud You would need to make your own test, which is only available in C++.

How would I make one like that?

I've looked into EnvQueryTest_Distance, still I can't find out how to give arbitrary score values. As I understand, there's FEnvQueryInstance::ItemIterator::SetScore() that takes query data, and computes the score using them, i.e. it doesn't allow you to tell the score manually. For instance, I can't do something like

SetScore(Distance > MinThresholdValue ? 1.f : 0.5f);
sand kettle
#

Hello! I have this sequence that I use for interacting with heard objects. First, character walks to the heard noise location. Then StartSoundInteraction checks if there is an interactable at that position, and if that interactable tag matches the heard sound tag. It then runs a dynamic subtree associated with that interactable, which executes a pre interact reaction (eg. act surprised when finding coin). After the reaction is done, I interact with that object (pick it up in this case).

  1. I want to move the interact nodes (last 3) in a sub BT. But it seems that dynamic subtrees do not get injected unless they are run from the same BT. I am getting this warning: BTTask_RunBehaviorDynamic node ("Run Behavior Dynamic") executed with no BehaviorAsset
  2. Is using dynamic subtrees a good way to do this kind of thing?
misty wharf
#

Check that your subtree is using the same blackboard asset

#

It must be the same as the BT's that runs it

sand kettle
#

It is the same

uneven cloud
uneven cloud
sand kettle
#

Inside StartSoundInteract task

#

First screenshot works fine while this doesn't

misty wharf
#

I do something similar in my game so it should work. I have a task which sets a subtree, and then after that task, the run node. Have you verified the gameplay tag matches correctly?

sand kettle
misty wharf
#

Have you checked visual logger? It has more BT debug info

sand kettle
#

what should I look for in vs log?

misty wharf
#

Not visual studio, visual logger

sand kettle
#

vis log*

misty wharf
#

It should have logs for each BT node execution

#

So look for when it executes the run behavior dynamic node and see if it says anything about its status

sand kettle
#

Idk man... I tried setting a breakpoint inside UBehaviorTreeComponent::SetDynamicSubtree and SetDynamicSubtreeHelper. It searches all nodes from the instance stack for a RunDynamic task and then injects the subtree if it has the matching tag... But the BT_Interact subtree is not even on the instance stack at the point of calling it

#

And it doesn't actually take RunBehavior nodes into account. It doesn't also recursively step into its asset to check for dynamic nodes

misty wharf
#

Ohhh you have them nested

#

Or at least tha guy does?

sand kettle
#

yeah

misty wharf
#

Yeah never tried with main tree -> sub tree -> run dynamic subtree

#

main tree -> run dynamic is what works ok for me

sand kettle
#

yeah that works for me as well

misty wharf
#

Fwiw, I'm using smart objects in addition to subtrees in my case - it sounds like your thing is kinda like smart objects also

#

the smart object in my case is using a gameplay behavior smart object definition, so it runs a gameplay behavior on the actor to do the actual SO behaviors instead of a behavior tree

sand kettle
#

yeah, i've looked into them a little bit

#

they seem to handle really simimlar things to what im doing

#

but dont wanna commit to learning them right now since I just want to play really simple reactions and it seems kinda overkill\

misty wharf
#

I kinda wanted to use the BT's in the smart object but I ran into a bunch of issues with it so I couldn't

#

I think what happened was that it would just fully swap my existing BT to the BT for the SO, and then afterwards it'd swap back to my BT but start from scratch which would obviously completely mess up the actual behavior flow

#

You could potentially consider using a "lite Smart Object" type solution maybe? Eg. instead of the fullblown SO system, create a custom one where you could define the logic and run that from the BT

#

At least it would avoid the issue of nesting BT's

sand kettle
#

Do smart object inject subtree or they run everything in one task?

#

So in my case, I would inject the reaction into the interact task?

misty wharf
#

They have two kinds of smart object types by default iirc, behavior tree based and gameplay behavior based

#

the BT ones have the aforementioned issue, but the gameplay behavior ones don't... the GB can just be a regular blueprint, so you'd just define your logic with regular blueprint nodes

#

when the GB finishes the BT continues as normal

sand kettle
#

Hmm I guess thats prob what im gonna end up doing

#

(2nd option)

misty wharf
#

Yeah the SO+GB works pretty well for me at least, but it does have a bit of an initial setup/learning curve due to the SO system's complexities

#

So if you don't think you need all of it, you could pretty easily roll your own "gameplay behavior" of sorts as just a custom blueprint that can be executed to do the logic

steel karma
#

Sorry to interrupt, but I could do with some help with Blackboard Key Selectors. I'm following the UE5 Behavior Tree Quickstart guide, and I've promoted a PatrolLocation variable as in the diagram, but for some reason it doesn't know to use the PatrolLocation entry in the blackboard. I put a breakpoint on UBTFunctionLibrary::SetBlackboardValueAsVector to see what's happening and it's got "SelfActor" instead as the Key.SelectedKeyName, which isn't even a Vector.

Any idea what I'm missing here? Does it just try to match the variable name to the blackboard key name? Why could it get completely the wrong name and type?

misty wharf
#

It doesn't work like that

#

The name of the key selector is entirely irrelevant and you can call them anything you want

#

You need to mark the variable as instance editable, which makes it visible in the BT editor. Then, in the BT editor, select the node, and you should get a dropdown where you can choose from your BB keys

steel karma
#

Wow, that is entirely missing from the guide. But it's good to know - I didn't think it would really just match based on name, but couldn't find any way to make the match explicit.

#

Next question - what do you mean "visible in the BT editor"? This is a variable inside a Task implemented in Blueprint, but I don't see where I would edit it

misty wharf
#

If you click the BT node look in the details panel

#

Instance editable variables should show up in there

steel karma
#

Ah, right. I see it.
It's kind of amazing they don't document this at all.

misty wharf
#

Yeah that's a bit of a weird omission from the guide

#

I definitely don't recall it ever working in that it would automatically match the name

steel karma
#

No, I didn't think it did, and my memory from having used BTs years ago in UE4 told me that there was somewhere I needed to assign it specifically, but I couldn't remember and I thought following the guide would work

#

Thank you, I think it all works now

bitter dock
#

Why does my recastnavmesh settings keep getting reverted? We have tiny characters that can fit in smaller spaces than the default allows but it seems like every time I open the engine the navmesh volume resets the area to default. Even if I save and output the change to source control.

Using world partition

#

before and after.

misty wharf
#

Did you change the settings in project settings, or in the navmesh settings in the level?

bitter dock
#

This was auto generated in the level with the navmeshvolume

misty wharf
#

Yeah so where did you modify the settings? Project settings or in that actor's settings?

#

Project settings governs the overall generation settings, so that's where you should be modifying them. The actor that's in the level gets its settings from there when it gets generated

bitter dock
#

I figured the recast actor acted as an override. I'll try in project settings, didn't know it was there. first time doing AI. Thanks!

fathom wadi
#

hey guys, trying to learn AI and struggling quite a bit. This is a test environment I made to remove any contextual issues with my actual project, so the names are a bit of a rush job. Regardless, i have 3 pawns, default straight from the "Create Blueprint Class" for pawn, in a singleplayer blank project. They have the following code, which would hopefully move them around a little on the navmesh. The console is printing "True", and currentdestination is updating as expected. However, the agents don't move! We also have a NavmeshBoundsVolume, as you can see painting the previewed navmesh in the last screenshot. any thoughts?

#

wanderdistance is about 1000, the delay is about 10 seconds long

#

those are both working, so it seems to be that "AI MoveTo" doesnt seem to know how to actually move the pawn

#

<@&213101288538374145> scam ^

#

sorry for @, not sure how to deal with that

harsh storm
#

Exactly like that

fathom wadi
#

yaaaay :3

harsh storm
#

Don't apologize for pinging them. That's what they're here for

fathom wadi
#

then this is a nicer discord server than some

#

who would ban me just for waking the dragon

harsh storm
#

Sounds like you don't want to be in that server anyway

harsh storm
uneven cloud
potent iris
#

we also have this which also notifies the mods PartyBlue

fathom wadi
harsh storm
#

Pawns don't have one by default, no

fathom wadi
#

how do i add a movement component? nothing's coming up

#

floating pawn movement?

harsh storm
#

Sure

fathom wadi
#

hm, i added one, still not working

#

what else do i need to do to make it compatible?

bitter dock
harsh storm
fathom wadi
#

annoyingly, nothing useful seems to be coming out of it

dense owl
fathom wadi
#

it's printing true, yeah

dense owl
#

Ok

#

You have to click on the frames until you find the one with the right info. Often times you’ll see it highlighted in red if something went wrong

fathom wadi
#

fair enough

#

what i'm trying to do is so simple and basic, though. anything i've done is something i feel everyone would've done

#

it's baby steps

dense owl
#

It is yeah

#

But you can’t guess at what could possibly be wrong, it’s too complex a system

fathom wadi
#

there's a template that uses AI, "Top Down" so i'm gonna analyse that one

uneven cloud
fathom wadi
#

thanks for trying, all!

dense owl
fathom wadi
uneven cloud
fathom wadi
#

that's not my point

#

debugging is always good yes but i don't understand how there aren't more tutorials or documentation to get the most basic aspect of AI navigation set up

steel karma
#

Just a warning - that AI MoveTo node is not very reliable when used in a normal Blueprint. The MoveTo node inside a Behavior Tree is more reliable.

bitter dock
# uneven cloud All you need to do is add a supported agent and make that the size that you want...

Looks like I added it in successfully. I have the logic setup to get the characters to walk already. On beginplay, I call AImove and set their enum state to walking. NPC stops on an overlap to look at the player, and resumes move ai on end overlap after a short delay. But after the recast went back to default even putting back in the same settings the npcs dont want to move out of their corridors. It looks connected to me, wdyt?

dense owl
steel karma
steel karma
# dense owl AI with blueprints on the learning portal and the 4th pinned link video here are...

And, to be fair, in my experience the navigation does pretty much just work out of the box if you drop a Character in, like the Basic Navigation tutorial suggests. If you have a bare Pawn then you need to add the MovementComponent and I think that Just Works as well. Basically the Navigation requires a PathFollowing component, which I think gets added automatically if it doesn't already exist, and that then moves via the Movement component

dense owl
bitter dock
#

its something to do with the navmesh bc the logic for everything was working but at specific , currently unsure and not yet replicatable, the ai realizes it can walk along it or not. no other changes were made aside from adding in this new agent and allowing for the height to pass in

uneven cloud
uneven cloud
bitter dock
#

The bear is 80uu btw i set the navmesh to allow for heights of 20 which had worked previously

bitter dock
#

It was part of an earlier test bc the default radius didnt fit in the corridors. It worked at zero before, does it need a little bit of padding?

steel karma
bitter dock
#

this message also comes up, new to the partition system. When I search for how to do this I just see docs about the compiler script. Is there somewhere i can access this in editor?

uneven cloud
bitter dock
#

they are big enough tho?

#

its primary capsule is not touching the top of it or anything. the larger one is just a overlap trace for looking at the player

uneven cloud
bitter dock
#

Just looks for assigned targetpoint which I have checked , the bears are assigned to one in each level. On its way to the path it runs into an overlap volume that teleports them back to their original hallway. They go in a loop

#

Runs on BeginPlay and re-triggers when called to resume movement after an overlap (endoverlap)

#

the logic for it to stop is currently not plugged in, for testing so its definitely not being called to stop right away. its state is set to walk

#

test targetpoint which is assigned

uneven cloud
#

Have you tried using the visual logger to see what path it's finding? Or any errors it might be logging?

bitter dock
#

First ive heard of that willlook into it

steel karma
#

I think the path shows up in the gameplay debugger output as well, if I remember correctly

bitter dock
#

Documentation for visual logger redirects to Unreal Insights which doesn't seem relevant 🤔

harsh storm
#

Visual logger docs don't exist in the 5.x urls, so just use the 4.26/4.27 ones. They're still relevant.

bitter dock
bitter dock
#

i also have a bunch of these, which cant be deleted

bitter dock
#

bruh I don't get it. I literally go to revert what I just changed in source control and start over and did the exact same steps and it works foxotiAngry

#

but heres all that was changed was the radius and updating the recast.

#

now its just a matter of it retaining these changes bc every time I opened the engine up previously it just ignored it, which is why I would think setting this default and adding new agents going forward will make the changes apply

#

yep. after merging changes into my work branch it just reverts the defaults. I don't get it I'm literally telling it to choose what I just did. It's definitely not in gitignore

#

i think it has something to do with worldpartition and these unloaded nev meshes

uneven cloud
#

Yeah. Sometimes you need to delete the recast nav mesh, because something weird has gone wrong. I believe you can delete them if you load the cells they are in.

bitter dock
#

Luckily with it being parititioned per folder although I couldn't locate them in engine I just deleted the uassets pointing to it and it seems to help. Still testing but it seems to have the settings be more permanent now

wanton compass
#

Hi there. Quick question - I'm struggling with having my AI walk to a location that's far away from player. I use World Partition and dynamic navmesh.
In my BT I have a simple MoveTo node, and I supply the target location vector to my blackboard, now here's the issue:

  • When I follow the ACharacter, it walks thrugh the world just fine.
  • When I leave it be, to cover the path on its own, it fails to find a full path to target. It only gets partway through and can't seem to pathfind any further (Observed in ediotr with the F8 freecam mode. The tree exits the task, and treats it as completed. The task is immediately dropped if I un-check "allow partial path". The navmesh is still displayed further along the path, at least if the show Navmesh debug is to be belived, it's just that the AI refuses to use it)

Could you please help me figure out, what kind of settings might prevent my Navmesh agents from finding proper full paths if the player is far away from the goal?

EDIT: Upon closer inspection it seems to me, that the pathfinding is reaching an early stop, due to the non-linear nature of my path to target. (Targets that start closer to target seem to do better.) Are there any parameters that I could bump, to prevent Unreal from aborting the pathfinding too early?

steel karma
uneven cloud
lyric flint
#

I have a Blackboard variable called Location which is a vector representing where the AI is moving towards. I want to run some logic in the behaviour tree that is essentially: if Distance(CurrentLocation, Location) > 500.0 then MoveTo. Is there a way to encode this in decorators so that I don't need to create another Blackboard variable to store CurrentDistance as a float?

hexed flame
#

You can create custom decorators, and I believe you don't need one? I'm sure there might be settings in moveto or in the pawn/ai where you can change the acceptable distance of moveto

rancid wing
#

anyone know a good way to deal with killing ai through behavior trees?

uneven cloud
rancid wing
#

Nvrmind fixed it

#

I worded it badly, I meant having a condition to have the ai not do anything when killed

uneven cloud
#

You really should turn off logic when the NPC dies

terse panther
static flint
#

How to derive from UBlackboardData? Its too tedious to copy my common variables over and over again

uneven cloud
uneven cloud
static flint
uneven cloud
static flint
#

Yeah I got it

#

Thanks anyway

terse panther
rancid wing
uneven cloud
terse panther
# uneven cloud Is at location

oh got it...
if we set the Acceptable Radius of the Decorator to 500 or anything it is working ...
its something i didn't know about and till now i was creating custom blackboard ...
thank you for this ...

rancid wing
uneven cloud
uneven cloud
rancid wing
#

Ok thank you!

dense owl
naive flower
#

Has the node "Run Behavior Tree" been reworked in any way? Inside my character controller, it does not show up unless I untick Context Sensitivity. And when I add it to my AI controller it complains.

misty wharf
#

I don't think so

#

Sounds like something's funky about your BP's to me 🤔 What is it complaining about?

naive flower
misty wharf
#

What is the parent class of this blueprint?

naive flower
misty wharf
#

player controllers aren't AI controllers

#

that function works only on AI controllers

#

BTs kinda require it to be an AIC

naive flower
#

I actually am mad at myself.....🤣 🤦‍♂️

terse panther
#

is there a way for navmesh to consider the Height of the capsule when pathfinding ?
as of now only the radius of the capsule is considered but not the height .

karmic canopy
#

Why Blendspace not working when using MoveTo node in behaviour tree??
Character is an ant btw

uneven cloud
karmic canopy
#

I am using Velocity, to get the speed and is it > 1 when is moving

#

@uneven cloud

uneven cloud
karmic canopy
#

No, just to get the speed

uneven cloud
#

What are you using to transition to the walking state? How do you have your anim BP set up? Is the pawn moving, but not animating?

karmic canopy
#

it is moving as intended, but the 1D blendspace idle/walk does work when I am 'MoveTo' node in BT, I have turn animations that works fine.

#

Also the walk/run animations when plugged directly to output doesn't work

uneven cloud
#

Sounds like an animation problem that #animation can help with.

karmic canopy
#

alright, I'll ask there

unborn sphinx
#

I was in here a few months back when I was workin on my NPC logic and it was tremendously helpful. Would anyone want to/be willing to playtest the project and provide feedback on the NPC behaviour? It's a learning project, not any commercial project. It's free on itch.🙏

lyric flint
#

Got a wierd thing happening. Even though the distance won't be within the 150 for some reason it still gets in and runs that code

#

anyone got idea why that would happen. Like there can see target but distance to and I've see it so unless both of them are true well it can't go in that

#

but it still seems to

#

so I've sorted it by well removing the can see target

merry flint
#

Hi i just want to ask if there is any way /or tutorial on how to do proper avoidance for my units:

lyric flint
#

nope not sorted it it's like when can see target is on that sequence it bypasses the other decorator

uneven cloud
uneven cloud
hexed flame
#

Auto Possess AI is also set to "placed in world and spawned"

#

nevermind everything, this was all it took to fix it. Changing it to "on possessed" though

lyric flint
#

Also I've verified the distance thing. It's when the can see target is there as well it seems to like ignore distance one and Purley got my can see target which is wierd

oblique basin
#

Also it looks like your blackboard key is a float value. Shouldn't this be your player? How are you telling the decorator which object it should be evaluating distance from?

lyric flint
#

That takes in the target and gives out float

#

Which decorator checks against

oblique basin
#

With the information I have, I'm not sure why you need a service node. You'd use ai perception to register when the player comes into view, set a variable, then have a branch activated by IsPlayerSet, then have a sequence. The first task would get distance, the next would be a selector with two tasks under it. Each task would have the same decorator node that checks if the player is in range, with one inverted.

cunning vault
#

Is there something like batched AI systems on detour and such ? I see there is a max agents number, shouldn't be there something like a max agents on move per batch movement ? so can handle bigger numbers spliting the logics ?
Is there some entry point to check this ?

stark oyster
#

what node will stop an AI moving even during the middle of an AIMoveTo call?

stark oyster
vague flame
stark oyster
uneven cloud
# lyric flint I don't get what you mean sorry

The visual logger is a debugging tool. It is highly recommended to use for AI.

Using a blackboard for distance and setting it via a service is really unnecessary. There's a built-in decorator called Is at location that takes in an acceptance radius that is a better distance check.

lyric flint
#

the distance thing I've put in specifically does a check between enemy and player

uneven cloud
lyric flint
uneven cloud
stark oyster
edgy solar
#

does anyone knows why if I set team ID to FGenericTeamId::NoTeam the perception system won't detect the actor?

#

Although I have configured it not to detect friendlies but only to detect hostiles, it still detects both friendlies, hostiles and neutrals.

#
Sight->DetectionByAffiliation.bDetectFriendlies = false;
Sight->DetectionByAffiliation.bDetectEnemies = true;
Sight->DetectionByAffiliation.bDetectNeutrals = false; 
lyric flint
#

I'm so confused

#

I've changed my grab thing on behavior tree so it's using bool and I have a service before the decorator else where effectivly doing the check and setting the Blackboard key accordingly

#

some how though even though the value is false so is not a pass it's still seeing it's a pass

#

any ideas here cause I'm not on this one

#

I'm trying to use the visual debugger thing but never used it before so not finding it easiest to understand

#

thats mu graph

#

the visual logger

stark oyster
#

AI move to node is failing and I dont know why, what are some reasons why it could fail?

#

This AI MoveTo node is running but is failing
I don't get it...

this code is running on spawned AI character, is there additional setup required other than just spawning them?

uneven cloud
uneven cloud
edgy solar
oblique basin
# edgy solar I haven't figured it out yet if anyone can help
Epic Developer Community Forums

I’m trying to implement AI Perception in C++ and I got to the point I always get stuck with and do workaround, the teams or affiliation (friendly, neutral, enemy). How do I assign different teams to different controllers? I know this was asked before, but I can’t really understand how to do it, and some stuff is outdated. The AI Controller alrea...

#

I don't remember if I used this thread to get it working but you basically need to define attitudes (friendly, neutral, hostile) to the generic IDs set in the controller classes.

edgy solar
#

and for testing I'm checking it like this

#
ETeamAttitude::Type TeamAttitude = OtherActorTeam->GetTeamAttitudeTowards(*Actor);

switch (TeamAttitude)
{
case ETeamAttitude::Friendly:
    UE_LOG(LogTemp, Warning, TEXT("Friendly"));
    break;

case ETeamAttitude::Neutral:
    UE_LOG(LogTemp, Warning, TEXT("Neutral"));
break;

case ETeamAttitude::Hostile:
    UE_LOG(LogTemp, Warning, TEXT("Hostile"));
    break;
default:
    break;
}
#

I set

#
Sight->DetectionByAffiliation.bDetectFriendlies = false;
Sight->DetectionByAffiliation.bDetectEnemies = true;
Sight->DetectionByAffiliation.bDetectNeutrals = false; 
#

but Sight->DetectionByAffiliation.ShouldDetectAll(); returns true

lyric flint
#

Cause that's what I did before and I understood it I was still doing it wrong

lyric flint
edgy solar
misty wharf
#

it depends on your implementation of GetTeamAttitudeTowards

edgy solar
misty wharf
#

Yeah I think that's the case since the implementation for the sense assumes it's on the controller or something along those lines

oblique basin
#

And also repurposed the generic interface for hostile/friendly identification beyond the perception system, for traces and overlap events.

edgy solar
#

I don't have it on my player control only on AIController and BaseCharater, and I assume if I need it to have more functionality I'd inherit from it and and extend it then implement my custom IGenericTeamAgentInterface on controllers only

edgy solar
oblique basin
edgy solar
lyric flint
#

So I looked on Google on documentation for services and I can't see where I'm using it wrongly

#

So still none wiser as the why the decorator is looking at the bool see its false but still allowing passage through the sequence

misty wharf
#

If you click the decorator what does the details panel show

#

It's a bit weird it says "IsWithinGrabRange is"... is what?

lyric flint
#

I have a service slight higher which sets the is within range bool like the blackboard key

misty wharf
#

Yes I mean the thing that's weird is that it says "is".. not "is set" or "is not set" or whatever

#

which is what it should say

#

and that's why I wonder if there's some problem with how it's been configured and wanted to see the details panel

lyric flint
#

The decorator looks at the key and only let's it so stuff under it if is within range is set

lyric flint
#

Abort self

#

And is set

#

Blackboard key is within range

misty wharf
#

Yeah it looks correct other than that so I'm not sure why it would let it pass into the node if it was correctly set up otherwise

lyric flint
#

From earlier

misty wharf
#

So once you get back, maybe try just redoing the decorator and make sure it says "Blackboard: IsWithinGrabRange is set"

#

because I'm 99% sure the blackboard decorator should show that kind of message on the node when it checks if the value is true

#

which it doesn't seem to be doing in your screenshot

#

Also if it still behaves seemingly wrong after that, try using the BT debugger to verify the variable value. If you pause the BT, it should allow you to step backwards to the point where it would run the decorator, and you should be able to see the current BB values

lyric flint
#

Never knew there was one

misty wharf
#

Just use the pause icon in the BT editor when you are playing

uneven cloud
# lyric flint So what my service needs to be on same node as my decorator ?

That isn't even remotely close to what I said. Your service is not going to tick before it checks the decorator. There is a check box to tick it on search start that you need to use.

The visual logger will help you to debug it. It's a timeline tool that will show you the flow of the BT. You can also add your own logging by using the vis log nodes. If you Google visual logger, you will find the documentation and a bunch of videos that goes over it.

Such as: https://youtu.be/FiJTBUNJMQk?si=xohVihexGVvyM2nk

What is the Visual Logger in Unreal Engine 4

Source Files: https://github.com/MWadstein/UnrealEngineProjects/tree/WTF-Examples
Note: You will need to be logged into your Epic approved GitHub account to access these examples files. https://github.com/EpicGames/Signup

▶ Play video
lyric flint
#

so

#

I've looked at my code

#

This is the service and the points where it's running, it's says player in range false

#

This is what the blackboard Decorator is looking for to allow the stuff under it's sequence to be ran

#

That is the BT setup, Distance to Target service ran whilst combat branch is being done and the decorator on the grab target sequencewith the details above

#

still for some reason the BT or something is ignoring that decorator and still allowing it self throw

#

if anyone can help at all that would be awsome cause I'm confused what could be causing the issue here

misty wharf
#

Put a print into BTT_GrabTarget which prints the value of IsWithinGrabRange

#

The first thing we really need to do is to establish for 100% certain that the decorator is letting it through with the wrong value

#

If it prints false in BTT_GrabTarget, then we've at least established that

lyric flint
#

it only shows it's hitting once

#

So just after I press Play and it shows the value being false

#

for iswithinrange

misty wharf
#

can you show the bp for how you printed it out

lyric flint
#

An then just where you have the last two on the BTS one of the is false which is correct and the black blue showing true which is correct as I walked up to the bot to test something else I've been having issues with

#

Thats the BTT GrabTarget

#

would be printing each time that task is ran

#

And thats the BTS

#

so where I'm doing my distance calculation and spitting out the bool to the blackboard

misty wharf
#

So it sounds like it is actually passing the decorator with false as the value 🤔

misty wharf
#

Try deleting the decorator and recreate it

lyric flint
#

will do

#

what should I set the aborts to ?

#

on the decorator

misty wharf
#

Shouldn't make any difference for the actual bool check

lyric flint
#

so

#

it's not doing the grab anymore like it's going to the patrolling stuff which is right cause I'm not in range of grab

misty wharf
#

Let me guess it no longer says "IsWithinGrabRange is" in the node's description and instead it says "is set" ? :P

lyric flint
#

oh sorry I didn't check

#

named same just with not spaces

misty wharf
#

Oh I meant here

lyric flint
#

arrr your right

misty wharf
#

Yeah, guess the decorator was somehow screwed up

lyric flint
#

thats wierd in terms of why it would say is

lyric flint
#

so when I'm in range of the enemy it seems to bug out and the bot walks off and it's bit touch and go if he'll actually grab, what abort would I need to use there to like just abort what ever it's doing ?

#

just thinking obvs common sense would say your in range of it to grab so it would rather then bugged and it walks off and gets wierd

misty wharf
#

Maybe abort lower priority would work better since it would prevent it from aborting this branch once it's entered even if the value was to change

lyric flint
#

so just checking here

#

how would I determine if I should have it just abort lower or both so obvs self and lower ?

#

would I do both say if it's something where I done want it to either do or not do it's own task as well as others ?

misty wharf
#

Yeah it just depends on how you need it to behave

#

If you want it to abort itself when the decorator's result changes, then you'd use the self options

#

But as said when that is appropriate depends on how you want it to work

lyric flint
#

fairs just be trial and error I guess as I build more into it's behaviors

fathom sun
#

Hello, does anyone happen to know why the MoveTo node might make the AI walk towards the target sideways?

For instance, if the AI character is walking towards the player position (not the actor itself), it might be walking sideways instead of facing the velocity vector. However, when the player stops, the AI character turns perfectly towards the velocity. This does not happen when I use the actor as a target instead of a vector

oblique basin
#

If not this, then it may be some settings in the class default or movement comp such as Use Controller Rotation Yaw or orient rotation to movement.

fathom sun
oblique basin
#

Get print outs of your yaw and make sure that it is the root that's rotating strangely

fathom sun
# oblique basin Get print outs of your yaw and make sure that it is the root that's rotating str...

The only yaw that matters here is of the control rotation. It pretty much prints the same thing it shows on the scene. Anytime the AI is walking sideways, the yaw doesn't change, unless the player doesn't stop. btw one thing I forgot to mention is that the AI has the sight sense, and if the player leaves the FOV, the AI will rotate just enough to get them into the FOV once again. Here's what it looks like

oblique basin
#

Video isn't playing my end

uneven cloud
fathom sun
#

It's 720

uneven cloud
#

Do you have allow strafe turned on?

fathom sun
#

Nope

#

Just to mention again, it doesn't happen if I use an actor instead of a vector in the MoveTo node, however I need to use vectors

uneven cloud
#

I would use the visual logger to debug what is going on.

oblique basin
#

If you switch off the FoV rotation offset, do you get the same behaviour?

dry ore
#

for some reason my character Ai just wont move its stuck in this one phase

#


#include "BTTask_FindRandomLocation.h"
#include "NavigationSystem.h"
#include "NPC_AIController.h"
#include "BehaviorTree/BlackboardComponent.h"

UBTTask_FindRandomLocation::UBTTask_FindRandomLocation(FObjectInitializer const& ObjectInitializer)
{
    NodeName = "Find Random Location in NavMesh";
}

EBTNodeResult::Type UBTTask_FindRandomLocation::ExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory)
{

    //get Ai Controller
    if(ANPC_AIController* const cont = Cast<ANPC_AIController>(OwnerComp.GetAIOwner()))
    {
        if(auto* const npc = cont->GetPawn())
        {
            //obtain npc location to use as origin
            auto const Origin = npc->GetActorLocation();
            //Get navigation system and generate a random location
            if(auto* const NavSys = UNavigationSystemV1::GetCurrent(GetWorld()))
            {
                FNavLocation Loc;
                if(NavSys->GetRandomPointInNavigableRadius(Origin,SearchRadius,Loc))
                {
                    OwnerComp.GetBlackboardComponent()->SetValueAsVector(GetSelectedBlackboardKey(),Loc.Location);
                    
                }
                FinishLatentTask(OwnerComp,EBTNodeResult::Succeeded);
                return EBTNodeResult::Succeeded;
            }
        }
    }
    return EBTNodeResult::Failed;
}
#

i cant figureout why it wont use Move To

#

nvm i just added sequence it works now im idiot

#

-.-

fathom sun
oblique basin
fathom sun
oblique basin
#

Is the rotate task definitely not being called while move to is executing?

fathom sun
#

It's not me doing that explicitly, it does it itself automatically, using the very same MoveTo node it is using to chase me

oblique basin
fathom sun
# oblique basin Double check this and also draw a debug sphere at your move to target vector. Al...

I've implemented a dummy actor that would move around the AI, and also added some drawing in the SetFocalPoint like that

void AMTH_AIController::SetFocalPoint(FVector NewFocus, EAIFocusPriority::Type InPriority)
{
    Super::SetFocalPoint(NewFocus, InPriority);

    FDebug::DumpStackTraceToLog(ELogVerbosity::Warning);

    FVector Location = GetPawn()->GetActorLocation();
    DrawDebugLine(GetWorld(), Location, NewFocus, FColor::Red, false);
    DrawDebugSphere(GetWorld(), NewFocus, 10, 12, FColor::Red, false);
}

You can see that the AI tries to walk both forward and towards the target only when it's on the edge of the FOV. Using the DumpStackTraceToLog to see what actually changes the focus, it turns out that nothing but UPathFollowingComponent::UpdateMoveFocus() uses the method. I'm attaching the related log just in case https://pastebin.com/ZHaVDhfH

#

Using "Advance a single frame" feature it turns out that it alternates the focal points. It means that frame A it tries to focus on the forward, while on frame B it's focusing on the target location

oblique basin
#

Yes, that's what I suspected

#

Did you figure out why and where the alternation is happening?

fathom sun
#

Why -- idk, where -- UPathFollowingComponent::UpdateMoveFocus(). That method uses this one to get the vector

FVector UPathFollowingComponent::GetMoveFocus(bool bAllowStrafe) const
{
    FVector MoveFocus = FVector::ZeroVector;
    if (bAllowStrafe && DestinationActor.IsValid())
    {
        MoveFocus = DestinationActor->GetActorLocation();
    }
    else
    {
        const FVector CurrentMoveDirection = GetCurrentDirection();
        MoveFocus = *CurrentDestination + (CurrentMoveDirection * FAIConfig::Navigation::FocalPointDistance);
    }

    return MoveFocus;
}

It should be going straight to the else branch as I'm not using strafes

#

So the only suspect is the CurrentDestination vector, which is most likely is becoming fwd or the direction towards the target

oblique basin
#

Anywhere you're calculating a vector, draw some debug lines from the origin to try to narrow it down. May be that the move to destination is changing between ticks which would affect the output of the above as it's using move direction.

fathom sun
#

It's not the issue. The blue sphere is the one I'm assigning to the BB

oblique basin
#

Can't see the video dude sorry

fathom sun
#

That's fine, it just shows that the location the AI is told to move by my code is always on the sphere

oblique basin
#

But drawing line would confirm that you're only setting one location. Could be that some sphere is being drawn in Narnia.

fathom sun
#

oh, alright

#

Nah, the line is only connecting the character and the sphere

oblique basin
#

Next step, I would manually get your move direction and draw a debug arrow to confirm the issue is related to multiple move direction spitting out different focal points.

#

Ie Get velocity and normalise

fathom sun
oblique basin
#

Very weird issue

fathom sun
#

uh, I'm not sure whether it's zero at some point as I normalize it to draw the line. Will check

#

Yeah, it's never 0

fathom sun
# fathom sun Why -- idk, where -- UPathFollowingComponent::UpdateMoveFocus(). That method use...

I was wrong about the method. Since I'm using PathFollowingComponent, it overrides it to

FVector UCrowdFollowingComponent::GetMoveFocus(bool bAllowStrafe) const
{
    // can't really use CurrentDestination here, as it's pointing at end of path part
    // fallback to looking at point in front of agent

    if (!bAllowStrafe && MovementComp && IsCrowdSimulationEnabled())
    {
        const FVector AgentLoc = MovementComp->GetActorLocation();

        // if we're not moving, falling, or don't have a crowd agent move direction, set our focus to ahead of the rotation of our owner to keep the same rotation,
        // otherwise use the Crowd Agent Move Direction to move in the direction we're supposed to be going
        const FVector ForwardDir = MovementComp->GetOwner() && ((Status != EPathFollowingStatus::Moving) || (MovementComp->IsFalling()) || CrowdAgentMoveDirection.IsNearlyZero()) ?
            MovementComp->GetOwner()->GetActorForwardVector() :
            CrowdAgentMoveDirection.GetSafeNormal2D();

        return AgentLoc + (ForwardDir * FAIConfig::Navigation::FocalPointDistance);
    }

    return Super::GetMoveFocus(bAllowStrafe);
}

Apparently sometimes the ForwardDir is either MovementComp->GetOwner()->GetActorForwardVector() or CrowdAgentMoveDirection.GetSafeNormal2D()

#

And yeah, sometimes the CorwdAgentMoveDirection is 0, so it uses the fwd instead

oblique basin
#

Aha

#

That'll do it

fathom sun
#

When it works correctly, i.e. the velocity direction is towards the sphere, the CrowdAgentMoveDirection is only edited here

void UCrowdFollowingComponent::UpdateCachedDirections(const FVector& NewVelocity, const FVector& NextPathCorner, bool bTraversingLink)
{
    // ...
    if (bIsNotFalling)
    {
        // ...
        else
        {
            CrowdAgentMoveDirection = (bRotateToVelocity || bTraversingLink) && (NewVelocity.SizeSquared() > KINDA_SMALL_NUMBER) ? NewVelocity.GetSafeNormal() : MoveSegmentDirection;
        }
    }
}

i.e. it just normalizes the velocity, so that the character keeps moving along it. The method is called each tick.

However, the frame it gets wrong another method is called, which is the UCrowdFollowingComponent::SetMoveSegment. It's pretty big, but at some point it sets it to zero vector, with this comment just above the line // not safe to read those directions yet, you have to wait until crowd manager gives you next corner of string pulled path. There's nothing that can set the CrowdAgentMoveDirection in that method after it was set to 0, but, as the comment tells, the crowd manager should assign the direction at the next corner or something (even though I don't have any)

#

If I can't find any solution, I can always try to use RVO instead of crowd manager unless multiple agent navigation becomes a problem 😔

#

In my case there aren't many agents, yet they're more than one, but I guess RVO could make it in certain cases

fathom sun
# fathom sun When it works correctly, i.e. the velocity direction is towards the sphere, the ...

I didn't pay attention to the stack trace at the moment of the SetMoveSegment that sets the direction to 0. Apparently it's called because I set a new destination value in the BB, which makes it call a new MoveTo. Up until the SetMoveSegment it's does everything correctly as it's not using anything crowd management related. So I guess using regular PathFollowingComponent would work just fine, but the crowd one won't, as it might not been designed with this way of using it or something.

In fact, that's the reason why the character faces the target correctly when it stops moving at all, as the BB doesn't update any value, and no SetMoveSegment is called

oblique basin
# fathom sun I didn't pay attention to the stack trace at the moment of the SetMoveSegment th...

It largely depends on how your game will scale. I generally use RVO but so far, I've rarely had more than 10 AI at any given time. I can't say it's given me any grief so far.

Unfortunately, I think the only solution if you stick with crown following would be to init your own component that derives from the crowd comp and overwrite or reconfigure your own functions that bypass the limitations according to your use cases. It'll be quite a bit of work so trying out RVO may be a better use of your time but that's your call.

#

Either way, well done on tracking down the problem. It isn't always easy picking apart epic's source code.

fathom sun
#

I have at most a few smaller enemies along the big one, so it should be fine using RVO. Modifying the crowd component would be error prone since there're reasons they do that, I just don't want to get in more troubles down the road. So yeah, I'll switch to RVO, and it should work fine

oblique basin
#

GL

lyric flint
#

so have a new issue where this branch still seems to do stuff even though AI can not see me anymor

#

I think my issues is the parrallel

lyric flint
#

Also the AI does as well

dense owl
lyric flint
#

Don't believe so but shouldn't matter

#

The can see target should break it out of that branch

#

I might just have to debug again tommorow

dense owl
#

That’s what I mean. Are you making that Not Set at any point?

lyric flint
#

Yeah sorry in ai controller

#

After something like 5 seconds

#

I think I might know my issue actually.

#

I delay setting can see target to false. What I'm thinking is due to that it's doing wierd stuff

#

For the fire weapon I think I'll have to have like a inshootingrange bool instead

#

Along side the does have ammo

coral mesa
#

I want to make formation AI on unreal engine

#

what should be the way to approach

#

think there is a big army in a formation

#

now i want them to work from a parent formation pawn which handles all the army

#

what should be the way to deal with it?

oblique basin
#

Set a leader, determine an array of directional vectors (V) and distances (D) that correspond to formation positions, then add V*D to the leader's location every tick, with some temporal offsets if you want it to look a bit more natural.

coral mesa
#

what about AI Controller of AIs?

#

is there extra calls or something?

#

i need to think of performance too

oblique basin
#

In your leader ai controller, keep an array of army units and feed them the locations

#

So calculation is only being done by one class instance

#

You're welcome

coral mesa
#

also how what's the better way to move NPCs to dynamic target?

#

like target which changes constantly

#

an NPC targetting other NPCs?

#

i did all these in my unity days but wanna know how things would be in UE

#

since it follows some architecture of sort

oblique basin
#

If all you want to do is move them around, you can just use actors and lerp them to their locations. If they eventually need more complex behaviour, they'll need their own controllers and either behaviour trees that move them to locations or just to move to location in their controller class

#

Move to has the advantage of pathing along the nav mesh

coral mesa
#

that's what I wanna know how navmesh works in UE

#

for starters in UE if I wasnt careful then I would've been calling many things just to set destination to target and thus lagging the game in process

#

wonder how that plays out in UE

#

Move To seems a bit buggy

#

if I set to specific actor then it tends to go out of navmesh????

oblique basin
#

Not sure what your question is. There are plenty of tutorials on nav mesh and ai movement around. Move to isn't buggy and setting destination isn't much of a relative performance hit.

unreal briar
#

Hey,
Does anyone knows how to disable the slow down / slow movement when using the crowd manager?
When the AI near each other they will slow down their movement and I would like to disable that

misty wharf
#

Isn't that part of the whole avoidance thing? Wouldn't they start bumping into each other if you turn it off?

unreal briar
#

Right, but the all slow down kinda takes the fun away.
Imagine that an enemy is attacking the player and you both standing still, then another enemy rushing toward you and then because there is another enemy nearby, his starts walking slowly... not thrilling.

misty wharf
#

I suppose... maybe take a look at how the avoidance system works, there could be something you can tweak in there. You could potentially allow your enemies to overlap, and adjust the crowd agent interface implementation so that the agent's cylinder size the interface reports is smaller than the real cylinder on it, which might allow them to still avoid each other but not be affected by it as much.

unreal briar
#

Does anyone knows why the AI move to breaks his path all of a sudden?
It happens in specific small areas.
I keep holding the mouse for the character to always move to the mouse location.
And sometimes it just breaks to a certain direction where there's nothing on the path, no obstacles or any object that can affect navigation.

dense owl
coral mesa
#

it goes out of navmesh and stucks outside

#

reminder that I was using floatingpawnmovement

covert fable
#

Howdy there, just messing my hand with AI and did a BP_Hostile Base and intending on making Child BPs that use the same Behaviour tree but with Decorators that will work off whether a certain boolean is ticked.
Now, i just simply wanted to ask how to actually create a custom decorator that could do this.

So as an example:
Standard BP_Hostile doesnt have Melee Ticked, but its child will.
Boolean Melee in a child actor, it'll pass through the Decorator selector for Melee Behaviour.

I sorta got my head round Tasks, but Decorators seem to act as Big booleans so thought to ask.

misty wharf
#

For decorators you have to override a function instead

#

Your logic is otherwise correct - if you override the function, you will get a return node for a boolean value

#

I forget what the function you need to override is called, but it should be fairly obvious if you check the list of available functions

covert fable
coral mesa
#

I want to make navmesh without any collision stuffs

#

what should be the approach to go for?

#

Something similar to Unity

uneven cloud
coral mesa
#

Not seeing the same case with UE

#

Its integrated with pawn

#

Or idk maybe AI Controller

uneven cloud
# coral mesa Or idk maybe AI Controller

If you want to use the built-in path following functionality, you need to have an AI controller. The simple move to node can work with non AI controlled pawns. You can also do your own path following, but I wouldn't recommend that unless you know what you are doing.

coral mesa
uneven cloud
coral mesa
#

anyway doesnt that cause extra overhead?

#

in my case I want tons of NPCs on scene

uneven cloud
#

It's not attached

#

Depending on what you mean by "tons" the AI controller is likely to not be the problem. It will be the movement component. You might want to look into mass instead

coral mesa
#

very premitive...

uneven cloud
#

Primitive is not a word I'd use for it

coral mesa
#

Probably some Physics, etc?

uneven cloud
coral mesa
uneven cloud
# coral mesa supports Navmesh?

The nav mesh doesn't care what type of object used it. Whether or not there is some built-in path following solution for the nav mesh is a better question for #mass

coral mesa
#

I looked at it and it seems its just spline following?

oblique basin
coral mesa
oblique basin
#

Your questions about controllers, pawns, NavMeshes, general navigation and collision are all covered in introductory tutorials. Mass isn't something you'll need to think about for a while. Those of us helping on these on these forums expect you to have taken the time to get up to speed.

#

In this video tutorial series we will going over everything regarding AI in Unreal Engine 5; including some examples of AI behavior typically seen in commercial video games.

In Part 1 we do some basic character setup to prepare a character for use as an AI character.

SUPPORT ME
Patreon I https://www.patreon.com/ryanlaley
Buy Me a Coffee I buym...

▶ Play video
dense owl
paper sparrow
#

'Use Continuous Goal Tracking' makes my enemy AI's movements significantly more fluid, but the task doesn't seem to stop even when the target has been reached and prevents my successor logic (use: swing sword ability) from activating. Is there any way to tell this task to stop so the Behaviour tree can execute the other tasks?

'Stop on Overlap' doesn't seem to do anything

uneven cloud
uneven cloud
paper sparrow
# uneven cloud Why did you make your own move to instead of using the built-in? Why are you ad...

Hey Luthage!

  • Why did you make your own move to instead of using the built-in? - So that I could add additional gameplay logic and error handling (setting the player to 'InCombat' State etc.)
  • Why are you adding the capsule radius to the acceptance radius? - So that the movement and distance checking will be independent of the 'size' of the enemy. There are some big boys in my game

I think I might have found a way to fix this, I can add a distance check on tick which will cancel the move and let the logic move to the next one

uneven cloud
# paper sparrow Hey Luthage! - *Why did you make your own move to instead of using the built-in...

Why is the AI setting anything on the player? That sounds like a recipe for disaster.

You need to implement cleanly aborting the task if you don't use the built-in task. Since you lose that.

Stop on overlap already takes the capsule radius into account. Both the NPC and Target.

That's not a real fix, because the path following is already doing that. Does it stop appropriately when not using continuous goal tracking?

paper sparrow
# uneven cloud Why is the AI setting anything on the player? That sounds like a recipe for dis...

Could you elaborate on why 'AI setting anything on the player' is a recipe for disaster? It seems like an unavoidable step for a hostile AI character.

I already implement a 'receive abort AI' event which cancells the task, same for the tick that finishes. It seems to work fine.

I didn't notice the overlap triggering on my tests... But in any case I need NPCs to always have 'some' distance to the player, so it probably isn't the solution that would work for this situation.

Without using CGT, it does work OK but the rotation is very jittery and it doesn't follow the player well

uneven cloud
#

Have you tried debugging it with the visual logger? I don't use move to actor, because it gives bad behavior.

paper sparrow
#

No, I just assume the 'MoveTo' without CTG is moving to the previously cached location an actor was at, and it updates with the new position when it reaches it.

With it on, it chases my player very fluidly and rotates well

uneven cloud
paper sparrow
uneven cloud
paper sparrow
#

Are you suggesting the 'moveto' command takes into account distance between capsules? So I don't need to compensate for it?

uneven cloud
dawn schooner
#

Hi! I'm working on destroying actors that have a StateTreeComponent attached. I'm facing a crash related to the component tick function and reading instanced struct data. What I'm not sure is why this error happens, since previously I have disabled the component's tick, and also manually called Stop() on the State Tree execution context. This is the callstack of the crash:

#

Maybe I am stopping/disabling the state tree incorrectly, but I don't really know what else should be done with it

paper sparrow
#

If you can reproduce it in a fresh project, fire a bug report to the epic team, its a golden ticket for them and they can put a fix in

dawn schooner
dawn schooner
dusty vigil
#

if anyone can vc, help would be appreciated as my behaviour tree is acting a tad bit broken

#

decorators seem to not want to work

dusty vigil
#

got some other issues as well

fading field
#

Hey all, I got a question: Is there a node to find the nearest reachable point to a location?

sudden field
#

not the nearest though

#

nearest point would need a lot more work

misty wharf
#

@fading field I think if you use project point to navigation this should get it

sudden field
#

oh wait yeah

fading field
#

That seems to work, thank you so much! 😄

lyric flint
#

so got an issue thats confusing me

#

when my AI looses sight of player there still shooting

#

I'm currently using CanSeeTarget for the check going into the shooting behavior

#

would people say maybe I should use another bool that work more with the behavior then doing generic CanSeeTarget

dense owl
#

I’ll reiterate that you might want to look into the forgetting actor feature

misty wharf
lyric flint
misty wharf
#

Oh, well, not much we can say how to fix that then I think 🤔

#

Sounds like your target data isn't being updated correctly when sight is lost

lyric flint
#

this was before I obvs found out I can actually put the Sight perception on the mesh like so it follows specific mesh bone etc

misty wharf
#

Maybe add some logging into it to see whether the variable values are what you think they are to help debug

lyric flint
#

*finished

misty wharf
#

Ah.. Yeah tbh I never bothered dealing with simple parallel, I could never decide what was a good way to use it :P

untold quiver
#

Anyone here create a State Tree Task in C++, then assign it put a break point in the code to debug the task and it never enters the task?

untold quiver
#

I got it, I was using a custom schema and a function that made the state tree run was based on me using a specific schema

lyric flint
#

So got this issue I have my AI on a nav mesh

#

However it seems to be failing on projecting to navmesh

#

It can't even find itself either tbf

#

like it don't seem to be able to see itself in world like if I do debug sphere at it's location

#

if I tell it like to move to patrol points its fine

#

so bit confused why random point wouldn't work or why it could get it's own location from what I could see

civic canyon
#

I need an NPC that walks over, sits in front of and starts interacting with a slot machine. Would smart objects be a decent solution to this? Where i give the slot machine a smart object, the NPC finds it and then uses it? and then i just do the slot machine logic in a something like a gameplay behavior class?

pure cradle
#

Hello I have some question
I'm making an rts game in it each unit is ai pawn control by individual ai control
Now I wanna create enemy npc factions
I was thinking of creating ai controller to act as the faction "brain" and have it to issue orders and commands to its unit controllers
Is this the best way to go about doing it? Are there other ways more efficient to achieve it?

dense owl
# lyric flint so bit confused why random point wouldn't work or why it could get it's own loca...

First you need to clarify what the problem is, you initially said “it fails to project to the mesh”, then you said it can patrol fine, but get random point isn’t working, but the code seems to be firing so you could very well have not properly setup the bb key that you’re getting. Start by watching the video in the 4th pin here if you haven’t already. Then learn to debug your code using breakpoints and hovering over input pins, gameplay (AI debugger) and visual logger

lyric flint
#

yeah so if I try have it just roam around it for some reason doesn't find it self on a nav mesh to be able to get a random point.

#

however if I tell it to patrol a path I create in same area where it's positioned it'll navigate fine on the nav mesh it's on

#

when I was bedugging from what I could see if wasn't able to see where it was on the nav mesh to be able to get random point within it's location

lyric flint
uneven cloud
uneven cloud
lyric flint
#

so first ensured it actually is on a Nav mesh which is it

#

ensured that it is runnning the behavior tree selected which it is

uneven cloud
lyric flint
#

checked the location in terms of both it picking random one from either it's own location on the nav mesh

#

and also from a target vector on the nav mesh

uneven cloud
lyric flint
#

well checked it

#

I don't know what other words your wanting me to use sorry

uneven cloud
#

How did you check it?

lyric flint
uneven cloud
#

What do you mean "checked the debug thing"?

lyric flint
#

As you can see here it's failing

#

The controlled pawn is valid as you can see

#

fixed it now

#

I saw my error

tardy spindle
#

has anyone run into issues with EQS traces before? the trace to the player is failing even though it's obvious the points can see the player pawn
I already checked that the Visibility channel is set to Block for all pawns, which I thought was the problem at first

lyric flint
#

like for my issue it was simple wrong vectors going into the select

#

even though you can clear see something, depending how you've programmed you actually may have introduced some incorrect stuff

tardy spindle
#

yea, I'm trying to isolate the issue, but I wish there was a way to visualize the EQS traces

#

I suppose I'd have to write my own custom trace in c++

boreal tundra
#

I would need a NavMesh chad that could help me with a problem (AI getting stuck)

tardy spindle
uneven cloud
boreal tundra
uneven cloud
uneven cloud
boreal tundra
uneven cloud
boreal tundra
#

I'm here to learn and program not to fight about human rights or other stuff I'm sorry.

dense owl
#

All of this time wasted because you didn’t just ask your question

#

Don’t ask to ask, present your issue and ask your question, it saves everyone time, and possibly nerves

uneven cloud
#

I already told them to ask the question and it was ignored. 🤷‍♀️

rigid basin
#

Hey everyon. Quick question, does anyone know if the detour crowd works with a Pawn or does it have to be a Character? The reson I ask is because I have a pawn and I made a movement component class that inherits from pawn movement component and I'm overriding the RequestDirectMove(const FVector& MoveVelocity, bool bForceMaxSpeed) method from it.
When I just use a navmesh volume and I call MoveToActor it works fine but when I add the crowd following component to my controller the MoveVelocity I receive is just a vector 0. Am I doing something wrong or its just not possible?

I also have implemented the crowd interface on my pawn and registered but I still only get vector 0.

tardy spindle
dense owl
misty wharf
#

^tbh this seems to depend on what you want to do with the "faction brain"

#

If you wanted to use behavior trees for the logic, then using an AI controller would be kinda required

pure cradle
# misty wharf If you wanted to use behavior trees for the logic, then using an AI controller w...

The faction head act as an npc faction in the rts it should be the one who decide how to spend resources, build units and direct those unit
Because of this I thought of using an ai controller with bt or goap to make decision and play but @uneven cloud did not suggest it because it will not posses a pawn
To be honest I don't plan on it possessing anything just directing other ai unit controller but I was wandering if mabye the is another way I havnt thought of

misty wharf
#

I don't think there's any harm in having an AIC without a pawn

#

Certainly curious to hear what Luthage thinks about it though

civic canyon
#

did they remove the "claim" function from the smart object subsystem?

misty wharf
#

Don't think so, that seems fairly integral to how it works

#

They might've renamed some of the functions though

civic canyon
#

seems like they changed it to "mark smart object slot as claimed", which now accepts accepts a slot handle.

"use claimed gameplay behavior smart object" has also been cchanged to "move to and use smart object with gameplay behavior"

civic canyon
#

Having a new problem where I'm unable to find any smart objects for some reason. It just prints out the "failed" string even though i have two actors with a smart object component placed right next to my NPC.

#

Nevermind, i flipped min and max in the "make box"

uneven cloud
# pure cradle So what would u use?

That entirely depends on the behavior you want, how you want it to function, the scalability of number of entities, how you want the workflow and your experience level. That could mean scripted, Finate State Machine, HFSM, state tree, utility or a planner.

BTs are really great as a priority order looping sequence of actions. They aren't so great at high level decision making. Using an AI Controller with a BT without a pawn you'll lose out on most of the built-in functionality and spend all your time fighting it.

misty wharf
#

Lose most of the builtin functionality? 🤔 In an average game that's probably MoveTo and some stuff like distance checks

#

So not quite sure if that's a lot of stuff lost :D

#

But yeah tbh not sure what would be the best approach for something like what he's proposing. Might not be BT's

pure cradle
#

Hmm bt might not be what I need so what should I use instead
The idea is to make the faction be able to manage resources and create unit choose groups to attack and so one bt might not be the solution cuz it's falls down to priorities and conditions and I need more of a decision making
So I may go about doing a combination of utility and goap

uneven cloud
fierce vessel
#

Hey guys I have a question and it help fitting to ask it here, is it possible to train/run an LLM model in UE5/UE4 as maybe an NPC or something? I have average experience with LLMs and UE but I don't know how to bring them together, any help will be appreciated Thanks

harsh storm
#

People still reference that for AI design

uneven cloud
# harsh storm Probably because of FEAR

I get that, but I see it recommend as the pinnacle of game AI, when it actually won't benefit most game, especially solo ones. It's like using a tractor to garden a 2' x 2' plot. It'll just get in the way.

brittle lynx
brittle lynx
#

Yes it is 😄

harsh storm
#

I've had it favorited for years now. Back when you were selling it for like $150 or something like that. Price has went up. Get it while its hot people!

brittle lynx
#

Till Sunday, December 31 at 11:59 PM ET

Might wanna hurry in that case 🙂

brittle lynx
#

Happy New Year 🙂

harsh storm
#

I have absolutely no reason for this though 🤣

#

BT works just fine for my zombie game, lol

#

But I swears it - one of these days....

spring inlet
#

it's one of the few plugins i consider to get one day, too

harsh storm
#

@brittle lynx Because reasons - have you benchmarked your plugin?

brittle lynx
#

I never made an “official” one since somebody posted a stress-test where they easily got 750 bots to run a relatively complex HTN with EQS and recursion: #742371547783888990 message

They later upped that to 19000 characters with tickrate manipulation.
#742371547783888990 message

harsh storm
#

All I can say is. wtf

brittle lynx
#

You need to join the server first. There’s a link on the marketplace page.

harsh storm
#

ughh - work 😭

brittle lynx
#

IDK if I’m allowed to post invites to other servers here directly 😅

harsh storm
#

You're not, that's why I said DM 😅

#

But I already joined

harsh storm
brittle lynx
#

Pawns that are just cubes to minimize the cost of everything but HTN for this test. Even then the fps only got below 60 for them due to rendering cost.

stiff gale
#

What's the high level concept behind creating AI NPC task based lifestyle? I already have a basic ai system. I want to scale it. I want my AI NPC to wake up in the morning then go to work then come back to sleep and repeat.

uneven cloud
stiff gale
#

Do I create task that AI can do? Then AI with free time will look for these task. How do I make AI go to sleep and wake up in the morning

#

I don't know if I should use MassAI to do that or even doable.

uneven cloud
# stiff gale i don't know where to begin.

You begin by writing out the behaviors that you are looking for. And then breaking them down into separate problems. Such as how do they find a bed? Do you want to use the smart object system for it? Get sleeping in a bed working before you move to the next problem.

You'll need some kind of schedule. How you set that up is going to depend on how you want it to work. Again, there is no RIGHT way to do it.

You only need to use Mass if you want to have hundreds of AI going at once.

stiff gale
uneven cloud
#

It'd be a really shit system if it couldn't do that.

pure cradle
# uneven cloud You have not given enough information to give a recommendation. See the first h...

Well I'm trying to make 2 ai actually: each with a role
The game split into a planet map in which a combat occurs the ai get a fleet of ships pre chosen ( usually not bigger than 30 -50) and manage the combat in the zone directing movement setting targets for ships according to pre made behavior variable that make " presonality" whether the ai prefer to engage more or defend more and so on
The second ai is in the galactic map there there is more decision making
The ai here again with diffrent " presonality" goals and objectives will decide how to spend resources if to build defense or create a fleet or research upgrades and where to sent a fleet to attack

uneven cloud
terse panther
#

hey..
i am trying to project the EQS points(Using EQS test Project) onto the navmesh and then check if the path exist still exist to those point(using EQS test PathFinding)
the projection of points is working fine, but still the PathFind test is ignoring those projected points
Any solution for this?

terse panther
#

kinda solved it...
i created a new class from Pathfind test, and added some new code, and that worked....

civic canyon
#

What's the best way to get my AI to avoid bumping into eachother. Got a bunch of AI navigating in the same area, but they tend to just bump into eachother all the time. I tried enabling RVO, but that didn't seem to do much

#

Using both an "AI move to" and a "Move to and Use Smart Object with Gameplay Behavior" (in different scenarios ofc) to get the AI to navigate

dense owl
civic canyon
#

Wow, just swapped my AI controller with the Detour Crowd one and that did wonders! Thanks a ton!!!!

pine spade
#

Not sure if this is the right channel, but I'm curious about the feasibility of building a kind of open world strategy game through Blueprints. It would have lots of NPCs acting autonomously in the world and changing the world's condition over time (Imagine 8 ai players battling it out in an RTS free for all, but it's a much bigger playing field.) I'm assuming this would be quite complicated to build the systems to drive the AIs and resolve their interactions, but as a starting point, I'm curious if there would be any hard limitations of using Blueprints, or things I should avoid.

dense owl
visual sluice
#

Should I use game play tags for an ai to move to situations, like for example like a npc moving towards a food source because I want to reference objects but a way that doesn’t make it so I have to reference every single actor but a category that’s it in

misty wharf
visual sluice
misty wharf
#

Sorry I didn't quite understand what you mean

visual sluice
misty wharf
#

I mean you can use an enum if you want sure

#

They serve similar purposes, enums just can't really be edited from the editor, and they don't have a hierarchy

shy rover
#

Are there any example projects anywhere that show how to use state trees?

#

I've had a look at the matrix city demo but that particular implementation is heavily coupled with mass so it makes it quite hard to understand the core concepts independently.

unreal lodge
#

Hello guys, do you have any recommendations for a starting point in AI ? I really want to do an complex AI in UE5 but dont know where to start since there a so many tutorials online

harsh storm
#

The beginner AI tutorial on the unreal learn site

#

AI With Blueprints is the name if I recall

misty wharf
thorny sun
#

Looking for some suggestions as I think this has been solved before. I'm trying to setup a behavior tree that can move and shoot at the same time. I'm using a parallel node, with the main task as shoot. The parallel node is set to delay finish. The problem I'm having is the shoot task only executes once. Is there a way to make it loop? I have tried to put a loop decorator on the shoot task, but it does not have any effect.

thorny sun
#

Oh figured it out. Had a cooldown with the loop, removing the cool down worked

clear root
#

There's something wrong with my learning agents blueprints somewhere, or a bug in the framework

LogLearning: Warning: BP_FlyingInteractor: Observation Goal_10 for agent with id 0 has not been set (got iteration 0, expected iteration 1) and so agent will not have observations encoded.
LogLearning: Warning: BP_FlyingPolicy: Agent with id 0 has not made observations so policy will not be evaluated for it.
LogLearning: Warning: BP_FlyingInteractor: Agent with id 0 does not have an encoded action vector so actions will not be decoded for it. Was EvaluatePolicy or EncodeActions run?

I've done everything right I think, where to look?

clear root
#

Nvm solved that problem,
But when it comes to the scales used when setting rewards and actions, do I just use trial and error to create these scales? I want the output of the network to be normalized so I just tune the scale down until it always fits in -1,1 but I'm sure there must be a way to know what scale i want ahead of time right?

ocean wren
#

I'm not sure you can figure that out beforehand, because there's a lot of variables at play.. things like the discount rate and whatnot. One of the main problems of RL seems to be the need for reward shaping, which is essentially fiddling with the reward maths. This is worth a watch: https://www.youtube.com/watch?v=Dw3BZ6O_8LY

I trained an AI in Trackmania with reinforcement learning, until I couldn't beat it.

I just opened a Patreon page, where you can support this YouTube channel with a donation (link below). Between research, programming and editing, these videos take a long time to produce. Any support will help me to spend more time on that in the future ! This...

▶ Play video
#

I'm looking at the research on this right now, because I don't like the idea of having to do lots of reward shaping, which feels like just moving the problem of BT's being too complex to RL rewards being too complex 🙂 I had thought that behavioral cloning with human feedback was a good approach, but still not 100% sure for games yet.

stark oyster
#

ok, this might be a 1/100000 rare question but it is seriously important.

is it possible to make specific ai not account for certain ai as blocking the nav mesh

mild bobcat
#

Is the Blackboard essentially state?

harsh storm
#

It's just a place to store data

#

Nothin' more. Nothin' less.

thorn girder
uneven cloud
grizzled mulch
#

Hi Guys.
I have this AI Animals that walk around in the very large Map with sublevels.
Everything works fine in the editor but when Packaged some Animals randomly stop moving and never move.
(Im using GetRandomPointInReachableRadius)
Question is : what is the best way to debug this kind of issue in a packaged game?

shell gazelle
#

A question: Should this BT first execute the task, and then set the cooldown? This is from a fresh 3pp project, and it waits for the cooldown first before executing the task for the first time.

#

5.3.2 latest

misty wharf
#

@shell gazelle Cooldown decorator for some reason immediately waits for a cooldown. It's confusing, I would expect it to run once and then cooldown, but that's not how it works

#

You'll have to make your own if you want it to behave in the expected way

dense owl
shell gazelle
#

dang

#

makes no sense either

#

nobody ever wanted an ability that doesn't work on the first use

visual sluice
#

So I have a ai service node task that gets all actors with interfaces including the npc with a for each loop with a enum ai state switch on complete with a set value as actor but the thing is, it picks up on the npc actor and nothing else. Is there nothing i can do and i have to separate the interfaces.

#

It gets the actor i want if i remove the interface from the npc

misty wharf
#

Are you sure the problem isn't that the npc happens to come out first and is being set as the value?

#

As in, have you tried to just check if the value you're iterating is the npc and ignoring it if so?

visual sluice
#

But I don’t know how I would go about doing it

misty wharf
#

Doesn't the service have access to the pawn same as task nodes do?

#

so you would just compare with that

visual sluice
grizzled mulch
#

Is there anyway to get the Size of the Navmesh bounds volume the AI is on top of?
Because when I run this and the radius is much bigger than the area. The AI stops moving

visual sluice
drowsy oyster
zealous maple
#

Hello! I have a flying pawn, and it seems to only work when fairly close to the ground, can I somehow change that? It is using "FloatingPawnMovement"

uneven cloud
uneven cloud
zealous maple
#

Sorry, like this:

cyan smelt
#

what's wrong with the condition?

#

as far as I know, "is not set" = false, "is set" = true

#

but the decorator doesn't care the variable's value, it always executes the "is set" condition

#

I'm a little bit lost

#

any help is appreciated

drowsy oyster
#

could you show the rest of picture 2

#

@cyan smelt

cyan smelt
#

are these ok?

#

MoveToTarget is a custom move to task

cyan smelt
#

alright, nevermind, it's my stupidity

#

when I replaced the move task with this, it goes perfect

#

I don't really know why I tried to make my own move function, sometimes it's easy to get lost while learning stuff :p

uneven cloud
zealous maple
#

Sorry.. Wrong screenshot. But thay sounds good, it's not what I did but I will try it. Thanks!

uneven cloud
cyan smelt
#

Yeah, at first I thought it would be better to lock the ai while moving, but may result with some absurd actions

random cedar
#

hey can someone help me ??

winter gust
#

Could try setting the peripheral vision angle to 180 maybe

#

Or hear noises box myte work ill see if I can test

random cedar
#

ok thanks

#

the peripheral vision where can i change it? sorry im realy new with unreal ...

#

im mean i now that i can make a bigger or smaller vision but change it to 180 is new for me

winter gust
#

It's in the details of pawn sensing but after testing one sec mine runs to me but doesn't go down to attack stays in the air

random cedar
#

yeees thats waht i want

winter gust
#

Perfect should work then

random cedar
#

i dont want that the unit goes down ok wow let me try it out

#

but can you please just send me a picture of the
Section where i can change it excatly to 180
If i search for "peripheral vision angle" in detail i didnt find it but i look more

#

aaahh sorry ok

#

i got found it 🙂 i try it out now

winter gust
random cedar
winter gust
#

first duplicate your bp enemy so we dont mess up anything you have set intentionally for x reason. with the new enemy open the bp and lets try this way of pawn sensing.

#

from pawnsensing component get event as my cursor shows Thatll be the top event then before making the call back function make your next custom event( So it can make the refrence)

random cedar
#

okok thank you very much i go for it now

winter gust
#

this simply grabs the sensing component and if it activates fires off. so if it can see you, should run.

#

Also don't forget to replace your enemy with your new copy(if you made one)*

random cedar
winter gust
#

It's custom event I named fallow player add the nodes and then on the top pawn sensing function

#

Attach whatever you name the second one.

random cedar
#

aaahhh yeeesss

#

sorry im to newbe -.-

winter gust
#

So of it senses calls your new event(mines named fallow player your can be named track player or even custom event1 but easier to track with good naming)

#

It's all good we all start somewhere ❤️🐛

random cedar
#

okok 😄 i try it out now

random cedar
# winter gust It's all good we all start somewhere ❤️🐛

ok i done it change the bp also and vision on 180 + use your BP but still the same it just looks at my direction and turns but dont move in the air but in ground it works... why -.- do you think maybe its how i set the gravity off on the unit i mean did i something wrong in the flying component?

winter gust
#

I do have gravity enabled

#

linkthink ai are funny things

random cedar
#

haha ok its crazy

#

i have no ideas anymore but cant sleep without to get it work

winter gust
#

In variables did you make a reference to your charachter? And off ai move to attach get player charachter?

#

Or show your new BP so I can browse and be sure you swapped the old ai with the new one in your map

random cedar
#

ok

#

one second

winter gust
#

No rush hopefully I can spot something

random cedar
#

yes im 1000% sure that i change the ai in the map i mean it works with your BP also but just in the ground...

#

i made no reference to my character because i try it out on the ground and its worked with your bp but the problem is still in the air

winter gust
#

Gotcha that's alright not a needed variable for this part actually just thinking

random cedar
#

hmm okok where can be the problem 🤔

winter gust
#

It's not colliding if it can move on the ground

#

It senses you, run the program with the enemy blueprints open but with a small window so you can see the lines fire off you'll see it go orange when it sees you

#

But you'll at least know if the move to isn't activating

random cedar
#

ok i try it

#

The lines remain white after starting

#

and after he sees me

winter gust
#

It's not triggering

#

The top pawn sensing goes orange right?

random cedar
#

no everythin stays white but i cant understand why also it staysw white when he is on the ground and trys to catch me

dense owl
#

Imagine not using an outdated system 😀

winter gust
#

Are you sure you swapped them in the map keks

random cedar
#

let me go for it again

winter gust
#

Neo send halp I'm nub

random cedar
#

but im sure

winter gust
#

Even just placing a new one in the map next to you to see if neither move

dense owl
#

Use the AI Perception system instead

winter gust
#

Is perception the line of sight?

dense owl
#

Sight, hearing, smell, etc

random cedar
dense owl
#

It replaced pawn sensing

winter gust
#

Just project settings or?

dense owl
#

Nah, you have to set it up. There’s decent docs on it

#

The gist is you add it to the AICon and add stimuli sources to stuff you want to detect

winter gust
# random cedar

Open a second BP window and show your other fish graph and see if it fires, but I also gotta look into Neo suggestion

winter gust
#

I just know your in game fish is activating somewhere

random cedar
#

yep now its orange

winter gust
#

So yeah in the map details

#

Drag your new fish in from the content browser into the scene and check lol

#

Happens no worries

#

We've been testing your old fishy nulgathkek

random cedar
#

haha ok

#

wait

winter gust
#

Can also test your original coding this way*

random cedar
#

yes its the same white lines but the fish is following me on the ground

winter gust
#

It should highlight if it's fallowing you linkthink

#

Like it did for your other one only other thing I could think of is making sure you have the same box's checked. The code should be going off though if the new ai is placed in the scene and chasing you

#

But now I must be off to study the new method as suggested by neo, if it's more efficient better sooner then later

random cedar
winter gust
#

Hopefully you can square it out soon its gotta be something simple we are missing 🍀🐛

random cedar
winter gust
#

Your sensing radius seems diffrent can you click pawn sensing and show me a few pics of your details I got a few mins while I get some more coffeee

random cedar
#

okok

winter gust
#

This what we are aiming for im guessing something isn't triggering the same

random cedar
random cedar
winter gust
#

Trying to remember what my blue circle is xD

#

All good lad you'll get it eventually and have that aha moment

random cedar
#

I really don't want to take up so much of your time, you been trying to help me for almost 40 minutes, thank you very much

winter gust
#

I believe in you!!!

random cedar
# winter gust I believe in you!!!

OK, I've now tried the same settings as you but it still has the same problems. Unfortunately I have to get up again in 6 hours, thanks again but I think I'll try the thing again tomorrow and ask about the whole thing here again, maybe it'll work out again one way...

winter gust
#

Sounds good lad I myte be missing something as well tomorrow I'll drop you a video that sets it up step by step and see if there is something we didn't square

winter gust
#

It's not the greatest method but gave me my foundation at the moment https://youtu.be/xm-7m5Fw1HU?si=PAgq9Gzg2eXwjmxc

Hello guys, in this quick and simple tutorial we are going to make a simple enemy AI, which will follow the player, have its own vision area, and attack when it's near the player in Unreal Engine 5.

Follow me on Twitter: https://twitter.com/GorkaGames
Subscribe to the channel: https://www.youtube.com/channel/UCv_n9oioNF6OpzR2dt6E4xg?sub_confirm...

▶ Play video
random cedar
#

ok thanks i saw that video in the past 🙂 let try it tomorrow again

#

by the way before i go to sleep another mate means this maybe i try it also before i post something tomorrow again here

"Hello again. You're going to need to trust me on this. Characters are for things on the ground. They come with a character movement component. You do not want this.

You need to make your thing a subclass of pawn, not actor. A character is a type of pawn, which is a type of actor. You need the properties of a pawn and not the properties of a character.

The pawn needs to have a floating pawn movement component. This is the component that will be used to move your floating pawn.

The nav mesh volume is not related to anything you are doing. For one, the volume is not related to the units. The "volume" is the space in which the nav mesh gets generated along the ground. It is not related to flying things. It's a volume because you might move up and down along stairs or something. But the nav mesh is on the ground. Flying units don't use it at all. It is only for Characters that walk on the ground."

dense owl
#

Just watch the 4th pin video here and use AI Perception

uneven cloud
# random cedar hey can someone help me ??

You need to change the nav agent settings for projecting to the nav mesh in the supported agents array in the project settings. You also need to turn off affecting the navigation in your NPCs collision components.

uneven cloud
uneven cloud
uneven cloud
# random cedar by the way before i go to sleep another mate means this maybe i try it also bef...

Your friend is partially correct. You can use the character and the character movement component, if you know enough C++ to work with the CMC. It's a better solution, but the pawn + floating pawn movement component is easier.

3d Navigation is really hard. A simple way people do it is to use ground navigation and float above the ground. Depending on the world geometry this may be fine for your game.

winter gust
winter gust
steep wind
#

hey y'all, I have a UE related AI programmer interview soon-ish, and I'm trying to prepare. Any UE specific things I should focus on? Obviously I've worked with the behavior tree, I've used EQS a little, decorators, services. Haven't used the StateTree, nor Mass. I'm pretty much just wondering if anyone has anything that comes to mind, something specific that you think anyone who is programming ai specifically should know about. Appreciate any advice/tips. Otherwise I'm just going to continue studying and refining what I already know

brisk abyss
#

Why there are only videos about reinforcement learning on YouTube? Is it impossible to train model inside Unreal engine?

uneven cloud
# steep wind hey y'all, I have a UE related AI programmer interview soon-ish, and I'm trying ...

You should have a deep understanding of C++. Vector math. Debugging. Profiling and optimization. Understanding of all the AI systems: perception, navigation, BT, and so forth. Should know what the state tree and Mass is, but with how new they are it shouldn't count too much. Should understand the controller vs character. Know about the anim state machine, GAS, and the character movement component. You should also understand the pros and cons of C++ vs BP.

Most importantly you need to have good soft skills and the ability to work with design.

coral mesa
#

Where is exactly the code which deals with Pawn moving with path when BTTask_MoveTo called?

#

I want to modify physical movement of AI

#

is this the one should I looking for or something?

zealous maple
north oriole
#

how would you make an enemy that tries to reach the player WHILE trying to avoid the player FOV?

wise sluice
#

Hey !
I discovered an issue with the EnvQueryGenerator_PerceivedActors
It seems wrongly implemented right?

#

This should first get the currently perceived actors and in complement append the KnownPerceivedActors right?

#

It seems to be either one or the other exclusively 🤔

#

Ahhh nevermind, "known actors" include all so it's useless to go through CurrentlyPerceivedActors 😔

coral mesa
#

What's really the difference between detour ai controller and normal ai controller?

misty wharf
#

detour uses detour crowd avoidance

#

that's all

coral mesa
#

or improvement

misty wharf
#

crowd avoidance will add some overhead, I don't know how much

#

If you don't need avoidance there's no reason to use it

random cedar
uneven cloud
north oriole
untold quiver
#

Does anyone have any ideas on how to globally swap states in a state tree based on the game's state. For example I have a basketball game and I would like my AI to swap between defense and offense depending on which team is in possession of the ball. I've tried to use a global task to resolve this but It crashes the engine every time. The only other way I can think of that will work is to put a transition in every single state that is waiting on an event and that event will trigger the state tree to return back to the root. But I have a pretty complex state tree and doing that for every state will be tedious. I don't mind it if its the only way but would like to know if there is a quicker way to go about it.

uneven cloud
north oriole
# uneven cloud I would start with just using the EQS to find a destination that passes the test...

Thx for your help first of all!I'm trying to understand better your suggestion. My goal is to make the enemy reach the player (so that should be the final destination) but with a path that avoids their FOV as much as possible. So, say I run a query with dot product tests to avoid the FOV and get a point between the enemy and the player, I'll moveTo to that intermediate point, and run EQS i guess until i reach the player?is that what you are suggesting?thx again!

uneven cloud
sand nebula
#

Hi! I'm hoping anyone could help me out here. I've tried setting up an AI character that roams around and follows the player on sight. However it seems to get stuck in an infinite loop between finding a point to move to, and moving to it except it's not moving.

I've debugged the blueprint class that finds a spot to move to and it seems to be outputting a correct X, Y and Z position.
Does anyone have a suggestion on why the character is not moving?

north oriole
uneven cloud
uneven cloud
fiery wadi
#

The doors are using smartlinks that update after opening/closing

sand nebula
#

@uneven cloud Thanks, such an useful tool!

north oriole
opal spoke
#

Just getting started with AI and was wondering what the difference is between EQS and AI perception. Should I use both?

uneven cloud
uneven cloud