#gameplay-ai
1 messages Β· Page 19 of 1
Thats what I was thinking of I believe
oh nice, academic stuff under a good license
Yeah, look, its ORCA.. apparently used in Warhammer Space Marine π
which was an underrated game

awesome
funds are... quite good too π
Hahaha.. yeah
thanks robot industry
lots of funding in robotics
gotta teach those drones how to avoid other drones
Been looking at AI music and such.. man its getting close
Looking forward to the next few years of AI.. there's a lot going on
I feel like FStateTreeTaskBase has a bug π€
Tick is called even though my OnEnter retured Success
I'd have to have a look at ORCA and RVO, I guess it is an intermediate approach that doesn't do pathfinding but is a bit more complex/complete than simple steering/avoidance?
none of the avoidance do pathfinding
yeye I know
but some seem to do smart avoidance such as finding gaps between other agents etc
I'm using similar stuff to: https://www.jdxdev.com/blog/2021/03/19/boids-for-rts/
But I'm interested in other forms of avoidance if it proves more effective
Or more performant
is there any good tutorial for ai behavoir tree priorities? i just dont get to figure out when to use as example: i have a boss that impales the player and throws him away, but everytime he does this, he spinns in 360Β° because the focus target is set, can i just make another task with clear focustarget before?
also need better explaination for the abort stuff.. i just dont know which has higher priority above 2 sequences
Sorry for the late response, I wasnt given a notification. I'm pretty sure i'm already doing that, and after doing some debugging i figured out my code works, but the "Move to location" task in the child state is firing before the EQS finishes. I have the EQS state transition set to "On succeeded" but somehow the "Move to" state is still firing before its set to succeeded. I would just have them in a group but i have no idea how to pass the location variable in that case. Any advice would be greatly appreciated!
You can use the EQS to do the selection. It takes a bit of work, but then it's easy to add any test you want.
Ah good idea, I guess you could have a generator like "smart objects in radius"
I use "get smart object slots in radius" that way you can get the closest available slot that is reachable.
Yeah something like that could work π€
It is ORCA. RVO2 is the library that introduced ORCA.
oh look it comes with an unreal implementation https://gamma.cs.unc.edu/RVO2-UDK/ 
Hmm, if you were using unreal engine from 10 years ago.. sure π
Yeah, it depends on what you're after. Most of them are after a collision avoidance that looks somewhat natural. There's a ton of research on this aspect. Personally I've found a lot of the models failing to look authentically human during movement. Some of the best models I like have aspects like "compressability" where agents can temporarily pack together. Others have "negotiation and reservation" where an agent sort of claims a spot via negotiation and others adopt a "wait" posture.. so for instance multiple agents trying to go through a doorway. Its an active area of research for things like crowd planning for theme parks, or crowd evacuation of large spaces like stadiums and such.
Norm Badlers lab is a good place to start
how does it decide which ones will wait?
I'm kinda confused about how to properly use BTs and numerous low quality youtube tutorials do not help at all. I read up that BTs are fundamentally different from state machines, and trying to implement states in it is a completely wrong way of doing things but I can't figure out how to make stuff work the way I want.
For example, I have an AI that roams randomly if player is not seen and chases if it does. Since (apparently this is the only way) I have to update player location every frame by completing the node, every frame starts over from root, goes down to chase, updates player location and moves towards it.
However, I also want the AI to do some extra tasks when player is lost during the chase. This is a problem however, since because I essentially re-run the entire tree every frame it will go straight to the roam branch
check pinned messages
there are more quality of explanations about correct workflows with BTs
tl;dr BTs are good for systemic designs, also can be called as "sandbox" type of behaviors. Its good at prioritizing behaviors, its also very good at interop'ing with other ideas like utility & FSM etc
there are cases you want to hack it and run different BTs to accomplish specific behaviors, or just disable BTs and run scripted actions
my favorite way of doing this is having a default systemic behavior on default BT and triggering scripted actions either that runs on BP or on another BT that where AIController manages this
re-running BT is generally something I try to avoid
never ends up well on large scale
To be honest, most of my current problems would disappear if I figure out a better way to just simply make the AI to move towards an actual player position
Right now if I plug the position in it'll just cache it and go there despite the player having already moved way past that point
That way I could just abort it using a condition and move onto whatever extra tasks I need it to complete after losing the player in chase branch
π€·ββοΈ
ohhhh my bad, thanks for the explanation π
I see, very interesting! I'll research more for sure
Ok I watched a couple of Rez Bot videos and it's criminal that this guy has <1000 views
When using AI moveTo on the built in manny character, the character doesnt run, it only plays the idle animation. And I cant for the life of me figure out why
Why do you think you need to update the player location every frame? That's a faulty assumption that you should rethink.
Forget about it, I missed the fact that you could plug an object reference into ai move to and it will move to relevant position by itself
But I also learned a bunch of useful stuff from that series, so I guess it was a happy accident
They negotiate between themselves.. usually time to the contact point (so basically closest wins), I've seen others where they have different rules for different agents (i.e. ones that are agressive get to push in)
Norm Badlers "Mitac" had that if I recall
But really the claim thing is kind of similar to having smart objects.. its just that the SO in this case is a doorway π it actually adds a lot to see agents coordinate at doorways.. looks a lot more human to have one wait and another move
I was quite happy seeing my squads stacking on doorways for similar reasons.. because it looks more human
Does anyone know why my AI pawn's controller isn't being set to the AI Controller I set on its BP?
If I call GetController() it's returning NULL
I'm spawning it via SpawnActor.
Looks like calling SpawnDefaultController() fixed it.
Hello! does anybody know how to reverse the direction in which the cars are going in the Citysample project? its using zoneshapes and the MassTraffic plugin
Quick question, shouldn't something like this never reach IncrementInt and just rerun the wait task after it ends?
Is there a way to disable navmesh on top of static meshes but letting them affecting the navigation around it without using NavMesh modifiers? I want to get rid of navmesh on top of them, but I don't want to manually place volumes
@verbal shore maybe decreazing Z of NavBoundVolume or using several volumes
yea wait return success, hover the selector and read its tooltip
Does anyone know how to make the Rotate to Face BB entry node rotate the character more smoothly? It sort of snaps the character rotation
okay, so do you have any idea why the right task is executed every time the wait ends? Is it a bug?
That worked in 5.0.3, but not in 5.1.0 and 5.1.1, and it also works if I use the default Blackboard decorator with a condition that is always true instead of a custom decorator
And it also works if i set "Observer aborts" to something else than "both" (but I need it)
π€
thats why I dislike BT and used StateTree instead
especially for pure C++ BT is annoying
Hopefully this is right place to post, probably several places even level design. I have been looking at AI Cover tutorials till I am going crazy, all show how to do Line Tracing to find cover - then stop. For me I need the ability to find any available cover, then if say the cover is a garden wall have the AI follow the wall till the opening and then peak/shoot or move through opening to get closer.
My only experience in the past with this is games like Crysis and others where Cover Indicators (Actors/Markers) are identified for things like doors, windows and edge of walls, identifying the direction to pass, then simply parsing the best location.
The cover finding works fine, but once I get under cover I want more realism with the AI working to find the appropriate exit/entry into a building structure or location to attack from. Is this still the best option to make a game marker to identify these locations?
Turn off use control rotation yaw on the pawn, turn on use control rotation on the movement component, adjust rotation rate on the movement component.
Hrms, is there some way to find smart objects, ignoring their claimed state? π€
It seems that FindSmartObjects never returns any claimed ones... so for example while an object might be claimed, it could still be a valid target to navigate to, and then wait until it's no longer claimed
It seems I might need to actually have a separate system to query for objects that could be of interest, and just use the smart object bits for the actual interaction slots on said objects..
I'd recommend going the crysis route as a starting point. Having actors that markup your scene is a common practice for AI. I added my own cover generation system that does a lot of it automatically, generating "cover rails" of continuous cover. There's a cover generator codebase somewhere on github if you're interested. It might be pinned at the top of this channel. Loads of games have components that can be added to actors that can add markup for AI to use. Add those to your blueprints so your designers have them when they use a blueprint is my recommendation.
Yea, it has been years since I have dabbled in AI but it seems the Crysis method and others that are close are still the best option, and would take less computing power, a little more impact on level designers but not much. I can place a actor at a door for the AI to enter/exit and then a actor on the left/right side so if the AI is in clearing/attack mode they can stop at the door and peak/shoot or enter into other cover inside. I can see using the EQS system in combination to simply identify the cover.
Thanks for the brain check, it helps to keep me straight:)
// Build list of available slot indices (filter out occupied or reserved slots)
for (const int32 SlotIndex : ValidSlotIndices)
{
if (RuntimeSlotStates.FindChecked(SmartObjectRuntime.SlotHandles[SlotIndex]).State == ESmartObjectSlotState::Free)
{
OutResults.Add(SmartObjectRuntime.SlotHandles[SlotIndex]);
}
}
π€
I wonder how do I get around this...
If I need to get certain SO's where the npc could f.ex. queue to get access, it would need to return SO's that are reserved...
hmm, it also seems that disabling slots at runtime (eg. due to being blocked by geometry) doesn't appear to be possible...
but the good thing is that it seems most of the complexity in this system seems to be there to support mass and very large open world stuff, which hopefully won't be an issue if I make a custom system based on these ideas π€
@uneven cloud any thoughts on this btw? Eg. being able to disable slots at runtime, or being able to search for slots regardless of whether it's already reserved or not?
I'm not familiar with smart objects that much but is it necessary to actually claim them? Can't you store their status elsewhere manually so that they are always available through SO subsystem but then AI can actually check if it is available or if it has to wait in queue to access it?
or the gameplay behavior definition won't execute its logic unless SO is claimed?
Interesting idea, that could be workable π€
your question got me curious and I've checked both SO component and subsystem implementations and there isn't anything virtual in them though π€
hmm I've opened my old code and it seems you actually have to use SO claim handle to use it but maybe there can be a workaround though
Yeah I think if I just don't use the claiming part of the system then it might be workable, and save the claim state somewhere else, maybe in a custom extension of the smart object component depending on how well it would let me do that
and I could abuse the claim system by claiming the slots which are blocked by geometry to effectively "disable" them lol
Hello!
I just used ChatGPT to learn more about a potential approach to an AI cover system.
I got some infos and I'm not really sure if they're corrent, maybe someone can help me with this π
First, it tells me that I should use a specific algorithm:
One such algorithm is the NavMesh Cover Point Generation algorithm, which is built into Unreal Engine
..is that correct?
It also tells me about a specific function:
Find cover points: When your NPC detects an enemy, use the **FindCoverLocation** function to find potential cover points within a certain distance of the enemy.
...I have the feeling that these infos are coming from a custom solution in some tutorial on the web. But maybe I'm wrong about this...
Pretty sure this is from tutorials yeah. I vaguely recall hearing about these things coming up here before
Its definitely not in the release UE π
generating cover locations is not trivial
On a large map, there's a lot to consider for cover... making a cover system that works minimally is reasonably easy, but one that works well for all sorts of use cases? not so much
Okay π π
...would've been also the first time for me hearing this after months of searching for a solution ^^
thanks π
...since I'm here, maybe someone has a tip where I could start with this? I'm looking for a solution in which I don't have to place cover location actors manually
it's a lot easier to place them manually, make sure they have a direction, and then selct the ones that are facing the enemy
For instance, do you have concealment as well as cover? do you have bullet penetration for different materials? do you have vaulting over cover? Do you have crouch and prone or even continuous height adjustments?
I mainly want to use it for simple (indoor) shapes like corridors and doorways and such
that is mostly using corners as cover
why not implement cover system with EQS where you test generated points so that an NPC is not traceable for threats? π€
can you destroy cover?
no need for that, no
placing covers manually seems tedious
automatically generating them doesn't leave any manual control in case of errors
it is π but you can make it tedious for designers, so nobody cares π
I had auto-generated cover you could hand edit
idk my experience with LD and GD tells me that these guys are lazy and prefer to do as less as possible xD
Well, yeah, but you make it so that its built in as components in your BP's and then they can copy the BP all over
one time they told me there's no way they'll want to place nav link proxies
exactly, that's the main reason why I wan't to avoid that.
Remember the first RainbowSix? The first level was an embassy. I'm thinking about a level that jas roughly that size.
Not really big, but tedious to place cover point all around
same as smart objects really.. cover is a form of smart object after all
i doubt paul is making something for a large team. if you only have one map please don't waste months writing a generalized cover generation if you could mark it up in 20 minutes
Even testing LOS for NPC's shooting at you can be kind of a pain. Eg. you don't want the NPC's to shoot at you through tiny 1 pixel gaps and stuff like that
- they need to test for multiple points of visiblity
and doing raycasts absolutely wrecks performance
there is only pain
and suffering
sunny π
well even with manually placed covers you'd still have to find the best based on factors like get me the closest one and the safest one from all observed threats. how is it different from generating a relatively small grid around NPC and then just have a series of tests?
But yes, there is only pain and suffering π
It's only for myself indeed. But since I want to iterate on the prototype I'm looking for a solution that is easy to maintain
good luck with testing a whole grid for multiple visbility checks π
I've tried the EQS only route and honestly it didn't look good.. mainly because cover requires coordination if you've got a group of soldiers or enemies.. so they don't all go to the same spot and such
cover point selection and generation are 2 different problems
one is what points to consider, second is what point to select
i actually did that π didn't notice much performance drop however the project was still on early development phases. the EQS was run in a service around every 1s when an NPC is retreating from threats (players, grenades). I also did dot test to run to cover from threats
It is a surprisingly complex system in truth.. you CAN make a cheap and cheerful thing work, but it won't be good
we have a big world with hundreds of players that can each have hundresd of npc's around him in the same server
That said, we had squads and bullet penetration and the like..
well the project I worked on didn't have that scale. maybe in that case I'd actually have to resort to manually placed covers but also in case of big worlds I believe chances the LDs would agree to place covers manually drops to zero
hundreds of NPCs sounds tough though
The SO system doesn't have a lot of flexibility, which is why I built my own. To change minor things about how it searches, such as allow for claimed slots, takes a lot of reworking things.
Yeah seems like it. I think Reddification's suggestion of not using the claim system at all might actually make it workable for those extra features I need, just need to have my own claiming system on the side for it
Can you use an unclaimed slot?
Yeah, I think the logic to use a slot is basically just getting the slot behavior thingy and using that to do whatever at least looking at the AITask for that purpose
It never checks that the slot is claimed?
I think the AITask does the check for it separately, so the actual slot behavior doesn't need to care about it
actually line traces are fast enough that you can make hundreds per frame without it being a problem
For a doorway if you are doing a BP with animations, simply add a sphere and name it door cover. With a trigger box it can serve two purposes, when the player hits the trigger a place to stand while the door is opened, Two spheres on each side can be used for tactical entry. You can do it through software, but like I determined years ago and going back to in the Crysis example is that is one of the more or less first games (not the actual first, can't recall the name of first) that used manually placed cover actors to make the AI look more realistic. What about Windows? A/C ducts they can crawl in? Easily done by tagging with a sphere for searching.
Use Line Tracing for finding cover. Actually you only need attack points which serves several functions. Lets the AI know which direction to watch among other tasks. Such as coordinating attacks with other AI from behind cover. Gives the impression the AI is watching the player, not simply knowing where they are.
I doubt it's gonna be easy to begin executing the SO behavior definition though, inside of SO subsystem it checks that the slot is claimed. after that if statement it returns nullptr. I'd seriously consider adding some patches to the engine source here if I had such a task like you do...
Oh damn of course it does something like that where I didn't look
I guess I could just claim it and immediately unclaim it... as hacky as that seems
I really don't feel like dealing with a custom engine for this lol
petition to make subsystems have overridable functions when
Looking for tutorial recommendations for making a cover system with eqs. The more I dig into Ryan laleys vids on this topic, the more I'm questioning best practices. I can't tell the difference between right and wrong anymore lol.
Or any excellent vids on intro to eqs even. Then at least I'll have a solid foundation.
I can tell you what I did and lets see how guys here will roast my implementation. it will probably make us both smarter
Haha
The bigger problem of overriding subsystems is now you have 2 of them, which can be very confusing. Unless you force the base class to not be created, which causes some weird problems with the Smart Object Subsystem.
Ugh lol
FlowGraph has a nice system where the flow subsystem just doesn't create itself if there's a subclass of it somewhere already
I'm completely disappointed in the smart object system with how inflexible it is. It's great to use as a guide or if what you are doing doesn't need a lot of customization.
If I remember correctly, there's also a crash if you try to make a subclass of the smart object subsystem
#RoastMe
- BT service reads AI perception component for sight, damage and hearing sense and collects threats
- then this service evaluates all threats and based on multiple scores decides whether to fight or flight
- when retreating, a dedicated BT underneath the main perception service is ran which finds the best location for cover via EQS
- EQS generates relatively small grid (about 10x10 meters, not very dense, parametrizeable in BT)
EQS tests are (tests scores are parametrized in BT)
4.1 distance - pick closer and at least x meters away from this NPC
4.2 dot product - don't run to a cover through threatening actors, filters out EQS items within some dot product range and scores items higher the more they are out of threats LoS
4.3 avoid threats. this test scores (but not filters) gets (through EQS context) all threatening actors provided by the main perception service and picks position that is not traceable from knees, pelvis and head levels of this NPC (just for fun I also added some prediction for threats based on their current velocity over some specified time so not only I avoid player I also avoid where player will be in a second)
4.? there was one more built-in test but I forgot what it was π€ - if new cover position is x meters away from previous provided from EQS - move to that location
- when fleeing - don't focus to threat, when at cover - focus on threat
what is the most efficient way to create AI groups?
i want to have max to 500 AI in view
AI groups
A manager that manages the groups and AActor for group representation
i want to have max to 500 AI in view
either #mass or custom tons of optimizations
can you give some helpful links? ;p
How do you decide what a cover point is versus a point out in the open?
if I understood your question correctly, the answer is the EQS query isn't about finding a cover point - it's about retreating, getting away from threats as good as possible. One of the tests checks that an NPC is not traceable by threats from tested EQS item. In this case you could call it a cover point. But it doesn't filter out traceable items, it just usually has the highest total item score modifier, because sometimes there might be no cover near NPC at all or it may be too far away so in this case NPC might prefer to get out of threats LoS by dot tests
I guess Iβm a bit confused when you reference a cover position but thereβs no geometry tests to determine if that position has half/full cover or if the AI would be on the right or wrong side of it. Do you have in-level markup for possible locations or this is all running on an EQS grid?
All the other tests make a lot of sense to me for scoring though
but thereβs no geometry tests to determine if that position has half/full cover
the threat evaluation test does 3 traces from knees, torso and head height levels which in future can be used to tell NPC whether it can stand there or crouch or prone
or if the AI would be on the right or wrong side of it.
well if the traces from threats aren't blocked on their way to this EQS item than it is the wrong side of a "cover", NPC won't prefer this location because it is traceable by threats
Do you have in-level markup for possible locations or this is all running on an EQS grid?
the latter one
Thank you so much!!!
I did go with EQS before but I faced some problems with for example having to score vertical cover points as well (lets say having stairs lead up to a balcony in a big room when there is no other cover point then behind the balcony to attack the player from a higher position).
...but maybe this is a too specific case and I should take of that in the LD process (?)
Anyway I guess the best solution would be to experiment and iterate more on the EQS tests. Thank you very much for the detailed explanation π π
I have the same issue I will be facing, but with stairs and ladders. I think there is a way you can score the stairs a lower value (NavValumeModifier(sp)) so when pathfinding they will use the stairs more (or less). Same with ladders for me, the cost of traveling through them is cheaper, so the system will think it is the preferred path. Can be especially useful in determining flanking positions. But I plan to use a lead or capt type AI system so all of the AI does not go blindly up the stairs/ladder one by one to their deaths.
I want to do a PR that exposes FInstancedStruct to BT editor but I have no idea how.. Anyone has any ideas where should I start researching?
Is this a slate thing or is it easy as
bool IsPropertyTypeSupported() const
{ // return FInstancedStruct thingy }
somewhere in the source code
BT editor? So for blackboards or?
BTNodes details panel
A blackboard key itself seems like a FInstancedStruct already, i just realized 
π€
(UPROPERTY(BlueprintEditAnywhere) FInstancedStruct MyStruct this is not being displayed on details panel on BTs)
Can anybody tell me why my enemies go near me instead of running to my face?
Tell your AI to focus the player...
Use focus node for that
Sorry I dont know much about it, is it this?
This will help you
What are the Get, Set, and Clear Focus Nodes in the Behavior Tree in Unreal Engine 4
Source Files: https://github.com/MWadstein/wtf-hdi-files
There are multiple nodes for focusing , all are covered in this video
Thanks for it, I was trying to avoid using behavior trees as I dont really know how to use it, but I guess I need to learn...
My ais was working good before, I dont get why they started walking near me instead of me.
It's easy to learn and really helpful
When you see this kind of behavior, you can do a draw debug sphere, if will help you to visualise
Thank you for help! I think I solved the problem. It is about navigation at that level, I was tweaked it to make it better for my big enemy, but somehow messed it for others. Even tho, I will start using behavior trees as they look more stable and more versatile.
If it helps anything, you could investigate how this works https://www.unrealengine.com/marketplace/en-US/product/blackboardextension
Doesnt look like what I'm looking for but still thank you
That's good βοΈ
Hey, is it possible to control the rotation/location for ai perception?
Is it bad practice to have a single gameplay ability for NPCs that just plays a root motion animation that gets specified when you execute the ability to take advantage of the root motion source synchronization, or should it generally be a constant that's set in the ability with separate abilities for each animation?
(and by specified upon execution that could mean encoding/decoding from an integer to save bytes if that's an option/good-idea, unless that's already being done in the background)
Im wondering if anyone here can help me figure out what exactly im doing wrong here. The general idea is that when the players are close enough to the enemy, the enemy moves to the closest player. I have my own tracing system, that is determing the closest player. I know that is working fine, the problem is the behvaior tree. I have no idea what im doing wrong here. Im setting my bb variable, that is setting fine. However, for some reason, when the closet player changes, the behvaior tree is not updating. The AI will roam, and when the closet player is set for the firt time, it will follow the player, but when the player is out of range, it will keep following, and when the closet player changes, it will keep following the same player
Attach the AI Perception Component to The Head Bone so that it follows the head and rotates along with animations.
Download the project from : https://drive.google.com/drive/folders/15QTUOyvu2jph9fSEJCxhgvIkCZg1wL0u?usp=sharing
This project is in ue5. You may not be able to open the project in a earlier version.
i think this will work
he is overriding the GetActorEyeViewPoint() with custom loc and rot
check the value of you CloestPlayer at run time in the Blackboard, and see if its changing there
Yes, it is setting
Seems to be some sort of issue with this node as using simple move to works fine, but simple move to was giving me jittering issues
MoveTo node works different from simplemoveto, as it will not update the goal location, first it will go to the previous goal location and then it will update and this cause jittering ....
you can use SimpleMoveTo in this case, as it updates the goal location
hey how did you get these fancy angled connection lines in BT editor? I want those too π
electronic nodes plugin
10q 10q
Anyone got a recommendation for the fastest dynamic geometry API where I can write some runtime geometry? I guess at a pinch I could write a vertex buffer and have niagara render it
Maybe #geometry-tools?
Need to visualize some navmesh based flow fields
naah, that stuff isn't really for runtime so much
I mean it CAN, but I suspect the code paths are less than optimal for runtime
I'm already using FDynamicMesh, just wondered if there was anything better..
Might need to visualize really big influence maps
You can generate static meshes at runtime but it's messy, they probably have the fastest codepath for things that never change at least
Maybe @soft void could help?
guess I'll try a niagara buffer, those can be stuck on GPU at least
Sup
Custom scene proxy
Not too much work
Will give you everything you need
Everything renders through scene proxies
Including Niagara
So custom scene proxy + custom vertex factory would be ideal
Is there anything specific for punting some data to GPU?
Thatβs quite a bit of work tho
I dont mind that.. its all to the good π
I'm pretty sure I did the custom scene proxy thing before
didn't think of the custom vertex factory, but that might be a good idea
I heard custom vertex factories are pain
I'm doing player-buildable walls with generating static meshes... took a lot of guesswork
Haha.. everything is a pain man π life is pain, C++ is pain, love is pain π
I was hoping the new dynamic mesh stuff in ue5 would make it simpler but so far not sure if it helps at all lol
you mean geometry scripts?
that and the dynamic mesh stuff they use under the hood
You're so badass with experience that you dont mind the pain π
I've been using Unreal too long.. its like stockholm syndrome at this point π
My problem is I don't have time to keep up with the new API's and all the changes
Although, I did have fun using alembic format for a houdini animated growth thingy a few weeks back.. houdini is super fun
You're not helping my impostor syndrome
Right now though, I need to visualize something akin to those RVO videos from like 10 years ago π
You're no impostor! you do stuff!
I also break stuff
more fun
I think we can all relate
Just the visualization part or relevant with avoidance too?
Bit of both.. its for applying a machine learning model to agent staging (i.e. where to stand, what to look at etc)
so it learns the environment?
But... it needs some nice visualisations, because its for a dance troupe
It learns the staging (think of it as X marks the spot for where actors go on stage) from films
Essentially, its a dynamic model to learn actor positioning relative to cameras, worlds and other actors
And I need to visualize it.. dynamically
And I need to project that visualisation out into the real world for dancers to follow
So have to make it super cute π
Its for my Holodeck work.. but apparently we're putting in a bid for some research $$ to work with a dance troupe too
I might wrangle it into doing formations and the like too.. because it feels like a good test case
Data driving abilities is a normal practice.
Luthage do you execute behaviors via GAs when AI interops with GAS?
Only when it's a reaction. Abilities that the AI decide to do are executed by the BT or interactable object.
I guess reactions play an anim montage?
or do you mean reaction in a context of behavior
A reaction in terms of reacting to a gameplay effect. Sometimes it's an animation, but not always.
Ah, alright. Thanks
Anytime
Had no luck attaching it to my pawn that consists of a static mesh. Haven't slept but I'll try at it again after a bit of rest.
Does GAS have UI and debugger and all that?
does anyone know if there is a way for the ai perception to detect an actors player controller?
well, you can get it from the actor.. so yeah?
yes but the problem with that is that i have two players which it seems like the ai perception just perceives as the same thing all together so the array list of what it perceives only has one thing in it
What do you mean it percieves it as the same thing?
You mean it gives you multiple senses of the same thing?
no it only senses one thing even though there are two players. I think this is because the two players are technically the same actor
Why would two players be the same actor?
no like they use the same blueprint
idk if that is the reason feels like it shouldnt be
Blueprint is a class
The instance of the BP is an object
You might want to print out the name of the thing being sensed.. debug what the perception system is actually giving you
ye thats what im currently doing and i found some strange results, ill se if i can solve it with this. ill be back if i cant hopefully with more info
I wonder what it would take to do multi-monitor with UE5.. I kind of have a hankering to make something silly
imagine an AI where you can use a map for command generation
on a seperate monitor
i haven't tried this myself π
...
will try it and I'll let you know if it works for me
I think still the best multimonitor implementation in any game I played was in Supreme Commander
You got a separate game view on each monitor, and in supcom you could zoom in and out seamlessly between the entire map being visible at once, and the individual unit level, so you could for example zoom the entire map to be visible on one monitor to be like a big overview
But since it was a regular game screen you could order units on it etc. too
Yeah, thats the kind of thing I'm thinking of.. I mean I know UE can render into different views.. so its got to be possible
Kind of surprised its not a thing really.. given how many people have multiple monitors
Most I could probably think of (I don't have much experience in Unreal, so tinkering mostly) was I could possibly align the security camera static mesh to match the default location/rotation of the ai's sight perception. With the security camera static mesh attached to the root component, I could rotate the actor and it should rotate together
Going to test in a few minutes
I might go down this route since I got what I visually wanted (the perception rotating with the static mesh component) https://gyazo.com/216299bfc30d45a2d0775c1386c2cb5e
Yeah this will work too, but then you have to create a link between AIcotroller and the enemy pawn ....
anyone had luck getting the dot operator to work in EQS? it seems to return a constant value of 1 for me. I am trying to pick points that aren't directly in front of the player
i don't understand how it thinks the dot product is 1 for all of those points
i think the issue is that i am using the querier in the "line to" input when i want to use the location of the tile that is being considered, but i don't see an option to use the tile
but if you can't use the tile then the whole thing makes no sense lol
ah, i figured it out, you need to use the EnvQueryContext_item
@crystal hatch
Hi!
Question: any plans for the future of unreal where rotated nav volumes will be supported? Asking because it's using just the bounding box of the Nav Volume now (Area is an FBox)
Cheers!
In principle that's what ARecastNavMesh.bPerformVoxelFiltering is supposed to be doing (kind of) but I just noticed it doesn't work. I'll file a ticket to have it looked at.
oh... ok. Awesome. Let me know if anything needs to be done through UDN. Cheers!
No need. Already filed as UE-177990
Why my ai cant hear noises? I make it work with ai perception on another enemy but cant make it work with pawnsensing
It turns out I misremembered how bPerformVoxelFiltering works. It filters out stuff outside of volumes, which is more apparent with multiple diagonally placed volumes, or with very big tiles that reach far outside of the volumes. But it still uses AABB.
So I guess we don't support rotated NavVolumes, and are no plans to support it right now.
Does AI Perception not rotate with the root component's roll? It seems like it only works for Yaw, so would only solution for seeing up/down be to move the actor up or down?
Going to make my bots open doors, I need help with a concept:
I need to loop through each path point from start to end each time the points are generated to determine if a door is in the path.
How would you setup the looping through each point from point-to-point from start to end each time a new path is generated?
is there a simple way to collapse a portion of a behavior tree into a subtree that can be reused in other trees? basically the equivilent of the blue print "collaspe to function" or "collapse to macro"?
Does anyone understand how this works using state trees
if conditions are true, when you send a ST event in tasks it gets transitioned to the target task
Thanks
How do you set up the event tag?
Or is it the normal gameplaytags
normal gameplay tags
Thanks
there are 3 checkboxes under DetectionByAfflication, did you check all of them?
you can do one thing(not sure if it will work or not)
Make your door not to affect the nav mesh, add a box collision , and when the AI overlaps it, stop the movement of the AI, then tell it to open the door, and the continue the movement .
How is the angle drawn for ai perception?
https://prnt.sc/-iCNlPuEgdmW
I assumed it was anything up/down in that narrow space, but noticed it only detects something "under" its field of vision if I increase the radius by a large amount
Managed to get close to what I needed by messing with these two values
https://prnt.sc/vw0jFEfDbb1j
I feel like there's a key element of behaviour trees that I don't understand. This is a picture of a tree. The Ai is just supposed to roam until it sees the player, then approach the player with an acceptance distance of 700 and then circle around the player for a little bit until attacking. (Attack is not implemented yet) Can anyone spot what I'm doing wrong?
where is inrangeoftarget set?
You've got your priorities wrong.. why is roaming higher priority than fighting? What is getselfactor? why is that highest priority?
Priority is left to right.. so always put your most important thing on the left.. but then get it with conditions
So attack can't run if no enemy.. so its high priority, but only enabled when enemy is not null for instance
and usually, I have an idle as the lowest priority that just mooches around and stands and plays anims etc
Yes, that would work except for when they overlap and they do not intend to open it they would still open it, like if the patrol path crosses over the overlap door will just open without anyone going through.
No worries I just figured it out I am tracing from the current path point to the next point + 100 units in front and he is now detecting doors in the path only when he is moving (velocity > 50) and saving that hit actor as the door in path.
Then, when he reaches the overlap I will compare the door in path with the overlapped door to begin the opening sequence.
I usually try and design my priorities first.. then I look at the conditions that enable those priorities
how do I disable this blue outline on smart objects? I've somehow enabled it and forgot how to disable π
for my enemy AI, it uses AI perception
I don't want to change anything but I'd like him not to be able to detect the player if he is above him
is there a way to do that?
Just do a check in the perception update handling logic to test if above or not
AI perception doesn't attach to anything. Or have a location. Not that kind of a component. It gets the view location and rotation from a function on the pawn, which you can override.
I would use a nav link instead. Once it gets to the link, open the door and then continue on.
Yes, it's called subtree. There is a BT node for running them.
i knew of the subtrees, i was just wondering if there was a nice UI for refactoring a chunk of a tree into a subtree or if you have to copy paste, it seems like sometimes copy paste messes up the decorators
You want to put higher priority functionality to the left. What else you might be doing wrong depends on what it's doing that is not what you want.
Copy/paste is the only way. If the blackboard is set correctly first, the decorators will less likely get messed up
Thanks
anyone knows whats the rules of state true multi task ?
you can do an external check, like if the player is detected, just compare the Z distance between the AI and the player, and based on that value AI can decide whether to respond to it or not
Hi!
We just discovered through painful trial and error that, the reason for certain map area to not have nav, is that the bottom part of our game and the top part are 9.2km away in vertical. If we move one of them within 8km, both get nav.
In other words: to get nav, you need to stay within 4KM of the world origin. I read that, to overcome this problem, you need to use World Composition (ue4) or World Partitioning (ue5), but that's not possible at the current stage of the project. Does anyone know where's this limit set in the engine? Is there a way to make it larger by changing engine code?
Thanks!
have you considered or tried putting multiple nav mesh bounds volume on map or using dynamic nav mesh generation around invokers?
Dinamyc mesh generation is a no-no for performance reasons for us (we use dynamic with modifiers only)
We support nav streaming, meaning the nav volumes are in multiple different levels etc.
Turns out that changing the cell height from 19 to 30 solved the problem. It changed a bit the topology of the nav generated, but using less cells in the bottom layers makes them reach higher altitudes
if I got some AIs that can work, some that can fight and some that just interact with stuff
should I split their state trees or should I go with 1 large state tree?
they share about 50% of the tree
Seems it's mostly a question of how manageable it is. If it becomes difficult to manage due to size, then it would probably make sense to split
how do I change ST parameters at runtime? cant find a way to even access it
Anyone looking at compute shaders for AI, I came across an interesting site.. https://unreal.shadeup.dev/docs
I show a way in this channel. Just look through my history in this channel.
also check UStateTreeComponent::SetContextRequirements
Compute shaders for AI? π€
I read UQuadtreeComponent and was freaking out about another spatial tree existing that I didn't know xD
I wouldnt know if such thing would existed π
technically can use compute shaders for everything, although I wouldn't use them for game logic generally speaking
All I know is compute shaders are assembly of GPU, maybe even that is not true
also idk to which extent makes sense for general use since most times we are already GPU bound
all GPU code ends up compiled as assembly
But then how Niagara runs on VM
ohhh I meant general purpose GLSL or HLSL, I have no idea about Niagara implementation specifics
I've been told it runs GLSL/HLSL on VM 
Mmmm
or more like, it runs compute shaders on VM
not the HLSL itself
see VectorVMBackend.cpp for fun
I know that materials compile into optimized HLSL
but dunno how that works under the hood
in theory at some point it has to be turned into some binary executable code
nice thanks
VM makes sense due to multiplatform support
its also even more complex than BPVM
probably
Yeah, why not? things like large crowd movements can be done using them
They're general purpose parallel compute, so stuff like agent movements and skeletal mesh anims and things that can have some element of localized comput can go on them
I was thinking of making a GPU based influence map and debug render setup
Having nav volumes in different levels is not how navigation streaming works. It's the nav data that needs to be streamed in using world composition or world partition.
This is what I started doing:
Implementation: When they overlap the timer starts for the trace which traces the path points. They get stuck at the door a lot (because of angle of arrival) So I also have a backup trace for when they get stuck at the door which is a single trace on the failed branch of the previous just from the capsule forward. Timer stops on end overlap.
This is how far I got with it in one night, questions start coming up like:
Becausethe door mesh does not affect navigation they got stuck on the door side that opened up, to prevent that I made nav mesh update for dynamic modifiers only and spawn a custom nav modifier to the scale of the door mesh until it clears the path then destroy it.
Should I even bother with hand IK on door handles? (I would think yes in some cases and no in others...It's more of a question as to whether we should bother with their hand IK, maybe ... for the sake of realism or "immersion" it would be nice, it's easy enough to do I already did it for the player so... why not)
I have this problem where 2 or 3 will stack up on the door and then no one gets through the door or if one makes it through then it closes the door on the others. (Not sure how to handle that ...)
Upon arrival at the door their angle is not always correct causing them to miss the trace sometimes.
Here's a video of it
https://youtu.be/rOu-txeme4k
@uneven cloud
Unreal Engine game development, 3rd person stealth action, WIP.
Hey is there a way to access the current BT Task to call an event from another blueprint?
This is why I would recommend using a nav link instead of using traces and overlaps.
Also you really shouldn't be destroying the modifier. The door being open might still block their way.
I feel like damn state tree has bug. I set paramter using 'StateTreeRef.GetMutableParameters().SetValueObject() ' but the task is failed cause object is still null, but I set it to a valid value.
anyone has any idea ?
π€
Not sure I understand your reasoning for a nav link. For example if the door did block the navigation then they would never pathfind to the door, is that why?
Nav links allow you to connect gaps in the nav mesh AND trigger behavior when you reach one.
Ok I get it, there are advantages there, thank you I will probably try it out.
hmm, so "shader" part is a misnomer? its just a fancy parallel operation method?
Well, its a set of instructions run on the GPU, which is what a shader is π
GPU's are parallel processing units that run instructions...
eventually they'll be fully programmable
Yeah, I definitely need a shaders 101 lesson one day haha π
like the old intel larabee π
shaders are super fun
its literally just code, but with good math instruction vectorization and the like.. which is why ML works so fast on GPU
Also GlassBeaver's classic method is just moving everything to GPU to parallelize them π
anims, physics, any math
So with compute shaders, you can do a ton of calcs in parallel, if you figure out how to optimise your data pipelines.. a bit like mass does? you know, rearrange the data to look nice and flat and fit it into parallel chunks
I guess one day we will migrate from CPUs to GPUs? 
Its weird, because people have been using just huge numbers of cores on CPU's to cut GPU cost down in datacenters for ML.. I guess its eventually going to end up the same
There was a chip intel invented called the larabee, check that one out.. it was a FPGA chip, which meant you could rewrite its architecture, intel were hoping devs would write custom render paths onto the hardware
It was super cool, but nobody has time to learn that.. developing your own render paths to draw triangles or elipses and such.. didn't take off, but it was REALLY interesting
GPU's are moving slowly in that direction
Went from everything is fixed.. to bits are fixed and other bits are programmable
eventually it will all be
I suspect we'll move towards the M1 style chips though.. maybe risc etc.
I have been trying to get DetourCrowd avoidance working for a few days in my main project. It used to work but has stopped recently. Just to make sure I didn't mess up some setting somewhere, I created a new third person project all with default settings to test it, and there is no path modification happening at all. Please see this short video and let me know if I'm losing it or what, but this doesn't seem like the intended behavior: https://www.youtube.com/watch?v=vGvdOkGiIbk
You need the detour crowd following component on your AI characters if I recall.. which only works from C++ last time I looked.. although that was years ago
I ran it in debug mode on my main project and it is adding the characters to the CrowdManager in the CrowdFollowingComponent
There's a few values you can modify in the codebase to add debug visualization to it.. might be worth taking a look.. like a bool value you can change to true to debug it etc..
Ahh. I do see if I make them run at each other they do try to avoid, just not the player because it isn't being managed by the crowd controller even though I have the DetourCrowdController attached to it
the .h file for CrowdManager says: * Actors that should be avoided, but are not being simulated by crowd (like players)
- should implement CrowdAgentInterface AND register/unregister themselves with crowd manager:
- UCrowdManager* CrowdManager = UCrowdManager::GetCurrent(this);
- if (CrowdManager)
- {
-
CrowdManager->RegisterAgent(this); - }
So I'll give that a try
Not working. I made a component that inherits the ICrowdAgentInterface and registers itself, and added it to my player. The the breakpoint is hitting, but if I am possessing the character the AI cannot see it. If I unpossess the player, AI avoids it. So far every mention of implementing this on the forums or elsewhere ends with no success from the user or they never come back with a confirmation.
Possessed player, the AI doesn't see it, but sees the same class of character not possessed to it's right"
Unpossess, AI can see the "player"
how can I debug navigation problems? my Ai works fine with some actor but doesn't move with other.
Nice, now go post on the forums saying how it all works π
what is the standard way to prevent the AI from chasing the player past a certain point if you are using navigation invokers to generate the navmesh dynamically? is there any easy way to generate an invisible barrier that the AI won't cross? If so then you could just say that if a path to the player doesn't exist to return to where you started, but not sure how to add an invisible barrier that only affects the navmesh
you can put a collision volume which will ignore your player/AI and set it to affect the navmesh ...
this might work
done π
right. Yeah, my bad. What I meant: we support that, while level streaming happens, on level added/removed, we handle the navigation chunk objects handled by each individual level and they are added/removed to/from the level when needed. We also managed to fix some problems with overlapping nav volumes in different sub levels. Something like what you can see in that link
https://github.com/mbrpistoni/UnrealHowTo/tree/main/FixForOverlappingStreamingVolumes
Quick question: is there a way to activate the visual logger outside of yhe editor? Rinning vislog command doesnt seem to work
There's a remote control plugin, maybe that'd work?
Hello! I assume this gets asked a lot, but how do I prevent one type of AI character from navigating an area, while allowing another? For simplicity, let's say I want character 1 to always take the left path, while character 2 should always take the right path.
You can assign different nav area types to your nav mesh, then use a nav query filter when moving your characters, where each character's query filter is configured to allow it to only navigate the wanted area types
Thank you! I'll look into that and come back if I don't get it. π
is there a way to make a blackboard key observable in a BTT? I am trying to create my own move to BTT but I can't find a way to the blackboard key observable like you can with the default move to blackboard task
I guess a decorator can do the same job?
although that doesn't give me the option to have a tolerance
It might be something you can only do in C++
Hello everyone!
Why on a decorator, the value associated to the SelfActor key is nullptr?
BlackboardComp->GetValue<UBlackboardKeyType_Object>(ActorToCheck.GetSelectedKeyID()); // returns nullptr
As a workaround I had to do:
AAIController* Controller = Cast<AAIController>(OwnerComp.GetOwner());
MyActor = Controller->GetPawn<AActor>();
But I would be happy to understand why, the SelfActor is nullptr?
Try getting the BB value by ActorToCheck.SelectedKeyName instead. If that doesn't work, either you have a property "always fill self actor" unchecked in project settings β AI settings or (more likely) you need to "resolve" the SelfActor BB key in an override of the InitializeFromAsset virtual method with something like that
void UBTDecorator_MyDecorator::InitializeFromAsset(UBehaviorTree& Asset)
{
Super::InitializeFromAsset(Asset);
const UBlackboardData* BBAsset = GetBlackboardAsset();
if (BBAsset)
{
ActorToCheck.ResolveSelectedKey(*BBAsset);
}
}
Is there a way to timeout MoveTo when "blocked" quicker or make the task pause? I'm finding even with avoidance, AI can get blocked and jitter for several seconds before failing with blocked. I'd like it to at least pause the MoveTo while blocked instead of continue to jitter back and forth.
Also, I would like to see it re-route to a longer route if it cannot make it due to being blocked. Here's an example: https://www.youtube.com/watch?v=QtEPAUb-k_0
This is using the Spline Based AI MoveTo plugin, sad to see it is a lot more jitter than I had hoped based on the video he has of Detour being used
Does anyone have a preferred method to path an AI to an exact location? I have discovered AIMoveTo stops when the location is within the agent's radius, which is too imprecise for my needs.
I have tried using Nav Modifiers attached to the pink guys to raise the cost up to 20 and setting the mesh to generate dynamically for modifiers, but even with a box the size of 10, it goes down to 1FPS when the characters with nav modifiers move.
Forget it. I figured it out. The option is there already.
Thanks for your help but SelectedKeyName did not worked either. I have not a "always fill self actor" checkbox but a "Add Blackboard Self Key" one and it is checked. And I already have the InitializeFromAsset. Still having the issue. π
I know this is the AI channel, but has anyone here use state trees for player abilities or states?
I had a simple prototype of conditional attack sequences made with ST
Do you like it? Are you going to expand upon it?
There is an enum bug in 5.1 which prevents me from using BP enums in parameters, if we ignore that, I liked it. But I also have Logic driver (a paid plugin), provides same features with less initial setup with more designer friendly editor so its a matter of how recursive graph will look like for me. Logic driver gets very difficult to maintain but ST is able to hold your hand a little bit more until some point, but yet again it has its own problems
Tldr, I like ST a lot
I am also planning to write a default AI frame work upon it with my ideal AI implementation fantasy, where AI controller doesnt exist and everything is done modularly with abstract data bindings
For multiplayer, its not an option though
No way to replicare state
Do you or anyone else know of any way to bind to enter and exit state events?
For what its worth, I did enjoy ST. Just too buggy for me. So I just went back to BT. Will try 'em again after some time in the oven.
does the State tree "Debug Text Task" needs to be enabled somewhere?
cant seems to get it to show up, not even with a super basic tree
AH it doesnt work in simulate
is there a better way to debug state trees?
I've been toying with making my own rotation function on tick, avoiding rotation if the character's velocity is below something like 20. It is much smoother. No jitter. If I could only make the pawn not move at all for velocity under 20 that would be great too. After the rotation is gone you can see the walk animation flash from idle to walking so its still a twitch but not near as bad as rotation.
I'm making an AI for my NPCs in a town setting, they have a daily schedule, ie, home, work, leisure, back to home. I've got it mostly working in BT, but reading a bit online its looking like using a state machine would be better for what I'm trying to do? notice a few people say state trees are buggy, but dont really specify how. Or is there another option
Why do you think a state machine would be better?
Im not 100% sure. But an article i was reading mentioned how you shouldnt force BTs to be a state machine with service/decorators, which i am kinda doing
Im setting the npc goals/tasks manually basedon time of day, so i dunno..
Plus i hit a bug where its not doing the temp wait node at the end of my tree for some reason
About to start work, so wont be able to reply now till morning
I went down that route with Logic Driver Pro. Great product, very quickly got out of hand for complex interactions between the player and NPC. I switched to BTs. I'm now working with State Trees which are buggy as hell and undocumented. Hopefully 5.2 comes out next month more stable.
I have a base Character blueprint that my NPCs inherit from, and I've made child classes for now to handle settings specific to the characters. I have a State Tree that I have been testing using one of the children, but when I try to apply it to other children in the level I get a hard crash every time I click play. Can you not share a state tree like you can a BT?
its something i too wanna know about.....
i tried this one with AI affecting the navmesh, but the performance drop was seriously high....
so dropped the idea π
,
Yeah what Iβm thinking is maybe have associated waypoints or something, multiple βentriesβ to the same location, if the first one is blocked try the other. Need to get into the code more to catch the blocks sooner if possible and change course.
but for the way point we have to manually put them in the world ? right ?
yeah for small areas it will work,
but for a larger map, it will be a pain to do π
wait, are you saying STs are not suitable for multiplayer yet? I still haven't got into them because at current state I really prefer BTs much more
Both BTs and STs doesnt replicate
On my journey of having multiple BTs. It seems multiple brain components actually work fine (despite how bad idea it is). The problem is some tasks, usually ones which have some delegates. MoveTo and EQS are good examples. The move and the query runs just fine but the finishing delegate gets the BTComp as AIController->BrainComponent instead of getting owning BTComp of th BT Task :(
It would have been so nice if multiple BTs were possible or at least running a sub behavior tree with a different blackboard :( Not being able to do that prevents all the cool stuff we can do with embedding state tree execution anywhere.
but that does not mean it is not suitable for multiplayer game, right? They do decisions server-side and client sees just the outcome like the enemy moving somewhere or spawning muzzle particle on his weapon.
Yeah I was mostly mentioning it about comparision with Logic Driver, since it can replicate state
Logic Driver can track which state you are in and replicates it to server or client with a replicating component since states are adressable with IDs, ST doesnt track or expose the current state afaik - otherwise it can run on server ofc
yes, so far we have not use the replicated Logic Driver features even on multiplayer project but it might be only because I am used to server-side only AI approach.
I definitely agree on your point that it can get difficult to maintain very soon. There is so many places where you can hook something, customize something what gives endless possibilities but can be also nightmare for understanding such SM as you need to jump into many nested graphs to understand what the thing is doing.
does set focal point even work? i was using set focus ( actor ) it works fine, it turns my AI to the given actor, but set focal point? no it doesnt, even though the vector location is provided but my AI units dont actually set focus, is there something i could be doing wrong?
Visual Logger
https://dev.epicgames.com/community/learning/tutorials/K6y1/unreal-engine-statetree-debugging-primer
state tree sub tree is for organization only or does it provide another functionality?
Which would be better, a) All AI logic on single Behaviour tree, b) Have sub trees off the main tree with the "Run Behaviour" node, or c) when my town NPCs need to change tasks, have the controller call Run Behaviour tree
2nd question, why is the Wait node at the end not running?
I dunno what I did, but its using the wait node now. what the heck was wrong?
Check visual logger to see why wait node aborted
All is options are good except A, prefer dynamic subtree injection instead of C
ok, so I could put each task, or atleast the more complicated ones, on a sub tree, and use Run Behaviour?
Run behavior dynamic
Actually it just clicked why it wasnt working... I was using Rotate to face BB Entry, which was set to a Rotation key, so it was probably failing
What is the difference between the two?
Replace get task with a service that sets a bt ref for dynamic one
Dynamic one can change its BT to run run time
Other one is static
Ohh, so when I give the NPC a new task, I assign the new tree, and then run it with Run dynamic
then have each task on a seperate tree?
Yes
Ahh... I could still have stuff on the main tree for other things, like if an NPC gets attacked, I could still put the flee logic on the main tree
Yeah its all about prioritization
cause the tasks, or as I'm calling them in my code, "Goals", will be seperate from reactive things like the player talking to the NPC, getting attacks, etc
You can also set different flee behaviors
With dynamic run BT
Simple thing provides tons of flexibility
Niice. ok. At this point I dont know how advanced that will get, or if I'm even going to need a "flee" mode, but it opens ideas.
Seeing as you're being awesome and I'm going to push my luck, What about if an NPC needs to be part of a cinematic, or a quest doing special things, I guess with a cinematic I'd put in a "do nothing" mode, and a special tree with the dynamic run for quests?
Just lock the brain component
tho it would be hilarious to see an NPC trying to run off to do its usual tasks in the middle of a cinematic and keep snapping back to cine position.
ooh, how?
There is a BP function, search for the keywords resource lock
And for quests, either same methods with dynamic run BT thing or swap BTs
ah, if I get Brain component on the ai controller, there is a start, stop and restart
and an "IsPaused", but no pause command
Its a Static func in bp
Just read some forum posts mentioning locking resource logic in BP as well
In cpp you call from braimcomp directly
k I'm still confused on the pausing the logic, I cant find any nodes about it, just start and stop. Unless I should be looking elsewhere, but I dont see in on the character either
when I get to it, I'll try the stop logic, and if I still have issues I'll ask/google more
right now I'm just trying to get the NPC to face a certain direction
helps if I set the key.
UAIBlueprintHelperLibrary::LockAIResourcesWithAnimation
I saw that one, but it needs an animation instance...
with BP, thats the best you can get, because, who cares about BP people in a framework that predates C++14
me!
but not Epic π
π
well atleast I got the NPC to go to different task locations, face rotations, and wait a specified time. Even gave the tasks option of a cooldown to do again
and without making the BT more complicated
enough AI for this morning. time for sleep
Thanks for the help btw Eren
anyone got an idea on this mystery? im using als v4 characters btw
I think you need to feed the target , if you are having it inside of bttask
For me the complexity came from changing states and all of the necessary rules. My NPCs have their routines but I want to interrupt and have them follow my directions then go back to what they were doing. Overall it turned into a mess but it could have been my inexperience. This was almost a year ago when I was a newbie.
Feed the target? I have used rotate to face bttask node too even that doesnβt rotate my player to the given vector location , even if itβs 0,0,0
Can you run a single State Tree on different classes? UE crashes on launch when I do that.
Wait i think there is something we need to change in the pawn or either movement component, not sure .. I'll take you a look and get back at you ...
Iβm sure you mean control rotation
I have similar experience with logic driver
Cause I checked that too
super powerful but maybe too powerful. You need to be very careful about how you do things there because otherwise it can be a mess.
Feels like ST is better in this as it forces a certain workflow on you but on the other side I think the workflow is not faster than having a graph and just drag and dropping nodes easily and creating connections just by dragging. I constantly found myself just reopening various dropdowns repeatedly in ST and clicking from state to state.
There is a new feature where you can link states to transitions
makes it easier to work with
similar to anim graph's features came with 5.0
in ST?
no, logic driver
Do you mean the gameplay tag based "portal" transitions?
ah yeah, I guess
I was working on Logic Driver for a client and I dont own it, so I couldnt follow much
yeah, I came up with that idea a few months ago when refactoring a big logic driver based state machine :D. The author of the plugin was super responsive and implement it 1:1 within a week.
so it was your idea? π
yes :D including the UX like coloring
you're awesome, that helped me a lot too haha
Yeah the support is great. I could use it for object logic if nothing else. Iβll take another look at it. It was expensive so might as well use it lol
I've been seeing LD pop up more frequently lately, lol.
You get access to the source code too
haha. I am not sure if I should be proud because sometimes I am afraid people will misuse it to just get rid of the visual connections and make everything even more obscure :D Saw it once.
You shouldn't force a BT to be a state machine. Having NPCs follow a routine can be done in many different ways, many of which are not forcing a BT to be a FSM.
I just realized people can comment on articles
Can you tell me why my character doesn't play anime montage?
Don't have a slot on the anim bp to play it - probably one of the most common things to check first
I'm having an issue where the AISense_Sight is not registering at all. I have an AIPerceptionStimuliSource on the player class. AFAIK it's set up correctly. The AISense_Hearing works fine, but the array for sight always returns a length of 0. Has anyone else had this problem?
You are returning immediately instead of waiting until the animation has finished. Should also check the anim BP as @harsh storm said.
Many different things could be causing it. Something breaking line of sight could be causing it. Could be team affiliation issues. Could be sight settings. I'd recommend using the gameplay debugger to visualize the sight pie as a first step.
Thanks! When you say breaking line of sight, does that work via collision channels? If so, what channel is the AI using?
Yes. It's the visibility trace channel.
Anybody know why my navlinkproxy work for a monster but not for others?
Am I placing it wrong? Edit: They are succesfully pass it but sometimes they are just stuck, this happen rarelly
The visual logger should give you more information on why they might get stuck.
I have a problem. the way my ai works is that it is registering the pawns it sees (the players) and then sets a variable called "targeted player" to the player that is closest, however when i cast to the ai and make the ai moveto the targeted player it only moves to one player all the time and not the player set in the targeted player (however this only happens when i do it in the behaviour tree as a task, otherwise if i do it directly in the AI blueprint it works fine). Anyone know how to solve this?
Is there a way to Claim and Use a SmartObject if I have a reference to its SmartObjectComponent? It seems (at least in Blueprints) that the only way to Claim/Use an object is to have a SmartObjectRequestResult. I can get this by running FindSmartObject, but... I already have a reference to the actual component. I know which actor containing a SmartObjectComponent that I want to use, so I thought I should be able to bypass the searching within a cube process, but am I potentially misunderstanding the workflow here?
Well I went down a long rabbit hole where it was working or not working seemingly randomly. Long story short, I fixed a lot of problems, but the main one was that a large volume component I had completely forgot existed was blocking the visibility channel. Everything works great now, Thanks!
after casting check the value of the TargetedPlayer, see if its the new one or the old one, or if you are setting it in the blackboard then at run time check whether that blackboard value is changing or not
this one
Sure let me check
No it still did not work
RotateToFaceBBEntry and SetFocalPoint do not work, but SetFocus actor works t
i mean bro
would anyone happen to know why AI behavior tree doesnt seem to run when i launch Standalone?
i need to troubleshoot a bunch to see if thats actually the case anyway just thought i'd check if this was a common thing or not. could be the AIController isn't possessing or something
edit: figured it out. was trying to check if we have a pawn (and then cast to our pawn class) in AIController's BeginPlay(), and if that failed (no pawn is set/possessed) then Destroy(), so I think that was happening before OnPossess finished and actually saved our pawn variable with our new possessed pawn. didnt happen in editor because it already possessed the pawn.
nevermind i got it working
how?
i had to disconnect this pin in the hearing stimulus
oh, so the issue was something else π
yep
How come an ai with sense sight can detect something through a wall?
The ai with red box outline is detecting on the other side of yellow area. Could the door have something to do with it?
Also, noticed hearing sense pops up even if I'm not moving as a player sometimes
Ah, it is the doors. Just tested with replacing with a wall
If your door doesn't block the sight trace channel then that's the problem
iirc sight perception traces by default on visibility, but it can be changed in project settings
Yeah if you have your function return the play length, you can set a timer in tick and return when it's finished
Avoid using the built in rotate task. We always do a custom rotate using fmath::rinterpto before setting an actor focus. For example, we have a task that sets bIsRotating, which triggers an animation in the ABP, then an anim notify state that rotates according to the length of the state and switches the bool off when done.
Yeah Iβve been trying to find a way to make it less snappy
That would be my suggestion then. Custom c++ BT tasks certainly make it much easier.
I dont know how to use it but it showing something like this when it stuck on door and looping forward-backward, but I dont get why it says aborted new requested?
I made a ChatGPT integration so GPT can control an npc within the ai system to decide the next function based on logical decisions, this would allow to make a dialouge system with this plugin or any other systems
here in high res
The movement component can handle smoothing out the rotation. Turn off use control rotation yaw on the character. Turn on use control rotation on the movement component. Adjust the rotation rate on the movement component.
User aborted new request means that your AI requested a new path. Likely because your target moved.
Hey guys, I have an issue with State tree and wondering if someone else experienced it.
I have a Task in a State that is binding to a Parameter of the StateTree. When opening up the Actor that uses that particular StateTree, I can see the parameter displayed and I can edit it, however the value that I inject there does NOT seem to be used by the task in question
In fact, it only uses the default value of the parameter in question (set in the State Tree editor) as opposed to the value set in the instance that the actor uses
hey there everyone, i was just reading about the zone graph and mass AI, its a pretty good thing, but i am having a question....
like the crowd that we spawn using the massAI, initially we will like assign a zonegraph to them, so is it possible to make some editing to those spawed AI, like giving them a AIController, or making them interact with the world or the player, kinda like open world games crowd...
Have a look at the city samples.. they do that, at certain distances you can transition to an actor-based object etc.
is there a cleaner way to get actor ref in state tree task from state tree without binding it?
How do you mean see if its the new or the old one, how would i do that?
Did I already mention I hate the concept of Brain Component?
Even recent UStateTreeComponent is not very helpful because of it as it is derived from UBrainComponent. So if I have UStateTreeComponent brain and want to launch a specific behavior's Behavior Tree, it will start causing issues as the AI Controller already has a brain and BT comp must be a brain too. At least in case of UStateTreeComponent I should be able to workaround it by duplicating it and deriving from UActorComponent.
Yeah, its quite an annoying limitation, given that AI might be applied across a bunch of different use cases. I guess its the old OOP'y way of thinking still hanging around. True components wouldn't have that design.
I am also not sure if AIController actor existing on the server-side only is ideal. I want to communicate some AI decisions like commands to the user interface and because of AIController being server-only, I need to replicate it via pawn what basically means leaking AI & Controller stuff into the pawn. Is there some other better approach people use?
typically you would rpc the request to the server, change state on the server, then that server state gets replicated.. UI just displays the replicated state.. I mean outside of which exact class it is that holds the replicated state, there's no real difference
And I think it kind of makes sense to have that state be in the pawn, because its the thing under control..
I wonder if every AI system is cursed like this, even Kythera had similar issues
Which curse is that? I'm sure there are multiple curses π
Is it too much to ask for a modular, extensible, and relatively modern framework for AI programming and design? π
I believe so π
UE and its alternatives cant provide any of those
until you build it
Oh trust me, there's plenty of games being made with worse setups than UE's AI tools π
I'm tempted to, tbh, not that I can easily but I want to ship a game not build something an engine suppose to provide 
Engine schmengine
Its YOUR responsibility to make your game.. if the engine doesn't do something, then you have to make it π
I fell into that trap myself back when the garagegames TGE engine was first around.. loads of people did..
waiting for some company to provide functionality is just a bad idea
Yeah I just realized even with modern engines having proper tools is a luxury
There is no AA+ team that doesnt build their own tools
You wouldn't believe the tools loads of games use.. I mean REALLY big games using XML to specify AI π
To be fair, it used to be pretty common practice that you'd write the engine, write the tools at the same time, then write the game.. you can imagine the engine and tools were kinda bad π
Well Luthage also said once they had to wait for a specific individual to define a data for a gameplay system for around a few months π And no one else was able to do it. If we compare UE with that, data assets looks something very fancy, but its not π
Yeah, UE's data handling isn't great currently, but its toolset is eons ahead of most games in general and its UI toolkit is extensible as hell. I mean people should be customizing the engine massively if they're doing it right
I'm currently trying to finish my nativization plugin, if I can find time after that, hopefully I have a UX overhaul idea for BTs. I want to keep low level systems in AIModule and create a new BT editor that has same features of property bindings of ST, and ofc no dependenies to AIController and such.. But damn, even thinking about is time consuming π
Yeah, its all about time isn't it.. I don't have any time to pursue my dreams of improving UE π
have to pay the bills
Which weirdly, might mean spending a few months making UE handle live data a bit better
Only if you would be working at Epic 
Maybe it could help on UX side haha
I'd certainly make them aware of my bitching about the UX for sure π
not sure I'd win many allies though π
The weird thing, is that there are SO MANY projects to work on.. you really have to choose them
That said, doing a game jam this coming week π
Bit of lecturer->student relations π
Plus its fun
And I want them to know I mean it when I say that its important what you do outside of your normal course to show you're a hard worker etc
Kind of a practice what you preach thing I guess
A generic one? Yes. A game specific one? No.
Most networked games have AI only on the server. This is very standard practice. Sending SOME data to be replicated to the character isn't leaking AI.
Sounds like you are fighting the engine.
hello
Just ask your question
how are you making him run?
Your attack player is calling runtoplayer..
ok
I take it. I definitely don't want to do client-side AI logic. Just that replicating AI properties by copying them to pawns feels sub optimal. But I am fine with it as there are other more important issues and I can work with this just fine.
mm im a noob in unreal
Yes, but I believe I don't have that high requirements. Just encapsulating behaviors into individual state trees or behavior trees and allow mixing them. But I get that most of my issues are from designs done more than 10 years ago. I hope Epic has time to revisit them at some point.
Highly disagree. The suboptimal way is replicating more than is necessary.
I am basing it on a picture of ideal design where pawn is really just a physical representation and everything AI & Player related is kept at the controller level. I know, not realistic but that's the core idea behind pawns, isn't it?
You're running into problems, because you are fighting the engine. When this happens you need to change your approach instead of trying to make the engine work in the way you think it should. What you are asking for, mixing BTs and STs, is a big ask. One that the engine doesn't support.
I think problem is achieving something like that causing more trouble than it has to be
Yes, the pawn (body) and controller (brain) is the correct paradigm. Most of the time, the client doesn't need to know about the brain, because it is just a puppet.
Why is it a big ask? In my case it is just that having a single BrainComponent feels like unnecessary restriction, especially after 10 years of the engine development. To be fair, state tree is a really cutting edge stuff in this regards because it can be embedded into anything as it is only a struct. Very easy to embed it into a BTTask. The fact that the out of box provided ST component still derives from UBrainComponent seems to be just continuation of this unnecessary restriction. On other side, it is quite easy to create a replacement in C++. To put it right, I complain about new systems being based on the same limiting framework instead of adjusting the framework.
compared to other engine areas, AI was under-resourced for a long time and just recently got some nice traction. Since the initial years of UE4 release there was very little progress on it. It is great that it has a team of engineers now in UE5 but still it is a lot of work for them to get it back on track after all these years when it was under-resourced.
Even decoupling AI systems from monolithic builds is more than enough imo
Changing existing frameworks causes breaks in all projects that rely on it functioning the way it does.
While you can embed a ST into a BT task, the amount of reasonable use cases is extremely small. It causes a significant amount of indirection that most wouldn't want to have.
The problem with generic solutions is that they cover the general uses and cannot cover everything anyone might try to do.
I disagree that it has good traction now. The new things are replacements for the existing framework instead of any improvement. It's also incredibly disappointing how inflexible the new systems are.
Depends, Epic is experimenting with mixing it too.
#gameplay-ai message
#gameplay-ai message
yeah, maybe I am overly optimistic with the current traction π I am just disappointed that in most cases they seem to develop the minimal required thing they need and then probably move to a next system (speculation)... not sure... but it feels weird that cool complex stuff like ZoneGraph was developed and then is not actively updated anymore. Same for Smart Objects which are still being developed but the changes seems to be rather minimal. Same for other systems.... Would be nice if Epic's management gave it as much attention as other systems like Niagara or Sequencer which have a team just continuously working on it and improving it every release.
Having a smart object run a state tree makes more sense. You can just do the same thing that they are doing and have the gameplay behavior tick the state tree and have the BT task run the gameplay behavior. That's a good way to do it without fighting the engine.
Building generic gameplay systems that can work for everyone is HARD. Building something for a specific reason makes sense and leaves it up to the user to use it, build on it, or build their own. I use a Utility/BT hybrid for my AI. I don't expect epic to build that for me, so I've figured out how to build it and incorporate it in a way that isn't fighting the engine.
However with the newer systems, making even small changes are incredibly difficult, so the best option is to not use it at all.
Tools like sequencer are just easier to make generic, so it makes sense to put more resources into it.
Hi, I have several AI Pawns located on the level. When i use Move_To in Behaviour Tree, they collide with each other instead of trying to get around the other pawn. How can i make them go around each other instead of colliding?
Hey! I have a question: We want to make a top downer where big waves of enemys just chase the player. very simple behaviour: run to player, dont run into each other and get stuck. Is using the ai system in ue5 with all these parameters very heavy on the system, or does it just use the variables that are actually needed from the ai? Because with 200 enemys the fps are already at 30 and i wonder if its because the ai is so heavy even tough its just sensing and runnin towards the player
i'm not even using complex meshes, just spheres yet
There are 2 different obstacle avoidance solutions built in. RVO and crowd following.
Could be a number of things that are causing perf issues with 200 enemies. Most likely culprit is the character movement component if you're using characters. Profiling is really the only way to know for sure.
thanks, i ll check it
Thanks alot! I dont know how to do that tought, seems i need to dig again xD
In order to consume few hardware resources as possible, but also to make it clean and simple to maintain. Should I spawn NPCs around the player while it moves along and delete everything out of a predefined radius? Would it be better to spawn the whole world and simply βput to sleepβ actors that are not in range? What is your preffered approa...
Any thoughts?
Without reading - it dependsβ’οΈ
As always, the best way is extremely context dependent
Answering without reading...not the sharpest tool in the shed.
Don't need to read - it's an exceptionally broad question.
Any "what's the best way to do <generic action>" is always it dependsβ’οΈ
Spawn everything and put to sleep would be the best approach in terms of CPU
Just make sure you really put to sleep, including movement comp, collisions, ticks, AI logic, etc.
Ai Character BP navigates to the PlayerStart position -OR- the Play From Here position and doesnt update location from there. Player is Pawn BP and am pretty sure its set up correctly.. only looked at the blueprints 1000 times by now. Where is the disconnect? I'm so puzzled by this.
is there a way to tell the AI to take another route to its goal location?,
like they always take the shortest path, but is it possible to make it take a little long path to the goal location?
Either put to sleep or despawn, they also consume memory when they are alive
You can use significance manager too
You can exclude some AIs from this like if they are suppose to chase player etc
I think you should be able to do something with splines to change how it moves. or you could always have some preset points around the map that the so goes to before the player
Hi everyone, I am trying to figure out what is the best way to force BT to re-enter to certain subbranch based on even timestamp, but I would like to ensure the re-enter have a cooldown of (ex: 1 second), is there anythink built-in already in the basic set of tools that allows me to do that?
Even -> event
yeah spline can do the work, but i am looking for a dynamic run time approach , as for the splines its just a static one .
I see, then i sadly dont know a method
In general, pooling is better than those options. However it depends on the game if that's even necessary.
What is the design problem that you are trying to solve? It sounds like you are trying to force a BT into acting like a scripted AI and there is likely a much better approach.
I have player firing a weapon, that generates events. These events have a timestamp, I want my AI to flee from the firing position
The problem is the first time they start executing this behavior, I want them to play a surprise gesture animation, and in the mean time I want to run a EQS service to calculate a flee position
But the second time I want them to directly recalculate the flee position, I have problems with how to configure the behavior tree because if the player keeps firing all the time, the behavior tree aborts continuously
I want to know what is the general way of sorting these sort of problems
With the current set of tools that unreal provides
Or maybe someone knows what is the best way of structuring the blackboard data to achieve this
The blackboard keys that I have at the moment are basically: FireHeard (boolean) FiringLastPosition (Vector) FiringLastTimestamp (float)
But I could change the whole set of keys and calculate something different if needed, the issue is I am not sure what is the best way of organizing this
In other systems, like in an HTN Planner, I would inspect the world state (in this case the blackboard) and I would write specific rules to start/continue the current plan
But here, because of the event based approach of the behavior tree I have some problems
But I got the feeling it happen because I am not using the behavior tree in the right way
And that I need to change the mindset
I typically classify this kind of thing as a reaction, which I don't recommend putting in the BT. Because getting it to work in a BT is incredibly gross and causes a lot of problems.
If you are using GAS, an ability is a good place to put it. If not, you can just script it. You'll want to pause the tree before you do any of your logic.
But the EQS and move to logic needs to be part of the behavior tree right? I guess I can move the reaction part to some sort of ability, but I am not sure I can move out the EQS and move to logic outside the behavior tree
Nope. There is a move to AI task and EQS that can be run in any BP or from C++.
So I am hoping someone has enough familiarity and experience with octrees within Unreal, such that they can help, for pay, my main programmer with its implementation?
Haven't found anyone in the jobs listing experienced with it.
Is it possible to feed a vector array to use as a custom path?
anyone know how to add enemy ai to a character?
What information do you need? The navigation octree is a good example that you can use.
I implemented an octree in my boid simulation, it's UE 5.0 but I doubt it has changed
it's relatively easy to setup
there are other examples of the octree being used in-engine
Those are all the classes interacting with the octreee
MSBoidOctree contains the setup data
the Octree Processor destroys and rebuilds the octree each frame (since I deal with moving objects, it is the way to have it updated every frame)
and in the boid subsystem, there is a helper function to get boids in a box
Another nice minimal example is FSmartObjectOctree
You need to elaborate more
Do you want your AI move with a custom FVector array you set?
instead of A* pathfinding result?
does it make sense to generate flow field for each building for a city builder?
1 to 15 units can interact with a building, there are up to 200 units and buildings
when building placed it will update the effected area of the cost map and regenerate the flow field of every building
it will end up with 200 flow field maps but it can last for 10min~ (days in game) instead of A* every unit every second (hours in game)
help with navmesh and use of octree for dynamic cover generation
If that's the case, why GlassBeaver's repo doesnt help?
Why not just update when they move?
I implemented it in 5.0, and I guess it's still true - TOctree2 does not have methods to update entity transforms
in any case the cost of teardown+rebuild is very small
lookups are the most expensive thing
pls i need help in the animation tab pls
Is there a way to limit the radius and origin point for EQS?
I want my NPC's to get locations all inside a certain location/radius but I'm not getting any good results here
hey, can't we use "get all actors of class" in a bt decorator ?
is it possible to add to the senses config of the ai perception component in the constructor of a cpp?
It's minimal to make that functionality.
rather than editing it through the BP?
or would I need to make a subclass of AI perception comp?
Origin location is done by making a context. Radius is done by using query params.
I wouldn't do it in a ctor as the component needs to exist and be initialized. I do it during possession.
I mean, my guess having a OnCircle and setting its center as Item instead of Querier, but I don't know what exactly is item, I'm very new to EQS sorry.
I'll search about it, don't really know what context is.
probably, but tbh if I work on improving the octree, I would probably try to find something that makes faster lookups (or probs a quadtree since my sim is 2D) since I call those numerous times (up to 2k times per frame)
A context is a class. You can override it in C++ and BP.
Hm so as I'm reading here, I create a context to give the origin location, and then that location will be the center of the query to get a location
I'll give it a try as a whole
how do I Get Sense Class for Stimulus in C++?
it seems to be part of the AI perception system but I'm not sure how to get the AI system as an object
You can look up the function
UFUNCTION(BlueprintCallable, Category = "AI|Perception", meta = (WorldContext="WorldContextObject"))
static TSubclassOf<UAISense> GetSenseClassForStimulus(UObject* WorldContextObject, const FAIStimulus& Stimulus);
it's a static function, so it should work if you just call it using UAIPerceptionSystem::GetSenseClassForStimulus
sweet thanks
I thought I had to get the subsystem but it turns out I can call it like that
Yep, usually if you have a BP node it has some similarly simple calling pattern in C++ as well
why is my perception component passing in itself as the Actor when binding a function to the OnTargetPerceptionUpdated function in C++?
I have the exact same function implementation in BP but there it passes in the actually sensed actors, I have sense enemies, neutrals and friendlies all checked to be true
I made the context and set the param, is working fine, but I'm still not getting to a good point. :(
What do you mean you aren't getting a good point?
I don't think I understood the Distance test, I'm setting the DistanceLimit param as a maximum
but my character is like, walking left or right on the same spot
I recommend using the visual logger to debug how the EQS is selecting positions.
this?
I think I understand now the issue
you can filter results but you still have to manage scoring to get better outcomes
Yep!
why does adding the perception component through cpp make it behave differently?
I swear I just replicated the same code I had in BP and I can never get my main character to be detected by my AI
I used to add the perception component to my AI controller through blueprint and now through C++ it just won't detect my main character even with the exact same settings
Anyone tried updating a project to 5.1 and notice that its generating visual studio code project and not visual studio?
got it working!!!
thank you so much for giving me tips and advice!!!
fuuuu, so its generating visual studio code files?? wtf π
these comments tho
It generates VS files for me
how do I compare the stimulus.type?
My navmesh is only apearing on my stairs for some reason, does anyone know what causes this?
whoops, the collision of the ground mesh was messed up, my bad 
I did an upgrade of a 4.27 project and by default its generating VS Code files instead of visual studio
So it doesnt generate sln file?
I dont even have an option for vscode file generation
Right clicking to uproject and generating project files creates a sln and intermediate folder
hmm, looks like it reads an .ini file and generates from there.. editor preferences -> general -> source code was set to visual studio code.. weird
Yeah, no idea how this happened.. I mean I don't mind VSCode for python stuff.. but not for C++ dev
Hmm, yep, changing that ini did the trick..
Hmm, whacky stuff.. ALMOST got voice based speech to text, gpt based dialogue generation and text to speech with automated visemes done
BUT I have a game jam for two days from tomorrow π
is there a built in way to detect if AI is stuck?
the move to function just returning normal state but the AI is walking into a tree (trees doesn't effect nav because they are super thin, 99% of the time the AI just sweep near the tree but 1% of the time it walk directly into a tree and just stuck there)
I think an easier solution would be to have the nav mesh reflect the trees cutting into it. That sounds like the actual problem. You could also add a nav modifier volume to weigh areas around the trees more. Is there something preventing you from cutting the nav mesh around each tree?
can you share the code?
yes. Basically from a spline of triggers we cast a ray to get hit results. We could then project this to the navmesh for movement. We are trying to build a pedestrian system and want to cut down the costs for movement
fill FNavPath and pass it to RequestMove on PFC
is it possible to have multiple AIs using 1 AI controller?
Sure, you can have one actor control other actors, but it's not designed for that out of the box
So you would need to do some amount of custom work to support it
Majority of the AI Controller logic assumes it only controls the pawn it possesses, so you'd need to build solutions to solve that for the bits you need
is it ok to run an EQS query every 0.5 seconds of a BT service?
unless you get EQS warning in logs about your query taking too much time or you don't have hundreds of NPCs I believe it's fine
0.5s seems like a reasonably query interval for positioning tasks
i think it depends on your eqs complexity, like how much points you are making with it...
i tried this but with the task, and but i was running for every 1-2 seconds, but there were no performance issue
Im just running it on a selector every 0.5 seconds to check the best score away from the enemy radius
I want to provide more than one actor class in the actor set context, this way does not work?
How to rebuild navmesh from C++ ue4/ue5
1img: Play mode
2img: Editor
any solution for this?
i deleted the whole nav mesh and then put it again and build it but still the same issue
edit: Fixed it, i just deleted the raycast navmesh, and rebuild the path
does it printing something ?
can I get api references for this? I was thinking of making a bp function to do this.
FAIMoveRequest & UPathFollowingComponent::RequestMove
only the first actor class which i set in the array
number 0 of the array
try printing the getActorOfAllClass values, and see if its printing the values that you want
I can have multiple grid branches in eqs? do they work? cause i want the grid to be generated around any character that is seen as a threat or enemy
no only one will work, i don't remember if its the left or the right
damn fr?
I cant have a grid created around multiple different actors?
You can create a custom generator for that or like run different eqs for each actor
hey, i am not used to that system, but i would like to run the left side of root tree even if the selfActor has not reached the move to target, what would be the best way to achieve that ?
Try using sequence instead of selector ...
but the behaviour will be similar not? because move to do not end the branch until is it done right ?
Yeah moveto holds the execution of the tree untill it's completed/failed.
U want to do the left side along with the move to?
yep i need to do it during the move to processing
There is a parallel node, use that
yep but parallel do not run the parallel tree if the main task is not running
i guess best choice will be to add a service on the root
but i do not like that idea so much meh
Do you want to run the left side everytime?
yep, so i am currently doing an other bt
and running both bt together will be the best solution i guess (?)
we cant 
you can do one think, create a task, and do you moveto and other things in that task
or go with the serices
why?
i did that
i came at the same point that doing a service lol
i prefer to keep the logic decorator check then task but i need to continue
Is it a cheaper approach than calculating the path? Just wanna know the practicality before attempting this.
Sort of. They are evaluated from left to right until one finds a result.
You'll just eliminate PathFind function
hmm noob question why cant i see the create new blackboard keys? or the blackboard keys that are in this blackboard?
solved it, nvm
Anyone happen to know how the behavior tree smart object things are supposed to be used? π€
I'm kinda getting my custom wrapper around it working finally, so looking at how the actual behaviors for them should be set up now.... and at least to me it seems like in order for the behavior tree to do anything useful, it would need to have a reference to the smart object that it's interacting with... and there doesn't seem to be anything to do with it in builtin unless I'm missing something
Guess I can just assign it into a BB key before attempting to use it or something... π€
It will be cheaper per agent right?
I dont know how you calculate raw Fvectors
with maths?
They mentioned spline but probably faster than A*
Wow, I'm rusty with UE stuff.. trying to get a character to impulse on overlap and the various checkboxes are not playing right π
guess too much python has rattled my brain π
It depends on what you mean by the BT doing anything useful with them. Smart Objects are meant to have the behavior defined on the object, not have the BT drive it.
Right, I mean if you use the behavior tree thing for the smart object, where the object's behavior is driven by a BT
In order for that BT to do something useful, it seems it would need to have a reference to the smart object (eg. to be able to tell the BT tasks what they're working with and such)
The smart object is supposed to be sent to the behavior, but last I checked it was not. If you fix that, you should be able to get the object from the behavior.
Right
Yeah I thought maybe it would be convenient if the behavior definition itself was able to assign the ref to the BB, but it would probably need a custom version of it to accommodate it since the default thingy doesn't support it
Yeah, you can subclass it to do that. I haven't tried the BT functionality as all of ours just trigger abilities, but when I last looked it shouldn't be difficult to add that.
Yeah
Mine are gonna be a bit more elaborate than just what you'd have as an ability I think :)
Basically stuff like picking up items from the SO, playing some animations, placing items back potentially, etc.
I keep thinking of how it should be useful for SO everytime I see it in the class picker :D
It actually led me also into investigating multiple BT comps possibility as I wanted to use it for the AI while it was running main BT. No success. I did not really need it as I have a custom gameplay behavior which triggers a GAS interaction ability from SO, so I did not investigate deeper.
On the other side, it is useful for me as I use gameplay behavior also for other things, not only for SO. Like behavior executed at patrol nodes. For some of these, I need no context params.
hey guys, I'm trying to lock my character's movement so that it maintains its current position on the Z axis, but whether I use AIMoveTo or AddMovementInput, it keeps moving down the Z when a destination is given. If I give it the current Z coordinates it still moves down, if I give it no Z coordinates, it stops moving altogether
I tried locking the Z axis from the physics constraints too, but no joy. Any thoughts?
basically the spline has triggers on it I can trace from I place my splines in the editor. So I am thinking that since splines already define what route the character is going to move on I don't need to calculate a path for them.
you can do one thing, for you goal location, change its Z value, like give the character's Z value into the goal location, so that it will only change the X,Y and not the Z
Yeah thatβs what Iβm doing right now, I push the current Z value into a variable and break the struct pins so that only the x and the y change and I push the variable into the Z pin. But it doesnβt work, it still travels down towards the floor (this is a flying unit)
can you share the code?
Not at my desk rn but I will when I can
hello,
I'm trying to use the Visual Logger to debug my AI, but in some specific levels it won't show me all the entries for some reason. I have a dozen AI characters in the level but the Visual Logger only shows 4 of them, even though they're all active.
The level is using World Partition, not sure if it can be related to the problem.
Anyone has an idea of what could be causing this?
Splines still run some relatively expensive math to interpolate direction but it would be faster than A*
I have an issue where my AI doesn't attack my player when the player is above the enemy, like on a slope or stairs that are too steep. I have a video demonstrating the issue. Playing around with collision capsules seem to improve the issue, but I don't want to do this as this changes melee range and can make the attacks look odd based on the distance between the player and the enemy. I'd like the enemies to attack the player on these gradients. Adjusting the player capsule helps, but still doesn't eliminate the enemy stopping and ceasing to attack the player even though the attack range is reached. Any thoughts would really help me!
Screen shots of AI code:
I am basically taking waypoints from the spline. What I have done is spawned equidistant sphere colliders along the spline which can be traced on a dedicated channel. Thr npc traces for these spheres and moves on the points that hit.
Since I already have the points I want the npc to move on won't it be better to directly use these points after projecting on navmesh rather than build a full A* path to each of these points? Even in AC Unity's gdc they said that the pedestrians strictly follow the splines when moving idle.
@terse panther is working under me on the prototype he can show you his setup.
This is how we are creating the sphere collision
result
and using the multi trace to find these sphere collisions, and storing all the hit points location and feeding them to the moveto
@celest python
Why you are not just getting spline points from spline component and projecting them to navigation?
And setting this up initially will take way more time than A*, but if you move this to C++ and do what I said, you can build a FAIMoveRequest with the points you projected to navigation and eliminate the Astar overhead mostly
Also probably you should check CitySample since there is also a similar setup there for pedestrians
for the spline points we have to create them manually, (holding Alt and dragging), and that is time consuming, but with this current setup we can draw the path easily and editing is also easy...
this all setup is for the prototype, we will also try with your solution, and then will compare which one is better...
for the city sample they are using ZoneGraph and i think that is Experimental, so thats why we are trying to avoid it for now
for the spline points we have to create them manually, (holding Alt and dragging), and that is time consuming, but with this current setup we can draw the path easily and editing is also easy...
Is sphere trace only for editor time?
to setup the spline
and not for providing path point array
we are manually putting the spline, and sphere trace is for the sphere collision that you can see in the 2nd image
and with the hit result we are creating a Vector array
spheres are only done once in load in a constructor
If you designed the spline in editor already, just get the spline component and get its points, it will provide an array of FSplinePoints
build the FVector array with it
How would my npc know which spline to pick?
We added spheres so we can run traces on it.
we are not proving the spline to our NPC
That too.
Ah I see now, NPC queries the nearby sphere collisions to pick the spline point to begin following a path/spline then?
we are not using the spline point, we are using the trace hit point as MoveTo point
I'm lost then, vegito was mentioning about spline at first place
But anyway if it works, it works 
Should be faster than A* one way or another
just fill FAIMoveRequest with array
the thing was we are looking if there was a better and more optimised solution π , our approach is working good for now, but we haven't tested it in the actual environment
yeah will do that too
we are using the spline just to create the Sphere collision ,
like in this image this path is created using 4 spline paths
we are tracing the spheres along the spline. Since they already act as waypoints, I thought there was no point generating a fresh path.
I would create an AActor that has spline point, build spline in editor, in editor time (construction script) create a sphere collision for each spline point, and those sphere collisions would be my own custom type I inherited from spline collision (if its even possible), and I would assing the spline point indexes to them by creating a int32 variable.
When a NPC wants to follow a path, it would look for most nearby spline AActor first, then request closest sphere collision, move to it first, then after reached, get the moved sphere collision's assigned sphere point index, and decide a direction, and start incrementing or decrementing the index to follow and get the next target move to goal from spline component's spline point array based on the index currently I'm following
it wont be 1000x faster than A* , but still faster
But wont that bind each spline to just 2 npc?
once you reach the initial sphere collision, you'll fill the array with the further spline points and provide to path following comp
no
this is just a way to get data from spline and follow it
any NPC can do this
you can even set a bool in sphere collision child you created and make other NPCs select different points if its not available
technically that is what we do with our trace. Plus it provides some variance to us as well so that all npcs dont walk in a line like ants
We could do some custom logic on thr colliders too yes.
Using 5.1 in the State Trees there is a trigger by Gameplay Tags, but they dont seem to work, or I am not using them right, does anyone have any experience with this? Sadly I don't see any official documentation about State Tree trigger by Gameplay Tags.
@keen crow btw I think you were wondering if it was even possible to use a smart object if it wasn't claimed, because the claim state was verified before the gameplay behavior for the object was returned...
Yes, you can do that :) If you have the smart object component, you can pull the definition from it, and then pull the behavior definition from that for example by slot index
once you have the behavior definition you can then trigger the gameplay behavior as it no longer really depends on the SO stuff at that point
10q for the heads up
I did, but most of them is not actually working in UE5.0.3 and, especially, in 5.1.1
i am not sure if i am right or not. but i think the MoveTo is projecting the destination to the navmesh,
do one thing put a debug sphere before the moveto, and feed its location same as move to, and see where it is drawing the sphere
Yes the move to projects to the nav mesh. To have flying movement that uses the 2d nav mesh, it's easier to create a new movement mode and fix up the Z when it moves.
@terse panther Iβll try the debug sphere see if that helps
@uneven cloud I tried using add movement input instead and it did the exact same thing, just moved slower (prly need to apply more force)
Just FYI that print node I have is there to show me what the Z value is when the unit receives the command
So kinda like a debug sphere, but maybe Iβm reading the value wrong
It's not adding an impulse. It's fixing up the location once the move has completed.
Oh I c
Well I replaced AIMoveTo altogether with Add Movement Input so that should be adding the impulse though, no? @uneven cloud
anyone interested in providing some live help?
But you could use it to then find the replacement in source code though
Dammit, I've run out of credits on OpenAI's API site.. sheeeit π
just a regular day?
I should get some kind of sponsorship π
that said, I'll get things fixed over the weekend..
I guess I should add some credits to my amazon account too
I hope Microsoft start reselling the chatgpt models soon. I've got a bunch of azure cloud credits
Its been really fun doing this little test.. got deepgram as speech to text, into chatgpt for dialogue generation, from there into amazon polly for speech to text, then back into Unreal for metahuman use..
oops, polly for text to speech π
highly recommend all of them to be honest.. deepgram is nice.. I'm going to ask them to give me some credits so I can release a free UE plugin for their speech-to-text API
polly is actually really solid too
I'm just messing with the OpenAI for chat continuation and history now.. to get a proper chat dialogue thing going
Arent you thinking about participating bigger projects by the way?
Hopefully replace all of them with open source over the next year
Yeah, I've got a bunch of bids on the go recently
this is more sort of funzies
But writing some papers on large language models and dialogue interfaces for immersive storytelling
It's nice you can find time tbh π
hahah.. I was doing game jam over the last two days π got mostly meetings tomorrow
@terse panther debugsphere draws at the right altitude, but the unit still tries to move as close to the ground as possible. I've tried adding another movement input after that node that only sends it the Z value again, see if it course corrects but nada
I'll keep working on it I guess
is there a way to find out WHY an aicontroller movetolocation node request fails? My monster begins moving immediately if I start it in the level, but if I spawn it, I get nothing but request failed when tryign to make it move.
use this node to draw the debug sphere, it will give you the points where AI will moveto...
see if its drawing the sphere in the air or ground
Ok Iβll try that @terse panther , it was showing in the air when inputted the current Z value so I think the same will happen, but Iβll give that a shot as well
Did you check the logs? if I recall correctly move requests that fail output to the log
try setting Auto Possess AI to Placed in World or Spawned on ur pawn
Yep, that was first thing I checked. I've also tried various delays.
How do you think fortnite is handling its navmesh in world partition? Static navmeshes are still experimental afterall
The thing is. The ai is possessing the pawn. It's getting all the way through the decision process and sending a move to location and its firing the on request failed pin but I don't know why. I have a debug print string on that pin
@fading shale if youβve already checked itβs not what fpwong said, it could be a problem with the spawn location or that particular spot on the navmesh. Have you tried changing the spawn point at all? Especially on the Z axis
I'm not using a navmesh, it's a floatingpawn movement. The spawn points are the same as the positions I used to manually place the monsters, so it should be able to move from there.
@fading shale that is odd. see if this helps : https://forums.unrealengine.com/t/spawned-pawn-not-moving-placed-pawn-moving-fine/52774/4
I'll give that a try...The failure output is coming from the controller so I'm doubtful this is the problem...I'm guessing since the controller is throwing the error, it's spawned.
If it doesnβt maybe try posting your code in here, someone might be able to spot the issue