#gameplay-ai
1 messages · Page 47 of 1
Epic only uploads 3 hour videos on youtube that have 5 minutes on the topic you want to know about
I think a lot of time people search for "how to make X game" instead of breaking the problems down into smaller problems.
Pretty much
Yeah, probably true
Frankly I don't see any problem in even low'ish quality tutorials
And some of these vids are older so the algorithm prly shoves them to the bottom
Sure it would be nice if it wasn't low quality
But at least it's something for people to learn things from
At least it gives them a starting point
We’re talking quality of content not quality of image
Then we have to field 1000 questions about how casting is bad and shit
At least they got started
Better than never having gotten started because all the guides are so full of techno jargon on best practices
:P
Which is what a lot of "good" material is about
I also see a lot of shit tutorials that are "how to make advanced AI," when it's the most basic functionality and shit ways to do things
was debugging maunally didn't call it for any purpose yet
Meh, first tutorial I watched was 11h of torture filled with stupid stuff. Sure, they did like 5% of things right and “it got me started”. But if I hadn’t found this server I would’ve quit
Speaking of advanced AI I'm thinking of tossing mine right now because ugh lol
Do you mean to use the single "Get Actor of Class" and not "Get Actors of Class"? And maybe the cast fails.
it's just a boomer shooter it doesn't need the AI to try and be this clever which only leads into it getting stuck because the logic is too complicated lol
I do w/e I can to make my AI simple and stupid. But fun.
no literally my E keyboard event is not working
Make it as simple as possible. But no simpler.
Where is this running?
in character blueprint
Start simple, fail complex
i was supposed to press e and change the ai's states manually to test it, patrolling and attacking me flip floping
Player character? Or just a regular ol' character? Are you possessed? Do you have input on the pawn set to accepting input if it isn't possessed?
I've considered making tutorials, but then I'd have to become a you tuber and learn how to market that stuff. Plus I really hate video tutorials. Don't people read anymore?
just regular character i created for the player, nothing inside it, i can use inputs i can move jump etc if this is what you are asking
I don't even market my channel. People still find it though. (I also very rarely make a tutorial)
that's all inside the character
Same I'd rather write but all the kids love the videos apparently
Marketing that stuff is not super hard if you make videos that people naturally search for, but you can also get pretty far by posting them in places where people hang out in
ok i changed the flow control to on result change abort self and it started moving and my inputs are working, but still cannot see me as an attacking target, just standing still in attacking state
Do you do your tutorials in BP or C++?
Oh I haven't really done any for Unreal. Just some random shorter notes mostly in C++ since that's where I mostly run into the "how on earth does this work" problem lol
I did write quite a lot on some webdev topics in the past including a video course, but that was years ago
I could make some tutorials on how to debug AI and just paste them here when people have questions.
Hahaha
Yeah I kinda wrote a few notes based on stuff people were asking about
It works because it's often what people will google about also
Yeah this one for example I think I wrote down because I've had to explain this a few times https://zomgmoz.tv/unreal/Blueprints/BP-spawned-pawn-doesn't-run-AI-logic
I'd imagine if you did this, you'd have so many pinned posts in this channel, lol
I should already 🤪
My brilliant strategy is if I ever make a plugin I'll use my docs page to advertise it
You search for how do I sort the details panel categories? Sure here's how you do it.. or just get this plugin
Hi ! how could i move my ai to an actor without all my different AI's going to the same point location ? I tried using radius but i want them to stand around the actor not far away from it
my guys are just standing behind eachother waiting to get a hit 😅
thanks mate exactly what i needed 😍
Use EQS.
Search for Luthage's messages about this
I have been banging my head the all day but can't find the reason why,
- I created a AiController with a Pawn
- added AIPerception component (Setup the necessary Sense).
- Added Stimuli to my PlayerPawn with Sight Sens configuration, and register the stimuli on Possess
- Added in GameIni
[/Script/AIModule.AISense_Sight]
bAutoRegisterAllPawnsAsSources=false
But for whatever reason the Player Pawn is not detected at all by the Sight. From my understanding the engine is using LineOfSightTo, so I tried on my side that function it's always returning false could it be the reason and why is that the case?
Thank you for the help!
The EQS is great at picking locations to go to in smart ways.
That doesn't actually change them going to the exact location. The actual trick is to make them go to different locations and use avoidance. Especially given that the avoidance built-in for UE is not great.
For your sight sense are you only detecting enemies and if so have you set up the team settings?
I’ve never had to manually register a stimuli source before
Line of sight uses the visibility trace channel. Is there something blocking visibility?
(I ended up doing my own Sphere Collision Trace for Visibility and worked) But still want to use the engine style
They turned off auto registering pawns.
Oh? When?
Maybe cause I use mostly characters tho
This one is detecting well my Pawn
Iixs did. It's in their first message
Ah sorry I missed that one
I did that since My character is possessing a Ship pawn didn't want the enemy Pawn to detect the character but the ship
Can you not add the stimuli source as a component at runtime or does the engine frown upon that
I can try that
Not sure you can
Cannot construct objects of type '/Script/AIModule.AIPerceptionStimuliSourceComponent' in Construct Object from Class
I guess a custom Sphere Collision will do^^
A sphere is a lot different than a line.
Ah, good to know
Line of sight is still a line
I'd do a debug line from the NPCs view point to the target's location
Will Try that thank you
It could be the view point or the target's location is weird.
oh I understood
it's blocked by my water component
first
as the line of sight is under water
Thx a lot for the himt!
hint*
I also need to register things like forgetting in the game ini right?
why is that
AIPerceptionSystem.bForgetStaleActors
this seems like a dumb question but i can't really seem to find a straight answer: are decorators, tasks, services, etc. instanced per controller/behavior tree? As in, can I cache things in them and expect them to be specific to the actor running them?
there is a toggle for whether they share information but I believe it's off by default?
okay, and the other half of that question, do the nodes persist for the duration of the behavior tree? Just trying to do something simple like the first time a decorator evaluates, it gets a component on the actor and checks a value, and on subsequent evaluations it already has the component cached
That I'm not sure about. I'd probably set it as a blackboard value if caching it is that important; though I guess you could just try it out with a variable and see if it behaves right?
i really wanted to avoid blackboards as much as possible (I'm basically just going to be copying a million variables that already have multicast delegates tied to their values changing into another location that does the same thing???), but it seems like variables set inside of decorators don't persist, and there's no real event-based way to make them if you don't use blackboard keys from what I can tell (if you don't have a blackboard key selector as a variable, abort behavior is dependent on checking the condition on tick...)
I see so much wrong here lol, but we’ll see what Luthage says 🍿
They are instanced if the node is created in BP. For ones that are created in code are not instanced by default. There is node memory you can use to save data.
is there a way to call abort functionality from a decorator at an arbitrary time in c++? like if i bind to a delegate on a component im passed in, can i call abort self when that event fires?
Why would you waste a blackboard for that?
essentially on the first evaluation of the decorator, save off a component reference on the owning actor -> bind to an event on that component -> when condition check is called just check that component's value but also if the event i bound to fires off i can manually abort self/subtree if needed
that seems like it makes sense to me but does not seem to be the way these are intended to be set up
Yes. That's essentially how the blackboard one works. You just have to build the functionality.
okay, guess ill just have to go steal the code for aborting on blackboard events
i feel like im missing the purpose of the blackboard at all to be honest, why would i want to store my variables i care about in an additional place?
like if health percentage, combat status, cc status, distance to target, number of targets, etc. can all play a role in behavior, and i have those things calculated for other uses already, what is the advantage of also setting blackboard keys for all of those things
Blackboard has a lot of uses. Say you have a service that is updating your target. How do you get the target to the tasks for attacking? You store it in the blackboard.
You don't need to store all of your data there and frankly you shouldn't, but there's a lot of use cases.
right, but i already have a threat component that handles the npc's threat table and has valid targets ranked by threat. why do i need to store that in a blackboard as well, when in my mind just binding to the threat component's information would be more straightforward
not trying to argue they aren't useful, i just dont understand the use cases
Because that's unnecessarily complex for targeting for most games.
ah, i play way too much wow so a lot of the targeting side of things is very RPG-inspired
You can do your targeting filter on your component. Just pass the selected target to the blackboard.
I work on AAA games, including RPGs and the EQS is more than enough.
Doing an EQS query for target selection is also good.
well i wrote it because i wanted support for taunts/fixate/threat modifiers on abilities, etc.
but thats just one specific example not really the main question
My EQS targeting also does that
interesting, i havent looked into EQS much but i thought it was mostly about querying the environment
That's what you should blog about Luthage. All the cool stuff you can do with EQS 😅
Nah. There's a built-in generator to get the perception targets. Then you run tests on them and score/filter them.
Have I told you yet about my sweet ability selection using the EQS?
You have.
i work in an indie studio and our targeting logic is in 12 different places in some godforsaken 4k line state machine, so im just looking for an alternative to THAT for my own game lol but behavior trees are not super intuitive to me
Oh jeebus - that sounds like a nightmare
this sounds cool
Our targeting is in a handful of env queries and never breaks.
Our threat is handled by a threat perception sense.
Luthage loves the EQS stuff. She got me using it and liking it more as well. Can do some cool stuff with it.
I haven't written a custom perception sense yet though
We use it for so much, but it's time sliced so it doesn't hurt perf
per my questions about decorators binding to external events: so it looks like i set up references and bind to relevant events inside of OnBecomeRelevant (and unbind in OnCeaseRelevant), and then in my callback function I just need to call ConditionalFlowAbort, which triggers the behavior tree to check the decorator's condition again?
is this right?
[/Script/AIModule.AIPerceptionComponent]
bForgetStaleActors=true
I couldn't find any documentation on how to actually set it in the DefaultGame.ini right so I just tried to base it off how the
Looking at the source code, bForgetStaleActors is pulled from UAISystem, so you might need to use AIModule.AISystem instead but not 100% sure
My AI isn't using the navmesh. They keep getting stuck on on stuff. (The stuff makes holes in the navmesh, so it's not that.)
I can't figure out why...
My player character uses the navmesh just fine. So the navmesh itself is healthy.
Any ideas on what I might be missing?
Ugh I wish they would have thought about composability with AI Tasks a bit more
MoveTo in of itself is a good AITask, but what if I want an AI Task which moves but for example retries the move if it fails or includes some other logic? GameplayTasks itself supports having a child task, but the way AITasks are constructed they for some reason hid this part of it
So now I'm copypasting the entire 300'ish lines of code for MoveTo whenever I need it behave slightly differently
decorators
AI Tasks, not BT Tasks
ah nvm
why do you not make an ai task which launches the move to task?
and if it fails it launches it again
Well yeah that's the idea but managing it is more complicated than it has to be as a result of how it's been designed
GameplayTasks support a "task owner" which can be another gameplay task, so this makes it easy to compose them as you just pass your task as the owner of the child task
AITasks also support this in theory because they inherit from UGameplayTask, but as said, for some reason they've made it so that it doesn't let you set it up in that way
Oh yeah, and to add to it... They have delegates on AITask_MoveTo which let you monitor the task process which would be ideal for this scenario also.
But guess what they made them protected because screw you lol
AITasks are obviously mostly intended to be called from BP's, but considering how much plumbing you need to handle it, I'm not sure how this is intended to be used for building your own movement logic
@uneven cloud btw are you familiar with FAIMessage / FAIMessageObserver? Do you reckon these features are actually used for anything? It kinda looks like no since as far as I can tell there's only some really rudimentary support for them in BT's
Do anyone have any helpful info on making ai teams
That's a very vague question. Is there something specific with that that you need help with?
hey guys, so i am having some trouble setting up doors for AI. Some doors are initially closed and can be opened by the player, therefore i wanted to use a smart link that can be triggered by setsmartlinkenabled (in theory). I have added this smart link proxy via a child actor to the door bp. however this smart link of the child bp actor never actually seems to work. regardless of the settings. When i place a nav link proxy with the same settings in the world, it works fine and i can also enable/disable the smart link via the level bp without any problems. any ideas why the child actor here doesn't work properly?
Does anyone know why my navmesh stops generating after a certain amount? this used to cover entire map, Tried a single bounds as well as multiple small ones, but it always stops at this radius, I've tried resetting my Nav Mesh settings but i might have changed something somewhere else.
I managed to fix the above by reverting the git changes, still not sure which specific option has caused it, gone through most but can't replicate 😢
You can just set it in the project settings.
I am. I tried to use it once and didn't like it, so I rolled my own message system.
Child actors aren't well supported.
Why aren't your AI using the nav mesh?
That's my question. It should, but for some reason isn't. And I can't figure out what I'm missing.
Heh okay, yeah it looked kinda messy as a lot of these AI systems kinda do.. thanks
what would be then a good workaround?
Mostly it was that theirs uses fnames and I wanted to use gameplay tags.
Ah
Plus it was a pain to hook into outside of the BT.
Well ... What is it doing? What type of debugging have you tried?
Making your own smart nav link component is the best option.
The issue isn't debugging. They're just acting as if there is no navmesh. So they're running against trees and rocks, instead of running around them.
The issue is that I don't have a good overview over all the parts needed to make an AIController character use the navmesh.
I'll probably have to watch some more tutorials. It's probably some small thing, like a checkbox somewhere I've missed. Or a component I haven't added.
The AI with Blueprints course on the learning library is better than any tutorials you'll find.
There is no setting to check or component to add.
I'll have a look at it. Thanks!
I want my enemy to lunge if they're within 5-7m of target. Does anyone have tips for implementing a running check so that the enemy could perform a behavior when they're within a certain distance?
I think my problem has something to do with AgentRadius for the navmesh. Which is, of course, a buggy system.
My AI's capsule radius is 120, and the default agentRadius is like 34. So it would make sense that they get stuck on things. For some reason, they stop moving altogether when I set either the RecastNavMesh(known to be buggy) or the Supported Agents to 120. So I gotta figure out why that is. But it seems I have a lead.
I don't expect you to do anything about this, just thought maybe you'd find it interesting.
One approach you could try is to check the distance on the perception updated event.
There are multiple versions, depending on your preference.
I use it for spotting a target to chase, then updating the blackboard with the chase target. The Behaviour Tree uses decorators to switch between MoveTos. So, in your case, you could add a "LungeTarget" to the blackboard and have a decorator keep an eye on that. Something along those lines.
But I bet there are many ways to do it. I'm no expert.
Any particular reason why when I have the AI set focus, it'll face the player character in all dimensions, but when I set focus to a different actor, it does not use pitch?
It's not a buggy system. You have to set it up correctly. If your agent capsule radius is 120, you need to create a supported agent with a radius of 121.
No, it's literally bugged. It resets if you edit the recast. The workaround is the supported agents in the project settings.
Not all the values though. Worth mentioning. It may be just the AgentRadius.
You shouldn't be changing the recast. You change it via the supported agents. Sometimes you then need to delete the recast actor and rebuild.
That entirely depends on how you set up attacks. There are many ways to do it.
Here's the reported issue: https://forums.unrealengine.com/t/recast-navmesh-does-not-save-when-editing-properties/299859/13
And the workaround: https://www.youtube.com/watch?v=8wuerMwu6fI
If you're interested. It's ancient, apparently.
As @MieszkoZ pointed out in his answer, this problem could be fixed by adding new Supported Agent to the Navigation System in the Project Settings: With this, I can restart the Editor and the RecastNavMesh.AgentRadius value in the level persists. Also, there is Nav Data Class variable in the Supported Agents so I assume you can create your ...
In this video I adjust the agent radius for the navigation mesh in order to tighten the borders around the environment so that our AI can navigate more effectively.
kw: navmesh moveto stopped stuck
Please subscribe if you enjoy the content!
I am a new channel and could use all the help I can get, thanks!
Attacks are gameplay abilities that are executed by functions on the character. The way I'm implementing lunge is by adding a collision component to the character, and as soon as there is an overlap the character lunges, then continues its behavior tree which consists of moving toward the enemy and attacking from a standstill.
I am aware of how to set up the navigation settings.
This way, the behavior tree will have the enemy chase another character, but as soon as it's within lunge range, the behavior tree will be overridden. After the lunge completes the tree will continue.
Let me know if anything jumps out at your here as being a bad idea
I know. But you said it's not a bug. And I don't entirely agree on that part. So I just shared the foundation for my conclusion with you.
That's not a great way of doing it. You already have the target reference so doing a distance check in a service would be better. Adding unnecessary collision will hurt your performance.
I tried using a service. The issue I'm having is that the "Move to" node keeps executing until it reaches its desired position, or fails to. As a result, if the enemy enters the lunge range while "Move to" is executing, it won't override the "Move to". Is there a way around that?
Every time your character moves, that collision component also needs to move and then does a collision sweep.
Yes. You use an observer abort to abort the move.
Ah! Great, I'll look into that. thanks
You're welcome.
Well, found this in AIController
// Don't pitch view unless looking at another pawn
if (NewControlRotation.Pitch != 0 && Cast<APawn>(GetFocusActor()) == nullptr)
{
NewControlRotation.Pitch = 0.f;
}
Not sure why it's there, but okay, pawns will only ~~not ~~use pitch to look at other pawns.
why is my Ai only able to pathfind to the players location if the player is touching the ground? if the player stays in the air like jumping of a ledge for more than 0.25 seconds the enemies stop since the player isnt in a valid spot in the navmesh since the player is in the air. how do i fix this?
That’s not what that says. It says it won’t pitch unless looking at another pawn, hence the nullptr check
Because the navmesh is a plane not a volume (the volume part only works in terms of having multiple floors)
You could cache the last location on jump or use traces or a number of other things, but otherwise, for you to path to something it generally needs to be on the navmesh
Yeah what I meant, flipped my words. Was trying to figure out why the AI was looking directly at the player but not at the static targets. I just reparented the target.
alright so i made a decorator in c++ that sets a timer when the node is instanced and tries to call a conditional abort when the timer finishes just to test things out. However, the behavior tree component that's passed into OnInstanceCreated is not valid when the timer fires off (I pass it as a weak object ptr to the timer). Any idea why this is the case?
You can increase the projection extent by making a supported agent in the project settings.
Is the node instanced? Is the BT comp valid when you start the timer?
yes and yes
and im still running the bt when the timer finishes as well, so it shouldnt have changed
When I'm using SmartObject, how do I check if an object is claimed? If I place three with two smart objects, the the 3rd ai still finds one
Oh, I didn’t realize you can use those to project path to objects above the mesh?
I guess as long as the origin pawn/char is on the mesh itself
No. It's so you can project the target's location down to the nav mesh.
Yeah, that’s what I meant in less clearer words
But it wouldn’t work in a game where everything is floating because your origin needs to actually be on the mesh right?
Well it works the same regardless of what you are projecting. If you have a hovering NPC that is above the nav mesh, extending how far you project down will still pass the project to nav mesh test.
I mean if your initial pawn is also floating it wouldn’t work
Like a strategy game with flying ships
Ik we had a convo about that before
Nothing needs to be ON the nav mesh. It just needs to be able to project the location onto it. In fact the actor location is generally in the center of the capsule, so it's never actually on it.
Oh, interesting. So you could do that too just by increasing the projection extent? Nice
Why wouldn't it work? I've said this several times that changing the projection amount does work. Hovering for something like a ship isn't a good way to do it, but it is a way.
I just didn’t realize it was an option, might have missed those last few times. But yeah, I realize it’s not the greatest for that use case
If you have a simple enemy in a mostly open space, it's a common way to do it. It's not going to look the best and might have some issues, but lots of games do it.
This is good info thx
any best practices for what to store or not store in node memory (and instance the node instead)? saw someone mention not to store TArrays in there
So, I ran this command in windows cmd, because it told me to when I changed some agent radius stuff. Things work now, AI does what it's supposed to, so that's great.
But when I ran it, it did so in a seperate command line window, I saw some red lines, but it closed immediately. Is there a way to view the results of that commandlet? You know, in case there were any errors I should be aware of.
Anyone had this issue with behavior tree not working from begin play?
This is the setup in the enemy BP, works on another map but for some reason not this one
Looks like it doesn't have an AIController. How do you spawn the enemy?
Try adding Spawn Default Controller
Still getting the same error
I saw theres a "spawn ai from class" have you used that before?
No, have not tried that.
Have you set your AI Controller class in the details of your enemy BP?
Because Spawn Default Controller adds that one.
Yeah I got that one checked.
Ok, so I'm running the Behaviour Tree on On Possess in my AIController blueprint. I'm guessing your actor has not had time to be possessed yet on BeginPlay, so maybe that's why you're having issues.
There's Possessed event if your AI pawn is a character. Maybe you could use that if you don't want to add your own AIController.
ah ok. How do you get that node?
I made my own blueprint "AI_BasicEnemy" that inherits from AIController, and I use that as the controller for the enemy pawn. AIController has an On Possess event.
Try just searching for possess, you may be able to do it from your pawn. But I'm not sure it exists there.
Character seems to have one. Though I haven't tried it.
ah great. It runs now and with no errors. My Ai aren't moving though; however, I believe thats just because I have Idle as the default behavior state.
Thanks very much for all the help
Good luck! Lots of pitfalls down this road. lol
true but people like yourself make it easier
You need to do this on possess not begin play.
this was done basically for easy of use for non programmers. So the people working on the ai didnt have to look that much into the actors/directors code. UE behavior trees targets easy of us for also non programmers. From a programmer perspective some of the system traits can be inconvenient of course
I asked this last night but it was super late so im not sure anyone saw it: Is it okay to store things like TArrays, UObject pointers, structs like timer handles, etc. in node memory? Is there anything that needs to be done to clean these up besides emptying them/setting them to nullptr in CleanupMemory?
That all should be fine. I would limit what you save to what is absolutely necessary, but I've never seen problems with it. One thing that is common is to use an AI task for latent functionality. So the BT node memory holds a pointer to the AI task, but it's the AI task that does all of the work. You can see the BT task move to as an example.
Thanks I'll look into it. I was testing different ways to accomplish the same thing, so still just working on a decorator that essentially just returns false for x amount of time then starts returning true, but without being evaluated on tick. So basically the node just sets a timer on InitializeMemory and stores the handle in the node memory. The timer then goes off, calling a function on the node memory struct and calls ConditionalFlowAbort (though I'm not sure yet what the difference between this and RequestExecution is), but I need access to the behavior tree component for that specific node, which I'm also storing in node memory. I accomplished this with an instanced node super easily but doing it with non-instanced nodes seems like im just abusing node memory more than its supposed to be
I disagree with these assumptions. The Blackboard is the way for systems outside of the BT to communicate with it. And for nodes to communicate with other nodes. It's actually a much cleaner way to hold data.
Why was everything deleted?
Maybe mod didn't like the mood?
Didn't feel right keeping a massive back and forth argument here, it's disruptive to the channel
okay so my decorator works now except when i set its abort behavior to self, it still aborts a lower priority node and i dont know why. I'm calling ConditionalFlowAbort when the decorator's condition changes, which looks like it is respecting the observer abort behavior (at least it seems to check it), but then it just aborts the lower priority node anyway. For reference my behavior tree is literally just a selector with 2 wait tasks, the left one has a decorator and the right one doesn't. The right one is getting aborted when the decorator on the left one evaluates to true, even though the decorator is set to abort self
if a visual is better
I want to make service to check if the AI can see the player , is the above blueprint any good for that, I am new and just started learning UE this month
I’m confused by your question. There’s no lower priority nodes before your decorator
the lower priority node would be the one on the right wouldnt it?
so it shouldn't abort that right node when the decorator becomes true on the left node
it is, but as soon as the left decorator becomes true it aborts the right wait and runs the left wait instead
when it should be waiting for the right wait to finish before switching
i think its because youre not supposed to call ConditionalFlowAbort when a node is not active, because explicitly checking for that seems to fix it, but it is a bit annoying that that isn't just checked automatically inside the abort function (when it is already checking whether the branch is active anyway)
That’s because a selector always tries the left branch and if it succeeds, it automatically fails the right branch
If you want the right branch to go off as well you need a sequence
Hey everyone, is there anyway to generate a navmesh on a moving platform?
I'm working on a space game and I'd like NPCs to be able to walk around on a flyable ship...
This guy seems to be doing what I need here, but he never explained how:
https://www.youtube.com/watch?v=iGLrovt4gJc
You want a dynamic navmesh and recalculate it as often as you need
Using a world partitioned map, do you 'Need' to select the 'IsWorldPartitionedMesh' on the RecastNavMesh? I've been having some issues and on my world partitioned map, everything seems to work fine with this option disabled
Does it need to be as dynamic as you imagine or could you set it up such that the ship is its own level, or that the world moves around the stationary ship?
has anybody ever had this problem where the ai's model interferes with the nav mesh bounds? It's being treated like a piece of terrain for some reason
would I have to change the model to a skeletal mesh?
Turn off can affect navigation on its primitive components
why does my navlink proxy never fires the Receive Smart Link Reached event even if the enemy looks like it reached the link?
i made the event print hello but it never does and i dont know why
You have the point link set up, not smart link.
how do i set up the smart link then?
Remove the point link
i remove the point link before but it didnt work still
alright nvm i got it to work somehow
before i turned on make smart link relevant but that didnt work but now it does
Hey guys, is there a way to auto enable this debug view when hit play? Without pressing the tilde and "Num 5" every time
Hey, is there a way to check if an AI controlled character has stopped seeing their target without changing the max age of the sight in their AI Perception?
How would you guys handle two enemies that have the same basic behavior (try to run into x range of their target, then use an ability from a prio list) but different abilities or different ability priorities? I'm assuming that making a 2nd behavior tree that's almost identical to the first one is probably not the way you're supposed to do that. Would you have a dynamic subtree that you run in the "choose ability" part of the tree? Have a blackboard key that points to an object that has a list of abilities the actor can use (that feels hacky since i dont think you can just put an array in a blackboard key by itself)?
No. I would have a task that picks an ability. I use the EQS for it, but you don't need to.
how would you pass the npc's ability options to that task
oh
eqs i guess
not sure how to set that up to do that
If you are using GAS, you can get all of the abilities, call the function CanUseAbility and have whatever other data on the ability you want to use.
i am not using gas, but specifically i would only like to pick from a subset of abilities in a task (in this example, specifically the melee range abilities, the mob might also have some abilities it uses if it cant reach)
if i could use arrays as blackboard keys i could pass them in that way
but maybe i just have a component with tags for abilities and pick by tag?
To use the EQS, you need to make a new item type. But like I said, you don't actually have to use it. Just get all your abilities and run tests on them.
Why does it need to be on the blackboard? That sounds wasteful.
im just not sure how else to change what values im passing in on an instance-to-instance basis other than setting them on another component somewhere and then just checking that component
Your pawn should know what abilities it can do. You just need a way to get them.
like if my mob has 5 abilities, i want to have a task that is basically "pick from your melee abilities," which would be 3 of those 5. just trying to figure out the best way for the task to ask whatever pawn its on what abilities it would like to consider its melee abilities, i could make it inherent to the abilities themselves but mostly i just want to be able to have an arbitrary list of abilities on a task that it picks from
but also have that list be editable per pawn, not per behavior tree
not sure if im explaining what im trying to do very well
sorry about that
You don't want to have them on the task. It doesn't make any sense for the AI to own those abilities.
You are explaining it fine. I'm trying to tell you that you are approaching it from the wrong direction. The PAWN should handle the abilities. The AI asks the pawn for what abilities it has and then picks the right one to do.
the pawn has all the abilities, and knows what abilities it can do, the behavior tree is just where i would be categorizing what abilities fit into which situations
Do you really need to say "pick a melee ability" or is it better to do "out of the abilities you can do, which one should you do if the target is X distance away"? The 2nd one makes for a cleaner BT and more flexibility.
so your task is basically just scoring all possible abilities given whatever context?
If each ability has conditions that must be met to execute, such as distance and line of sight, and a priority then you can easily make a BT task to just pick the best one.
Then you can add more abilities without ever touching the AI.
so you wouldnt really handle ability priority in the behavior tree at all then, its all external?
(aside from just asking it to get the best one at the point where its time to use an ability)
Yeah. Putting ability selection into a BT makes a really messy BT.
okay interesting. having a visual layout for ability priority was kind of one of the main reasons i was even interested in learning behavior trees, my system before was basically just an array of structs full of conditions and ability classes, but it was kind of a pain to edit
You also can't reuse the BT if you put ability selection in it. All the BT really needs to do is Find an Ability and Execute Ability
yeah that was kind of why i was asking the question, it wasnt clear to me how to reuse base behaviors while overriding the more specific ability selection stuff
makes sense that you just kind of dont lol
Finding an ability also doesn't really work well with the tree structure. It's much better to use Utility - where all abilities are scored and then the best one is selected
I'm working on a game with hundreds of different creatures. We have 3 combat BTs. Because the ability selection is handled this way.
my initial instinct (instead of scoring) was to basically create this as a data structure (this is just a random WoW rotation guide) where you just have a ranked list of abilities, which can be in the array* multiple times, and associated conditions for casting them
do you think scoring is more straightforward and flexible? with no experience in doing that i kind of assumed it could get messy with a lot of abilities, but again thats just an assumption having never implemented it
I think scoring is cleaner. It's also a lot more flexible.
If you do good debugging with the visual logger, it really doesn't get messy.
alright, i will keep that in mind. i do have another question with the setup of just selecting an ability: how do you deal with abilities that require a certain condition to be usable? You would eventually want a monster to use that ability but would need to force them to meet those conditions first, so do you score BEFORE checking whether something is usable, and then find out what conditions to fulfill to use that ability?
essentially with the super basic approach i was testing i have abilities that can be used in melee and abilities that can be used at range, but if the target is always in melee they'll never use the ranged ability, so something would need to force them to run away first to use that ability instead of just continually using the melee abilities, for instance
For my ability selection I have them find an ability, get into range and then execute the ability. I don't think running away feels good from a player perspective, so they dodge instead.
What that means is that dodging has a high cool down, but also a high priority.
okay, i think i need to make a distinction in my ability system between "ability can't be used because of cooldown/global cooldown/cc/lockout/etc." and "ability can't be used because of an arbitrary ability-specific condition like range" so that i still score abilities that can't be used because of stuff that can be fixed by movement
They will also prioritize abilities they can do right now over ones they have to move into range for.
thanks for your help, gonna go test all this stuff out and see what i can come up with
You're welcome
Where is this option in UE5?
I asked the same question a few days ago: #gameplay-ai message
and got some useful info some messages later
Can you highlight it?
In my case the support from @uneven cloud answered most of my interrogations:
#gameplay-ai message
and
#gameplay-ai message
any ressource to learn how to use smart object correctly ?
Honestly - after reading people's experience, I'd just roll my own. It'd probably be easier/better in the long run.
The concept of a SO is pretty straight forward.
i would wait until 5.4 is out
currently smart objects are rather meh than good
and as Duroxxigar said the concept is rather simple, idk how large your game has to be to take advantage of the caching that epic implemented (which on the other hand seems to be the root cause that smart objects still can't move until 5.4)
I am having a LOT of problems trying to get multiple actors to walk through a door without them getting stuck on each other like its a housefire.
I've tried RVO and Crowd Manager without much success but I'm new to both of them. Can anyone point me in a direction?
If it's not a very wide door this can be complicated because you'd need them somehow intelligently not try going through the door while someone else is within the doorway
This could be done by making the door a smart nav link which can handle the queuing of npc's through it, but it would be significantly easier to just allow your npc's to overlap
thx sir im gonna do a simple custom thing in bp then i dont require it that much anyway
Is it possible to increase the radius for nav link proxies? I've got a setup that works great for launching 1-2 AI actors from point A to point B, but any more than that and it bottlenecks:
I found the snap radius setting but it seems to only be available for simple links..
While you wait for an answer maybe you can make more nav link proxies next to each other ?
Yeah I've set up two, I wonder if more is just better
even with 4 or 5 they bottleneck every now and then
maybe less frequently but enough to be an issue
the documentation of nav link proxies is next to nonexistent lol
Any clue why navmesh stops working once the game is packaged?
My advice is to roll your own queing mechanisms. Doors are quite tricky, but if you write the code well, you can generalize to ladders, elevators, escalators, vehicles etc. Basically shift some coordinating logic into the door (a smart object if you will, I use my own SO component for it). I used a similar thing for squad control for door breaching and room clearing and it works well.
Its essentially using resource locking and/or some kind of usage token schema
Also dont forget to create debug visualizers and the like. It really helps.
I'm not sure I follow. My issue isn't so much that they can't use the nav links, it's that the nav link point is too small to fit more than one AI actor at a time, so they'll group up and sit there blocking it for each other
when they're not grouped up, it all works great
Well, you're trying to fit a lot of people through a small opening. So you have to control who is currently using the opening right? You have to deal with people coming from both sides. You have to control who has priority. Those are all general coordination aspects
Personally, I switched off all agent-agent collision and use soft seperation instead.. so that you don't get that very obvious capsule collision stuff
My agents had to play coordination animations for stuff like grabbing the door handle and opening the door, or setting breaching charges, or using a breaching device/gun or using a mirror etc.. so a bit special case, but still.
It's more like I have to make it so they can even get to the entrance of the opening. it's not so much a queueing issue with the nav link itself but a collision issue like you mentioned after
I don't know if turning off enemy to enemy collision would make sense as a whole for this game but maybe allowing them to slip by each other more than they currently do would be good
not sure how to do that
here's an example of it happening
ignore my buddy in the background lol
So what I do, is just change the collision on the capsule to ignore other capsule as collision, you can do it in the capsule collision settings
now if you only do that, they can pass through each other.. which is fine to stop things funnelling, but looks weird
maybe a way to turn it off when they're specifically going to the nav link?
So not in general but just for that case
yeah I was thinking that too
so you then add a pass that pushes them apart from each other, using a simple steering force like thing. I do it in the detour crowd update
I don't suppose there's a "is navigating to nav link" type boolean I can use
oh yeah that sounds good
how do? lol
Basically, look at how TF2 does collisions between player.. its basically just a force that forces them apart from each other.. super simple
scales to a higher force the more they overlap
its a steering force called seperation if you want a search term
yeah that sounds ideal
all I found is this which might work?
feels like that may be more work than just adding a force that pushes them apart on collision
yeah
You could turn off collision and just handle the pushing on overlap I guess
I did mine as part of the detour crowd movement steering force.. so you can do some funky shoving of crowds
someone more experienced may be able to tell you how to extract navlink specifics from the path/navmesh but it's hard to say, depending on how tightly packed the bottlenecks are. LIke if they get bottlenecked 2 navpoints before, then you have to account for that, etc...
😵💫
We had squads moving around a map.. did some small random offsets from each nav path point so that each squadmember didn't try and converge on a single point.. can help a lot
I think the navlinks stuff needs C++? I did it in C++ anyway, but I don't know if it was all exposed to BP
Maybe someone's tried it recently
Yeah I wouldn't be surprised if it needed C++
this actually ended up working surprisingly well lol. the node returns -1 if not navigating to a smart link and otherwise returns a positive number, so I'm able to switch the collision based on that
it's a bit of a bandaid for now, definitely the separation force would be a lot cleaner
If you ever try it, do add some kind of priority ordering so that agents can push past other ones
Do you have any references to the best way to implement this?
No, but you can maybe look up some things on steering behaviours. I think there was some discussion of it in Game AI Pro books that are available openly now
There's always Craig Reynolds original site.. but the Game AI Pro is probably a bit easier to understand for implementation
"LogNavigation: Warning: NavData RegistrationFailed_AgentNotValid, NavData instance contains navmesh that doesn't support any of expected agent types."
I don't get it. It supports all three? No?
Too busy with shit 🙂
going to have a bit more me time this semester thankfully
I was literally spending every weekend making videos for various classes
Hows things?
I've decided to become an ultra capitalist and try and cobble together some tech to make big $$ 🙂
Or just rob a bank I guess
You need to make more of them. There is no radius or a range. It's point to point.
I made more of them, it still just only takes two actors to block each other from using it
the point is too small
Well..yeah. it's a point. UE doesn't support regions for nav links.
Again the point is that because it's a point rather than a region, it's not usable when actors get in the way of each other
the use case is generally limited to just one AI
I understand that it doesn't support regions, it should
For the gap that you have a screenshot of, you need to add more links.
How many more? I made 5 and it would still happen
but I spread them out a bit
Enough to cover the gap. It's going to look pretty ridiculous if they queue at a gap when it looks like they can just move over a bit to avoid another NPC.
How can I prevent an AI Perception system from updating for actors of the same type?
By using the team interface functionality
I disabled collision; RVO avoidance helps keep them from colliding when not moving through a door. Exactly what I wanted thanks for the pointer.
Is anyone aware of good documentation for the enemies/neutrals/friendlies functionality in the AIPerception component?
I wrote some stuff about it here, https://zomgmoz.tv/unreal/AI-Perception/IGenericTeamAgentInterface
Oh thank you... everything else I looked at was ridiculously convoluted.
<@&213101288538374145> can we pin this pls
Ty
Hmm it just occurs to me the Custom TeamID enum page isn't being linked correctly from that page 🤔 wonder what's up with that...
Ah yes. Turns out Quartz which I use to generate that site is case-sensitive, while Obsidian itself is case-insensitive
Anyone know what might cause this?
None of my characters are moving. It behaves as if there is no nav mesh. But only after packaging. Before packaging, it works fine.
Are you using level streaming?
I've seen folks have issues with that when the navmesh volume is in the streamed level or some other configuration like that... besides this, only thing I can think of is you might need to delete your recast navmesh actor (it stores the actual navmesh data) and regenerate it (Build -> Build Paths)
Greetings!
Can somebody explain how I can place NavMeshBoundVolume in procedurar generated map?
Because we cant place them during runtime, but the dungeon (map) is generating during runtime. So I can't just place volume in every generation room
No. But I am using servertravel to go from the main menu level to the actual game level. Not sure if that matters.
I have deleted the navmesh recasts many times. It makes one for each agent. Doesn't seem to make a difference.
Actually! I just deleted the recasts again, just to be 100% sure, and now it's working! I must have fiddled with something after the last time I deleted them. Can't really remember what... Maybe it was restart of the engine in the meantime? Difficult to say....
But deleting the recasts and rebuilding paths fixed it in the packaged build.
Thankyouverymuch! I was losing my mind over this.
Oh that's good then :)
Yo, anybody knows something about AI navigation optimization?
Is nav invoker a really good solution against "just place big navmesh bound for generated level"
Hey guys i have 2 zone as bp that i want to get the transform and feed it in the blackboard to use it in thebehaviour tree how ?
Im mostly asking to understand the way u would communicate that data from those bp to the ai controller
You need to get a reference to the object you want in some fashion
If it's a specific actor type, using get actor of class could be acceptable as long as you are aware of its potential issues (eg. if you place another actor of that type and so on)
If you have more than one of them or it's just otherwise not a good solution for you, you could try to identify the actor by tag, or have the actor register itself somewhere like the game state or a subsystem
You can then use that registry in your AI controller to pull the actor from it
thx, but then nothing as to be casted or communicate via interface or ed its just getting a reference ? cause casting isn't getting a reference ?
casting is reserved to get an entire class ? here we just want to reference on object is that right ? @misty wharf
Casting effectively says "convert this value into this different type if it's possible". It doesn't get anything
oh thats why u have to feed it with a get in the wildcard pin
man ur explanation is one of the best i found thx btw
Thanks :) That's nice to hear

Yo, anybody knows something about AI navigation optimization?
Is nav invoker a really good solution against "just place big navmesh bound for generated level"
Does anyone know if it's possible to make AIs 'walk' underwater ?
I mean, walking on NavMesh even if the AI Actor is in a water volume
hi, I'm writing an essay on how generative AI will affect the games industry for artists. I would love to know anyones thoughts on the subject?
Probably more for #generative-ai or #lounge. This channel is for AI within UE
(I don't know the rules for #generative-ai - so make sure to double check)
Using an evironment query, I'm trying to score each point by its "navigable" distance, instead of it's vector distance from the origin. There's a test called Pathfinding but it only returns a bool for whether it's navigable, not its distance.
Or do I have to settle for whether the point is visible from the origin.
You could potentially create a custom test that does this. I think you can get the full path to the target point and then measure its length. Do note that this is more expensive to compute than just the regular pathfinding test
Nav invokers are incredibly expensive.
But if I will place NavMeshBound without invokers, that will be worse?
No it will not be. Invokers are the most expensive way to generate nav mesh.
You can change the pathfinding test to use path cost by using the drop down.
Strange, because Invokers cast NavMesh only around NPC, and "just NavMeshBound" cast on all generated map
Thank you so much, right under my nose.
No, of course I like this solution ( "just NavMeshBound" without invoker), because with invokers I need to do some additional logic in behevior tree, but that very strange
Invokers do it at runtime. They also are more expensive than fully Regen nav mesh, because of how it generates.
"just NavMeshBound" is not a thing.
Okay, in my situation:
- I setted navigation to "Dynamic"
- Placed EXTREMLY big NavMeshBoundVolume in place where I will generate dungeon
- Dungeon is generation during runtime, NavMeshBoundVolume casts navigation on it because of "Dynamic" settings
You have static, regen modifiers only, full regen or invokers.
I think "dynamic" its full regen?
NavMeshBoundsVolume doesn't "cast navigation on it". The navigation system generates nav mesh within the bounds.
Not sure, because without NavMeshBoundsVolume I didnt have any navigation pathes
@uneven cloud sorry to jump in with an ask, but do you think you could provide opposing usecases for using a generated nav mesh vs invoker components?
("I don't have time" is a fine answer, just thought it could shed some light)
Invokers are incredibly expensive. They should not be used. Full stop.
So, just big NavMeshBoundsVolume without invokers better than with invokers...
Sending love from the front lines. Full stop 🙃
Haha
But why people use invokers?
Because UE didn't always have navigation streaming and people making tutorials don't know what they are doing.
So invokers are sort of deprecated at this point?
Pretty much. They haven't been updated in years.
Agreed. But how I can optimize pathing in my situation? (Navigation in procedural genereted dungeon in runtime)
Ok, that's good to know. I was considering them as a way to mitigate spaces between nav meshes, but I assume there's a more performant way.
Or I don't need optimize navigation?
Is your navigation causing you performance problems?
I know I've undermined my own position by not knowing about invokers, but as a general rule "if it's not broken, don't fix it"
Focus on optimizing the parts of your game that are slowing your game down
Not sure, Im just thinkg a step in fufture
Or in modern terms, premature optimization is a bad idea
Agreed
Premature optimization is bad, but so is knowingly doing something incredibly expensive.
Why I cant place NavMeshBound inside blueprint?( Placing big Bound just in screne looks like terrible idea, but maybe its okay in industry
(my dungeon is genereted by rooms, rooms === blueprints)
Programers use size squared for distance, because it's not worth the cost of the square root. That's not premature optimization, that's being educated and experienced.
The nav mesh bounds volume is an actor. Just place it in the world the largest it needs to be.
I did it, but Im afraid that generation can go out of this Bound. (or I can make it EVEN BIGGER!!!!11)
okay, I got it, Thanks for advices)
You are best!
I'm not at my development PC at the moment, but I'm curious: is it possible to set the extents of a dynamic navmesh volume during runtime to accomodate for changing worldspace?
Perhaps by setting extents and forcing an update?
I don't believe so, but you can move them. You just need to call On Bounds Updated in the navigation system if you change it.
If your bounds are too big and covers empty space, it's not a big deal. Nav mesh just won't generate in the empty space.
Will overlapping navmesh bounds allow an AI to cross from one to the other, or is that only handled through navlinks?
Yes it will.
All the bounds do is signify that the nav mesh will be built within the bounds. They don't do anything else.
So if the nav mesh is generated with a path from point A in one bounds and point B is another, then there will be a path. The bounds actually doesn't matter.
So for a modular sort of world (building by building, for example), would it make sense to have each piece include its own slightly oversized nav mesh bounds that then overlaps with others as pieces are loaded into the world? Or is it too expensive, with a better solution typically being to load in pieces to a large area with an existing nav mesh and regenerate it?
has AI changed much since 4.27? is EQS still in beta?
Are clients allowed to run an environment query?
I think there's some new tests and generators in it but in general it's the same. It has been perfectly fine to use for many versions now despite the beta label
also it might have lost the beta label at some version of 5 but haven't really looked at that
Better to have the bounds volume(s) in the world.
You have to do some code changes to allow the env query manager to be created on the client
There used to be a setting in the project settings for AI systems to be created on the client, but that changed with 5.
And then instance set pieces into those volumes and regen nav mesh at runtime?
I'm trying to make a simple state tree with a random patrolling AI. The FindRandomLocation state has a task that has a Vector as an Output while the WalkToLocation has a Vector has an input. I'd like to bind the output of the FindRandomLocation to the WalkToLocation but, based on how the tree is set up now, I can't. The only way i've found to do so is to have both tasks on the same state. And even if I do so, the AI Move To failes with abort.
Am I missing something?
Hi. I'm struggling with understanding the concept of Age in perception component.
Easiest to explain what I want to achieve.
I have a Tower that will fire on the enemy that comes within range (in this case Sight perception) . It will always shoot on the player that has been within the range the longest. If that steps out, I want to select/focus the enemy being within range for the longest again.
Now if I put MaxAge to 0 (zero) the Aging will not happen within range but only when it comes outside of range to remember where last seen.
If I put MaxAge to 0.1f it will constantly trigger a new perception update.
If putting it to 9999 it still doesnt increase within the range. Only outside.
Is there an age that is growing within the perception range? Should be as it is triggering a new update when Max Age is low. How do I get a hold of it?
Am I thinking about this the wrong way? (C++ or BP doesnt matter)
Yeah, you’re misinterpreting it. Max age has to do with how long after it left perception range until the target is forgotten
Verbatim from the docs: Determines the duration in which the stimuli generated by this sense becomes forgotten (0 means never forgotten).
It doesn’t measure from when it was perceived but rather from when it stopped being perceived
Guess I'll have to do my own "age" thing then. Thanks.
What about open world? 👀
Just look up her messages about open world. Still favor nav mesh streaming.
Some ppl adviced me to not use the world partitioned nav mesh. Cause it was unstable and hard to use in editor...
https://docs.unrealengine.com/5.0/en-US/world-partitioned-navigation-mesh/
Does nav mesh streaming is the same tech?
I'm trying to understand State Trees fully. Now I'm trying to implement a simple behavior where the AI goes to a objective
I get this error and, while I understand the error, I don't get the reason why there's no condition for the AI to enter the MoveToObjective state
Since I'm sure that the FindObjective task returns "true"
The State Tree attempts to always enter the leaf
So the Idle state would never be active without MoveToObjective being active
I don't know if it's related to the error message though, haven't seen that one
Mmmh, okay, i think i understand the problem now. The MoveToObjective will never enter since the IsThereAnObjective variable is set with the FindObjective task
Also - since you have an enter condition on the leaf node which depends on the parent node, this will not work
that is on the Idle state
If the leaf node's condition would be false when the parent state's task has not ran, the leaf node and the parent would never activate
okay, now i understand
then in this case what would be the best (or one) way to implement this kind of behavior?
Someone was here a while ago who said that using different selection mode setting he got it working, but I've not tried that myself so I can't say for sure
If that doesn't work for you, I've listed a pattern here which can be used https://zomgmoz.tv/unreal/State-Tree/StateTree-design
Do note that this pattern may not work if your tasks which load data don't resolve immediately - in that case, you would need to have the "wait state" to actually wait for the data to become available before transitioning to the next state
mmmh okay, that's clear
So in this case is probably better to have the info about the objective on the Blueprint of the AI and then use it through the tree
what it's confusing a bit for me (coming from behavior trees) is that it feels like the state trees don't have a place where to store and use data (like a Blackboard) but the data is spread in different places
because, using the evaluator to do so, feels demanding in terms of computing since you'd do it on tick
but i might have not understand a lot of things about State Trees :)
do you guys put the StateTree Components inside the controller or the pawn ?
how do i make navmesh generation avoid those boxes on the lower right? They have collision preset of PhysicsActor, since they are intended to tumble and be knocked around, but i want only the player to walk into them, and for enemies to avoid them. How?
the pawn
but i don't know if it's the best way to do it or not
oh
how is the "Can Affect Navigation" check set-up?
thanks a lot for the answers btw!
ah i didnt know that feature existed. Can ever... is not ticked. ticking it makes them be pathed around like i want
Would it be possible to make these boxes be ignored by enemies while they're intact, but become walkable and not block navigation once the player has bumped into them (at runtime during gameplay)?
on top of my mind a way could be to use the "on hit" event for the cube and, once they are hit, you set the "can affect navigation" check to false
while before was true
but this isn't "can affect navigation" , it's "can ever affect navigation"
Isn't there some distinction there? That checkbox sounds like something that shouldn't be toggled at runtime, my intuition says there's probably another, better way to update the status of how things affect navigation during gameplay
seems like the sort of box you'd want to have toggled on for things that don't affect navigation but might later get changed to, also. like an authortime optimisation?
at the end there's "Using the Runtime Generation (Dynamic)"
maybe that might help with what you need
very cool thank you!
one more related question, is there any way to randomise pathing a bit, so that agents choose an only -fairly efficient- path rather than machinelike precision on the minimal cost? To simulate more organic movement and prevent crowds from clumping up around corners and chokepoints
on the non-optimal path, i don't have an answer. For the crowd management, i'd suggest this https://docs.unrealengine.com/5.0/en-US/using-avoidance-with-the-navigation-system-in-unreal-engine/
never used though, i only know its existence
hmm no, i dont think avoidance is what i want. i dont mind if enemies jostle and shove each other around, i just want their movement to be less predictable
thank you for the links so far, im saving these for later, the first one has a lot of good stuff
hello i have an issue with my navmesh, i tried yo fix it by using Nav Link Proxy
but it only take the stairs to go downstair
nav links have a setting that allows them to go both ways or only one, sounds like you havent set that
(I literally just learned this!)
i did it
this direction setting?
^
being stairs you shouldn't even need a Link proxy. Did you check if the navmesh are generated inside the stairs mesh? Also, have you tried to increase CellHeight, AgentMaxStepHeight and AgentMaxSlope for the AI pawn?
no for the agent part
i'll give it a try !
it's on the ai controller ?
should be in the project settings
happy to help!
did you try to change one setting at a time? not sure why now it's not moving anymore
try to reset to the previous one and check if it works again
not sure why it's not working anyomore tbh
i rested it now i'll try redo only the AgentMaxSlope
they can go down but not up
but
they have the path
have you tried to increase max step height also?
no
what's the max step height by the way ?
Largest vertical step the agent can perform.
this is how unreal explains it
i think i have collision issue too
meaning it's the max height the character can step before needing to jump (i.e. with link proxy)
seems like the navmesh it's not generated in a proper way though
how are the collision set on the stairs?
navmesh/eqs question - how can i ensure that npc type A cannot walk over certain areas of the level, but other npcs can? Sort of like a navmesh obstacle but that is only recognized by A, while npc B C D etc can all walk over it freely
Nav filters
it's easier to understand how they are if you go in the object and check them
it's not really clear to me from this pic 😅
https://docs.unrealengine.com/5.3/en-US/navigation-system-in-unreal-engine/
Honestly, reading through this can help clarify some stuff with how to go about doing things with the navigation stuff.
It's not like super great, but it goes over some neat things that most people aren't even aware of
Nav mesh streaming. Not invokers. Being an open world game doesn't change how expensive invokers are. In fact, with an open world game you need to consider performance even more than a typical hobbyist game.
i'm in the object 
Not without making modifications to the pathing algorithm.
i'm puzzled by that, this seems like a common sort of thing to want. IT doesn't really make sense that humans and animals would obsessively hug every corner precisely when they turn, and behave like heat seeking missiles to get anywhere. robots sure, but otherwise, its not very organic
You have to make the character movement component settings match the navigation settings. If you change the step height or max slope in one, you must change it for the other.
Pathing algorithms use a heuristic to determine a path. The shortest path is used, because you can distill that to a mathematical function.
hmm, well they make a path out of waypoints right? Perhaps i can interdict that and mess with the path before its followed, add some randomising to the waypoint locations?
OOOOOOH

i'll give it a try
You could try. There's a function you can override for the post process path, but it's C++ only. It'd likely not look great, because random rarely does.
C++ is where i'm most comfortable!
Didn't Eren look at PostProcessPath and figure out it was fairly useless for this? 🤔
I can't remember.
Thank you!! For some reasons the docs are always the last place id look, but this time it seems like they cover exactly what i needed
I've seen him recommend it before. I don't think it's a good idea, it would be better to change the heuristic, but if people want to alter the path afterwards that's where I would start.
Does nav mesh streaming work with dynamically created level instances, too, do you know?
We did a game a while back where we instanced out tiles, and I remember we used invokers.
Yes. You have to use dynamic generation though. Still cheaper than invokers.
Gotcha.
Yes, in that case I fell victim to the tutorial misinformation swamp for sure!
Thanks for the answer! Will be good to know if we ever revisit that game!
I've worked on 2 games that had procedurally generated worlds. Both times we did performance testing with dynamic generation vs invokers and invokers are several times more expensive than dynamic generation
Huh! Indeed very good to know!
I think otherwise
Because what you were asking for that day was happening inside of that function
But Luthage disagrees that its a good idea to do what you were asking there
Does anyone know if the Move To task overrides the actor's rotation? I made a service to make the character spin in place but it doesn't happen if the Move To is being called, even with Strafe on
iirc the path following component overrides the actor's "focus" which ends up having it face the direction it's moving to
Any work around that?
Not sure, I'd start by looking through the code for the path follower comp and hope there's something useful
Alright, I'll look there, thank you
Is it possible to have two different controllers with different behavior trees but the same blackboard? 🤔
Same as in shared or just the same type?
Shared
If you look in the BB editor, each BB key should have a checkbox for that
You'll have to enable it for all the properties you want to be shared
I am doing a project where we manage a hotel, but customers come to the reception and tell us how many hours or days they will stay and whether we will accept them accordingly. In short, how to make hotel customer random NPCs, can you please help?
What have you tried so far?
I tried to integrate the daily lives of NPCs into the hotel, but it didn't work the way I wanted.
what have you implemented? How are things structured as is? what do you want and what happened instead?
I integrated the activities that NPCs do in daily life (sitting, eating, chatting with other NPCs) as a hotel customer, but it did not work the way I wanted. NPCs were entering the hotel and leaving again. What I wanted was for the NPCs (customers) around to come to the hotel and stay for an hour or a day. This is just
Behavior tree?
Yes, I integrated the behaviors, I wrote it wrong
Do you know how to trace and debug behAvior trees? F9?
You need to give a lot more information. There are many ways to do what you are trying to do and we can't guess which way that you implemented it. I do however recommend learning how to use the visual logger to debug your functionality so you can ask a more specific question.
Ok I did it and solved the problem
Hello! I'm using the Visual Logger to check the activity of the State Tree my AI is using. Usually it's super helpful but now, when the AI is stuck, it just says "Could not trigger completion transition, jump back to start." with no reference to any of the states i'm using
Anyone has any idea on how to get more info? Understanding where it gets stuck and which of the state doesn't complete the transition?
Try looking at the previous logged messages
You can also try using the state tree debugger which should be in one of the menus when you're editing the tree
Has anyone experienced a fatal error with state tree? I keep getting a random crash which has at the top of the stack trace
Assertion failed: IsValid() && IsValidIndex(Index) [File:D:\build\++UE5\Sync\Engine\Plugins\Experimental\StructUtils\Source\StructUtils\Public\InstancedStructContainer.h] [Line: 119]
I know it's state tree that is causing the crash because the stack trace is quite explicit
UnrealEditor_StateTreeModule!FStateTreeExecutionContext::GetExecState() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\StateTree\Source\StateTreeModule\Public\StateTreeExecutionContext.h:386]
UnrealEditor_StateTreeModule!FStateTreeExecutionContext::GetInstanceDebugId() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\StateTree\Source\StateTreeModule\Private\StateTreeExecutionContext.cpp:586]
UnrealEditor_StateTreeModule!FStateTreeExecutionContext::TriggerTransitions() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\StateTree\Source\StateTreeModule\Private\StateTreeExecutionContext.cpp:1584]
UnrealEditor_StateTreeModule!FStateTreeExecutionContext::Tick() [D:\build\++UE5\Sync\Engine\Plugins\Runtime\StateTree\Source\StateTreeModule\Private\StateTreeExecutionContext.cpp:427]
Haven't seen anything like that, you'd have to debug it I think to find out what's up... Given it mentions TriggerTransitions it sounds like there might be something wrong with one of your state transitions though
Thanks, that helped!
Also, asking an opinion, are State Trees really worth using for simple things? I.e., if doing a simple AI with a walk to objective and then wait, it feels that it's a lot more complicated compared to do so with a Behaviour Tree
I don't think there's really a right way or wrong way in that sense... Personally I find them fairly straightforward to use, plus they can be used for other actors besides just AI controllers unlike behavior trees which are fairly heavily coupled to that
The problem that I'm having, personally, it's one and is about the enter condition fo the different states
It's easy for me to make a State Tree where the conditions are never met or a condition is met too easily and i don't want to
Another question: where do you store the data? Like, in Behaviour Tree you do it in the Blackboard, but where do you do that in the State Tree?
I mostly pull it straight from the owner actor in the tasks, or I have tasks that pull data in
But yeah if you find BT's work better for what you want to do, I don't think there's necessarily any reason to not use them
State Trees are definitely still missing a few bits here and there, like the ability to run subtrees, which can make sharing state trees across several AI types kinda annoying or duplication-heavy
mmmh okay, it's the same thing that I was doing and it feels there's no better way to do it
but yeah, feels like they are still a bit incomplete and not fully ready to be used, in my opinion
thanks for the answer again, it's always nice to have another point of view
My BT tasks and stuff also pull data straight from the pawn and controller pretty often
I don't really like BB's that much... they're good for some purposes, but for others not really, and especially with AI's that have a lot of data it seems you'd end up with a bazillion BB fields that you'd use in like one or two places
that's also true. I like them for being one place where to have all the data but still, can get quite messy
Maybe I feel more comfortable with BT and BB only because I used them a lot
I think having some kind of BB-type mechanism in ST's could be good as well. Like being able to have more than the one context actor variable
You can extend it with custom stuff into the context but it seemed to be really complicated when I looked at it a while back
Yeah, definitely that
it feels like having one place to have a bit of data and only care about that would help
also because, without it, it feels it's difficult to keep track of all the data that you might have here and there in BP
Yeah kinda depends on what the task is. A lot of the ones I have are kind of specific for a particular type of AI so it's fine if it uses GetExternalData to pull it
yeah, i saw your way of designing it and it's a good way to work with it tbh. I might go back to State Trees in case I'll need them but feels like that, atm, BT are the way i feel more comfortable with
how can i make enemies pushable? I'd like to slowly shove them aside if they're lighter than the player when both bump together
all pawns derived from acharacter
is this something doable with physics or behaviour in the character movement component, or would i need to do some coding?
You can apply a force to the character via the CMC
that seems like a viable option
const FVector OwnerLocation = GetOwner()->GetActorLocation();
for (UPrimitiveComponent* Comp : OverlappingComponents)
{
FVector PushTo = bPushAwayFromOwnerCenter
? (Comp->GetComponentLocation() - OwnerLocation).GetSafeNormal()
: PushDirection.Vector();
if(PushTo.IsNearlyZero())
{
PushTo = UKismetMathLibrary::RandomUnitVector();
}
if(Comp->IsSimulatingPhysics())
{
Comp->AddForce(PushTo * PushForce);
}
else if(auto* CMC = Comp->GetOwner()->FindComponentByClass<UCharacterMovementComponent>())
{
CMC->AddForce(PushTo * PushForce);
}
}
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
what functions would i use for that- ah
This is some code I use in one of my projects for the purpose
I have a component which collects overlapping actors into a list and runs this on tick to push them around
do CMCs simulate physics by default?
No, CMC is incompatible with simulate physics
It has its own physics simulation
that's why you have to add the force to the CMC instead of using the component's add force
understood, thats fine
the above code I use also supports pushing regular physics based actors, but that part is not needed if you just want to push characters
do you do pushing in singular bursts or granularly each frame?
just a preference question, perhaps you experimented with both?
guys is there a way to return something when ur AI move to the location u told him succesfuly or do i have to manualy track it with an overlap event ?
It depends on how you want the effect to behave, a weaker slower push would probably work better over time, but a stronger one could be just one burst also since it would probably push the target further away
There should be a MoveTo node which has a pin which fires when the move has finished successfully
im using the default moveto task , but u made me think i need to create a custom task anyway should be better lol thx
Oh, if you mean the BT MoveTo task, then that task finishes only after the move has finished
i see so i only need to make a custom task for the following and it will be "sync" as i want then thx
Yeah anything you place after the MoveTo in your BT would only run after the AI has reached the destination
Do you have any resources about how to aggregate tick calls ?
Unrealfest 2019 sea of thieves talk
Ok i'll check that, thanks !
i have this aic setup, blackboard, and enemy bp but the enemy is not moving towards theplayer character and dk why really 😦
nvm
I would use OnPawnBumped
that function doesnt seem to exist in the cpp ref, am i mistaken?
In the movement component?
oh, well is there an equivilant on the character?
No.
https://docs.unrealengine.com/5.3/en-US/API/Runtime/Engine/GameFramework/UCharacterMovementComponent/ hmm, not seeing it on here either
NotifyBumpedPawn
I'm trying to get into StateTrees for my AIController moving a pawn around. I have a State Tree Task: STT_MoveToLocation which uses a MoveToLocationOrActor latent node to move the pawn using the controller. The problem is that I can't transition out of the node until the task is finished. Are tick transitions not checked while a task is running?
how can i get this line and togle "observe blackboard value" in a custom task guys ?
By adding that functionality.
so u can 😄 how do i do that ?
Create a custom task with C++, public variable, etc
its have to be in cpp ?
Not sure if it has to, but it'd probably be easier than in BP. I haven't worked on directly replicating that before.
But with C++, you get to see literally how they did it and what they do...
im slowly starting to understand bp and i want to come to cpp but if i can avoid it
Well you can add that functionality by adding variables and the code needed to do that. However I don't understand why you are making a very specific task instead of doing it as a sequence and using the built-in move to.
Yeah why can't you use MoveTo and then a CustomTask_Sit, instead of MoveToAndSit?
i should use the built in move to but i did this without thinking the option will not be there
also its use the same values so my brain was bugguing on that
like the sit target for the motion wraping and the move to
thats why i made it in one go but u guys are right
i was also curious to know this cause it could have been usefull in custom task
but i was thinking it was a c++ thing since u can't see the moveto base task in bp
The way you are trying to do it is reimplementing functionality that already exists. You need to learn to not reimplement things that you don't need to.
thats true
wdym? What do you need to see? The BTTask for MoveTo just uses the AITask Move To
The move to BT task doesn't just call move to. It actually does a lot of important things, like abort the move when the task is aborted.
yeah cause there is the observe value u can't have by default in custom task
ok yeah not "just," lot of managerial things, besides it
As well as allow you to observe changes in the blackboard that triggers a repath.
yeah thats for the repath i was asking
but dw guys ill use the base moveto and a custom sit task
You can have it in a custom task. You just need to implement it.
i need to work on that lol i dont know how to implement it and u said i need to not reimplement when its not neede
@mild bobcat @uneven cloud thx for the infos
im in 5.3.2 and my AI debug menu (') wont open
You check the hotkey settings?
Are you in Simulate or PIE?
Altho iirc it should work in both
I keep getting this ensure failure the first time a certain custom BT Task is ran (BTT_MoveToRandomPoint). It freezes the editor for a few seconds and pops a call stack, but everything seems to work apart from that.
LogOutputDevice: Warning: Script Stack (2 frames) :
/Game/Blueprints/UI/Subtitles/BehaviourTree/Tasks/BTT_MoveToRandomPoint.BTT_MoveToRandomPoint_C.ExecuteUbergraph_BTT_MoveToRandomPoint
/Game/Blueprints/UI/Subtitles/BehaviourTree/Tasks/BTT_MoveToRandomPoint.BTT_MoveToRandomPoint_C.ReceiveExecuteAI
LogStats: FPlatformStackWalk::StackWalkAndDump - 0.048 s
LogOutputDevice: Error: === Handled ensure: ===
LogOutputDevice: Error: Ensure condition failed: AsAIController [File:D:\build\++UE5\Sync\Engine\Source\Runtime\AIModule\Private\Navigation\NavFilter_AIControllerDefault.cpp] [Line: 20]
(more UnknownFunctions[] after this)
This is the Task. Nothing super weird, I thought.
Does anyone have any idea what might be causing it?
I don't know if the context provided is enough. I thought I had editor symbols to reveal UnknownFunctions, but maybe not.
In addition, this only seems to happen the first time this function runs. Subsequent PIE:s work fine.
Heres a few extra lines of stack but again, useless in my eyes:
LogOutputDevice: Error: [Callstack] 0x00007fff7b21d03d UnrealEditor-AIModule.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007fff81c30b4a UnrealEditor-NavigationSystem.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007fff81c31046 UnrealEditor-NavigationSystem.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007fff81c38a1c UnrealEditor-NavigationSystem.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007fff81c6b518 UnrealEditor-NavigationSystem.dll!UnknownFunction []
I'll see if creating the Task anew fixes this... I suppose it could be ✨blueprint corruption ✨
I guess changing that Target variable might be forbidden if the Task should be considered const? (but that feels unrelated to me)
No, still happens with a fresh blueprint task and no Target variable being modified
I believe I might have found the cause: the nav filter. Switching from NavFilter_AIController_Default to Recast_Filter_UseDefaultArea seems to have mitigated it. Or it was just luck... I'll edit this message if it keeps happening.
Quick question are Decorators still executing after their value will be true?
hey, i dont understand why the boolean toggled doesn't take effect on every instance of npc (see screenshot and video) the screenshot is from the task beng fired that set the boolean and the video show that only the first one have the expected behaviour wich is having his abp set on the sit state machine after the siting animation
Get Actor of Class, singular
but if i take all actor and set the boolean on each they all gonna be in sit position after only one npc do this ?
Well I don't know how your system works beyond what's in the screenshot
get actor of class returns one only, get all actors returns all that currently exist
ok cause i want it to be instanced on the npc that do that task,
This boolean is set in the parent of npc class and the abp check if its up or not to change his animation and i get that class to change it in the custom task after the sitting animation but i think its not the good way or i need to get all actor and filter with the "controlled pawn" of the event receive Execute AI and change it only on the concerned instance ?
So you're trying to trigger a sit animation when the npc reaches the bench?
yeah and it work but after the sitting animation i want the npc to stay sitted wich i was trying to achieve with updating wich state machine is activated in his animation blueprint
Right - why not just set the boolean on the npc the BT belongs to?
thats what i was actualy thinking lol it sound the most convenient
That seems like the way to go yeah, you can just use the Controlled Pawn variable in the BT task
hmmm u saying that i need to use the controled pawn variable to do what ?
I mean the parameter to your BT task event should have the reference to the pawn
which you can use instead of get actor of class, since it gives you the pawn that the BT belongs to
im so dumb -_-
thx sir
hello! I'm creating a simple AI that moves to random points using AngelScript for the tasks.
I made this script to make the AI move and, once they reach the destination, they stop executing the task. I'm wondering though if i'm doing something wrong or if this could be done in a better way, also because the distance now depends on the actor dimension.
Here's the code:
`FVector Destination;
EPathFollowingRequestResult MovementResult;
float AcceptanceRadius = 10;
UFUNCTION(BlueprintOverride)
void ExecuteAI(AAIController OwnerController, APawn ControlledPawn)
{
//Get destination from the Blackboard
Destination = OwnerController.Blackboard.GetValueAsVector(FName("Destination"));
//Draw a sphere in the destination point, for debug purposes
System::DrawDebugSphere(Destination, 20, 12,FLinearColor(0,0.33,1,1), 10, 2);
//Move the AI to the location
MovementResult = OwnerController.MoveToLocation(Destination, (AcceptanceRadius/10), true, true, false, true, nullptr, true);
}
UFUNCTION(BlueprintOverride)
void TickAI(AAIController OwnerController, APawn ControlledPawn, float DeltaSeconds)
{
//Print(f"Distance = " + Destination.DistXY(ControlledPawn.GetActorLocation()));
Print(f"Distance = " + Destination.Distance(ControlledPawn.GetActorLocation()));
//Check if destination is reached
if(Destination.DistXY(ControlledPawn.GetActorLocation()) <= 50){
FinishExecute(true);
}
}`
my main concern is the distance calculation. What I mean is, i.e. if I create another blueprint that derives from the script I made, then depending on how big it will be, the distance between the point and the actor will be different, so I will need to change the acceptance radius. Is there a way to make this modular and based on the size of the actor? Should I take the size of the actor then and consider it when calculating the distance from the point?
I don't know about AngelScript but the builtin moveto stuff should be able to take into account the actor radius
it might be one of those true, true, false, values you're passing into MoveToLocation
If it doesn't work for whatever reason, you can certainly just take the actor's capsule and get its radius
Quick question might be weird, does blackboard variable are instanced per npc using it ? i mean does each npc as is own instance of blackboard variable ?
Yeah. Blackboard properties are not shared between instances unless you enable it from the settings for the property
im gonna pay u if u continue to help me lol, beware (ty btw)
Hello, is there a possibility to get Receive Tick AI to run inside a BehaviorTreeDecorator? Or does it only work in a ServiceBP?
Since i can override it inside a Decorator i thought it should work, but the tick never fires
haha, I'll be sure to send you a link to my plugin if I manage to get it published so you'll get something in exchange
nice
I don't remember for sure but you might have to enable ticking on it either in the BT editor or in the settings of the decorator itself
Thanks, but sadly i cant find anything like that xD
my problem with that it's that, i don't know when to stop the task. So what i'm doing is:
- On tick, check if you reached the destination
- If not, keep doing the move to
- If destination is reached, call the end task
so maybe i'm missing something there
and i'm doing that since the moveto method returns "success" if there's a path to reach the destination as far as i understood
There should be a way to determine when the move has finished via delegates also
oh thanks for the tip
i just found that there's a “Get Move Status” method
maybe that would help
I don't understand why you don't just use the built-in move to with a sequence and a custom task that just gets a random location. You are missing a lot of important functionality from the built-in move to.
I've never used angelscript before. Can you not use the AI task move to so you can use a delegate to know when the move has completed instead of doing it on tick?
Good idea. I will make those changes. Our AI is generally pretty simple and most of these nodes were made a long time ago, so they've just stuck around!
The delegate on this is protected because epic hates C++ developers trying to not reinvent the wheel :P
so ive finally made my characters able to push each other around, using AddForce in the Character Movement Components, but when i apply equal force to both participants, the one who is moving seems to suffer far more than one standing still, even when the latter is a quarter of the mass
I'm thinking some kind of friction/braking values might be involved in this that are causing a non moving char to stop themselves much earlier
any idea where i should look?
In this case, the ones standing still have no controller, they are braindead (there's a tickbox to make it work on chars with no controller)
Most likely the active velocity from the movement is affecting it
You can try resetting the velocity of the actors to 0 before applying the force
i don't think that's it, the difference is too pronounced, like the goblin being shoved half a metre while the player rebounds and flies through the air
although it would make sense that friction/braking don't apply on a target that's moving
It's worth a try. Also note that if you're not setting the "ignore mass" flag, the weight of the actor will affect it as well
yes i want the weight of the actors to affect it, thats the point
to be clear, the actor that has far less mass, is being pushed less (although if i increase their mass, they get pushed even less, so that part is working correctly)
what exactly is worth a try? One already isn't moving
Resetting the velocity I mean
alright i've tried it, this dampens the rebounding of the moving character, but they still get pushed back from the collision more than the stationary one does
in any case this isn't a workable idea, i want to maintain velocity, the goal here is to allow a big guy to shove his way through small goblins
how physics-based are you looking?
why not make the big-guy dominant in the physics and only affect the goblins
There are linear braking values somewhere in the engine, look for damping
I'm using the AddForce function built into a character movement controller, its a sort of fake physics, but it should work for my purpose
the same force is being applied to both characters, the goblin weighs 25kg, the player weighs 100kg. When they collide, the goblin should be pushed farther, its getting pushed less than the player
there are a lot of values related to braking, damping and friction, i don't understand them and need a bit of guidance to find which one(s) are likely to help
Turn them all off and add them back one by one?
There's Braking Friction Factor
Ground Friction
"Physics Interaction" section i believe only applies to interactions with physics actors
It even has built-in things like repulsion force, etc, but it doesn't play well at all with CMC
ahaha this is fun
Have you already debugged the acceleration values applied on the characters?
i turned them all off and now i'm playing air hockey with goblins
i shove them and they just go wheee
lol
well, probably tweak to taste then
oh god its self sustaining now they keep bouncing off each other
goblin collider
one of them built up enough momentum to launch me out of the map
I'm guessing you want the ground to have friction but maybe reduce the friction factor.
i present a video of the goblin collider
i'm not even entirely certain why it worked like this, they seemed to keep building up speed, whenever a goblin touched another it launched it faster than itself is moving
i found that braking friction is the value i wanted, and setting it to 0.5 or less for goblins gives pretty good results
I've used the AI task in code just fine.
Did you use the delegates from somewhere else like the path following comp for it?
because:
protected:
UPROPERTY(BlueprintAssignable)
FGenericGameplayTaskDelegate OnRequestFailed;
UPROPERTY(BlueprintAssignable)
FMoveTaskCompletedSignature OnMoveFinished;
just a question I made in another channel: if I want to make an actor with custom movement, and make that actor to be player controlled, and AI controlled, I have to replicate the same movement system using two completely different methods? (an AIcontroller and a PlayerController)
is the force added a function of penetration depth?
So I actually use the Havok versions. However, the AI task to use a smart object does us the AI task move to, so you can see what delegate they are using.
You can't make something AI controlled and player controlled at the same time.
For AI controlled characters, they move using the movement component. If you are making your own movement component, it needs to at least be a child of the nav movement component.
AI movement uses either RequestDirectMove or RequestPathMove
which component defines those functions? and how could I make a custom nav movement controller? Only with c++? Using blueprints it seems I can't base them on it
The movement component. Specifically the Nav Movement Component. There is no such thing as a movement controller.
I believe it is only available in C++. BP really is not a good idea for expensive things like movement.
Yeah as I suspected it just uses the gameplay task owner api which allows it to detect when a child task finishes. Interestingly it does bypass the static construction function for the MoveTo task, which would normally prevent you from using the gameplay task interface stuff for this
it just NewAITask's it instead
nope, nor velocity, its just calculated based on the total mass of both parties and applied to them equally
addforce itself factors mass against that so heavier things get less acceleration
possibility that when moving fast, they are penetrated by more than a few frames, so that the force gets added multiple times? CCD may prevent that.
CCD's expensive, though
But it's likely just a side effect of how fast they're moving makes them collide deeper and thus have more cumulative force applied.
If you want the character to just be able to move them aside, it may be better to apply repositioning instead of acceleration.
Any thoughts about generative AI models and how they might influence Unreal Engine's toolset?
It's not really a modeling software; it's probably more of question for Blender, etc.
Generative AI models will unlikely to ever be useful for game AI.
The most I can really see them doing with gen AI is the same sort of thing that github copilot (which is just GPT) is decent at: boilerplate code
I think that Unreal's blueprint and Behaviour Tree systems are already quite accessible to folks with less programming knowledge. AI might help with "how do I code this behaviour?" but not with "how should this AI work?"
Why i can't get navmesh to appear inside the houose as well
I believe #level-design will have the help you need. Im guessing it has to do with collision setup of the model.
That and the floor inside might be too narrow
Hello everyone, I have a problem of AI making my game crash in shipping builds (not in dev builds), and mostly when another player joins, thing is I think it's a replication or authority thing, uncertain since debugging doesnt give me much, are there rules to follow for AI specifically or anyone had this problem ? ( I first place the AI on the map and destroy them after 5s and respawn them through the GM to have it synced is it the right thing to do ?)
The main thing is also the package difference between shipping and dev ? What should I be looking for
Guys any tips how to make basic AI npc? I have planes and I want have bunch of NPCs planes chasing me and shooting at me, I guess I should use behaviour tree but I am not sure how to make chasing because it should not be always on my tail as then I Wont be able kill it
You would need to first decide how you want it to work really
For example, let's say that you want the AI to lose tracking if the player banks hard for a given amount of time, so you would need to make a BT (or whichever way you implement your AI) that would cause a different task to run if that happens
behaviour tree yea
idk how to make it but definitely plane should be not OP
it shoul sometimes lose you
or lose fight
No one can really tell you how to do it, because it depends on how you want your gameplay to work
I'd start by just building the very basics of it so the other plane can chase you, and then add things into it and see how it plays
hey guys i want to run a tick ai event in a service to track a task interruption from the player (dialogue interaction) and i need to get the player class to get the boolean that is set when the dialogue interraction occur and i was wondering if it was the good way to do it, is that not a performance problem to run a get actor of class in an event tick running in a service ?
can someone explain what this Crouched Half Height variable does?
EQS is asynchronous. You need to bind an event to query finished or whatever it was called
It adjusts the capsule height when you crouch
Or rather, that's the height the capsule gets adjusted to
If you're doing it just in a handful of places it's not a big deal. However, since I'm assuming the AI knows it's being interacted with, you could certainly store the current thing it's interacting with into some variable within the AI pawn or controller and read it from there instead
TRUE
why not just call it crouched height, then? are you sure that's all there is to it?
I don't see any particular reason that the height of a crouched character would be half of their standing height, a lot depends on posture and limb lengths
Because there is no property called capsule Height. It's Capsule Half Height. Hence so is the crouched height called half height.
You can define crouched half height at runtime
Half-height because it's the half-height of the capsule due to how the capsule height is calculated
so the actual crouched height of the character is going to be double whatever i put in that box?
what about Perch Additional Height?
alright., code design question:
I have created a system that allows characters to shove each other around, it works great, although it works on a frame by frame basis while they're touching
I also have animations for stumbling and staggering, i want to use these with the system, but the question is how. Not the actual animation playing, but how do i decide when an actor is staggering
all i really have to go on is knowing that a bumping event happened, the force involved, and their velocity. But there's lots of small bumps where a staggering animation would seem overkill, i really only want to use it in cases where someone is being shoved back several metres
how do i decide when a char has been shoved enough to warrant entering a staggered state, how long should i play it for before i consider them to be under control again, i need some thoughts and advice here
Maybe you can just determine whether the force is sufficiently large?
Otherwise you might need to measure the amount moved across some period of time
that was the first thought, but since there are multiple bumps over several frames, it won't work i think
If it is asynchronous what for is the "Return Value" output on the "Run EQSQuery" node?
assuming that i track velocity changes accumulated from applied forces, how can i then determine when that velocity change has been fully counteracted? Either from braking friction standing still, or from acceleration in a desired direction by attempting to move?
in the first case it's easy to just check if speed falls to zero, not so much in the latter case
why I can't fire interface event from ai to bed blueprints? my message in AI is firing but event not working
I belive it is becuase message target but how I can target bed blueprints?
You could debounce the handling and take the highest or total force applied?
It returns the query blueprint wrapper, which includes the event you would need to bind to
Holla, Am having a weird issue
the sight perception for some reason is only looking one direction and does not rotate with pawn facing direction
how can i solve this?
Is there a 3d pathfinding solution like Cpathfinding on marketplace, that actually can package with the project? For 5.3
A* is rather popular, more expensive than navmesh
what's the best way of adding a bit of delay between the loops of the loop decorator?
I am looking for A* solution that works in 3d, most implementations are 2d, and then there is extra complex unreal engine.
Greetings!
Have a wird bug: When servers player dies (by any mean), all AI disables AIPerception component. Any clue?
Put the Loop Decorator on a Sequence with Attack followed by wait
You'll probably need to trace and debug with F9
does the pawn rotate with the AIC?
Yes
Why would you place them in the map, then destroy them and then respawn them? Don't place them in the map, just spawn them.
Because I spawn them with settings on their instances
That's a really bad idea.
You just spawn them. If you need to change the settings, which I don't understand why you would do that, you set it up so whatever spawner has those settings.
I recommend doing the AI with Blueprints course on the learning library to learn the systems. Once you understand the systems, you should be able to make your AI without someone telling you how to do it.
I want some to roam some to follow a path etc and respawn with the same settings
Instead of ticking and watching a bool, you should really use an event dispatcher/delegate.
So you set it up so those settings aren't set on an instance of an NPC. You do know you can put variables anywhere, right?
Yes but how can I give a variable to an actor that isn't spawn
Why would you do it on a frame by frame basis instead of just using NotifyPawnBumped? Doing it on tick is unnecessary.
You put the variable somewhere else and then set it when it's spawned. How you do it entirely depends on how you spawn things.
Let's say you spawn things using a spawner in the world. On the spawner you need to have spawn data, which includes the classes to spawn, the amount to spawn and whatever variables you need to set. Let's say a spawner needs to spawn 5 NPCs, 2 that roam and 3 that follow a path. So you set up your spawn data to be able to set that.
Imagine if each NPC has a specific behavior, DO you think I would need an equal amount of spawner ?
- How does authority and replication work for spawners
You override the function to get the view location and rotation. I prefer to use a socket. Only available in C++.
My project is in c++
What function do I need to override?
Get Pawn View Point I believe.
APlayerController::GetPlayerViewPoint got it thx
That is not the function. It on the pawn not the controller
Why would you need an equal amount of spawners? Do you not understand how data works?
NPCs should only be spawned on the server.
You do understand that a nav mesh uses A*, right?
which course? link?
please
Google that exact wording it’s on the Unreal learning portal
You want me to Google that for you?
You need to override the function I told you to, because that's what the perception system uses.
can't find that function
Instead of just a task, do a sequence with a wait after the task.
there is getactoreyesviewpoint
lol I thought u mean some certain course lol
I did mean a specific course on the learning library.
Here, I googled it for you. https://dev.epicgames.com/community/learning/courses/67R/unreal-engine-introduction-to-ai-with-blueprints/mX27/introduction-to-ai-with-blueprints
oh it was that function thx
sorry bruh, thx
You're welcome. I use a socket on the mesh and then use get socket location and get socket rotation. A socket allows you to put it exactly where you want it (between the eyes). It'll also work with head rotations if you add look at functionality.
gotcha makes sense, thx for letting me know
How do you ask a mod to pin a message?
You don’t
I've seen people do it.
@ Moderator or DM
<@&213101288538374145> can you pin this?
Done
Thanks!
is there a counter indication to bind an event dispatcher in a service task ?
What do you mean by a counter indication?
If you want to bind to something in a service while the service is active, I would use On Become Relevant to bind and On Cease Relevant to unbind.
idk its to avoid using the event recieve Tick AI but if at the end it take more to listen to the bind, but i was just lost in my mind, what are those Become relevant and On cease Relevant ? thats not default function i can override
Those functions are called when you first enter and exit the branch the service is on. They aren't well known, but incredibly useful.
is that recieve activation / recieve desactivation ? i have unreal 5.1
No, they’re overridable functions from the details panel afaik
Yeah. They changed the names for BP.
i see i was about to use them thats cool
im gonna use them then and use an event dispatcher the thing with those tick running on instance of actor scare me im to nooby to know what cause real performance problem or not
I really hate it when Epic changes the names of things between code and BP. It's only sometimes and it's very confusing.
look like it lol
looking at statetree component code and why this does even exist to begin with?
Somethings need tick and that's OK. It won't kill your perf, unless you put A LOT in tick. The trick I use is "is there another way to do this that will work and not be super complicated?" If yes, do the other thing. If no, just use tick. Then profile occasionally and fix what needs fixing.
yeah but i m doubting cause for example, here i want to make an event dispatcher so that way i dont use the tick BUT, im gonna get the class of my character to bind the event dispatcher, is it realy different from getting the class in the tick event, does that change anything ? cause to listen to the event dispatcher something need to be on tick right ? i dont get the nuance
You don't need to tick if you use a dispatcher. Using a dispatcher means: instead of checking on tick for something to happen, I'm going to do nothing until that event happens.
thx just red a bit but mine will be kinda different as I am going to make plane/pawn 😄 but it will surely help
i see thx
You are still going to use the systems. It doesn't matter what they use as an example.
yea
true
Give a man a fish, and you feed him for a day. Teach a man to fish, and you feed him for a lifetime.
Is anyone available or willing to help me trouble shoot my behavior tree?
Explain what you are trying to do and what it's doing that is wrong and if someone can help, they will respond.
I have a question in regards to creating an AIController cpp class in Rider as compared to creating it in Unreal. When I go an create a cpp class of type AAIController via rider and try and build, I get build errors with this message. However, when I delete the .cpp and .h files, I can build and not have any problems, except I'm out an AI Controller. Now when I go in Engine and create new c++ class and Choose AIController from there, it creates it and I don't have any problems, and the .h file actually has less lines of code, only the GENERATED_BODY(). Is there something I missed that I needed to do?
probably better ask the folks in #cpp
I had similar issues when I first started with CPP
I was copy pasting code from other classes etc, running into issues with the right includes & inheritance
Hello, so I'm looking for a way to respawn AI's with this spawning way I have. Anyone would have an Idea ?
What exactly is the problem with this?
I want to be able to respawn them, on destroy with the same settings they have on spawn
And I have no idea on how to do it
One way to do it would be to assign a listener to the actor's on end play event, which you could use to trigger it to be respawned

