#gameplay-ai
1 messages Β· Page 26 of 1
Itβs for people to explore the engineβs capabilities
Lyra is excellently made, it's designed to show devs how to build that kind of game as well as how to build a framework for any type of game
Who is "they"
Them, the bastards
no hate I love lyra
Well, I think we should stop the topic since it doesn't help in any reasons for game dev though.
I guess r/troll went private ?
Well, I'd refer him elsewhere, but then that would just be mean for the people in that channel because it looks like cheems is here to complain instead of learn
This is a channel about #gameplay-ai
Maybe you can try #ue5-general or something
They have their own discord server I heard
If you're not a troll then you're obviously a noob. Start with 10 bots, and learn stuff. Hell, start with 1!
Well, they're not mutually exclusive either
Lag -> Optimize
You don't optimize for 1,000 characters running client-side prediction π
Why is someone meant to make your game for you π
you go and learn unreal by heart so that you can start messing with internals and be aware of all the cache misses and virtual call.
Unreal engine does not offer a ready-made character that is exceptionally light-weight and single-player only. But it does offer this framework. APawn.
And it has #mass for ECS based approaches
As I said previously someone did a HISM approach for RTS type game
What is this?
oh yeah, definitelly not a trol π
But as new as you are, you need to learn the engine first, not go directly into making a game with 1,000 characters
<@&213101288538374145>
hi
How this is about AI?
Hi, pls delete troll
Whichever mod arrives, can you pin this while you're here so it doesn't get lost
Thx π
Well that ended well π
I thought it was a good question if he had approached it from an actual learning perspective lol π€£
(How to get 1000 ai in unreal)
it's possible
very hard
but possible
you're going to have to fake a looooot to make it work
Any existing plugins doing this?
I was thinking most of those games that have lots of pawns use smoke and mirrors to make it look like theyβre all singular AIs
I think glass beaver was the person who did a HISM approach
the tech to make it work easily is relatively new
Mass is kind of the thing here
I hope to see some simple NPCs doing interaction like combat with Mass in the future.
Yeah, it would have been a good question π
Btw I heard SpatialOS died. Or at least changed gears completely. Are you still using it? You could technically have done 1,000 AI with that π
The problem I have with mass is that it's stitched together around a framework that's really not meant for what mass is trying to do
Oh god lol
We got rid of that thing ages ago luckily, needed some engine mods too because it saved some additional flags to every single asset and ended up needing mods to asset loading to get them to load in normal engine builds lol
So if instanced meshes are just redrawn copies of the same mesh with diff transforms, you just have a few characters navigating the mesh and the rest of them pretending to navigate next to them? π
I didn't think you'd keep using it. Building a game reliant on a service that could - and very much did - go away at any moment would be asinine π
Well my conclusion for the 1,000 AI question is ~~maybe you can do it with mass, but no matter what, it is going to be a phenomenal amount of work that most people can't do (maybe including me) π ~~ come up with a better idea for a game that doesn't need 1,000 AI
Yeah, definitely ain't worth it imo π
Why would you need 1000 individual AI loaded at the same time in one spot tho
Well if you make ants itβs simple, they have a hive mind π
Still, they donβt all need to be individualized, just appear to be that way, players wonβt sit there with a magnifying glass trying to discern if each unit has its own personality
If youβve got 1000 units on the screen, itβs chaotic af to begin with
One of the games with the most impressive amount of AI's that I can think of is They Are Billions. That one makes 1000 AI's feel like a small feat :P
How many AIs are supported in Ultimate Epic Battle Simulator?
I've checked some videos with that (I believe so, maybe wrong) like have 1 millions vs 100k, something like that...
What's causing the AIController to have a FocalPoint when not doing anything? Causes my AI to stare off into space and I have no logic that sets the focus at all yet for them. I like the results I get when it focuses on the next waypoint (engine behaviour) but not sure why it does this.
GetFocalPoint always returns a value, but it can be FAISystem::InvalidLocation. Not sure if it helps π
Ah yup, they compare against inline static const FVector InvalidLocation = FVector(FLT_MAX);
Which I can handle with if (!FAISystem::IsValidLocation(FocalPoint))
Thanks π
no problem π
Maybe there is something interesting you aren't aware of in the distance
I haven't even put in the background birds yet π
Really looks quite nifty wandering around looking at the next waypoint. Really brings him to life π
looks cool
How do you handle climbing?
navlink -> montage?
Well, I have a system that all my characters use, which uses both CMC and GAS and is properly net predicted. For the AI yeah its just a navlink, don't yet have a proper way to do those procedurally yet but I'm thinking on it.
I recall UT4 source code contains a system that lets you add navlinks without designer input
Well, I have the path they character will take, so I could do some tests along the path to search for ledges that need a navlink spawned. I have bAllowPartialPaths as well, so if it reaches end of path without reaching goal, then I can do an additional search to catch edge-cases in whatever system I build
Yeah that's a good idea too
I find with stuff like this it is better to dwell on it for a while, something often occurs to me if I give it enough time
I was brainstorming something similar earlier; navigation system lets you bind a different functions to FindPath methods
so I thought maybe I could do that edge searching method after the default FindPath method is executed
and my function would run exactly after it, and if any edge found, it would recursively build new path on top of the previous ones until it reaches the goal
and between each FindPath() it would add new path points from bottom to top
but issue was I needed to information of the current state of the path, so I had to extend path points etc so pathfollowingcomp could report if I am climbing, swimming etc otherwise only way to play climbing animation is trying to guess it by velocity
then gave up
Do you have any example to show? I'm curious
Not at the moment, a while ago my computer is infected with a malware and I couldnt save some of the data
Aw man that's a shame
The older I get in life the more vehement my backups are ;D I have a perforce server that I submit everything to religiously, and it runs backups itself - need to think about getting some external system as well for the backups but they could be huuuge
My perforce server is just an intel NUC that doubles as HTPC in living room
Well, since this project is going to have years of development, risk isn't really something acceptable anymore
Once I am free from what I'm working on currently I will continue my suffering with AI programming
I might redo it
It wasnt even working properly but at least was a nice start to execute the idea
I'm having trouble finding the functions. FindPath is used everywhere for... finding asset paths π
but in my project all MoveTo tasks run async pathfinding and they wait to receive the result
it wasnt cheap to run
FindPathSynchoronously in AIModule
it makes call to a more abstract native class
and that class has a typedef for a func ptr
which findpath logic uses it instead of calling virtuals
Would that imply that you're stuck with non-async pathfinding and take a performance hit?
No idea, I didnt test much
but I was dumb enough to premature optimize things way before I worked on that
with 50 AIs it was around 1.75x faster to find paths though
dropped from 0.5ms to ~0.3ms
so since its was already estabilished like that I went with async route
// this awkward implementation avoids virtual call overhead - it's possible this function will be called a lot
return (*FindPathImplementation)(AgentProperties, Query);
Oh, I see, I can see why that comment is there
So basically I just need to grab the nav mesh and change it's FindPathImplementation to my own function
inherit from recast and change yeah
though dont forget the disclaimer
Does anyone know if EQS queries run concurrently? / What is the best way to handle a situation where one query depends on the results of a previous one?
EQS is timesliced
unless you explicitly run it sync
you need to write a system that builds a chain of EQS requests on your own if you have dependencies
Right, but doesn't timesliced mean its allocated a budget per frame and will defer calculations to latter frames if its over budget? That doesn't mean its going to be executing concurrently necessarily
sync implies it will happen at the same frame (or at the same thread), since EQS extends it to next frames its not synced but not the concurrent in terms of multithreading
basically sync one ignores the budget and runs it directly
I see, but, to clarify - I do not need the results of the first query to start the second, only that the first query is resolved at the time the second is run. The order of execution matters, the start and end times do not, so long as order is maintained
Seems it was a moot question anyway, it only has sync method not async π
yep you can do that, just sort the EQS assets in order and run first one ,then bind the delegate of the eqs instance that gets called after EQS is finished
then pop from array, then execute the index 0 if it exists
What is the advantage of basic vs hierarchical pathfinding
afaik hierarchical is more advantegous in complex paths
basic is more punishing but faster in simpler paths
not sure though
it has async too
Oh you're right it does. Mine is using sync but I don't think I ever made a decision there
Suppose it needs to be specifically setup
by default all is using sync
Probably best to just stick to sync then
doesnt matter really
if you have multiple AIs doing pathfinding at once async is better
I had a custom system each 1-2 seconds AIs was changing their paths so I was batching the requests and processing them all together
async one runs the sync code on another thread
Does async actually call find path too?
Any idea why it's disabled by default? Maybe sync is actually faster unless doing many requests
Or maybe less simple to require waiting for the result for newer devs π
yes threading has an initial cost and it not always practically beneficial unless you batch requests at once
How do we change the default nav data?
I forgot
were we suppose to drag it to map
Haven't done it yet, just about to get started so I'll find out soon π
Nah, GB is on another level. He wrote his own skeletal mesh renderer. He's doing instanced skeletal meshes.
He's done his own networking stack, his own navmesh tech, his own VFX I believe... he's just built different.
Heh yep he sure is π
I want to say he's also doing his own physics as well.
But I can't remember at this point.
I think he's doing GPU physics.
That's some dedication
Yeah, it's wild. I still wish Epic would give us an instanced skeletal mesh π
Gotta make red alert in UE5? π
With animation sharing, you can already really lighten the load of a lot of AI
CMC still proves somewhat problematic though.
But you can use nav mode and that helps a bit as well
Then do some AI LOD and you can do quite a bit with that.
If skele mesh was a bit more lightweight, could probably get away with more skeletons
I do wonder what the most expensive part of CMC is to be honest π€
It will be the client-side prediction
Possibly also the physics subticks
These things
// Perform the move
while ( (remainingTime >= MIN_TICK_TIME) && (Iterations < MaxSimulationIterations) && CharacterOwner && (CharacterOwner->Controller || bRunPhysicsWithNoController || HasAnimRootMotion() || CurrentRootMotion.HasOverrideVelocity() || (CharacterOwner->GetLocalRole() == ROLE_SimulatedProxy)) )
{
Iterations++;
bJustTeleported = false;
const float timeTick = GetSimulationTimeStep(remainingTime, Iterations);
remainingTime -= timeTick;
its the FindFloor()
it also updates overlaps 3 times (via MoveComponentImpl, which is extra overhead)
calls something expensive two times based on FindFloor result
The accessors are really making it hard for me to make this FindPath function. It has private the RecastNavMeshImpl and then protected it's accessor GetRecastNavMeshImpl but FindPath is static so it can't even access the mesh in any way whatsoever
then use pathfollowingcomp
Idk if this should be all that expensive to be honest.
override tick, bind to path ended delegate if exists
when path ends, do the search
then block the super::tick call until it climbs
but you will have to repath
after climbing is done
So the theory is that if I use a partial path, it will get as close as it can, then it'll check if it should create a nav link?
yes
navlink is not necessary either i guess
just find the surface to climb
then execute climbing action
literally by updating transforms
treat the wall as a path
That's problematic, if the black line is a valid path the red is significantly shorter especially with verticality, but it'll never test for the red path.
Off the top of my head, maybe I can simply search from actor location -> goal location and add navlinks along there instead of along the actual path, but there's probably some big flaw that hasn't occurred to me yet
what I did was when goal reached I did a box trace, divided into steps by distance, ran line traces
at point hit was not blocking i subtracted climbing root motion animation's height (how much Z it moves) from the last hit trace and after reacing to that Z played the animation to climb
I think I will have to try doing it the Fortnite way instead
i dont know how fortnite does, but i'd guess its relying on static mesh data
This one
I wonder why not releasing the fortnite built component out though. It sounds very useful for the case with non-continous navmesh
Perhaps it isn't project independent in the sense that you have to build your level specifically for what it is built to handle
Perhaps mesh sockets
I dont think so
I have no idea either.
desigers would die
How to make these extra datas
yeah seems like static meshes has UAssetUserData
they can bake vertex points to the UAssetUserData in editor
All my problem would be solved if nav mesh could have huge step height π
some engines allow vertical navmeshes
I don't think I've seen UAssetUserData - how would you go about actually using it? π€
its exposed as UPROPERTYs on assets
its often instanced
so they get serialized with their owner data
After all, I think Unreal navmesh feature is very limited. If you want to do anything a little bit complicated, you have to do a lot of cusomization.
Yup π
Like Jumping AI, wall climbing, wall run, flying...you cannot solve any of this with just tweaking the settings which makes me frustrating.
To be fair - flying isn't something like any engine really solves for you
And jumping is pretty much solved for you
flying is someting UE could support without much trouble
both mercuna and kythera supports
and probably many other in house engines also follow similar methods
And those have more than like 3 people working on them
one of these days we'll buy Mercuna out and we'll suddenly support flying π
Hoorayπ€£
Easy way to convince Tim - make next season of Fortnite be flying based.
I think I'll deal with the navlink problem in the future when I'm actually designing my environment π
if we could insert splines (navlinks) into path point arrays it would be awesome
it would require OOP on navpoint classes though but it would make extending pathfinding and following very easy
hit an obstable? slap a spline and make path following comp follow it
wanna fly because player is floating in the air? run eqs around it and modify the current path with a spline
@ocean wren
what do you think?
Found on Mercuna page
kythera also received megagrants
So looking at UAssetUserData - guessing, based on your theory Eren, they made their own that allowed them to just quickly draw on the static mesh
Mieszko has to confirm that, I am not sure what kind of extra "data" that is
That's why I was just talking about your theory
Had no idea what Mercuna was so googled it. I thought this was tongue in cheek but nope its definitely there π Lets make the joke about Epic buying it out into a reality
Keep tweeting Tim about wanting a flying focused Fortnite season.
They have a habit of buying out stuff right after I pay for them, happened with Live++ (now integrated as live coding)
If I pay for it maybe they really will buy it out π
if CPU access for meshes is opt-in in editor yeah
Or another way - become a big UEFN creator and then tweet about how it would be so much cooler if you could have flying AI
The prices aren't indie friendly, unless reasonably well funded, so I won't be buying a license for that π my ape brain missed the indie licensing because its tiny by comparison, but still a hefty amount
there is no other standard way to add extra data to SM without subclassing SMComponent
I was with Vaei's idea that it's probably just sockets on the static mesh
Yeah there would be a 00_l and 00_r socket, 01_l... etc
they dont need userassetdata for it
just blueprint utility class
that loops all SM assets in content folder and adds sockets
I think they spawn at runtime but yeah
userassetdata is a container that'd keep the "data" in shipping build that you can serialize during editor
My world is... enormous, so none of that at runtime for me
sockets get serialized into the mesh class directly, since you cant do the same for your non socket data without engine mods, userdata asset is the way to go
I mean - it was your idea about the asset data π
Don't need to explain to us about mesh sockets
I dont know what kind of data* Mieszko is talking about
I'd love to know more too
I've got an idea
it could be a socket, or just raw FVectors representing relative transforms
@crystal hatch Can you expand a bit on how FN adds that extra data to generate the nav links?
I also thought about this as well.
Maybe they have a secret way of performantly accessing all AssetUserData of a type from a world π
Definitely missing part of this picture
I know π
I literally wrote some code using that interface today π
i found my old code btw https://gist.github.com/intaxwashere/b915daa7c1f27475a55bb9f7990ca2ed
its bad, slow, probably wouldnt work either
but in case if you need it
its also intentionally written badly to achieve proof of concept only
Thanks for that! I think it has the same issue I pointed out before though
which one?
If there's a valid longer path it'll never reach the partial path because it'll never test for it
But again, I haven't tried the other idea, of simply searching towards the goal instead of searching along the path and potentially spawning some nav links there ahead of time just before the AI MoveTo is called
yeah naturally it wont cover that
I think that idea could feasibly work though now that I think about it. You'd just do multiple traces based on how far the goal is and see if there are any navlinks to spawn. Not perfect but doesn't have to be
what kind of isekai is this anyway
the one pratagonist is an average loser in the real world and a hero in another? π
Not a hero π Think KonoSuba
its still on my watchlist
It's the best Isekai on the planet
re:zero still exists
Yeah re:zero is good
if you are into evil mode you can do that trace thing per path node
then if it succeeds run pathfinding from found location
recursively
and sacrifice around 2-3ms at worst case scenario
but it would be "perfect"
Trying to run a big world on a small device so don't think I can afford that
you have up to 10 pathfindings if you have less than 10 AIs pathfinding at once
if you run on a seperate thread
Super high level, because it's been like 10 years already π :
- we have a dedicated asset to configure a collection of links, with nice visualization etc.
- every static mesh can have dedicated user data that points to one or more assets of that type
- at runtime we extract this data and based on it create navlinks, with some additional testing for applicability (in FN you need to care about "things in the way").
just something came to my mind btw, that specific situation seems to be guaranteeing if a valid path prevents you to execute climbing, there will be sharp turns in the path
you can filter the path nodes by calculating their direction to next one
and cut 90% of the operation
@tawdry zephyr π He speakth!
So Eren was accurate - user data
i guess since FN runs on dedicated server it wouldnt matter but, is every static mesh create navlinks runtime? I didnt ever play Fortnite so I might be being a little bit naive here by missing the design of the game π
i was assuming they create the navlinks like how UT4 does, in editor time
Every player buildable thing and all walkable building pieces have these links, and most of them are being built at runtime
Ah, I see, okay
thanks 
Hello, is there any way to get current active task from BTS/BEhhaviorTreeComponent ? Name at least or any reference on that
const UBTNode* GetActiveNode() const;
Do you have an editor tool that helps with generating/visualizing these for the designers then?
this will only provide "instanced" nodes
yeah.
with nice visualization
I'd imagine so
Makes sense. For my project I'm just going... to use sockets... and make something that bakes the socket to user data π Some primitive error checking such as them exceeding the ledge height
Since I don't need to build walls/etc at runtime I can just bake in editor I suppose
tnx
I could also look into doing something like a procedural foliage spawner? That spawns nav links
for managing hot spots, duh! π
In the original FN:StW when AIs attack walls and other building pieces they distribute nicely along the wall, and projectile tossing ones stand at the back, all at the defined locations. Hot spots are essentially "attack locations" but the thing has been built with more uses in mind. There are bits of that in AIModule, but the actual implementation is in FN.
I only found out about it 'cause I was exploring the AI System section in the project settings.
Oh dang - and while looking at AISystem.cpp I have learned that there is a static delegate that gets called whenever a pawn is spawned π€
Errr - when begin play is called on the pawn that is.
I always say that code is the best documentation π
Sure - but some C++ code is awfully weird and hard to follow lol
Interesting. I'm doing something similar for AI attacking something - they circle the target
Best
Only
Hi! I have a question about EQS generator dot test. I have set the EnvQuery context to the player and trying to obtain the rotation, but with no success. Anyone knows what could be the issue?
Is this done by predefined points on the walls ? or generated via the nav system?
the points are actually defined similarly to the navlink approach I described - there are assets containing information in relation to the mesh, and at runtime the "slots" are created dynamically.
I mean that's the way it worked when I implemented it way back when π FN:StW definitely shipped with that, not sure if it ever got changed.
yo any good places to start making AI?
would you mind elaborating?
Is there a way to load namesh data from an asset into a dynamic navmesh ?
Basically trying to optimize our map generation system. Each building set should have its own namesh data but I could never get it working using NsvMeshChunk
NavMeshChunks is the only "load a piece of navmesh and stitch it to the rest" thing we have.
Hey! How do I ensure that AI MoveTo always rotates the character in the same direction? Sometimes the character rotates around in a huge arc which isnt necessary when its already facing the direction of where it's moving to.
Basically when AI moving I want the character to always use the smallest rotation possible, how do I do that?
There is a rotation rate setting in the CMC. You might need to disable use controller yaw in the pawn settings
Hi, may I ask how I can run EQS in a state tree?
For example right now the return value how can I select a position or actor depending on what I want?
And is there a way to switch an AI between Mass AI and either a State Tree or Behaviour Tree?
I also notice that adding a condition to a selector in a BT doesn't do anything. Even when it evaluates to false, the leaf nodes still run.
probably because its right after the root node
add another selector between root and yours
Hi
Thanks I'll try
Huh, that works. Thanks.
i think the BT jumps right into the first selector, without evaluating any decorators/conditions
I see
You need a simple composite node right after the root afaik, so your tree doesnβt just get stuck on root
You can run services on it tho iirc
The ROOT is just a dummy node, editor-time-only, just so that there's a convenient way to indicate which BB is being used. The first node after it is the actual runtime Root (that's why I always name it that) and the execution starts from there. No conditions are being checked on the real root node. Services do work (by design, if not let me know).
If you want navigation at runtime over a map and you don't want it to lag hugely as that happens, aside from using navigation invokers, how can you do that?
you can use static navmesh, or configure the dynamic navmesh so that it doesn't get discarded on map load (needs coding I believe). If your map is procedural then that will involve a lot more work.
No they are static maps, it's just got items in it that can moved around (barrels etc) that are likely to affect the navigation
depending on the nature of the movable things you might get away with "modifiers only". So it's that or use dynamic and look for "how not to discard dynamic navmesh at game start". It's been discussed a couple of times already IIRC
yeah, sure π
If I Recall Correctly
Hmm, doesn't sound enough. You'd need to sweep a capsule along the spline to really see if its traversable. That's how the Havok guys did it (Ben Sunshine-Hill did a great presentation on their capsule sweeping shenanigans).
why nothing is easy 
If it was, everyone would be doing it π
You're inspirational as always π
Maybe someday we'll make it easier.. but until then, at least you have a job π
I mean, its not outside the realms of reason that behaviour specification might be automated in the near future
It came to a point nothing surprises anyone when it comes to automating stuff
There's a lot of potential for making game dev a lot easier
and creative work in general
I'm of the view that co-creative stuff will be pretty popular very soon as the tools become more capable
Been reviewing some papers for AIIDE and there's some very nice work going on
Copilot writes my 1/3 of the code these days and it already assimilated me
I've only used it for python π
Hey at least you can get away writing code for something you dislike π
I'm writing a bid for some funding for some more voice-control data viz stuff for unreal right now
using large language models and having them control an API is pretty on point.. Unreal won't be able to avoid it π
I noticed absence of our lord and saviour too even though I was just here for a few hours since a few weeks
I recommend taking a break from Slackers to every regular in here π
intoxicating
it actually makes you more productive, not saying to shitpost
To be fair - that's how I've always treated it. I'm mostly here during work hours when I'm waiting for stuff to compile or blocked by something. Or when I'm just chillin'.
Ever notice how I like never interact on the weekends?
I learn a lot by interacting and I know SFA rn, so thatβs why Iβm around a lot π . Also dead-end job with no escape rn
Hey guys can you please recommend some good guides/books (except pins) about AI in UE (preferably c++ based) in particular, cause I have a Junior AI programmer interview scheduled soon and I have not worked with AI before.
And looking into AI-related engine classes it doesnt seem to me "big" enough to separate the topic to position. Is it really so different from "Gameplay programmer"?
There's no easy way to make BTService listen for AI messages like BTTasks do is there? I mean I looked into the source code and it seems BTComponent has some special structs to hold BTTasks references and stuff but I believe that could also be used for any UBTNode
There really isn't much out there for C++ based. But there are a few resources pinned.
It's good to see someone is getting paid well to do some work @ Unreal.... I wish there were a thankyou emoji i could send :/
https://docs.unrealengine.com/4.26/en-US/API/Runtime/AIModule/Perception/IAISightTargetInterface/
As far as I can tell it is just gameplay programming, but also likely includes knowledge of AI specific tools such as behaviour trees
@crystal hatch actually, if I PR this node itself into the engine, think it will be accepted (assuming I do it exact way they want, which I'm sure I will)?
Edit: Or better yet, maybe just change the AI MoveTo node itself because all I'm doing is exposing parameters that the move request takes that weren't available, maybe you know why it wasn't done by Epic?
Only thing I'm not sure is what to name the node, ideally the original should become AI MoveTo Simple but don't want to mess with that
what could they do in worse case scenario - reject it?
Isn't about worse case scenarios, just wondering if its worth doing in the first place
i chimed in on the last second of you posting - didnt even read the log you have going..... I do know how LIMITED AI::MoveTo() is - you almost 100% have to make your own task.....
In my own experience in application development the choice to its "worth" is yours alone to make
Maybe I don't need to add a new node, maybe I can just expose those parameters to theirs, I don't see any downside or reason they're missing to begin with, but maybe there is a reason I've missed
if its beneficial - which i'm sure anythign outside of UE's default implementation of that funct is... i'm certain its far better than the state its currently in
The choice is, if there is a good chance it will be accepted, then its worth doing, which the person I @ will have a much better idea of, I'm not here to debate philosophy π
i'm not trying to hold a debate with you -t rust me i'm on your side in teh matter.
theres tons of things UE that i'd wish were different
I haven't had to code my own MoveTo node yet (not counting my side scroller!)
Check the top-most pin, you can just fork my repo
No need. Built in works for me.
If you do, I mean π
I probably wouldn't even if I needed to, because if I needed to, I'd be doing something else entirely.
I'm fortunate enough that most of my games work within UE's framework quite well π
Fair enough. All I did was expose parameters that aren't exposed, it doesn't really do anything different, just allowing the option, I'm still unsure why Epic didn't do it to begin with
The main one I wanted is bAllowPartialPaths and @gritty glen also needed FilterClass so I just exposed everything that the move request has a parameter for that wasn't exposed
Hopefully MieszkoZ knows why Epic didn't expose them in the first place, then I'll determine if I should PR the entire new node or only expose the extra parameters
It is interesting, considering Move to Location has all of those
currently running into some issues with RVO Avoidance and Detour Crowd AI Controller. Right now my AI character has completely custom locomotion logic (separate from Character Movement) completely using Root Motion animations. In the avoidance example on the Unreal docs, they are using the Move To node in AI Controller along with RVO Avoidance and the Detour Crowd AI Controller. I am not using character movement, but rather creating a path to a location synchronously and using a direction vector pointing my character to go straight there.
Is there any information from RVO or the crowd following component I can use to affect my direction vector? Should I be using character movement using Move To if I want to do this? Any help would be appreciated
for the record this is what I am referring to.
Are these irrespective to character movement? Will this add character movement sliding to my characters if I have these enabled?
There is a course on the learning site called AI with BP. That will go over most of the systems. Then you can dig through the code.
You should not use detour with RVO. It's either one. Detour adjusts the path to avoid objects, so you'd need to override some functionality to use it without the movement component.
How do you determine whether detour or RVO is more suitable? I'm new to avoidance in general. Is either of them better at handling the situation with two actors crossing paths both trying to move out of the other's way but because they don't communicate they endlessly move into each other's way? π
Literally trying to work this out myself
as far as I can tell the Detour Crowd AI Controller is literally just the AI Controller but casting the Path Following Component to the Crowd Following Component, is there any information I can gather from that?
like how I can recalculate my direction vector to determine to move away from other enemies, since I'm not using the Move To node
which typically would do that for me
You should use the move to node and override functionality in the crowd path following component. I don't remember which function it is, since it's different than the default path following component.
thank you!
I seriously dunno what I'm doing wrong. Using character movement still causes these guys to all bump into each other. Using pawn control rotation makes no difference. is there a typical simple algorithm I can use to recalculate my direction vector or something? One thing i was thinking of doing was doing a line trace to the location I want my AI to move to, then if it hits another enemy, just get the right of that vector and strafe around it until the line trace doesn't hit anything, but probably not the best solution
It looks like most of the crowd following component functions aren't meant to be used outside of the class despite the fact that they're publicly exposed, most of them have no comments or documentation (the Unreal documentation also has nothing) seriously at a loss lol. pullin my hair out over here
at the very least if it could give me all the overlapping agents that (probably) would help me but it looks like that's all handled by the Crowd manager
Are you using the crowd following component? Why are you trying to use the functions outside of the class?
You need to give more information on what you are actually doing, instead of saying that it doesn't work. Have you tried debugging it with break points and/or the visual logger instead of guessing (control rotation has nothing to do with avoidance) or getting frustrated that you want to reinvent the functionality.
I am trying to incorporate the detour crowd AI controller onto my existing AI. the only problem is I'm not using standard character movement, I'm using purely root motion animations
I am creating a custom controller which casts the path following component to a crowd following component just like the detour crowd AI controller. My custom locomotion logic creates a direction vector from the main character's position to the location it is trying to move to and uses that to drive the movement. I am trying to extract any information I can out of the crowd following component to see if I can somehow influence my direction vector just like the way they're doing in their code. But ultimately this whole thing would probably be easier if I got rid of all that custom locomotion logic and just used the move to node like the example project on the unreal forum.
I am trying to use the move to nodes and they work but my character slides along the ground because it wasn't set up to respond to character movement. That's a separate thing to refactor for my animation blueprint
My characters spawn in on a random point inside of a circle. They walk to random points in the circle, stop, wait a few seconds, then move. Unfortunately using Move To at the moment doesn't solve this, they still just slide into each other. Is the main Detour AI controller set up differently? I'm seriously unsure as to why I can't derive from it, the only code I see is a constructor which casts the path following component to a crowd following component
Idk I'm prolly overcomplicatin this this is causing me more stress than it's worth and probably nowhere near as hard as I'm making out to be
It doesn't cast to the crowd following component. It sets the class to be the crowd following component instead of the default.
You need to use the move to logic, because it MUST use the path following component to follow the path. What you need to override (in your own crowd following component) is sending the information to your locomotion functionality instead of the movement component.
I will just make my AI detect "am I touching another AI", and then on update "well, I've been touching them for too long so I'm going to stop" which will put them back to "idle" before going to their next waypoint. I'll randomize what counts as "too long" on the initial detection so usually only one of them stops, and sometimes both stop π That will work for patrolling and for combat, well, I'll wait until I have an issue then fix it a similar way. Maybe I'll just randomize a "priority" for each bot, if it happens to be == they can both re-randomize. Lower priority maintains their pathing, higher priority changes.
Such simple solutions don't work for a lot of games tho π¦
Is it possible to use EQS with StateTree?
not sure where to post it, we have a problem with rebuilding navmesh, really huge map, rebuilding crashes engine because not enough vram (24gb vram 4090), any ideads what can we do?
Buy A6000's for your build machine?
or I guess RTX 8000 or whatever the equivalent is
Any reason you can't do dynamic navmesh with invokers instead? That's what I'm doing for my really huge map π
I never had a crash in the first place but I also never tried to build a static one
it's still better for performence to build it rather than use invokers
Ah yeah it would be. Sorry I can't be of any help π
nah its okay, its still some advice, we are thinking about that but would like to find a solution to current problem if possible, if not then we will buy some quadro or go with invokers
How are you building it and are you using world partition or world composition?
Anyone know best way to get the Nav Mesh to generate within this vent ?
Vent is using complex collision but as you see no generation of Nav mesh inside ?
Might not be big enough
isn't there something in settings that you can change for it to accept it ? like allow AI to move in there ?
Not sure
fair enough
Can the AI fit in there? If you change the settings to fit in a small space like that will change it for the entire nav mesh. If the settings are smaller than your character, that will cause issues navigating around.
I'd recommend nav links instead, especially if they have to do special animation to fit in there.
?
well I was hoping that I could have certain AI only navigate through the vents, I was going to use a modifier to help with that
issue I'm getting is no matter how I chage the nav stuff to allow Navigation to gereate in their it just isn't wanting to generate I've made vent bigger and it still won't generate in there
That doesn't change what I said.
Not sure what you mean can it fit in there, I would be making one that will fit ?
or am I not fully getting something here?
Looking at an AI Size of about 0.293794 m
Hello ppl, is there any way to simple enable/disable nav link component? I have nav link component as part of my Door blueprint and want on open to enable navlink, and on close to disable ?
How are we supposed to know if you are going to have a really small AI that fits in there or if you are going to do something with animation to make them fit?
You can have multiple agent settings in the project settings. This creates multiple nav meshes, which can cause memory problems. But a few of them isn't a big problem from my experience.
Something that small might also be better as Niagara and using boids.
Are you using smart link or point link? Point links you change the nav area. Smart links have a function to disable.
apologise thought with a vent and the picture a small AI would have been a given
Regular Nav Link Component, added in blueprint, there is no smart links. How to change nav area, that is first what I tried but can't access to anv area to se
also making the vents bigger in both height and width it's still not really wanting to generate in there but when moving the collision on the mesh it's building nav each time so must be doing something
just isn't show visiable green thing that nav mesh has generated there
I tried clear for links but nothing happend, maybe should call some nav mesh regen? but that also not optimal for performance
you have any links to where I could get more info on this ?
Info on which part?
the multiple agents bit
Go to the navigation settings in the project settings. You'll see an array called supported agents.
arr yes, I looked at that slightly weren't sure on it
So what would this allow me to do this adding a supported Agent ?
If you are BP only, it might not be accessible. You can try to deactivate the component. If not, you could switch to a smart link that has more BP functionality.
You set up the agent settings for your different AI sizes. I would highly recommend grouping them together into categories like small, medium and large. Then you set the settings to fit those AI sizes. It's really not that hard.
ok, tnx
arrr right okay
not working
Still does not like this venting, I'm starting to think it's not generating issue, but maybe something else
Now I'm just confused like why have i got pink showing when the vents close to floor of the where the green is
When I lower this to the floor it blocks navigation which i would expect
any ideas here cause I'm quite confused whats happening here
Pink means low height for your configured Agent. No color means it's too low for the Agent height (or the agent height is too high), so it won't allow the navigation mesh to be built below the Object
You should be able to change these settings on the recast navmesh actor if I remember correctly.. But you should also be able to completly remove the Actor from influencing the NavMeshGeneration.. Might be easier
so found how it was doing the pink thing, makes sense what you said
my major issue which is driving me round bend is the follow
The white vent is on for player to crouch through and literally just that height will about generate nav mesh
the silver is the vent which actually I want only small AI to go through but no matter what settings I change it simply won't generate nav mesh in there @tender chasm
world partition
and crash is durin using building paths
How are you building paths?
What is the size of the opening and what is the agent property settings?
Is that the entire size or the size of the opening?
That information is useless. I asked for the size of the opening and what the agent settings are.
No. The supported agent settings in the navigation settings, not the nav mesh settings.
it wasn't working so I deleted the custom one
Just re-created a supporting agent
it's gonna be default settings obvs but what I changed was the radius and height and still wasn't wanting to work
unless I missed something
I need to go but will return later to hopefully getting it to work π
Your supported agent settings needs to be smaller than 1/2 the size of the opening plus a buffer. Keep reducing the agent settings.
If the size you gave is correct, the radius has to be < 50 and half height < 98. However with the pictures you showed, it looks a lot smaller than the dimensions you gave.
The silver vent or white one ?
White one is actually bigger them 1m, planning can stand up in it where as one I just made is just over 1 meter both width and height
Also, would I need another nav bounds volume for this other supported agent I've created ?
No you don't need another bounds volume.
You are making it far more difficult by bouncing between different size of openings. Pick one and then find the settings that work.
That's what I tried to do with the vent
But it wouldn't accept anything I pit in to generate the nav mesh.
Hopefully with this new vent being just over 1m wide and high it will actually work
Will the player actually see the AI travelling through the vents btw?
So I changed it to yeah as they can also be used by player
This is the new vent versions I'm making
In the previous version you would have seen the ai still just only at points where it goes over a opening
as i said, with button build paths
Are you following the world partition navigation documentation? https://docs.unrealengine.com/5.2/en-US/world-partitioned-navigation-mesh/
why does my ai move just fail
Is there a nav mesh ?
And can it get to were it's going
The ai move to won't bother moving AI if path failed
Use the AI debugger and vislog to troubleshoot
If it wasnβt the missing navmesh
Thanks ill try that rn
why arent they allowed in there?
they are made out of static meshes btw
like just cubes
its fixed if i put them on "overlap all" but i need them to block the bullets
Why isnβt what allowed where?
sorry that was really vague
my enemies that have the code for ai arent allowed in the navmeshboundsvolume
but its because of their collision
is there any way to like
whitelist it? or anything?
Are you talking about the holes in the navmesh ?
yes
Go to their mesh settings, turn off can ever affect navigation
Same for capsule or other components if needed
and this part shouldnt affect it
Troubleshoot. Is your AIMoveTo failing?
the roam is working, but its not suceeding
and it only detects the player as soon as the game starts, so if i start the game behind them and move forward it doesnt detect me
same thing wit the retriggarable delay
Might be better to use EQS with the built-in perceived actors generator
im gonna look that up hold on
This is driving me round bend Nav still won't generate inside the vent only on top of it
Vent opening, literally big enough to fit player croached easily so relly can't get why with the agent settings applied why nav can't generate inside of it
actually scratch that with a build all levels
it's working but I now have two nav mesh it seems
okay so another build all levels get rid of the double nav mesh green thing
Thanks, didint see that. Will check it!
awsome so I did this
two supported agents the default and another with altered radius and height, however in the world it's only showing the Nav Generated for the Defualt one and not the Low one as well, is there setting somewhere I have missed?
so it only seems to like one supported Agent if I include the other it just doesn't generate
Get rid of the defualt on supporting agent and it uses the other one there
now I can keep this but need a way to ensure the AI when it should uses the Vent to traverse and not the hallway, currently theres a modifier there making that area different cost etc to the purply one
Does it not generate or does it not debug draw?
so without it drawing it I weren't able to actually see if it was generating it, I was taking the drawing as what it is generating
I could be wrong there though
You are wrong. You need to enable drawing on the recast actor that is generated.
Now I have put the other supported agent back I lose the draw for the Low one and have neither one or other or both
I have two recast obvs and both are set for drawing etc so not 100% on this one
Apologies so with drawing back on all I see is the Low Recast and not the default one ?
Okay so fair enough ever knew it defaulted to off when drawing
Is it possible to make a combat artificial intelligence that learns from combat and improves?
Possible, yes. Should you do it? Probably not
Why shouldn't I?
Good AI is not smart, it just has the semblance of being smart. Players donβt have fun when theyβre getting wrecked by an AI thatβs learned all their tricks
The Last of Us had to dumb down their AI because it would just flank the player and absolutely destroy them, and people hated it
Itβs ok to make it seem like itβs learning, but no one wants to sit there playing chess against Deep Blue in your game
Thanks you!
Maybe "learns from combat and improves" could means "improves the fun of the player." You could make AI that adapts to the way the player fights to make it more engaging and fun. If they like doing a certain type of combat, the AI could pre-empt that and set up the scenario to be more fun for them.
The player likes using explosives? Cluster the AI near funny explosion points so they go flying in cool ways/interacting with interesting set pieces.
Or, line them up and run out into the line of fire of the player if they like CQB with automatic weapons.
Or, if the player likes being a sniper, prepare to engage them at a longer distance and give them a challenge but a fun scenario.
Yeah, that would be fun for sure
Thank you very much to all
So this doesn't seem to be working
when playing the AI never moves to the vector thats been passed out
even if I flip the + inputs AI still seems to not want to move
Keeps telling me this as well, NavMesh needs to be rebuilt which I've done
could this be something to do with I have two recast and it not knowing which to use
Are you projecting that vector onto the navmesh?
I did try try to find that but couldn't find the function
I know is something like project ...
I don't use blueprint for it but this is my C++
if (NavSys->ProjectPointToNavigation(CurrentWaypoint.GetLocation(), ResultLocation, NAV_EXTENTS, NavData))
{
CurrentWaypoint.SetLocation(ResultLocation.Location);
}
else
{
// We have utterly failed to resolve this waypoint, or there is no valid nav mesh at all
bLastWaypointWasUnreachable = true;
bWaypointUnreachable = true;
}
(The commented part might be a bit misleading since its part of much more elaborate logic so ignore that)
Did you debug the values? Print if it fails, draw the debug location, etc
You'll want to step through the engine code with a debugger and see where its failing
I've done random point to debug if it's my code or something else which is must be
it should work with that though
it's the function UE gives you
Yeah, it should do, unless there is no navmesh there
well I have Nav mesh there but because I am seperating my AI so one can go through a vent there is two recast
one for normal sized AI and another one for the smaller AI
do I need to pass in the recast it needs to use or ?
You'll need to pass the nav data for that navmesh I suspect, but I haven't dealt with multiple so I'm not 100% that's it
If you give nullptr it does
if (NavData == nullptr)
{
NavData = MainNavData;
}
I'm suspecting its not the MainNavData that is responsible there
I'm trying to select it but it doesn't let me
There are functions like this, not sure what BP equivalents are there (these functions are part of the UNavigationSystemV1 class)
This is how I get a reference to my navdata but I don't access a secondary navmesh
UNavigationSystemV1* NavSys = FNavigationSystem::GetCurrent<UNavigationSystemV1>(GetWorld());
ANavigationData* NavData = NavSys->GetDefaultNavDataInstance(FNavigationSystem::DontCreate);
So long as you have something to pass to the NavSys, you can get the NavSys that way and have it return the correct NavData
but I'm not doing any of this in C++
my AI stuff so balckboard are all BP
just because I'm not good enough yet to do C++ for this bit π
Like it's got a random point but never sees it as succesful
it does keep telling me the NavMesh needs to be rebuilt
anyone help with this becuse it's driving me round the bend, I literally can't find whats wrong but this all started roughly after messing with adding another nav thing that only smaller AI can use
even doing default character based BP and AIC BP based on defualt AIC it simply just can't find valid vector on nav mesh
There is literally generated Nav mesh there like how is it failing to grab a location on it
So I have noticed this, Its getting the exact location of the actor every time which is why it's failing which leads me to believe it must be something with the Nav Mesh which is messed up, It does say NavMesh needs to be rebuilt as you'll see in video. I've rebuilt nav mesh multiple times but constatly says same think
is there anyone who can help cause this issue is really causing me pain
literally worked up to point of trying to implement another supported agent and now everythings broke
Use the visual logger to debug. https://docs.unrealengine.com/4.27/en-US/TestingAndOptimization/VisualLogger/
Shadow mode in Killer Instinct did this years ago. There's a GDC talk on it.
Metal Gear Solid 5 has adaptive AI, such as AIs spawn with helmets if the player does enough headshots.
Then you have left 4 dead's AI director that adjusts the game based on player behavior.
At the end of the day, we are creating player experiences and not real AI. Most advanced game AI topics are about balancing believable AI, difficulty and performance.
will do, I did get it working some how but then after going through some stuff it now don't want to work again haha
Keep at it, thatβs programming. You make something, it doesnβt work, you fix it, you change something else, it breaks.
do overlapping nav area modifiers have any concept of priority?
I'm doing a quick test in the editor now and it looks like Null has advantage but I remember running into the issue a while ago where the last updated one would take precedence
sure, just no need to think about it in terms of machine learning, but rather clearly understandable mechanisms for the player
I am working with state trees and I was wondering if, when we're executing a task on a child state, the parent state is also active and therefore their tasks also execute π
I think that is intended
They are more like scopes I suppose where every scope can still abort all children by succeeding or failing. Well that's how it seems to work anyway.
hey, does anyone know how to set the initial values for blackboard?
are they always zero initialized?
you can create your BB component before running the tree which will give you a chance to set valued before the first BT run. Call AIController.UseBlackboard (also available in BP) and after that call you can access the BB component
Yo ai peeps how do you guys decide what type of framework you use for an ai e.g bt utility goap blah blah blah
Figure out the pros and cons of each (I made a table for easy reference) then pick the best one based on the needs of the game and the team.
is it cool to paste it in here? like a screenshot of it
No. This talk is a good place to start:
https://www.gdcvault.com/play/1024224/Flame-Retardant-AI-Stopping-AI
rah xD
why no
I work at a studio and what I do on company time is owned by the studio.
Also you really need to understand the different architectures to make a decision.
fair enough
thought you was just being a bit weird about it
@uneven cloud fully appreciate the link , suuuuper helpful
Great link, thanks, now I want to learn other AI tools π
There are a ton of good AI talks in the GDC vault and on the GDC yt page. The vault has more videos, but is harder to navigate IMO.
99% of my theoretical AI knowledge comes from a combination of "AI Game Programming Wisdom" book series, "Game AI Pro" book series and GDC AI talks witch a dash of AI-related parts of "Game Programming Gems" book series.
TIL we can brute-force change the execution of the BTs
Hey guys, the purple thing is my NavMesh, anyone knows why there's this path which I can't seem to include in the Navigation? Even the top of the tank has it but not the path
It seems to be only this specific landscape which has these weird paths
sorry where do I do that?
check which shortcut is assigned to open console from editor settings
in EN keyboard it should be tilde
is it not displaying any collision boxes in the map?
shows me same as before, these collisions are blocking volumes
Oh here
So I see these unclear lines, do you know how to fix that?
yeah its the collision display
doesnt seem any collision blocking the path
I was betting on some weird collision setup since you said its happening on a specific landscape
it might be
I searched online and people said to check βfill collision under landscape for navmeshβ, do you know where that is?
its in the scene components that you put to actors
doesn't that mean that the navmesh itself wont change?
the navmesh will change, because you'll (hopefully) remove the collision
and then it will generate walkable polys on the path
okay so kinda basic question, how do I move my ai to one specific place in the world, cus I thought that was what the world direction input was in the add movement input node
apparantely not
AI doesn't use AddMovementInput because they don't have an input device. use the move to nodes
I've got a question related to BB and BT. I made a fairly complex but solid AI for my first enemy. It' a swordsman, which basically it'll just go to the player and try to hit him. Now, if the enemy isn't seeing the player, [they'll just patrol and do their stuff].
Right now, I want to make a new enemy, which is an archer. The blackboard should be fairly similar, but the behaviour tree will be similar in, let's say, just a 30%.
In this scenario, what would be the best way workflow? In my last project I've been duplicating the BB and the BT and that worked fine, but I would like to know if there's a more efficient way to work with multiple enemies.
Something to consider is that all enemies are going to be humanoid and all the AIControllers are going to be children from the same class.
Just make a new one ?
I just have an ai controller class that has the BT and BB as an input exposed in blueprints
It isnβt worth tweaking your current one to fit the archer
If you have behaviour that is generic enough you can turn that into its own BT and call the Run Behavior node whenever you want to execute, for example, a Ranged Attack Behavior. All variables that can be used by all AI could then live in a parent BB, and then make children BBs that have AI specific variables.
I would counter that it isnβt worth writing the melee attack behavior multiple times for multiple AI. It also means if you update that behavior you only have to update it once. This is akin to turning repeated lines of code into a function.
If you have two independent BTs that would be my definition of writing it twice. Writing is probably a bad verbβI should have said creating.
yeh id have to disagree.. dont think that rule extends here
Hey guys, any idea why EQS doesn't come outta beta mode ? it still says not recommended to ship projects with
but yeh its w.e
then how would one implement an AI that reacts to surrounding sounds without eqs for example ?
Itβs because the front end isnβt up to Epicβs quality bar yet. Functionally it has been used in many games so consider it effectively out of beta.
wdym the front end ?
The UI IIRC
on the doc it says not recommended though, by UI you mean the debug system they provide with it which you can see on screen ?
thx a bunch, kinda got it.
Thatβs from one of the developers. So feel safe in using it π
Thanks for your answers, @lyric flint and @trim berry.
I think I know how to proceed.
Not "one" of the developers. It is the developer π€£
Long may he reign
lool
Mieszko is the one we praise (and curse β) for the AI tools. BTs, EQS, AIController, debugger, Mass, etc...
He has help finally though π
Hello, I'd like to ask you for some help, I've been having some trouble with my AI in my Tower Defense project, it would be really simple, it's just supposed to follow a path created by target points, I followed a tutorial for this because I'm fairly new to unreal engine. The problem is that the character only turns left, but not right, I tried to check everything but I have absolutely any idea what the problem might be. I'll link the video I followed. I'd really appreciate some help.
https://www.youtube.com/watch?v=SfnvbzfGZnE&t=1s
Hello everyone. This is a quick Tutorial, how to create a simple NPC System.
I used the Version 4.27.2 of the Unreal Engine for this one.
Discord: https://discord.gg/exuHzHjahe
Level: https://www.unrealengine.com/marketplace/en-US/product/modular-houses
State Machine: https://youtu.be/u4avH99F6FA
Animations: https://www.mixamo.com/#/?page=1&ty...
If youβre following a tutorial and itβs working for them but not for you, watch it again, you probably missed something.
Well, I already did, but Iβll give it another go tomorrow.
Hello, I am copying a pathway system with splines for an AI to move, but I don't know why my AI doesn't recognize where it has to go, I've been trying to see for many hours but I have everything exactly the same as the other system that does work for it
Can someone tell me what could be causing this problem?
Thank you
Do you have more details? Like AI doesn't execute BT at all or something wrong within BTs?
I'm forcing that part of the BT to run
Now I discovered another problem and that is that when I update the behavior it does not change the enum in the BT
You probably need to check if the location set to BB is right or not, then nail down the problem to your character movement or something.
Add break point in your BTs task nodes or watching the BB value for the location is the really one of your spline or not?
Basically, if you are not able to set the correct value for BB, it would be an invalid vector value at all.
I just checked the coordinate that the spline gives me and it is correct
Positions it right at the beginning of the spline
So the problem is your character is not moving?
sure, my character doesn't move towards the spline
The movement in general of the AI works, I have another state that is to follow my character, and that executes it correctly
Done, I was able to solve it, I was just missing a connection in Ai Move To
The pawn exec
Sometimes talking about the problem makes me solve it faster, I realized very quickly where the problem was when you asked me this question
I don't know why that happens to me hahaha, sorry for the wasted time
Did you forget to hook the pawn pin to the AI MoveTo task?
Even input the AI pawn, doesn't work?
This works now
Still have any other issues now?π
hmm actually yes, but it's not a problem, it's a question
My AI when I quickly pass through a wall, it gets stuck with the wall since it can't go through it, I would like it to realize that it has a target in front of it and try to cross in another way, is there any way to do this? Maybe a tutorial or documentation can help me
I can record this if you dont understand me
My english is so bad
It's okay. I think I can understand it. Do you have any logic built in BTs that how it supposed to do if realized the target?
For how to set the target, I suggest using AI perception component.
So how could AI stuck? Did you make it chasing players?
The problem is that the AI tries to break through the walls
Ok, I think the problem is why the wall object doesn't be exclusive from the navmesh.
Did you rebuild the navmesh though?
Yeah, try it.
Hmm same problem
But you can see the navmesh is not correct in your map. Some places has wholes but it has nothing there.
You may check your mesh collision settings that have "CanEvenAffactNavigation" checked.
Just so we're clear, I'm the one to curse about the UE4-era AI tools (that we still use/maintain/develop) and Mass (mostly) π . State Trees are Mikko, and I only kicked off Smart Objects that were taken over by another dev since.
Si
Isn't Mikko also working on a new pathfinding thing?
Not MassZone but something else
not at the moment. But he did put together some awesome prototypes that we're sure to pick up at some point
What I like about the UE AI tools is that I watch a bunch of GDC talks about AI, over the course of months, then when I get to UE I find all the cool stuff already there it's like... u can just sit down and play with enterprise tools. So thanks.
I would get excited by some AI devs getting excited about like BT, or whatever... (yes, these are old GDC talks lmao)... and I see UE not only has these tools, but is building the next gen tools that people are rumblign about too at GDC.
hello all. ive noticed some of the default engine decorators do not have Observer Aborts options. (for example Gameplay Tag Condition). am i missing something here? must i recreate the decorator myself to add this functionality?
That was a good watch. It did a good job of justifying my use of FSM over BT, not that it came from a place of experience π€£
The chart is useful
what are you talking about, Bulletstorm was awesome π
indeed it was!!!
My big naive UE5 AI wishlist is:
- mobile navmesh (e.g. on a ship)
- a more "moddable" EQS
- automatic traversal navlink placement
mobile navmesh (e.g. on a ship)
oh man, this has been on my todo list ever since 4.2 π We just never had an internal need for it so I wasn't able to spend time on it.
The strategy is the usual. Convince Tim to do a Season of Fortnite on a moving ship with waves of enemies.
Crossover with Sea of Thieves π
<@&213101288538374145> this is a great source, can we please pin it?

Np son
just buy Kythera with fortnite money, easy
nah, we just want more nav, we can handle everything else π
(we have too much fun building it π )
lol I can relate, every time I see a well-built marketplace plugin my reactions are 1. wow neat 2. but what would I do?
The navigation features are included in Havok, so I doubt there is a large push from bigger studios.
The EQS is very moddable in C++.
Where should I look for modifications in terms of stuff that isn't obvious from the editor? Item types?
It depends on what you are trying to do
Maybe I'm approaching my problem badly but I would like contexts to be less static (right now it's a subclass of) - e.g. a context along the lines of "get <thing> with <gameplay tag> from my collection" where I can pass the gameplay tag in as a data binding
that was one of the nice features of kythera but their domain specific language was pita to work with
in UE I guess bindings happens through run EQS node in BT but its not extensive
What is the problem that you are trying to solve?
my targeting layer can reason about multiple types of targets at the same time and I don't want to have a duplicate context class and query for each case
Why not make it a test instead of a context?
Then I'd be hardcoding the target type per test? But I'm not asking for help, I am simply pointing out that EQS is not as data driven from the querier's side as much as I'd like, you said it's very moddable from the C++ side so I asked for some avenues that I might be missing.
So Havok+UE is a very popular combination? interesting
BTs would have to implement property extension module like how animation system and statetree does but it doesnt so you're not missing anything
its not scriptable/moddable easily
there are simple structurse to allow bindings but they dont go beyond simple data bindings from node to eqs instance
@crystal hatch is there any news on NavigationSystem V2? π
i mean they went and changed everything to V1 years ago
I did that π And I did have a V2 prototype ready! But then we hired more people, and more projects happened, and priorities shifted, and... you get the picture π I recently started again calling out a need for a nav system rewrite, and it's a consensus that indeed we do need that, but we don't have enough people to work on it (AI team is spread really thin right now).
ah yeah makes sense, what was the plan for V2?
just more optimized, cleaner code? or new features. One of the biggest issues i see with navmesh and the navigation system as a whole is the generation cost, not being able to easily implement navmesh chunks from a UNavMeshChunk (i could never get it working)
in short, support for a "limitless" number of independent navigation data instances of different types (navmesh, nav grapshs, flowfield, etc) with a hierarchical graph of them supporting seamless pathfinding and transition between any of them.
it was to make us ready for huge open worlds. I guess I saw the future π
hah nice
see i tried to do chunking
with our prefab system
{
PrefabAsset->SerializedNavmesh.Empty();
for( int32 Idx = 0; Idx < NavChuckActor->NavDataChunks.Num(); ++Idx )
{
FNavDataSerialized& Data = PrefabAsset->SerializedNavmesh.Emplace_GetRef();
FObjectWriter(NavChuckActor->NavDataChunks[Idx], Data.Bytes);
Data.NavName = NavChuckActor->NavDataChunks[Idx]->NavigationDataName;
}
}```
if (APrefabNavChuckActor* NavChuckActor = Cast<APrefabNavChuckActor>(ChildActor))
{
NavChuckActor->NavDataChunks.Empty();
for( int32 Idx = 0; Idx < PrefabAsset->SerializedNavmesh.Num(); ++Idx )
{
URecastNavMeshDataChunk* Chunk = NewObject<URecastNavMeshDataChunk>(ChildActor);
FObjectReader(Chunk, PrefabAsset->SerializedNavmesh[Idx].Bytes);
Chunk->NavigationDataName = PrefabAsset->SerializedNavmesh[Idx].NavName;
for (FRecastTileData& Data : Chunk->GetMutableTiles())
{
dtMeshHeader* Header = (dtMeshHeader*)Data.TileRawData->RawData;
Data.TileCacheDataSize = 0;
if (Data.TileCacheRawData.IsValid())
{
Data.TileCacheRawData->RawData = nullptr;
}
}
NavChuckActor->NavDataChunks.Add(Chunk);
}
}```
but i never could get it to work
yeah, I never got navmesh chunks either π Someone else worked on that π
all i wanted to do was save the navmesh in our prefab level
and inject it into our generated level to save on calculation costs
cause i lock the navmesh, and only release once the level has been created
everything is in blocks and defined sizes, so it shouldn't have caused much issue
on older platforms (ps4/xbox one), this is one of our biggest costs π¦
the main issue i found with chunks is it only works for static, not even dynamic with modifiers
sounds like it should work [edit: it being the code you posted]. One of the changes I did when FN started using AI was to not discard the serialized navmesh, block regen on load, and once load was done reset the accumulated "navigation dirty areas". And then made random POIs dirty navmesh, for good measure. Saved shitloads of time on load.
how do you stop it discarding the serialized navmesh?
cause i already block the generation, and flush the dirtyareacontroller
that one I believe is based on a flag in nav data instance, or nav system. Give me a sec.
this is what i do
* setting bForceRebuildOnLoad to false can override this behavior */
UPROPERTY(config, EditAnywhere, Category = Runtime)
uint32 bForceRebuildOnLoad : 1;
/** Should this instance auto-destroy when there's no navigation system on
* world when it gets created/loaded */
UPROPERTY(config, EditAnywhere, Category = Runtime)
uint32 bAutoDestroyWhenNoNavigation : 1;
/** If set, navigation data can act as default one in navigation system's queries */
UPROPERTY(config, EditAnywhere, Category = Runtime, AdvancedDisplay)
uint32 bCanBeMainNavData : 1;
/** If set, navigation data will be spawned in persistent level during rebuild if actor doesn't exist */
UPROPERTY(config, VisibleAnywhere, Category = Runtime, AdvancedDisplay)
uint32 bCanSpawnOnRebuild : 1;``` i see the flags
I'm looking at the code right now and it starts getting back to me. In general your code should be enough - with caveats. The main one being that the navmesh will get scratched and rebuilt if the navigation bounds don't match. I suggest you made sure that's not the case in your, well, case π
yeah, i will keep tinkering with it, i mean its def faster than what it used to be
i managed to reduce it by a good third of the generation by tweaking stuff
but just getting that last bit of performance would be nice, we do hide the navmesh loading behind a loading screen anyway
i did try using async building but that turned out to take super long to build the navmesh
sure it didn't freeze the gamethread
but the generation took in the order of around 50-60 seconds
I'm not sure why you'd be hard coding it. You mentioned maybe approaching the problem badly.
Contexts can be data driven outside of the param functionality. Not directly in the EQS, but it can call functionality that is data driven.
lmao hey I recognize that name
Hi guys, I have a really simple MoveTo function on my Pet class, Basically when I press E as my Summoner Character, it'll spawn the pet and its default controller
void ABasePet::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
TObjectPtr<AAIController> PetController = Cast<AAIController>(Controller);
if (PetController && GetWorld()) {
PetController->MoveToActor(UGameplayStatics::GetPlayerCharacter(this, 0));
}
}```
this works, but if I change it to my custom AI controller then my pet no longer follows me
TObjectPtr<APetController> PetController = Cast<APetController>(Controller);
I've tried changing it to this, but still doesn't work
Is your pet controller an extension/ child of the normal one?
If you mean APetController : public AAIController then yes
K
then the BP controller is from APetController
c++, which declaration ? like spawning ?
// In my SummonerClass
void ASummonerClass::Summon(const FInputActionValue& Value)
{
if (BasePet) {
TObjectPtr<ABasePet> Pet = GetWorld()->SpawnActor<ABasePet>(BasePet, GetActorLocation(), GetActorRotation());
Pet->SpawnDefaultController();
}
}
What is your default AI controller in settings
this one ?
Oh right, you did show that
Did you use the AI debugger and vis log to see if anything stands out?
π© Didn't know that's a thing
The only thing in log is
LogPackageName: Warning: DoesPackageExist called on PackageName that will always return false. Reason: Input '' was empty.
Not sure, but that looks like some different issue. And I meant the visual logger in Tools > Debug. Start with the debugger tho. At runtime, press β
If nothing is showing under AI, maybe use the main level window to manually select the pet instance from the outliner and see what AI is controlling it
Yes, that is the vis log
from what I see BP_Petcontroller is controlling
Hover over the blue bars
Or just click on them
To see what happens step by step
should see something like this:
is there more beyond the move accepted? or rather do they all show the same?
also expand the stuff on the left i.e. ai controller and path following
both pets show similar log, just with different number
It's null on my end too
the main diff I see between mine and yours is that onPathFinished: Aborted
my vis log doesn't have that.
could be something else, but unfortunately this is where my extremely limited "expertise" ends. I'm sure someone else will be able to spot your issue, might just take a bit for them to come on
Btw, this other error might be happening if you try to load a level by name. Safer to use refs. If that's not the case, it might be a common 5.2 bug which apparently gets fixed when clearing the Unreal Engine folder in AppData. See here for more info https://forums.unrealengine.com/t/doespackageexist-warning-flooding-output-log-in-pie/268002/12
Sorry for the wait, yea I tried this solution of deleting files in cache UE folder and it no longer shows that error
tried it with AIController this time, it seems to show very similar outputs
except it worked π
Ok, fair enough. Then all I can think of is you're extending wrong somehow
Haha, just wondering, is my way of doing it correct? like we "can" use our own custom AIController right? Like in my case PetController is a AIController so it should work?
yeah, you definitely can, I have it done in bp
but not sure about the cpp implementation, I'm trying to find an example now
thx, I'm experimenting rn
here's a preview of what my custom AI bp would look like in C++
I tried doing it in bp and it works, but as soon as I change Pet's AI controller to my own PetController (BP or not) then it stops working lol
how did you create it in Blueprint?
like this ?
yea, except my BP_PetController is from my c++ PetController, and PetController is from AIController
probably not
oh you thought I called my c++ function in bp?
maybe not the blueprintType
I comment out my c++ ai code and just did it in bp
I think you need to make it so your c++ class is exposed to BP
to test, you can try to make a new BP AI class directly from the AI Controller base
if that works, then it might be a missing flag issue on your custom one
without doing AGridPathAIController right? let me test it
yeah, ignore the GridPath, that's just an experimental Epic AI I'm using for my project
umm
Is that by default? or did I accidentally changed something so it's not exposed to BP?
I think you normally have to set flags on C++ classes in order for them to be exposed to bp, but tbh idk enough about the #cpp side of things to tell you for sure, those guys might tho
I'll try to delete my current custom controller class and add it again, I may have changed some stuff about it because I was following UE behavior tree guide
π
It works now
thanks Neo!
Trying to use my AIController to run Behavior tree, so the pet moves to x location, but pet isn't moving for some reason, any help is appreciated
// PetController.cpp
void APetController::BeginPlay()
{
if (BehaviorTree) {
RunBehaviorTree(BehaviorTree);
}
GetBlackboardComponent()->SetValueAsVector(FName("EndLocation"), FVector{ -4290.000000,-1710.000000,0});
}
The EndLocation value is indeed changed, but not sure why pets aren't moving
What is your pet pawn class?
ABasePet : public ACharacter this?
Ah, ok. So you have the movement component for your pet.
yea
Do you have the navmesh?
Ok, try a humanoid pawn to see if moving or not. Then to nail down the problem with you AI BTs or your pawn class...
These kinda simple logic code I usually called in Blueprint and it could avoid some issues like thatπ
True lol, just tryna get some practice in C++
Hi guys, is there any reason why my pet follows me really smoothly using my c++ code, but my pet isn't smooth using behavior tree, it will stop for a very short time then continue moving
Is it because of Selector and Sequence?
void ABasePet::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
TObjectPtr<AAIController> PetController = Cast<AAIController>(Controller);
if (PetController && GetWorld()) {
PetController->MoveToActor(UGameplayStatics::GetPlayerCharacter(this, 0));
}
}
vs
// in PetController.cpp
void APetController::Tick(float DeltaTime)
{
GetBlackboardComponent()->SetValueAsVector(FName("EndLocation"), PlayerLocation);
PlayerLocation = UGameplayStatics::GetPlayerPawn(this, 0)->GetActorLocation();
}
I think the main difference is the MoveTo in BTs is a task. It will stop the movement and the speed will be set to 0 immediately while the task is finished.
Does that mean Behavior tree is more suitable for like Enemy AI? Do people use BT for pets as well?
or it works, but I just don't want my pet to stutter every few seconds, is there anyway to change it?
You could do it but you might need to customize something for your pet AI.
Like you set the moveto target but you also doing a service that if it reaches the specific range close to the target, then you speed down your pawn.
Something like that.
I see, I think another reason is the MoveTo node means the Pet will need to reach that location, only then my Pet will move to another location, it becomes obvious when I increase my Summoner character speed
oh well, it may be because I set MoveTo's key to Location
Yeah, that's why I said it is a task. It needs to be finished unless you abort it by force.
oh I probably miss understood you haha
I was trying to set it to just chase my player object, not exactly sure how to do it lol
so far I've made a BB key and set it as my MoveTo key
Yeah, you can do that, but the pet will probably stop immediately too if it gets close enough to the master.
If you want it be smooth, still need to do more extra workπ
oh lol, was hoping it'd fix the problem
Basically Actor is a UObject
I tried it with UGameplayStatics::GetPlayerPawn(this, 0)
oh nvm it does work
thx
I think it is following very smoothly for some reason
Good to hear.
thx π
You should not be calling move to on tick like that. Move to contains latent functionality.
If you have the controller setting to spawned or placed in world (variable on the character) then you don't need to manually spawn the controller.
Run behavior tree should happen in On Possess and not Begin Play.
Set Use Acceleration For Paths to true in the character movement component. Then adjust the acceleration and deceleration.
Is that in case it gets unpossessed and repoed at some point or is there another reason for it?
There's usually no point in running BT if there's no Pawn - a number of task nodes will just fail without it. And there's no Pawn until Possess gets called which is always after begin play.
Oh, that makes sense. I thought the AIConβs begin play only occurs when a pawn with an AI controller it spawned
nope. It's perfectly fine to spawn an AIController without any pawn in sight and have it posses and unposses any number of pawns (in sequence, not at once).
Oh thatβs good to know, thx! Btw, Iβve noticed if I stop logic via bp while a tree is running, the treeβs runtime visual indicator (highlighted stream) keeps showing as if itβs still running but stuck in that task with no finish execute. Mind you, it still restarts the tree from the root when run BT is played again, so it might be just cosmetic, but I was wondering if Iβm doing something wrong and keeping the tree loaded or something
Like I would expect it to just appear inactive
sounds like a bug.
but yeah, it also sounds cosmetic.
Ok, np, not a big deal
Hmmm, I've never consider about an AI controller without a pawn. Usually just think it is spawned along with the pawn. No idea what is the case that spawning an AI controller bug without the pawn thoughπ
I've seen a number of people using AIController without a pawn just to use BTs (with game-specific BT nodes that don't need or want Pawns). For example as a squad-controller with BT driving the squad logic.
Okay, it makes sense in this case. By the way, since you are here, I'd like to ask a question confusing me for a long time. Let's say I have a parent tree for a certain AI pawn, and inside this parent tree have several child trees including attack tree. I put a cooldown decorator for a specific attack movement and this cooldown decorator will still stop the behavior tree task being triggered even get out of the attack child tree? Not sure you can totally understand my question, sorry for my poor expression.
nope, I don't get it π
Ok, for example. I've an AI can move or attack. For his attack, he has a melee and a ranged attack. I put the cooldown decorator on his ranged attack task for about 10 secs. So after his attack, he will get back to the main tree which has movement and attack sub trees. If he meets the condition for the ranged attack, does the cooldown still work to stop him doing ranged attack? Because he finished the attack tree in the last iteration.
It depends on a number of implementation details. If it's a "static" subtree and the condition is on the root then it should work. In other cases it heavily depends on specifics of how you set up your subtree and where the data comes from.
Easy example is to have an autopilot mechanic I think
It could unpossess when you disable autopilot
Or games that have AI take over when a player disconnects
not to mention that if an AI driven pawn wants to drive a vehicle there's an unpossess and posses taking place (possessing the vehicle pawn) π
I remember we did this before but not with AI controller (player controller probably), because the AI programmer implemented a lot of stuff himself without using behavior treeπ
Thank you for the answer. I'm still a bit confusing what means static subtree, since I don't remember any options for thatπ
In my game I have AI that basically control player characters anyway, since its combat based they need to do what players can, would be an easy hand-off π
there's two "run BT" taks nodes in BT - onc "static" and the other "dynamic". The "dynamic" once lets you switch inject different subtrees at runtime.
Ah, thanks. So yeah, probably dynamic one won't work because it has different instances at all?
Even the dynamic one could be made to work. If you store "ranged attack cooldown" in BB, and use timestamp for it instead of "time left", and you don't expect decorator checking it to "abort lower priority" then it would work. Or more precisely: it would abort lower priority but only within the limits of the given subtree.
That's pretty clear now. Thank you for the clarification.
thx for the explanation! I've changed run behavior tree to OnPosses!
which function sends the information to the movement component in the crowd following component?
I keep finding a variable in CrowdFollowingComponent called MovementComp but I'm never seeing any struct or packet of information it's specifically sending into it :/
are you talking about the MoveTo function sending information into the character movement component?
also does Detour Crowd basically make RVO obsolete? I remember someone saying you can't use both RVO avoidance and Detour Crowd AI Controller
If anyone knows, does anyone know how the information generated by MoveTo gets passed into Character Movement? I'm seriously confused since I cannot find any direct references to Character Movement specifically in the MoveTo node in AIController
essentially I need to pass in the information generated by MoveTo which typically gets passed into Character Movement into my custom locomotion logic

