#gameplay-ai
1 messages Β· Page 49 of 1
:/
The UDN answer I can't really share, but it basically says that the "Getting stuck" and "Running into walls" of larger Agents on smaller NavMeshes is expected
And that one should not have too many too different agent radius, but rather try to group them and stick to 2-3 NavMeshes
It doesn't says if the AgentRadius should be the smallest or largest of the group
But the largest makes more sense
thanks, it looks like it would be much faster to make separate queries for separate teams
Interesting, thanks for sharing... Yeah sounds like maybe the approach with modifiers that you could attempt to generate during mesh generation would be the only realistic approach here π€
...or a third party navigation solution but I guess that depends on your budget
I tried apply tag to actor but got false when try to check this tag, am I doing something wrong?
looks like Gameplay Ability Component not returns reference to own tag container... so, ho to apply tag to component?
iirc with the ability system component you have to use Add Loose Tag or whatever it was called. Also #gameplay-ability-system
gotcha, thank you very much
although this doesnβt work either, you should probably try applying tags using an effect
Really π€ I'm pretty sure I've used add loose tags on the comp and it has worked
You sir are a hero, thank you for typing this! in the space of a day, I saw the debug tools and have solved all my issues π π π
sir ma'am
Deepest apologies!
How do I manually call a function so that AI use sight to detect. If I place my 4 AI NPC two in each team to fight with each other. After each team member get killed, team a and team b leftovers don't detect each other. If I place them in roam which triggeres hearing and sight senses then they fight again. But in idle they don't detect after fighting
What is this "leftovers" and "idle" you speak about?
What's the difference between those and the ones that do work?
Are there ways to organize behavioral trees more effectively? Such as encapsulating one section of the tree so it can appear as one node, rather than having the whole tree be shown
How do i differentiate between a player leaving the sight radius of an AI vs entering the sight radius of an AI? using AI perception with chaos vehicles and I need a car to break when a player is in front, but then accelerate back up once the player has moved out of the way
Why does a trigger box with all ignored and "Query Only" can block the Sight Sense of my AI Controller?
Is it a known bug ? (I'm with Unreal 4.26)
Are you sure this is the cause it's getting blocked?
π€
Does it have any other primitive components besides this one?
Ha maybe... I tried to reduce the issue to its simplest form, this is just a Trigger Box (the default one) with custom collision to ignore everything, and a Default Pawn with a AI Perception Component.
But the pawn has many things on it. If I use a "simple sphere pawn with sight stimuli" it works
I have a chaos vehicles car following a spline, but I need it to slow down during a turn and then speed up again. What is the best way of doing this?
I'd try having it look further ahead on the spline as it goes and slow down if it determines it needs to turn beyond a certain amount
I think the Game AI Pro books have some sections on car AI so maybe that's worth looking at also
I did type out an answer yesterday.
All of the 3rd party navigation systems work the same way, because as I said earlier testing the agent while pathfinding explodes the pathfinding cost.
Well I mean maybe some third party system would allow what he wanted to do with it out of the box was mostly the point :)
Yeah I was told that too (the mod stuff), where polys could be flagged and the NavMesh would just get a very low Radius to practically generate everywhere. But the proejct I need this for needs dynamic generation, so this wouldn't work.
I think another approach could be implementing an alternative FindPath function that does actually forward the AgentRadius to the dtNavMesh and filter cells via that.
But that's just a theory of mine.
Oh? I must have missed that.
Well I mean if you were to have it autogenerate the modifiers that would work for dynamic meshes also wouldn't it?
Yeah I see it now. They also say the Radius during pathing would increase cost. Which I could see, but it can't be THAT big of a cost change
(I read pretty much everything Luthage says - she is so knowledgable & helpful π )
I wouldn't know how to generate the modifiers. The idea is to add a flag to the polys to filter them via NavFilters
Like, directly add the flag during generation, no additional mods
Ah yeah that's basically what I meant :)
Yeah but the recompute is apparently pretty expensive
The person I talked to only pulled that off cause they have a static, baked navmesh
With the amount of stuff that can go on in a game, I don't see how adding a simple float check to the query would break anything
Like, it's not free, but how bad can it be
Probably depends on how bad it is to get the data from the poly
We decided on the grouping stuff now anyway and probably won't further touch the topic.
Still good to discuss it once in a while to learn the limits of the existing navigation.
From what I've learned from Luthage, stock navigation leaves much to be desired; havok's stuff is where the hotness is.
It really does increase it by a lot. Havok can do what they call clearance caching which does what you are looking for, but it's still cheaper to bucket NPCs with multiple nav meshes.
(But stock navigation works well enough)
The NavMeshes are recomputed when the game loads the level (on that project) and having 2 already takes a few seconds to build for a given island. They spawn randomized structures, buildings and more at the start. Adding more NavMeshes would just make that wrose
Havok doesn't support dynamic runtime generation though.
Yeah players can place new buildings where the NavMesh has to again rebuild
The only downside to the grouping is that anything between NavMesh X and NavMesh X + 1 now has to walk through gaps as large as X + 1 AgentRadius
Solves the "getting stuck" part ,but not necessarily logical for a player to see a smaller creature walk through a big gap
Yep. Which makes sense. You don't want them going where they might not fit.
Right, but that's what we had, also partially due to Epic's comment on the NavMesh agent radius
Which says to use the radius of the SMALLEST agent that traverses the navmesh
You don't want that. You want your buckets to make sense.
If I group let's say 6 Characters with the following numbers:
30, 35, 40
180, 200, 220
In two groups, Epics comment suggest that the Numbers would be 30 and 180 for 2 NavMeshes
But that's total nonsense
That causes 35 to 220 to use the 180 one
And 200, as well as 220 to get stuck
Cause they still path through 180 corridors
Such as shitty comment (unless I misunderstand the comment)
So we now set them to 40 and 220
And that works fine
On P2, we had 3. So small, med and large. I don't remember the exact numbers, but we use the largest radius of each bucket
In The Ascent we had 2
The 3rd one would have been too much
I wanted a third one to spawn loot on :D
Did you use navigation streaming?
Idk anymore. That's 4.26+ or whatever the version was
And we had to ship for the older console generations
I also didn't set that up. I only knew about it cause I wanted another NavMesh with more precision
I know that RAM was a problem, cause they took too much
At least in return for what the 3rd one was used
Same with P2. We had to use navigation streaming to ship
I can't say if we used that or not. Simply don't know
I know we had a pretty annoying thing going on with a navigation ping
That was supposed to show you where to go
Which was added last minute
And we had levels unloaded with no navmesh available to path the ping along
I think they added invisible meshes to allow pathing of that ping
But that was probably just a last minute make it work solution
Sounds like you did use navigation streaming.
The Ascent was quite huge, idk how that compares to P2
how would you guys find the nearest point on the navmesh using a point that is not on the navmesh? like here? my chase AI stop moving when the the player is not standing directly on the nav mesh. ive tried using project point on to navmesh but it doesnt seem very consistent
Depends on what you mean by huge
We had 3 or 4 tiers that were their own persistent levels and that lots and lots of areas in one tier that were all streaming levels
Yeah it's all relative. It's an open world RPG fwiw.
So you were able to run for quite a while, go to different towns and what not,
Even had a train system iirc to bridge some of the travel time
I haven't played P2 so I can't compare
In theory, afaik, all you can do is projecting with a reasonable extent
P2 had 1 really large level and then maybe 14 smaller ones.
I use the EQS to chase a player so they pick a reasonable spot at their attack distance. It doesn't matter if the target is on the nav mesh, just if they can find a spot on it.
thats what I was trying but its kind of weird, when I project the point, it will either snap the point to world origin, or if i set the extents higher it will shoot off to a location not even close to the query location
in 5.3.2
That sounds kinda strange
Project point won't always give you reasonable location.
Like, I get that the point might simply project to something you didn't expect
But that's kind all
fair enough lol, will def give the eqs a try, I was using it prior for other things but didnt really think of using it for tracking
If you have a point that is next to the stairs/ramp, in the air, above the floor.
And you have an extent that can reach the navmesh on the floor and the navmesh on the stairs/ramp, then yeah, it can find either
That's why I recommend the EQS. You can do tests to get a smarter location.
But shooting off to a location not even close is strange
Yeah I mean, EQS can generate a few points, from which some of them will be garbage, others will be where you think they will be and you can filter on more stuff than just that
And then pick the "best" one
As you can also score them
Not sure how often you would want to execute that query
But I guess some sort of low tick service could do that for you
Been a while since I touched Behavior Trees
A service is how we do it. With the EQS being time sliced, it doesn't explode perf
curious of your EQS method though, I dont want to run a huge EQS constantly for tracking but if the chase target for the eqs is beyond the extents of its query distance like in this draw over, that would still make AI stop moving no? I suppose I could do a stepped test and grow the EQS if the AI cant find a reasonable route but im not sure if thats a good way to go lol
Im actually using state machines now, its easier to understand the flow imo haha
With the little note that a single test is not timesliced and can still kill perf
RIP
I tend to use a donut with 3 rings. It doesn't make a lot of points but still covers a lot of use cases.
I'm so happy I don't have to touch StateTree anymore atm
I had my fair share of time with it with Mass
Running traditional AI via it is the very last thing I will ever do
I believe it does now. I'm working on an open world MMO now and we dropped the EQS time slice to 2ms. It never goes above that.
Hm, I would need to check. The slicing would need to happen inside of each individual test
Not running the next test if the previous one took too long is way simpler
Maybe you just don't have expensive tests
Even if we don't use expensive tests, never going over 2ms would be impossible.
I believe the change is in how the iterator works, but it's been a while since I dug into it.
Is there a way to wire up blackboard key variables in a pawn? Or do you just need to call it with the key name?
Referencing an older reply π
I can't make this work, I tried lowering the rotation rate, but my enemy character is still snapping to the new direction instantly when turning around.
Am I missing anything else?
You need to turn on "use controller rotation" and turn off orient rotation to movement. You also need to turn off use control rotation on the character.
C++ or BP?
BP
I can't find use control rotation on the character
Nope. You need to use the Key Name
Tragic!
It might be controller rotation. The yaw is turned on by default and that's what makes it snap
thanks, got it
Could it be that it is starting to move in the new direction already while it is still rotating with this setup?
It's a bit difficult to interpret, because I'm using a procedural control rig animation.
I'd want it to rotate in place, and then move.
If you want it to rotate and then move, you need to add rotation before moving.
I'm trying to call "rotate to face BB entry" to face another character. For my humanoid character, it doesn't work. The character doesn't rotate. For my wolf character, it does work. Does anyone know any possible reasons for this? I verified that what they're rotating towards is valid. Also, the "move to" node works for both.
Traditional AI as in simple AI? I don't have that much experience with both and am still trying to figure out StateTrees but I feel like it's harder to understand how to manage data with them (still have to see how evaluators work)
You don't.
Do you have use control rotation turned on in the character or movement component?
bUseControllerRotationYaw = true;
if (UCharacterMovementComponent* MovementComponent = GetCharacterMovement())
{
MovementComponent->bUseControllerDesiredRotation = true;
MovementComponent->bOrientRotationToMovement = true;
}
in the character's init
You really should only use one of the options, not all 3.
What does the visual logger say when the rotate to node "doesn't work"?
Visual logger - the AI debugger or?
Also when is that code being called?
In the character's initializer
I just changed something and it worked. Let me check something quick, and I'll get back to you with what it was
If you mean the constructor, what you set it as in the BP will stomp those.
But thanks for the help -- I removed those unnecessary movement component changes
Yup. That was the problem.
the blueprint settings overriding what I set in the constructor. Sorry -- using terminology from another language
Yeah you have to wait to set things like that until after the BP is loaded. I prefer using pre initialize components.
I don't love that though, because I have a lot of blueprint classes based on the C++ class, and I don't want to be worrying about the settings in each
Better to set the value in BeginPlay?
Got it.
This is a really good reference to bookmark: https://docs.unrealengine.com/5.0/en-US/unreal-engine-actor-lifecycle/
Oh, nice. I'll take a look through that
"Post construction" is right after the BPs have run their construction scripts. So anytime after, you don't have to worry about BP settings stomping anything or you can use a variable that is set in BP.
I prefer using pre and post initialize components. Just to limit the number of functions.
Okay I've got this pretty basic Behavior tree, and the problem is the "waiting" mode.
Basically the goal is, if the AI doesn't have a target, run the patrol sequence for 10s then enter waiting mode. Simple! The problem is, entering waiting mode just set's the controller's mode to waiting, so that finishes instantly, so the behavior tree moves on, which makes it instantly switch BACK to patrol mode again
How do I make a condition such that it STAYS in waiting mode?
What is the "waiting mode" and why is it outside the BT?
So it just tells the controller to stop moving the pawn basically
Movement is kinda automatic on these things, they're either chasing or patrolling so far, waiting mode is new
That's a really bad way to architect it, but if that really the route that you want to take, the task should not instantly return. It should stay in the task until the waiting mode has finished.
There's literally a BT task to wait, so I don't understand why you need this extra waiting mode.
For a time, though. The waiting mode NEVER finishes, it can only be interrupted.
I see what you mean about the architecture though, i know movement is normally a task. The thing is, what I'm trying to avoid is a pawn that moves to a waypoint, stops, finds a new waypoint, and starts moving again. That's why I have the wayfinding here, and the movement just on tick
The move to nodes already make the pawn stop moving, so that's redundant.
that's exactly the problem with them actually! I want the pawn to always stay in motion (unless waiting) while simply updating the target location
The movement should never be on tick.
It HAS to be on tick, how else would you get smooth motion?
I'm not using any AI movement component for this. There's no value in doing so, because I'm writing my own pathfinding. (I've actually tried the approach in a previous AI of doing custom pathfinding but with a simple movement component, and it was way more trouble than it was worth)
It doesn't HAVE to be on tick. How you get smooth movement is to turn on Use acceleration for paths on the movement component and tune the acceleration and declaration rate. Then use a service to update the target.
Sure but the movement component is using tick internally obviously. I'm just doing that in the pawn instead because I'll never use this movement system for a different pawn
I think the root of the problem is that this system has no way to conceptualize a move as something that takes a certain amount of time. It's either not moving, or it's just moving, continuously, with a destination that updates constantly
I mean internally the AI movement component has to be doing this same thing, right? When you say "move to location" it stores that target location, but then it also flips some internal boolean that enables its on-tick movement function.
Okay, more basic question: is it guarnateed that ReceiveExecuteAI gets called before ReceiveAITick? Like can I use it to set up some vars I'll need on the tick?
Okay, updated, still not working. The problem now is that it gets stuck in that infinite wait, even though the condition on the parent node is no longer true!
See, that blackboard value IS set but it just stops checking it! Frustrating.
My NPC stop detecting each other after they kill some from the other teams. If debug, I can see the sphere on both of them but they stand in front of them in idle state. If I change them from idle to roam then they detect again.
What do you mean they stop detecting? How are you updating targets?
So I fixed that last issue by switching to a conditional loop, but this one is less simple. You can literally see the check is failing, but it stays stuck in this node
Internally the path following component gets a path and moves the character via the movement component. The BT task waits for the AI task to finish. The AI task listens for the delegate on the path following component.
Why aren't you using observer aborts?
I just found observer aborts actually! But.... it's not an option for this one?
There are limitations on when you can use them.
Yeah, I moved that condition to the parent node and it's working fine now. Weird!
I don't understand why you have a blackboard decorator under a simple parallel
I don't anymore, at least not directly.
The decorator on the wait is just to skip the wait in the case that a waypoint could not be found, the wayfinding system is intentionally chaotic so the odds are decent the next tick it'll work
Like with that one, why do you have a blackboard key for movement goal is set? That's a sequence so if the task before it is setting the movement goal, if it succeeds then the next task is run. If it fails it's not. So having a decorator is redundant
Redundancy is resilience! π
No, it makes things confusing. Use the BT functionality.
The honest answer is there's a lot of redundancy in this code right now because i'm in the process of moving from a quick, hacking POC where this was all in one pawn, to an actual BT powering the logic
And it's a waste of a BB key
No the BB key is needed either way, the move node uses it
All that sequence functionality should just move to a service anyway.
Makes it much clearer and removes the need for a simple parallel
Probably eventually, but right now it ain't hurtin' nobody there.
It hurts me!
haha you have no idea the extent of my crimes
Apparently so
Anyways I've been hesitant to make that a service because I'm doing allllmost the same set of steps in a different place, but not quite.
Plus the pursuit sequence isn't done yet either, it's gonna have a "check distance -> Attack" branch too
PLUS I dunno how I'd do the fast retry on failure if it was a service
Well if it's almost doing the same thing it can be a service with options exposed.
The other reason I'm hesitant is that UpdateMovementTarget is the computationally expensive part of all this, that's when it does the pathfinding, so I like that I can do other checks before running that each time
If you're in C++ you can schedule next tick to be whenever you want.
You can do that in a service. Do the checks first. And use branching to decide if you need to do the expensive things.
(The check is also kind of gross code so I like having it in a separate task that just works and i dont have to think about it)
Or it could be in a function.
It's like 3 functions lol
It can still be 3 functions.
my ai controllers of my hostile enemies aren't recieving a behaviour tree
they have the red aicon
What? A behavior tree? Which behavior tree? Where do you run it? Show some info!
Is there a way to make an optionally bound input property on a State Tree node? It seems like that's what happens for all subobjects of nodes, but properties of nodes themselves will be either required to be bound (using the Input category) or constant
Have you tried using Parameter as category?
Ah, yeah it's either that, or leaving category empty works too (it's the default behaviour). The problem is that instanced properties will either not be bindable (when using the Instanced specifier), or not display properly (when not using the Instanced specifier)
but that's a different issue entirely that I managed to forget about
(and the property in question is an instanced subobject)
Oh, yeah I never tried instanced in state tree tasks π€
Random idea but maybe using a UObject based instancedata would work better for that? No idea tbh https://zomgmoz.tv/unreal/State-Tree/StateTree-InstanceData#class-based-instancedata
sorry clarified my original comment
The big picture is: I made a task to execute a Gameplay Behaviour (from the AI behaviours plugin)
my instance data is already UObject based, cause I needed to connect a delegate
I'll dig into the binding extension, maybe it has a problem with instanced props.
It seems like the required property flag CPF_PersistentInstance is not present in my UProperty when inspected by the binding extension, weird
not a problem to solve today probably
hi all, I think I've noticed that when my character capsule is large enough, the actors location is far enough away from the navmesh that pathing queries fail, is there a way to ensure pathing is checked from the bottom of capsule not the center?
making a new context that reports location as location - capsule height seemed to help
so maybe the moveto tree task does project, but eqs pathexist doesnt?
I'm working on an AIController for NPCs in my game. I would like the NPCs to be friendly towards a player in general, but if the player attacks one of the NPCs, all of them should see the player as an enemy. After certain actions in the game take place, the player should be seen as friendly again.
My current approach is to override GetTeamAttitudeTowards in the NPC's AIController and check a list that tracks the current enemies to the NPCs, seeing if the player is in the list. Does anyone have other tips for accomplishing this, or think I'm going about it wrong? I'm curious because the friendlies/enemies/neutrals system seems complicated
Is there a way to have a BT Service fast-retry in the case of failure? Like if normally it runs every 1s, but if it fails I want it to try again next tick?
Using the attitude system like that makes sense to me.
I actually have a somewhat similar implementation in one of my projects where if the player attacks civilians makes the police faction hostile towards the player via a similar mechanism
Okay, cool. I ended up implementing it that way -- seems to be a clean option
A better solution is to adjust the default projection extent by creating a supported agent in the project settings.
That's a way to do it. It's better to actually use the team affiliations, because your way can easily get more complicated and hard to debug.
Is there a decent blueprint tutorial for team affiliations? I need a solution for something like that but with a preference toward the simplest possible solution, I don't need any concept of attitude as anything but a boolean. Attack on sight or ignore entirely are the only options I need. I don't even need a way for anything to change affiliation.
You can't implement it in blueprints
Or, rather, you can't implement the builtin system in BP's. Of course you can build a custom system if you want
Oh good. I actually prefer to build custom from scratch but it's so rarely the right call.
Not very important, but do you guys specify AI values that are used in tasks and services like attack range, speed, etc. in the BT or in the AI character?
Depends. If it's defined in the character it can vary on a per actor basis, in BT you'd need to have separate BT's if the values need to be different
Building your own custom system will not integrate into the existing AI systems.
That's okay, I mostly only interact with the existing AI systems via wrappers anyways
@nimble smelt are you wanting to use the generic team interface for perception? i just did this last weekend so i could help
I'm considering it. Obviously if it's not usable via BP thats a no-go, or if it's got so much unneeded complexity that rolling my own is faster than integrating with it
Why not? its very simple to do in c++, and then just inherit from that class if thats all you need, i can show you if you want
Basically because kludging shit together in BP is fun, and setting up Visual Studio and the C++ build system is pain
ah okay, I will say it is veryyyyy easy
if you care this is how i set it up, it is exposed to blueprints and i set the teams there
We choose do these things not because they are easy, but because they are entertaining π
`// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "AIController.h"
#include "AIC_Human.generated.h"
/**
*
*/
UCLASS()
class ETERNALANGUISH_API AAIC_Human : public AAIController
{
GENERATED_BODY()
public:
AAIC_Human();
virtual ETeamAttitude::Type GetTeamAttitudeTowards(const AActor& Other) const override;
UFUNCTION(BlueprintCallable, Category= "Team")
virtual FGenericTeamId GetGenericTeamId() const override;
UFUNCTION()
void OnTargetPerceptionUpdated_Delegate(AActor* Actor, FAIStimulus Stimulus);
UPROPERTY(VisibleAnywhere, Category = AI)
TObjectPtr<UAIPerceptionComponent> AIPerceptionComponent = nullptr;
TObjectPtr<class UAISenseConfig_Sight> AISenseConfigSight = nullptr;
TObjectPtr<class UAISenseConfig_Hearing> AISenseConfigHearing = nullptr;
protected:
virtual void BeginPlay() override;
void DefineBlackboardNeedKeys();
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= "Team")
FGenericTeamId TeamId;
};`
so just 3 lines
I think when I say I don't touch C++ people think I dislike C++ or don't know it, when really it's just I don't want to maintain a workspace that can build those solutions because I've tried that and it's awful
ah that makes sense! sorry if i got the wrong impression
I used to be real scared of it, so i try to encourage :3
I mean, I haven't written C++ in years either, but I'd happily relearn it if it wasn't so painful to work with comparted to BPs
I have a really hard time mixing the two together, i still have some gaps to fill for sure
it gets me all frustrated lol
The ability of blueprints as a system to just GO, just RUN every time, the second you want them to, with no builds no setup no config barely even taking a second to compile, that's something C++ just can't seem to manage, and it keeps me away.
Tbh I don't find C++ particularly painful to work with. You press a button and it compiles. That's pretty simple lol
Thats definitely nice. Though I will say using rider, and a beefy pc and i just recompile and the project loads reallly fast
I still maintained the workspace best I could, but every time I touched it I basically lost a day to setup and debugging again. That cycle repeated like 3-4 times.
I built a new computer a couple months ago and I haven't yet had reason to setup a dev environment for C++ on the new one. And I aim to maintain that state of things as long as I can
haha good luck!
Frankly if you are serious about gamedev you're just handicapping yourself by not using C++ at all
I sort of get tired of all the little buttons in the blueprints and the interface, at least in code we can go to definition and stuff
i feel like i always miss a magic check box
but it comes with the territory
If I'm handicapping myself, that just makes it fair for everyone else π
haha thats the spirit
lol
I feel like unreal c++ is really toned down as well
like ive only done javascript at work and it wasnt too bad
of a transition
That's the other thing, even if you KNOW C++ you kinda have to learn "Unreal C++" as a different thing
C++ without memory management makes it super easy
not really man
if you know code its not that bad
yaknow what i mean
i just get scared when i see pointers but i havent had any crashes yet
It's exactly the same
It just has a few macros you use to do a bunch of UE things
Pointers are in BP. They just look different.
For work I've used C#, VB, Java, Kotlin, Ruby, python, JS, and Typescript.
I THINK that's all of em
My list of languages is so long I don't know if I remember them all lol
If you are a reader, the AI for unreal 4 book has c++ examples for every single project in the book, i read it twice its so good.
I'd rather spend a day coding than an hour reading π
great for just learning c++ in general for unreal
C++ ain't that high in my list of languages I'd like to use but I don't particularly mind it in UE at least
I think I'd still rank it above Java just barely lol
But below C# definitely
Now that Kotlin exists there's literally no good reason to use Java.
It is, it's available in UEFN already
ohh cool!
It seems like a viable alternative to blueprints, I was hoping it would have better performance so it'd be more of a C++ alternative, but I heard it runs on the BP VM so I'm not so sure
ahh, thats a good use case
that would leave blueprints to just animation stuff, honestly probably a nice workflow
I think a lot of people are worried about the perf of blueprints but they've only ever heard it's worse in the abstract
Yeah most of the time it's entirely adequate
But I've definitely ran into a bunch of cases where it wasn't
and my projects are not exactly triple A either lol
I think for AI it probably matters yea? like tasks should probably be in c++?
An AI for Unreal that doesn't have a chapter on the visual logger isn't worth much.
he brings it up in the book
Most of the time not really, only if it runs often
but its great for learning c++
If it only runs on occasion like a BT task typically does, it doesn't make that much of a difference
ah that makese sense
If you have a lot of AI's running the task then you may start seeing a difference, but it's always the usual mantra: Profile first
Most of the time your FPS is all down to render anyways
Like always it depends on what's in a task. A tick function in a BP that does nothing essentially costs nothing.
That's not true actually
Depends on what you are doing and the size of the game. It's not just worse in the abstract.
Just having an empty tick event in BP has a cost
Yes i read this recently
True but it's VERY small
Yes
Yeah, it's just one of those things that can add up
Premature optimization is the enemy.
Apparently almost all my projects somehow have random things that add up and then I have to fix them
lol
Its the first place the unreal devs look when supporting games, from what they said
Every time I've had framerate troubles and profiled it, the answer was like one specific stupid thing I was doing. It's never "oh no I shouldn't have used blueprints" it's "Oh, turns out I shouldn't apply radial damage on tick"
Oh yea i agree with that
I've had a lot of issues with perf relating to NPC's because apparently my projects gravitate towards having a lot of them so even when they sit in the level idle waiting for the player to walk into them they incur an FPS cost :P
Have you looked into the vertex animation stuff? it works realllly well
That's not entirely true. BP BT nodes are all instanced per character. It's not just a runtime perf cost issue. When you start having 15ms load times when spawning.
True
One "weird" BT perf issue I had was that the BT search was pretty high. Turns out that if you have a BT which just keeps hammering the same instantly finishing node that is expensive
Replace it with a Wait node so it doesn't repeatedly keep hammering it and oh the performance is now much better :P
Yep
Thats a good tip
It shows up in Unreal Insights as "BT search" or something like that in case you run into it :)
It's basically the time it takes for it to find a node to execute
Basic question, if you define a component in c++ and then inherit that class with a blueprint, is the execution of that component still in c++?
Depends on the function.
I was reading how the character movement component is really heavy, and wondering if that helps at all
If it's overriden in BP, then it's not
Simply having your function be BlueprintNativeEvent incurs a cost when it gets called, even if it isn't implemented in blueprints at all
oh interesting
Compared to a "regular" C++-only function call
It can be an optimization to avoid calling the BNE, it's used in GameplayAbilities at least https://zomgmoz.tv/unreal/Detecting-Blueprint-implementations-for-functions
That's because it needs to look up to see if it's been overriden
Yeah
man that website is rad
The biggest cost issue with BP is ref chains.
Any hard reference. If you have a BP that hard references anything in data, the size of that BP in memory now includes that reference.
BP inheritance causes hidden hard references. Casting to any BP in BP causes a hard reference.
working on my editor plugin I noticed a hitch in some cases when a certain BP was being referenced... it was just an item with one graphic on it, or so I thought
Turns out the BP graph happened to cast something to another class which then pulled in a huge chain of stuff :P
It's a bit annoying you can't query for info on the BP inheritance chain and stuff without having the whole thing in memory, wish you could just load up the metadata or something
I did hear about some dark magic called "parsing the uasset file" but I didn't dare go there yet lol
Oh lord that sounds fun
That would be like blueprint reflection basically right?
I may be using that term wrong
Something like that
Whats the max AI you have gotten in a your games at once?
we should have an AI drag race haha
that would be fun
I've been able to have > 300
Oh my like full actors????
Yes
Thats a lot, I was testing last night and I squealed out at like 100
frames drop harddd
Any big tips for that kind of thing?
Profile.
It takes being good at profiling and optimization
You don't know what's slowing you down until you profile.
too right
I also write good AI code.
LOL
I use the character movement component just fine.
maybe we will get lucky and and AI will make A* even better
Do you have any strategies or you just profile profile profile?
You have to manage CMC pretty carefully if you want 300 AI's using it because even if they just stand around it incurs costs already
Unlikely to happen. LLMs aren't AI
You can optimize the CMC. Especially the find floor functionality.
Using nav walking instead of walking is a very easy way to optimize the CMC.
now thats a tip i can use
Instead of a full capsule sweep for find floor, it projects to the nav mesh.
Yeah navwalking helps but this is also part of "careful" because if for whatever reason it momentarily thinks it can't navwalk, it reverts back to regular walking
It literally walks on your navmesh so if the mesh is janky then the movement is also janky
Did you havea resource to this? i'm not finding much besides the findfloor function
ah okay
you can just change the default grounded movement mode or whatever it was called to NavWalking
You still need to profile early and often.
It depends
Hello, maybe a simple question but I got an AI that I want to jump whenever it detects an obstacle in front of it. I have set it up using a triggerbox in front of the AI, as soon as the triggerbox hits something it jumps. I tried to mess around with the collision settings of a cube, if I use the collision preset "overlap all", the ai jumps in time, but the cube doesn't have collision. I got query and physics collision enabled though. Does anyone have a clue how I solve this?
nvm solved it by putting pawn to block
Okay wanna run a plan by someone else before I do it. This pawn I'm working on attacks by basically jumping at the player and exploding if it hits. A timeless classic. If it misses, it goes back into AI mode and takes another try.
My plan right now is to have the "jump" actually destroy the actor entirely and just spawn a projectile with the same model. If it hits something other than another pawn, destroy the projectile and respawn the pawn. That way I don't have to deal with writing code for the pawn to actually "jump", and I can isolate all the on-hit functionality.
Is that all... sane? Any pitfalls I'm not thinking of?
Why not just use the projectile logic on the pawn to begin with?
Seems like a rather elaborate system to avoid doing that
Two reasons, one the pawn has a some stuff that it just DOES every tick, that I'd have to turn off. I'd also have to make sure the AI tree had a state for "flying through air" and could resume function after. It's a lot of things to pause and resume
The other reason is, a pawn either has the "projectile movement" component or doesn't, right? It seems odd to have something move as a projectile momentarily then not again
On a higher level, there's basically nothing about its function as a pawn that I need when it's a projectile, and nothing about it's function as a projectile that I need when it's a pawn
They share a mesh, that's pretty much it
Hey guys, I'm having a couple of issues with my walking robot spider thingies.
- I want them to keep a distance from rocks. If they're too close my procedural control rig animation will put their legs onto the rocks like on the image.
I tried increasing the capsule collision in their character bp, but that seems to mess up pathfinding with EQS. They can't find a valid location anymore.
I also tried to increase their agent radius, but that doesn't seem to do anything. How can I make them keep a distance from rocks and other stuff? - I'm not sure how to set up their collision in general.
If I run them over with my vehicle, they'll just walk over it like in the screenshot.
I'm actually not even sure what kind of options I have regarding how to handle running them over.
Like, add a larger sphere collision and on overlap something let them evade or something like that? But what if it still happens?
As a simple workaround solution, I tried adding a larger block collision but that again messes up pathfinding.
Well it seems pretty common for AIs to have certain "states" where certain things turn off. BT logic can be paused via using Claim Task Resource so it's not too complicated to do
Replacing it with a projectile and then respawning it would probably work but just seems kinda complicated for something like this :D but ymmv I guess
Also you can spawn a projectile movement comp on it at runtime for this purpose and then delete it, or just keep it but inactive
I guess I don't get how it's complicated, it's like 2 function calls isn't it? Spawn projectile, destroy actor then spawn actor, destroy projectile.
Although unless it has some very specific movement requirements, the projectile movement stuff is pretty trivial to implement yourself also I think
Well sure, but you need to set the projectile up so it goes into the correct direction, and then when respawning the AI needs to go back into the appropriate state it was in before
Spawning actors is not also super performant but if you're not planning on doing a lot of this all the time it probably isn't going to matter
@uneven cloud How hard was it getting that many actors moving around at once?
Did you happen to have a demo?
I didn't think it was that hard, but I have a lot of experience.
What all were they doing if I might ask?
They were doing quite a lot. It was a test for a AAA game. We decided from a design perspective that we didn't want that many, but it was possible from a technical standpoint.
Can it handle navlink proxies, do you know?
First time I heard of this but it sounds like a neat optimisation!
I would maybe imagine not... I'll try it later!
It should handle proxies yes
hottt
Is navlink proxy fast?
As opposed to what?
Well at least I'm not aware of other ways of doing what navlinks do
How do I pause behavior tree execution in a blueprint?
or can it be done from a pawn or controller
Actually scratch that, better question: How can I notify a behavior tree task that the task is done?
When this thing goes into projectile mode, I want it to fly until it hits something, so I'm going to need to wait somewhere for a collision event.
A task waits until FinishExecute is called within it, unless I misunderstand your question.
Kinda. Calling FinishExecute is the easy part, the hard part is, what's the best way for the pawn that's going to register the Hit Event to get a reference to the Task and cause FinishExecute to be called within it?
Typically you would have an event dispatcher on something that the BT task can listen to
So pawn dispatches event, BT task registers for it, event in BT task calls FinishExecute? That works for me!
Yep
Is the idea to implement IGenericTeamAgentInterface on all characters that have teams, and use that at runtime to determine the relationship?
Yes. It's pretty easy to change teams during runtime. It's also pretty easy to set up an affiliation solver that uses data set up in the project settings.
Okay, will take a look
I'm trying to make a branch of sort, to determinate whether the enemy should do a melee or ranged attack based on distance, but I'm having some issues with the right-most branch not executing. Anybody knows what's the proper way to do that? (Play sound task is there just so I know it executes)
If it's intended to execute only one of those, then you want to use a selector for the part that chooses the branch
A sequence node will abort if one of its children fails, so if the first condition doesn't succeed, this causes an abort of the entire sequence
If you instead place a Selector so that the sequence has your find distance and selector, and the selector contains the two blackboard conditioned ones, then I think it should work as you wanted
Has anyone ever had the issue that AI doesn't do what it is supposed to do but when you turn on visual logger it runs fine? This is so weird
I've had some issues like that in the past with some other things where debugging causes it to behave differently, those are always fun
also known as a heisenbug
I would try to add some logging/printing into the logic itself
Oh, I see. I'll finish my breakfast and try doing that π
Yup! That seemed to work. Thanks <3
Using EQS is there a way I can filter out the circle points that arent against the wall like the others? Im using the circle generator because its the only one that puts the point against a wall like a point of cover. If there is a better way, let me know
making the minimum radius just below the circle radius seems to filter out anything thats not being blocked by a wall. Seems to be ok for what I want
That sounds like a decent way to do it. You might need a custom generator otherwise
Finally!! I started to get a hang of the EQS systemππ!!! DANG!!
why is it, that when I increase the capsule size of the character pawn, eqs generates no valid pathfinding points anymore?
Prly cause itβs directly tied to navigation. Try not to touch the capsule component that comes with the char. Use extra shaped collisions if need be
Hey guys, trying to set up some enemy AI, pretty basic just attacks you no patrol. Issue I'm having is, two can't attack me at the same time? One just stops and de-aggros once the other attacks me... Any ideas what I'm doing wrong?
what's the recommended way to abort a move to order? does StopMovement in the CMC just cancel pathfinding and movement input? I don't want to zero out velocity or anything like that in case i'm knocking an AI back or throwing it in the air or something (this is from Blueprints, in C++ it seems fairly straightforward as you can tell the pathfollowing component to stop)
Where is a good place to set the FGenericTeamId of the various characters?
You might need to increase the projection extent. You do that by setting up a supported agent in the project settings.
What are you talking about? Of course you can and should adjust the capsule.
How are you triggering the move? You should cancel the task that you started the move with.
AI Move To bp node
was trying to make a task that does a MoveTo then when i get close enough i EQS query for a specific spot and do a move to a location
so that i dont have to query all the time when im far away, may not matter though
Use the move to location or actor one instead. You can save the AI Task reference and cancel it.
alright thanks
You can save it on the character class or the controllers.
in this node tree. if the cooldown decorator returns false, i expect the Selector to keep trying to execute the same node until it succeeds, but instead it falls back to the sequencer above that leads it to reach the BadConditionMet node. is there another way to handle this?
i just want it so the Selector would keep trying to execute the BTT_MeleeEnemy without falling back
Okay cool, yeah I ended up setting it in each character's constructor.
If you use the character, you do need to reroute the interface functions in the AI controller. Just override them and call the ones on the pawn.
Your assumptions of how it should work is not how it works. If you want it to loop, you have to use a loop.
yep i thought as much. so how does it work? does it stop execution one the leaf succeeds or when it doesnt find next leaf?
im taking about the selector btw. not sure if i made that clear π
Selectors work by trying nodes until the first one succeeds. If it can't find one, it returns to the root and tries again. You however don't have any fallback behavior.
i dont think i understand...in my head the way it would work is it tries to execute that node, the decorator disallows it, selector considers that a failure so it goes to the next node, it doesnt find any so it goes back to root, rinse and repeart
so when the decorator disallows the execution of the node, it forces the selector to fallback?
oh root is the start of the execution π€¦ββοΈ sorry im dumb π
I recommend using the visual logger to understand it better. It will show you exactly how it executes.
yeah i've been using and it helped a decent amount. i just dont understand this specific case π« i think what throws me off the most is this description. i would've thought it would keep executing until it hits a successful node. i didnt know it would return to the root at all
but what you said made things so much clearer now. thanks a lot!
Where does it say it will keep executing? Why would you think it would do that?
yeah it didnt say that, i just assumed it did. my issue was it didnt mention this little detail that's why i was thrown off
It says if all children fail, the selector fails. When a sequence or selector fails, it doesn't keep trying nodes. It restarts the tree.
yep now i understand that. it was a skill issue on my part π
Hi. I want to be able to give my AI character a stat change while they are within a particular branch of my AI tree. Is doing so through a Service the best way?
It's a solid way, yeah
I forget the exact method names, something like OnBecomeRelevant and OnCeaseRelevant.
Hello, this may be a dumb question but I can't find an answer anywhere through research. I am new to Unreal and I am working on a pawn that moves towards the player when they overlap. The problem I am getting is that everytime I go to playtest, I get a red message saying that the NavMesh needs to be rebuilt. I've tried tweaking the project settings a few different ways and nothing seems to be working. If I'm in the wrong channel please let me know. Thanks in advance!
Not a problem. Do you have a NavMeshVolume in your level?
Oh man is there finally going to be a videogame of the fantastic movie Twins?
hello guys, how i can limit axis for my ai character, i try to make it move only right and left ,smth like moving wall, how can i do it?
Why would you make an AI then? Maybe you can use your own movement rather than navmesh?
its air hokey game, and i already made player wall, but now i need to create enemy wall, i think it should be AI cause it moves on its own
In air hokey the opponent should be able on two axis, right? Slide along the table
my bad, my game similar but not air hokey, whatever , how i can limit AI movement to Left and Right
If you really need to use only AI then the easier way would be to make the navmesh small so that it can only go left or right
Alternatively, there is nav filter that you can use and i believe there was some setting for limiting movement
However, to me it doesnβt sound you need ai navmesh, rather something custom. You could use interpolations to move left and right and make your own bt tasks to make them go where you want to
have food for thought ,thx appreciate it
Moving along a spline sounds valid
Hi there ππ»
I'm setting up some Navmesh bounds but in some areas I will need to update it on events. Anyone know why the Navmesh modifier updates in editor but when I do the same thing in blueprint, nothing changes?
have you set navmesh to dynamically rebake in project settings?
Of course, I missed that in the set up. Thanks
Has anyone used the cooldown Decorator in the Behavior Tree? Seems like it starts on CD when you start playing in the editor (which is what i want), while it starts off CD in a packaged build. it's weird.
Really? π€
I always thought it was weird it starts in cooldown, but does it really behave differently in packaged?
That seems like it would make the decorator completely useless almost because it makes testing any logic problematic
Yeah it really is weird. I wouldn't know what else is different, besides the game being packaged. In Editor everything's fine. The AI has some long cooldowns, about 180 seconds, but when I try it in the packaged build he executes that node right away and only goes on cooldown after that.
which is... quite annoying in a boss fight.. because the enemy fires all abilities immediately xD
Hi Grug! My level currently has a NavMeshBoundsVolume that covers the whole play area. When I added that to the level, a RecastNavMesh-Default object was added. Are there other actors I need to add or are there settings on the recast actor that's causing this issue?
You didnt change cell size or any other setting right? Because as I know (not much experience in ai) , since it happened once to me, it was that my setting were wrong (maybe too costly, idk but it somehow gave problems), did you try removing all the navmesh and add it back?
Also if you show the navigation do you see it actually green on the floor?
I adjusted the default cell height to allow the navmesh to work over curbs. I am seeing green on the floor when I show navigation. I'll give deleting and adding a new navmesh to see if that will help.
I had the same issue when i tried to make the navmesh work on a ramp and cell size was fixing that but was giving me same issue so i had to avoid that at all
So i didnt even fix it
hi
why nav link doesn't
launch character
but printing
it looks like the character is trying, maybe he's jumping slightly somewhere, but I don't know
The basic vibe Iβm getting from Unrealβs forums are βlol whoopsβ
Oops I forgot where I was for a sec there π
what is the best way to get AI to open doors? my guess is Nav Link but I could be wrong, I generally tried with this and the AI ββcan't get through the door
nav link is usually fine, but you need to first make sure the agent can fit throug the space in the door to begin with
i know this is a bit counterintuitive, but can you disable ticking on a service? I just wanted to use one to respond to events while the subtree is running but I have delegates i can bind to and don't actually need to check on tick
Fairly sure it's possible in C++ services but I'm not sure if that option exists anywhere on BP based services
You could try setting the tick interval to -1 and see if that does it, or if not just some really large number
in BP i think setting tick interval <0 just fires every frame
ill see what i can find on the c++ side of things
If I have a UPerceptionComponent that's set to only perceive enemies, and a character becomes an enemy after already being within range of the UPerceptionComponent, how should I make the UPerceptionComponent notice them?
Thereβs a function called Request Stimuli Update (or some name like that).
Hi everyone! I'm trying to have my Fish AI only navigate through a river but want to know if there's a way to have the navmesh act like a spline and generate that way? That way I don't have the fish navigating outside the river and onto the grass when I put an entire navmesh box over it. If not I'll probably see what I can do with the EQS and have the fish detect splines with a tag stating it's water. Any suggestions appreciated ^_^
If by "act like a spline" you mean generate along a spline-like path, there's no builtin way to do that. You could potentially create your own logic to generate it like that, but I suspect that would be rather complicated
oooff i'll figure out a workaround with EQS then, thank you!!
I mean if youβre using a spline you could just have them follow that. Unless this is supposed to be COD Ghosts π
is there something i can do to make AI prioritze certain parts of the navmesh for traversal?
For context, players can build roads, which the ai should then prioritze to get to their desired location, but if there's no roads available they should still be able to get to their destination
Thanks, exactly what I was looking for!
I'm loosely following this tutorial https://dev.epicgames.com/community/learning/courses/67R/unreal-engine-introduction-to-ai-with-blueprints/mX27/introduction-to-ai-with-blueprints
In it he places the AI Perception component on the pawn. But I get a warning in console saying it's "Designed" to be on the AI Controller 
The tutorial is for UE4 so did that change at some point? The behavior works fine aside from the warning.
LogAIPerception: Warning: UAIPerceptionComponent::OnRegister: Perception Component is being registered with BP_MobAgentBase_C_3, they are designed to work with AAIControllers!
Is there a way to access the coordinates on a navmesh? I want to get a valid position to spawn an enemy. Is this a way to do this?
It was always intended to be on controller as far as I know, but they only added the warning at some point in UE 5.x. It still works just fine though, but maybe they're planning on deprecating the pawn compatibility
Depends on what exactly you mean. You can project a point to navmesh or you can get a navigable point within radius, or some other such means
Something I'm confused about - say I have a character who is neutral towards 3 actors that are perceiving it. The character does something that makes itself an enemy of those 3 actors. Is there a best practice for updating their perception system to recognize this team change?
yes, get a nivigable point within radius I think would do it, there is a method for that?
Yes, the name is something like get navigable point within radius :)
perception component has a function RequestPerceptionListenerUpdate or something like this... this updates the affiliations, but I'm not sure if this is necessarily the best function to call for it since maybe your actor switching teams doesn't have one, so you would have to call it on some other one
kinda trying to let the fish roam randomly but only in water, but what I might do if all else fails, is put blocking volumes all around rivers and lakes
Pretty new to BT, is there a way to make a selector pick randomly?
I assume a BTD with an output that selects random int or something like that? But i got no idea how to use that variable and make it proceed to a random sequence in its branch.
Selectors go from left to right and stop at whatever succeeds first
Have to make a new composite node
At least I think that's what they're called. Can't remember exactly
Arenβt those EQS nodes?
I thought that was a sequence
No
A sequence goes from left to right through every node/branch
Selector stops at first success
So how do you get a random sequence in a batch?
If I attach a USphereComponent to a character and call GetOverlappingActors, will it automatically ignore self?
What is your actual use case? What are you trying to pick at random
Not sure, maybe look at the code for that function
I want when in range them to do a random action
Might be better to just have the attack in the BT and decide which type of attack happens outside of it. Like using GAS to determine which ability will happen
I'm having a little trouble determining how much complexity should be on the BT/BB side vs. the controller side. As an example I'm setting up my AI to handle multiple players at once, with logic for determining which player to target. My instinct is to do this on the controller side
And then manage targets in tick and assign the best current target as a BB value
But is this sort of thing better kept entirely in the BT? I suppose you could maybe do it with the decorators and such
depends on how complex you want to go. The EQS system has tests you can use to score and filter your targets
I've peeked into that but it seems like it queries for targets every time? Is there some way to hold or work with just known targets at the moment? 
not necessarily, you can just run an EQS as a task with a stored BB value, but tbh if you do some testing you'll prly find out onTargetPerceptionUpdated does not fire when you expect it to, and thus can be unreliable

What event to use for when a target is acquired then? 
it might work fine for your use case, test and find out. For me, I had to use EQS -> Composite Node -> Get Perceived Actors generator, because having multiple targets confused tf out of the perception update function and having to filter through the targets manually would've involved countless hours of work that's already done on the EQS side for you
You can do that using navigation filters and area classes.
Why are you doing this?
There should be a function to update the stimulus source. You might need to unregister and reregister. It should be in the perception system, not the perception component
Forget actor doesn't do what you probably think it does. The sight sense caches off the targets based on team, so you need to update that for each listener.
The targets should certainly not be doing anything to the listener's perception component.
If the listener's team gets updated, there is a function for that.
The listener is the one doing the perceiving. The source is the one being perceived.
The team is not cached. The potential targets are cached. It's an optimization. Instead of going through all of the potential targets to check the team every update, it only goes through the targets they can perceive.
Correct
When a listener perceives a source, it can remember that it had perceived it. Forget Actor clears that memory.
You don't want to disable the caching. You can either call UpdateListener for every listener. Or see if there is an UpdateSource function that does the same thing. Or unregister and reregister the source. All of which should be done via the perception system and NOT the perception component.
Did you miss any of the times I said that it should be done on the perception system and NOT on the component?
At no point in time did I say to unregister a listener. I said to unregister and reregister a SOURCE
Unregistering a SOURCE removes it from any listener's cache. Registering a SOURCE adds it to any listener's cache.
there's also source π
So with MoveTo you can't set the acceptable radius dynamically, it's a fixed value for every user of the tree? So I made a task to do it using MoveToActor, and I noticed this Allow Strafe business
How do you utilize that? How do you tell ai to strafe? 
can you do inheritance with blackboards in blueprint? not seeing the option to use my existing blackboard as a parent class in the editor
Doubt it? What's the use case
Does anybody have experience with working with hundreds of AI NPCs? I feel like the more I add, the "slower" they react to my player. It almost feels like their perception isn't being updated fast enough because there are too many NPCs. But it's not very consistent. Any thoughts?
Having a parent blackboard with a set of variables that basically every NPC wants (target, a few combat components, etc.), and then the ability to inherit from it to add other keys for individual blackboards. its basically just copy/pasting but faster i guess
would make it easy if i decide i want every npc to have a key for their current target or their health level to add it to everyone at once instead of every different blackboard needing it
I'd forgotten it was there tbh
was trying to find blackboard as a base class in the "create new blueprint class" wizard lol
yeah it doesn't have a Create child class context item either
it's under Artificial Intelligence but there's no "base" per se
yeah
if you pick that one it just inherits from whatever the base blueprint bb is
there's probably some optimization magic or something that prevents them from letting you do that
same result tho (assigning parent BB that is)
for sure
Wouldn't that require me to place a bunch of volumes everywhere? Like if I did an area class for a river that bent a lot, I'd have to use a lot of box shapes and edit them into the shape of the river instead. Just wondering if that would be expensive?
I'm struggling to even get AI pawn to not face direction of movement. Even though this is off in it's movement component 
Ah, set focus 
Hi guys ! I want my AI to dash attack the player when the AI is in range of the player (500cm) and has cooldown. Otherwise, the AI must move towards the player. But if the following behavior tree, the AI only dash when it has reached the player location. The "Is at location" decorator doesn't abort the current "Move to" task. How can I do this behavior ?
(For the exemple, I removed the cooldown condition)
(+ in reality, I have other abilities on the left of the tree with more conditions (cooldown, range, blackboard values...)
There are settings to adjust the abort behaviour on decorators, I seem to recall?
I could be wrong, haven't touched AI in a while.
Yes, but there is no abort option in "Is At Location"
I see. But if the MoveTo node is set to track the actor (not just the position it was in when the node began), doesn't it abort on its own when it reaches the target radius?
That has been my experience with it, I'm pretty sure.
Yes it aborts on its own when it reached the target radius, but I want to abort sooner if the AI is in rage of dash attack
the dash attack can be triggered if the player and the AI have less than 500cm. The move To target radius is ~20cm. If the AI is at 800cm, the AI move towars the play, then, when the distance is less than 500cm, the AI must trigger his dash attack
hey guys,this setup works fine but there is one thing i want to add then ai does not see the player after lets say 3 sec,he continues to roam around.Cuz now he follows me infinite after he sees me
do you set hasSeenPlayer key to false somewhere ?
in the first sequence you compare tour key value with false, you never set to false
Don't use Pawn Sensing component and use AIPerception instead
You will have callbacks when no pawn are in line of sight
i added ai perception and removed pawn sensing,but how can i debug it ?i tried with ' key in game with numpad 1,2,3,4 keys but that does not work
play, select your AI in the Outliner, then you can press ' key
normally, the gameplay debugger debugs the AI in center of the screen, but sometimes you can't control the camera so I do this by selection the AI in the outliner
after pressing the ' key, you must press the 5 key (for perception)
none of the modes work,i followed all your instructions
do you have this on top of your screen (when you play, after pressing ' and 5) ?
if yes, by selecting your AI character (that have a AIPerception component), you should see debug
its there but its gray all the time
for me its 5 because I have Abilities en 3
ok, for you its 4
press 4 then Perception should be green
i tried 0,1,2,3,4,5 on laptop,on keyboard,selected and deselected character
i mean ai
and 4:Perpcetion was green ?
grey
this are the settings
it's not a UE related issue so, maybe your keyboard is broken or you don't have focus on the play window idk
I don't know, I just add an AIPerception comp, start playing and I can see debug... I didn't setup anything else
π€
how can i spawn a navmodifier volume along a spline at runtime?
turned off this option in mouse settings
and which one do i need the forgotten and what else?
@dire fable
I use this to know if the pawn is seen or lost
Not sure if this is the best implementation but it works
tried this and vice versa the bools and didnt work.Is stimulus 100% required?
i will try with stimulus now
don't forget to change the "Abort" setting in this node
and don't forget to link this node to Self
yeah linked it now to self but what abort setting,
Self or Both depending on the behavior
oh man ,tried a lot of variants,maybe im doing something wrong?both are self aborted, one set and another not set with the same blackboard key .And here are the events inside the enemy ai ,the key name is spelled propperly cuz i copied it.controller has reference to self
How does one handle Swimming AIs, that are above the NavMesh (due to it building below the surface)?
Or is the "below the surface" already the problem? Currently facing a problem where the QueryExtent is not high enough for an AI that is in the water to find the starting poly.
i made it huh
this is what it looks like
and here is the behaviour tree
i didnt use the bool
just the character target-actor type
FYI, I ended up overriding GetNavAgentLocation in my C++ Character, tracing for the Landscape with the Pawn Profile and the Capsule Shape of the Character, but only if we are swimming.
Seems to work fine and shouldn't cause any issues I hope :D
Interesting, good to know that's also possible
anyone else ?
Do I need to do any cleanup for an AI-controlled pawn when I kill the actor, or can I just DestroyActor and assume the controller and behavior tree and any ongoing tasks and all that crap will just be gracefully closed out?
How do I get my EQS query to run in a loop and repeatedly update its target without interfering with other actions the BT is taking?
I have an EQS to locate a position furthest from player that has no LOS to player
Then the AI runs to that spot
It works really well but if the player is pursuing it won't update until it finishes moving to its current target spot
I want it to update some regular period of time, I tried a wait with parallel but that causes a stutter
I tried a few different configurations and couldn't get one that was closer than this. This is almost perfect except the stutter ruins it
There's a pause when it cancels the MoveTo while it waits for the EQS query
I need the Query to continue infinitely π€
Another way to put this is "How do I make move to more flexible?"
Move To is frustratingly basic for something so important
You can't even set Acceptance Radius dynamically 
Oh hmm you can run eqs queries in bp 
Could have a separate timer from controller that loops the query and updates the target hiding spot every X seconds
And BT just looks at the spot and goes 
Is that the only way though?
Feels a little clunky
This is in a 1second timer btw
Could prob do 2 seconds fine
Kinda feels... wrong. Like I should be doing this in BT 
Not necessarily. You can set anything to have a nav area.
You can only set blackboard based decorators as observer aborts unless you make them in C++.
Are you pressing 4 on the numpad?
its all fine,it works now,i fixed the numpad
What is it that you are trying to do?
By running it using the built-in service node.
what the heck is this? this half of the foliage from landscape dissapears when opening another level and then this level


Are you responding with pepe emojis?
First emote is to indicate "Hmm that's a new term" and second one is to indicate "I am now reading the docs I found thanks to your use of term" 
I'm not getting quite the same behavior with a service that fires every second vs. the way I had it before 
You do understand that pepe the frog is hate symbols, right?
Hmm yeah with this setup it seems like it doesn't stay in the Move To long enough for the EQS to get a result
If I put a wait, then it works 
Does anyone have advice on where to learn on pathing. I see alot of patrolling that follows one path but what I want is a lane. If the AI is in X position it follows that X position the full way around said path.
A point in the right direction would be greatly appreciated!
the path is a spline constructed from a set of points and each point is interpolated to form the curve. Using the spline normal, you can "inflate" the 1D spline by using the normal to find the left/right vectors, then just add 1/2 the width your want the road to be. This gets a little janky if the points are far apart, but it's a fairly easy way to get a road. You'll run into the typical issues that inflating a spline like this might make you choose some unpathable points. You can directly convert a path into a spline like this using a spline component:
SplineComponent->ClearSplinePoints();
for (const auto& Point : ResultingPath->GetPathPoints())
{
SplineComponent->AddSplinePoint(Point, ESplineCoordinateSpace::World, false);
DrawDebugSphere(ControlledCharacter->GetWorld(), Point, 8.f, 8, FColor::Red, false, 5.f);
}
SplineComponent->UpdateSpline();
they have a param to visualize what it looks like with width, but you need to actually implement width pathing yourself.
Then to move you'd do something like
while(true)
{
const auto ClosestSplinePoint = SplineComponent->FindLocationClosestToWorldLocation(ControlledCharacter->GetActorLocation(), ESplineCoordinateSpace::World);
const auto SplineDirection = SplineComponent->FindDirectionClosestToWorldLocation(ClosestSplinePoint, ESplineCoordinateSpace::World);
//Get spline normal
//Take spline point and add a random (-width/2, width/2) to it
//Find direction to new point
ControlledCharacter->AddMovementInput(Direction);
const float DistanceToDest = (ClosestSplinePoint - Dest).Length();
if(DistanceToDest <= AcceptanceRadius) {
co_return;
}
co_await std::suspend_always{};
}
Already fixed it, but thanks!
When Move To is interrupted by itself (i.e. blackboard decorator sees that MoveToLocation vector has changed), there's a "stutter", is this impossible to avoid? 
Like even if the movetolocation is in the same direction
There's a momentary slowing of the pawn
My thought is to use MoveTo targeting an Actor, and move the actor around, but that seems sort of extreme
Since MoveTo can track an actor as it moves, but not a vector as it changes
Like if I want a pawn to continuously flee from the player by EQS'ing up a best spot to run to, and it needs to update that best spot over time as the player chases
Every time the spot is updated the AI stops/starts
I'm sure it'd work if I used an actor as the target and just updated its location instead of updating the bb value 
Are you using acceleration/deceleration for paths currently ?
I don't know 
Those are settings in the CMC but prly not if you donβt know
Also, are you calling stop movement before a new move is issued?
Without this it will complete a move before it notices that the move target changed
Also, without this, there is still a 'stutter' when it completes a path, prior to starting its new path
Like it takes >1 frames to transition from one move command to the other 
I mean your EQS is set to tick every 1s
Yeah. It updates the target location every 1s. Which interrupts the move with a new move. Which cause a stop/start instead of just smoothly switching to the new target
You can use visual logger to see exactly what happens in that time
I don't think it's a bug I think it's just expected behavior, no?
MoveTo can't seamlessly transition to another MoveTo, there's a frame of delay or so
Is what I'm gathering 
So if you want to have a pawn that moves away from something by continuously selecting new points ahead as it goes, and you don't want it to stutter every time the target updates, you need to use an Actor or a custom MoveTo task 
Found this 
Moving a waypoint actor around works pretty well 
if i have multiple decorators on a node, how does aborting work? does it abort lower priority only when all decorators abort, or only one?
like if i have two decorators on the same node both set to abort lower priority for example
The decorators are separate. If either one's condition to abort is true, it will abort.
is there a way to abort only if both are true? composite decorators look like they work the same way but it wasnt super clear
You'd have to make your own decorator, I believe.
thanks
Has anyone experienced receiving a nullptr in BTTasks when trying to get the pawn owner from the aicontroller? I am really confused as my tasks previously worked before
Are you running your BT from On Possess or from Begin Play?
I tried running it from both and seem to get the same results
I mean, like switching between them not running it twice in both
Sure :)
So I am just testing a bt task to find a random location in radius of the pawn
It seems to be running but the debug console is showing that the aipawn isnt found
This is the task being run: ```EBTNodeResult::Type UMyBTTask_FindRandomLocationCPP::ExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory)
{
// Need reference to AI Controller
AAIController* AIController = OwnerComp.GetAIOwner();
//APawn* AIPawn = AIController->GetPawn();
AActor* AIActor = AIController->GetOwner();
if (!AIActor)
{
UE_LOG(LogTemp, Warning, TEXT("THIS DOES NOT WORK"));
return EBTNodeResult::Failed;
}
// Get AI location
FVector Origin = AIActor->GetActorLocation();
// Nav mesh stuff
UNavigationSystemV1* NavSystem = UNavigationSystemV1::GetCurrent(AIActor->GetWorld());
FNavLocation RandomLocation;
// If both are valid then assign blackboard
if (IsValid(NavSystem) && NavSystem->GetRandomPointInNavigableRadius(Origin, SearchRadius, RandomLocation))
{
AIController->GetBlackboardComponent()->SetValueAsVector(BlackboardKey.SelectedKeyName, RandomLocation.Location);
}
FinishLatentTask(OwnerComp, EBTNodeResult::Succeeded);
return EBTNodeResult::Succeeded;
//return EBTNodeResult::Type();
}```
I tried getting the pawn and actor -- both don't seem to work
If I go straight from ownercomp.getowner to get the actor it does seem to work though. But I am curious why this code that has previously worked before doesn't
GetOwner is wrong for starters. This returns the owning actor which is different
And is quite likely to be null unless you've manually set it to something when spawning the controller
GetPawn() is what should work
ah okay
is there any other details that might help with this problem
I will post my controller in case I am missing something there:
Hard to say, from the BT screenshot it looks like the pawn is being set because it's set into the SelfActor prop on the BB correctly
AAlienAIController::AAlienAIController()
{
BehaviourTreeComponent = CreateDefaultSubobject<UBehaviorTreeComponent>(TEXT("BehaviourTreeComponent"));
BlackboardComponent = CreateDefaultSubobject<UBlackboardComponent>(TEXT("BlackboardComponent"));
}
void AAlienAIController::BeginPlay()
{
Super::BeginPlay();
}
void AAlienAIController::OnPossess(APawn* InPawn)
{
Super::OnPossess(InPawn);
if (IsValid(BehaviourTree))
{
RunBehaviorTree(BehaviourTree);
BehaviourTreeComponent->StartTree(*BehaviourTree);
}
if (IsValid(Blackboard) && IsValid(BehaviourTree))
{
Blackboard->InitializeBlackboard(*(BehaviourTree->GetBlackboardAsset()));
}
}
haha... it is now suddenly working...
Are you hotreloading by any chance
is that the same as live coding?
I did live coding then a full rebuild deleting binaries and such
for whatever reason, changing it just now back to get the pawn has seemed to work but I have no clue why
Livecoding is different and better, but it's possible if you were livecoding that it wasn't reloading the nodes correctly
Usually LC works if you are modifying function bodies (except constructors), but it's still possible that it may affect some things like this
I see, thanks for your help
Do folks have any thoughts on WP navmesh (it's still labeled experimental)? Specifically, is it stable enough to build a game around?
sorry I asked for details and then got sucked into work forgetting to answer. I see you found some support anyway. Your sequence is correct, OnPossess you run the BT and in any task you should have a valid reference to AIController where you can call GetPawn. Hopefully you fixed this for good
Quick question. Detour Controller does not allow moveTo to work. The reasons?
Why do you think it doesn't?
You might be at the limit of agents allowed. You can change that number in your project settings.
My... how...
my AI is firing OnTargetPerceptionUpdated when it sees other copies of itself... even though it does not have a stimuli provider component at all
How is that possible 
what da fuk
I'm so confused right now 
Testing with AI Perception system, it looks to me, like the AI Perception Stimuli Source Component just is not needed at all. I found this playing with Noise - it simply works with only having an AI Perception Component on the receiving side with configured senses. All actors making noise do not need the Stimuli Source at all. Found this threa...

It also completely ignores team settings on the AI Perception Component 
@proud flume pawns are automatically registered as sources by default
Team settings also requires implementing IGenericTeamAgentInterface on your actors https://zomgmoz.tv/unreal/AI-Perception/IGenericTeamAgentInterface
Yeah they mention the config setting to disable that in the link there
Thanks for the link though
looks like lots of useful stuff in here
Hey so I have lots of AI related questions so if someone is willing to just PM me I would love that lol. I dont wanna flood the chat here with all my lack of knowledge π
Go through the course that is first in the pinned list.
Oh okay cool didn't even know that was a thing. I will do that! Thanks lol
Does IsAtLocation not work with an actor target? I'm like an inch from this thing but it's still evaluating false, even though it IS targetting the player pawn
Your target actor is a ship. Is that a large mesh?
Nah, pretty small. Root component is a sphere collider with radius 30, and it mostly all fits inside that
NM that's my problem, I'm dispatching the task finished event too early somehow
Question: Is it possible to create an AI bot thing that moves, attack and all that shit, all without using NavMesh? And without building my own nav system?
NavMesh feels to limiting, with the navigation only as big as you make the nav mesh. Is there something more adaptive?
It's hard to argue for or against a feeling that something is limiting. You should have specific requirements for your navigation that guide your evaluation. But you have options:
- Use nav mesh (probably try this first and switch when you have to)
- Stream in nav mesh
- Use nav invokers
How are your AI bots going to avoid obstacles? The point of a navigation system is so that an NPC can effectively navigate around the game world without running into things. How does an AI know there is a wall there to avoid? Well... There are several options for that, but a nav mesh has been proven to be inexpensive enough to run for a number of agents as well as have a high fidelity of actually looking intelligent.
When you say adaptive, it leads me to think about how we used steering behaviors prior to nav meshes. It was done by having probes that extend out and then use forces to push them out of the way. While this worked OK, they never really seemed to have a purpose. They'd run at a wall and then just miss it.
All a nav mesh really is is a graph of points that an NPC can be at without colliding with the world geometry. Because it's a graph, the points are connected together if they can be traversed without running into anything. So really it's just a simplified version of the map that the NPC uses to traverse without running into shit.
A nav mesh allows the NPC to come up with a plan. A path from point A to B. Typically this is done by using an algorithm called A*, which builds a path using that graph of points to cheaply find the shortest path using a heuristic.
However, using something like a steering behavior you can't build a path. You point it in the direction of point B and hope it can figure it's way there. In open space, this can work fine. In some cases using BOIDS (a steering behavior modeled on birds flocking) you actually want that, specifically for wildlife. In a more complicated world it looks like absolute garbage.
By adaptive, I mean I can take the code and put it into another project and it would still work without needung any prior setup
Another project outside of UE?
another ue project
Another UE project will still have the built in navigation system.
Like, I wouldn't have to set up a new navmesh. I can just port the files into another project, start the project and be able to use it straight away
That you could make a tool to set up if you want to.
what do you mean?
yeah, but it's tedious. I'm just wondering if there is other options
You drag n' drop, then just scale like crazy for the most part
Unless you're doing WP stuff. Idk about that. I don't do WP type games
It's still tedious, so if there is another option where I don't have to set up a navmesh everytime i have a new world or project, I'll take it
WP is still drag and drop, scale and then follow the instructions.
World partition
They made setting up navigation so incredibly simple and yet people still complain.
The only thing I'd like is a navmesh painting tool. Instead of doing the nav filters
So I can fine tune stuff a bit easier
Something kind of like this https://horugame.com/real-time-navmesh-editing-with-booleans/
You could build something similar. I don't think painting the navmesh in, but painting with nav areas.
On one project I made a tool to paint nav links. It didn't take that long.
That sounds neat
I haven't delved much into tooling yet to be completely honest.
I would want to be able to paint the navmesh in as well most likely.
So use automatic to do the map, then fine tune with the paint tool.
First step is figuring out how to even paint anything, lol
That might be possible.
Was it actually painting, like it was like painting foliage - or was it more like placing nav links automatically at X intervals?
Painting is definitely possible. I'd start by looking at the foliage tool.
It was painting. Or technically clicking. 1st click placed one side of the link where the cursor was and the 2nd one put the other side. It also had the option to place X links at Y intervals.
That's cool
I think it'd be kind of neat if we could have a nav link area - so as long as the agent was in the area, they could traverse to the other side.
Or maybe that's too niche
Because in order for my agents to cross a bridge, I ended up setting up like 3 nav links that allowed them to cross it.
It also had some other options for editing, but I don't remember them. It only took a few days to make and that was like 2018.
They have code for it, called "regions" but the comments say they never got it working.
Just when I was doing it, was like, "man - it'd be nice to have this as an area"
That's how Havok's version of links work. It's so much easier.
Struck again by the budget of indie π
@uneven cloud Does Havok's AI sdk integrate quite seamlessly with UE?
They have a UE integration. It's not exactly seamless, but we don't have to do much to get it up and running.
I'm not a big fan of how it's set up, but I also don't have to worry about it too much. They have a UE team that I can ask for things from. Support is top notch though.
I'm trying to use StateTrees, I am having is I have a task that i'm trying to delay the task finishing. It delays the print string as shown however it continues to the next tree. Any idea on why?
Hey, Unreal noob here. Would anyone be able to tell me how I access this when creating my own task for Behavior Trees?
That's not default functionality for a task. If you want that, you need to implement it yourself.
Ok thanks! I was under the impression that move to was just a default task. Is it not possible to have a task react to changes in the BB? What are the best practices here?
The move to is a built in task, but it is not the default task. You can have a task respond to changes in the BB, but like I said you have to do that functionality yourself.
Is there currently a way tell the BT to hop back / restart from a given node? I know BTs are essentially DAGs but Iβm wondering if itβs possible to restart an entire tree at a given node index somehow?
Iβm trying to use BTs for dialogue and it works really well, the only gripe I have is that sometimes it would be nice to have a βbackβ option in the dialogue which currently isnβt something I found how to do.
What a travesty, Mieszko would be rolling in his virtual grave
Dialogues for BT never works really well
How come?
The acyclic nature of it?
To be fair itβs early enough that I can just scrap it and do it all in bp using a data structure. It was just a novel idea that worked out well for me
Its rather about BTs specialize in prioritization
Well.. it worked out cause theyβre simple.
Good luck
Hmm.. This isn't gonna make me write c++ is it?
No
I'm trying to keep stuff simple for the first game. So even if its a little janky, it might be fine. I am tempted to try FG.. I just hope that it will be easy to adapt to a dialogue system. Cause frankly what mine is supposed to do is quite simplistic. Just cyclic (if possible) talking, and firing off trigger events on certain choices being selected
Well, the other idea I had was to have my dialogue in a structured data format that represents a graph. Somewhat like:
DIALOGUENODE
id: 0
text: "some dialogue"
choices:
CH
next_dialogue_id: 1
prev_dialogue_id: None
text: "I am a choice"
...
...
Something along those lines albeit this is simplified. But the idea is that a single BP could iterate over the dialogue nodes and choice nodes and construct a UI which adheres to this "prev/next" and event behavior. Something like that
Could be JSON, could be something else. Idm
I guess the trick here would be how you tie blueprint events to the dialogue and so on..
Damn.. It's kinda annoying cause the BT thing got me like 98% of the way there. I got it to display dialogue, assign quests and even have predicate responses where some dialogue options show up based on absence or presence of quests/objectives/variables in the game instance
The only real issue I had is the inability to restart the BT at a given node so you dont have to finish the whole dialogue tree and start the npc interaction again
:/
easy to adapt and writing a custom data format which implies a custom parser too doesnt match though π
avoid BT though
Yeah I am trying to do a quick prototype of what I described above atm to see if it's viable
if not ill grab a third party system
Thanks for the help
I might have a way to do this with a component bp and an interface but we shall see

Is there a way to conditionally filter out a Smart Nav Link based on a specific instance of an agent?
Example: I have a door that is locked, and some agents carry the key. I only want them to attempt to path through the nav link if they know they can successfully unlock it (has the key).
Otherwise they would attempt to path around it.
Not 100% sure but have you tried giving the link a certain nav area class?
I haven't tried it myself but if you were to give it an area class such as "locked" and set up your nav logic so that you have a nav query filter that excludes "locked", then the npc's would avoid the locked door
Hm, no -- now that you mention it, I notice you can select which class it will represent when disabled.
I haven't touched nav classes that much, but it feels like a good place to start looking!
Makes a lot of sense, thanks!
also you may need to set the navigation generation thing in project settings to "dynamic modifiers" or whatever it was called if you want to change the locked state at runtime
at least if this approach works
Ah right, I'll keep that in mind.
Thank you for your response! I will be sure to keep that in the OnPossess
Hmm, by default a disabled navlink gets set to Null area, which of course means they can't path through it. Creating a Locked area I imagine would result in roughly the same. But if an agent carries the key, I want the Locked area to be treated as perfectly cheap and passable, but only for them.
I had hoped there would be some overridable function or something to dynamically resolve the cost when an agent does pathing... Maybe there is in C++?
// NavigationQueryFilter.h
/** if set, filter will not be cached by navigation data and can be configured per Querier */
uint32 bInstantiateForQuerier : 1;
/** if set to true GetSimpleFilterForAgent will be called when determining the actual filter class to be used */
uint32 bIsMetaFilter : 1;
/** helper functions for adding area overrides */
NAVIGATIONSYSTEM_API void AddTravelCostOverride(TSubclassOf<UNavArea> AreaClass, float TravelCost);
NAVIGATIONSYSTEM_API void AddEnteringCostOverride(TSubclassOf<UNavArea> AreaClass, float EnteringCost);
NAVIGATIONSYSTEM_API void AddExcludedArea(TSubclassOf<UNavArea> AreaClass);
/** find index of area data */
NAVIGATIONSYSTEM_API int32 FindAreaOverride(TSubclassOf<UNavArea> AreaClass) const;
/** setup filter for given navigation data, use to create custom filters */
NAVIGATIONSYSTEM_API virtual void InitializeFilter(const ANavigationData& NavData, const UObject* Querier, FNavigationQueryFilter& Filter) const;
virtual TSubclassOf<UNavigationQueryFilter> GetSimpleFilterForAgent(const UObject& Querier) const { return nullptr; }
Some of these seem promising!
You can create a nav query filter which allows certain areas or disallows others, the filter can be used when you do movetos or other navigation queries
Gotcha, but I imagine all my actors should be allowed to pass through the Locked area for doors that they carry the key to.
Yeah if you have multiple different kinds of keys having one filter per key type might not be the best, but I think there might be some way to have them be configured more dynamically also
I have tag-based keys, so very many indeed...
But it seems like the functions I posted above might let me do what I want in C++. I'm just a little scared!
But I'm sure it's fine.
Haha :)
If you figure out a solution for it I'd appreciate it if you can ping me - I might need to do something like this in the future so curious to know how it could be done
I'll be sure to!
Hey Guys,
What is your take and advise on Openworlds and Navmeshes?
I have a rather large open world. and I tried Static Navmeshes (atm I'm building my paths according to the docs with WP)
But I also see alot of people talk about Dynamic Navmeshes and Nav Invokers. However I have never been able to get Dynamic Navmeshes to work fluidly.
If you have a rather large forest scene or whatever. It is in my experience undoable. It hitches like crazy.
I have tried turning off Navigation affecting on almost everything, but it keeps being trash.
I have an 8K Landscape. and every dunamic calculation/drawing of the NAvmesh just breaks everything.
I also experience NAv tick time hitches just being in the editor.. It's so annoying. I just can't find one conclusive answer or setup tutorial anywhere..
Are there any good tutorials out there that go in detail or what am I missing?
Cause all Dynamic tutorials use the default Open World map that empty AF so it doesn't feel realistic..
I have been told in this channel that Nav Invokers are very bad performance-wise.
That dynamic navmesh is almost always better.
Wait, aren't they supposed to be used together though? Cause hwo would the Dynamic NavMesh know where to be spawned?
I believe the idea is to have the navmesh dynamically generate for all loaded tiles of an open world map.
Whereas nav invokers just keep generating continuously.
Honestly, I'm the wrong person to tell you these things! There are more knowledgeable people in this channel for this topic :)
Oh that's interesting.
The problem for my though is also that the generation of it is slow AF.. (And so it hitches) Wish I could make it happen on an Async thread without C++..
The other thing to look for I think is "navigation streaming" - I don't know how that works, but that's another thing I recall coming up whenever people ask about level streaming and such with regards to navigation
Yes, indeed, I remember hearing that too. I wonder if the thing is to have the navmesh already exist in the streaming levels, and the "dynamic" aspect is only that it patches them into the rest of the navmesh when loaded.
Yeah I think that's the way I'm setting it up now.
According to the UE5 docs you can use a Static Navmesh and enable IsWorldPartitionEnbaled and than it will load the Navmesh or stream along wit the rest of your WP Cells.
https://docs.unrealengine.com/5.3/en-US/world-partitioned-navigation-mesh/
This is the link to the Docs, if it's allowed to post.
It's been building for a over an hour now already though.. π
Hi! i have this state tree task where it sets the PatrolPoint struct to some value (img1). i've made sure to mark it as output and everything.
now i expected this to actually change the patrolPoint parameter (img2) but in the move to task the struct is zero initialized (img3)
I'm not entirely sure if I understand correctly - but you need to actually bind the input parameter to the output parameter of the other task
oh that makes so much sense! thanks a lot
yeah well maybe it didnt π
so i just set the out FPatrolPoint to in. i thought that would give me a reference to the parameter so i can change it however. still the same issue
are parameters mutable? if so, how can i do that?
Category=Input or Category=Parameter should allow binding them iirc
hi i want little help with this i want a thing like 4 enimes of the same blueprint placed in a level waiting and two attacking if the first two died the others can attack can someone plz help me
I would recommend using a static nav mesh or dynamic with modifiers only with navigation streaming. Do you need fully dynamic generation? Is that absolutely necessary for your game?
Invokers are the most expensive option. Lots of tutorials use them, but they are incredibly expensive.
input didnt work for me and Parameter isnt a valid property type it seems?
it doesnt show up when i use it. or does it automagically bind to the parameter list?
It automagically does
Nothing happens automatically
(If I'm following the issue correctly)
The only thing that will bind automatically is the Context category stuff
I have to admit I'm not quite following what's going on :D
If you've never done AI before, I recommend the AI with Blueprints course. It's linked in the pinned messages.
plz helpppp
Please have patience
tl;dr all i want is to save a variable from a task in the parameter list to use it in another task (just like blackboards in BTs pretty much). hope that clear things up π
Right - so you mark that into the Output category in the task that produces the value
no ive done it but dont know how to do this
And in the task which you want to use it in, create a variable in the Input category, and you can bind it to the value from the other task if it's set up correctly
(correctly=the task with output is either a global task, or in a parent state of the task that wants to use it)
You've done the course and don't know how to do what you are asking for?
yes
this is my task tree so far. so just need to put the bottom two tasks under GetNextPatrolPoint?
Which part are you confused by?
yep that did it. thanks a lot @misty wharf!!
i cant start the attack i need start attack node to do this