#gameplay-ai
1 messages Β· Page 6 of 1
No one even reads pinned stuff anyway.
yeah, screw those pins π
oh zoombapup is back!
haha... back is a bit much..
I saw the 5.1 update is due, with mass supposedly being ready for prime-time
I somehow doubt it, but worth a go π
And still no Verse π
We have a drone training app to develop for one of my modules this semester.. so hope some of my students at least look at it
I assume the documentation is almost non existant still, for the fresh UE feeling π
@ocean wren did you ever see beta.character.ai?
not sure..
I've been spending time with it for a while (thanks to BlueMan) and it looks like your pick-up line generator AI
Hahaha.. I guess its a fun use of a large language model
did you guys see that openAI's "whisper" voice to text model recently? looks really good
they even open sourced it properly
well, sort of
guess they're learning from huggingface
Saw a few tweets about it, but there is a huge inflation of recently released AI tech, I'm barely able to keep up π
Yeah, there's a lot right now, all the ML confs tend to cluster releases together
This one is able to do research for you in stackoverflow
and even write c++ code for you
I dont think I see something like this in practice before
except GPT-3
yeah, there's a lot of these services built on top of gpt3
there's a bunch of large language models out now though.. including some open source ones like bloom (I think its called that?)
google released their t5xxl model and such too
starting a new VR/AR plugin thing next week
doing voice control for scene creation
I'm hyped for it
using voice->text->clip->ml->UE5 π
its using UE5? 
I'm hoping to freak people out with the demo video π
this is work with a company, so it won't be open sourced until a year later sadly.. part of the funding is that they get first dibs for a year
But I'll be doing some papers on it all, and eventually release the codebase etc.
Iβm also doing a similar thing, but itβs probably not as advanced
oh? do tell
voice->text->fine tuned gpt-3->custom trained model that I will be releasing a paper on in 2023->voice
Oh yeah bloom
At this point too Iβm waiting for the startup companies to start releasing diffusion models for every aspect of game development
Text to high quality model
Or something like that
yeah, diffusion is pretty hot right now.. bit like transformers with a few years back
Yeah
But transformers I thought were more so popular among just the AI community, with the attention is all you need
Diffusion made it to the mainstream audiences too
Especially with StabilityAI
They snuck attention into the diffusion pipeline too π
Oh lol really? I personally have not studied diffusion yet
Diffusion is super fun, but latent diffusion is where its at
The real game changer was openai releasing the CLIP model
clip is basically in everything right now
Oh, yeah
its the glue for most of these new models
Yeah CLIPβs in everything
@ocean wren how you are going to "create" scenes? geometry scripting?
luckily there's an open source clip now too
Graph neural networks and sequencer π
That is what harmonai has been using to make text to production samples
Which is a startup from Stability AI
Isnt sequencer just a timeline track that evaluates keys 
basically, a graph representation and a sequencer sequence (you get an input temporal graph and turn it into a sequencer clip)
spatio-temporal graph to be precise
ah, so its not going to be "actually" runtime
I'll be building the sequencer version once we've proved the basic pipeline
haha.. yeah, there's like a dozen or so text to 3D models from ICLR and the like π
there's a bunch of text-to-video models too
imagen video looks damn funny
That one is open source though and can run through a collab.
colab is a bit of a weird one.. I'm going to have to take my PCG students through running stable via webui using it.. but its just that little bit.. annoying π
they keep making my notebooks stop working during live demos
You can run it wherever you want, it's just that most people don't have a V100 readily at their disposal on their local machine, but if you have one, run it locally
I run notebooks locally on my A6000 machine
but when we're in class, I kind of have to use a colab
I usually make a gradio interface and just run the colab as a server, but then google keep futzing the interface so things timeout or go wonky π
one recommend, try that stablediffusion infinite outpainting gradio interface.. that one is neat
I really didn't think some of this through though.. on my github account, I've got 300+ repo's π
Hi #gameplay-ai! Anyone know of a primer for extending unreal's navigation/pathfinding system? I want to implement a flow field navigation method that utilizes & integrates with the existing navmesh functionality.
I have no idea what flow fields are but I would suggest looking at the builtin components and things that use the navigation system
I doubt there's much info on how to extend it unfortunately
NavigationSystemV1 I think is the class that manages much of it so I'd start maybe there
Thanks, yeah, was hoping to not have to dig through source code and deduce how everything works. Or at least reduce the amount of that significantly.
anyone know anything about 3d pathfinding? a tutorial, a plugin, really anything accessible?
best case: some sort of 3d navigation volume
Came across a few on the marketplace, there seems to be a decent free one called DaS or DaN or something like that
Just search for the tag "pathfinding"
Then there was a pretty nice looking one that had "navigation" in its name with a quadcopter in the icon
Adding new navigation data types is actually pretty straightforward. You need to extend ANavigationData class, override the relevant functions (RebuildAll for building, pathfinding functions and whatever else you want to support) and add an entry to your project's NavigationSystemV1.SupportedAgents.
Once that's done you can configure your AI agents to use that specific nav data type via FNavAgentProperties.PreferredNavData and all the pathfinding calls will go to your flow field or whatever you implement.
I can't get the AI to see me - I've put their sight/perception radius to a ridiculous number and I am taking my player pawn's object and passing that to the blackboard for the player target (on begin play of this AI )
I'm about as confused as this AI is
make sure the player pawn is registered as "stimuli source" with the perception system. You either need to set bAutoRegisterAllPawnsAsSources = true for your senses or call RegisterPerceptionStimuliSource on the perception system. Adding UAIPerceptionStimuliSourceComponent component to the player pawn should work as well, just set bAutoRegisterAsSource to true.
Heyup Mieskzko!
Hey Phil! One of these days you'll spell my name correctly ;P
Hows things? Did you work on the mass AI stuff? I remember Mikko talking about it on twitter
dammmit π
Mieskzko is that right? π
I'm deep in mass core right now and pretty much the sole dev atm π
I'm just about to launch some masters students at the Mass stuff.. so I'll be having to review it to write some info for them. Didn't have much time to look yet. We're doing some drone simulation work.
make sure to use 5.1, a lot of improvements went into it. Master is even better
Yeah, I saw the announcement about mass being production ready the other day? we've got a few weeks before they're ready for looking at it anyway
Got to go over some flight-sim stuff first π
Looking forward to having a look beyond just setting it up π
it's not. Was supposed to be, but I pushed back. MassEntity will be production ready in 5.2. MassGameplay not so much.
having said that, all the things that were missing to declare it production ready have already been implemented, just didn't make the deadline for 5.1
Ah, yeah, I'm mainly just poking at it to up entity counts for a crowd sim.. they're learning about graphics stuff from drone camera training point of view
I think there's enough there.. hopefully they look at using shader tricks to up entity counts too
How come you're alone on mass? its so weird how there's lots of AI startups with lots of developers. I guess its an epic thing.
Seeing companies like modl.ai looking for UE devs makes me consider it π
and Matthew's stuff with Kythera
Good to see you around here though, even if I can't spell your name right π
I'm alone on Mass because we have so many things to do. Engine AI team is now ~6 people (depending on how you count) and there's BT, EQS, StateTrees, SmartObjects, Mass, Navigation, all the debugging tooling not to mention InstancedStructs (that came from our team) and all sorts of things we need to do since it's often the AI team that comes up with the crazy new stuff that hasn't been done before π
Question for you.. did the mass stuff come from the Matrix awakens thing, or was it planned anyway? I mean it seems unlikely you'd develop something like mass just for a demo π
We really should create a discord bot that collects all of the stuff people ask in here.. its amazing how many people ask for the exact same stuff π
Mass has been build generically with the Matrix demo being the first client
We built a knowledge base thing in Azure AI for a demo a few years back when everything was online.. at least cut down some of the dumb questions
Ah, makes sense.
Well, look forward to playing with mass in a few weeks.. we need to cover some graphics stuff before it π
How do you in a BT typically deal with "cleaning up" when a branch is interrupted? Simple example: An NPC is sitting down, and gets interrupted by something. Now it wants to run away. But they need to play the Get-up-animation first.
our BT design assumes each task is capable of cleaning up after itself, so you'll need a dedicated BT task that plays an animation in response to being canceled. Remember to return InProgress in response to Abort call and call FinishLatentAbort once you're done.
Or you can use BT Services and handle Actication and Deactivation
Makes sense, thanks π
Mieszko is the OG UE4 AI programmer, so it's more like I ventured into Mass (and stayed) π
Yeah, I know. But I've only seen you talk in #mass π
I love the BT stuff btw (despite what some others say π€£)
fair enough π
BTs are king! Until Mikko polishes up the StateTree stuff. ST's are cutting edge stuff, just not done yet
From my high-level overview, I don't see much difference in using the two to be honest. So I would assume it's something more low-level where the benefits shine.
STs are an elaboration of the BT idea with a lot more attention paid to UX side, like parameter binding. Having said that I believe a lot of people will stick with BTs due to the familiarity and legacy code (every non-trivial game has custom BT nodes).
I can't imagine us deprecating BTs anytime during UE5 lifetime.
BTs are life. BTs are love.
I tried StateTrees back in 5.0 preview I believe. I couldn't get the states to pass data to each other correctly. Could not figure out how to actually expose that stuff.
Here it was
Passing data to tasks.
Got everything else working though.
Did it with the evaluators though.
a big advantage of STs is that they're not domain-dependent and can be use for a lot more than our BT implementation. And the separation between domains is supported out of the box with schemas.
BTs could do anything in principle (I know some people used it for UI flow) but some code work is required to do that
BT for UI flow? Madlads
I also really like the perception system tbh. One of the reasons I elected to use UE to be completely honest. The AI tools felt nice π
yeah, we used to have awesome tools π Now they're starting to show their age - the original designs come from classical corridor shooter days, and <50 opponents. It's a different world now! We need to update. Maybe I'll work on that once I'm done with Mass (in 2 years or so π ).
I haven't the feintest idea on how it even works. To busy actually trying to build a game π€£.
I have read some people online say that it's performance was definitely on the lower side. But I knew it was pre-Fortnite days, so it was more for smaller enemy counts. But you can do some simple things to make it feel better.
Thanks for all the work you've done thus far and the things planned for the future. I definitely appreciate it!
And the age may be showing - but these tools are still the best that I've seen from any publicly available game engine π
Often times, AI tools are left to the developer in other engines.
Perception system perf definitely suffers with a large number of enemies (especially if every one is in a different team). Those are ways to address that but someone would need to just work on it while not working on Mass π
Labor of love π
brb - going to apply to be on AI team now. (JK, many books to read)
well, we are looking for a senior AI navigation programmer... just saying π
Definitely not me π€£
Hi Mieszko
how it's likely AI team would accept (small) UX improvements on BT's and BTTasks as PRs? at #cpp we usually talk about how Epic usually insta rejects useful PRs so I'm quite discouraged to do PRs for AI module
AI team as a collective, and me personally, really appreciate all the community contributions and I regret it sometimes takes me so long to get to them and pull them in. I'm sorry about that BTW. Please post PR and feel free to tag me to facilitate the process - sometimes our github bot fails, sometimes it's offline and sometimes the tickets get marked wrong and end up on some other team's plate.
Hey, it's the man himself! Thanks for the info. I should clarify my idea a bit since you can likely point me right to the right place! Logically the way I'm envisioning this working is that I can take the existing (green π) nav mesh that gets generated and then define the vector grid within the navmesh geometry that the flowfield pathfinding stuff would utilize. A high level view would look like
Get existing navmesh
Get closest cell on navmesh to desired point
Use existing navmesh cost data to generate the "distance grid" by traversing adjacent navmesh cells
Utilizing this newly generated distance grid, traverse the navmesh cells again to generate a vector for each cell that defines the path to the desired location.
I'm not sure if you're familiar with the technique, so this is a couple minute video that defines it pretty well https://youtu.be/Bspb9g9nTto?t=47
So, in using the already generated navmesh, I hope to take advantage of the fact that it takes care of figuring out the navigable area for my agents and by nature of the geometry generation and path cost system it should do a lot of the heavy lifting.
I'm going to look into what you've already given me and investigate the navigationdata class further.
In this tutorial, Sidney Durant explains vector field pathfinding and its advantages over more traditional pathfinding algorithms, such as Dijkstra's.
Read the tutorial: http://gamedev.tutsplus.com/tutorials/implementation/goal-based-vector-field-pathfinding
@crystal hatch Out of interest, is there a UX designer that helps you with these things? it doesn't feel like much has changed there.. but seeing the statetree gives me hope π
@celest python π this is actually really good information. Might encourage me to look into it more as well π .
I'm pretty sure that a lot of the pain points people who come into #gameplay-ai have aren't technical, they're UI/UX related
and of course, lack of knowledge π
Yeah, also recently many Epic staff started to interact with community and this also makes me happy. We learned the backstory of some mysteries behind the bug reports and PR rejections in the last few weeks π (especially that FLatentInfo thing)
Now....if we can just get someone to crack the lid on Verse π€£ @celest python
Verse?
new intermediate language
Text-based gameplay scripting language
oh, that the one the skookum guys were working on?
Yeah
I guess I'll start with text wrapping on BTNode descriptions π
and sanitizing UClass names
Hahaha... I just had flashbacks to trying to figure out rounded corners in slate nodes π
I hate UI coding with a passion, so have like a white hot anger when things aren't just nice π
Funny how most of what I have to do involves making graph editor UI's
I think the gods are using me for their sport
I'm not into any type of GUI programming too, even though many say slate is quite good compared to its alternatives
yeah, generally slate is fine
I mean, if anything ui programming wise is ever fine
I'm hoping for ML enabled UI "coding" soon π
like github copilot for people who hate ui π
I'm interested in that - but just no real need yet. So far, what UE offers out of the box is sufficient for me π
Quite a few jobs going around for slate + ai guys
I guess thats because they've got some random ML/AI codebases and want someone to productize it
and slate is a bit of a dark art, so its rare to find someone with AI + slate
So, I'm trying to calculate the various forces to apply to move an AI, and I want to apply different forces depending on the context (is the AI being chased, does it have a target destination, etc.).
Would it be ok to set that up as a Sequence that runs to Tasks for calculating each force (evasion force, etc.) with Decorators checking if each should be calculated, then having a Task at the end of the Sequence that sums up the forces and applies them?
Having a sequence run through a half-dozen tasks every frame, basically.
The alternative would be to do it all in one big Task, or directly in Blueprints, I guess.
I don't see there being much use for it being in a sequence
does it have to do any decision making?
or is it just calculating forces?
if the latter, then I'd have it as a function on the controller or something
bearing in mind that if you use the detour controller, there's already something like that
Both StateTree's core as well as the tool's UI and overall UX are all Mikko - not only doe he care about these things a lot, he has the artistic talent and feel to back it up. No designers, AI team traditionally builds it's own tools alone π
Is that normal at epic? how do you evaluate usability then?
Bad idea. I mean, the idea is cool and interesting, but it's also impractical in performance terms - running a bunch of tasks in a BT sequence every frame will result in a terrible perf.
I know there are UX people there π I guess they're doing fortnity stuff?
we wing it π
I would love some more doc on Statetree π
the approach you described is very close to what we did for minion navigation in Paragon. In short, in editor we generated navmesh and then based on that we generated two flowfields, one for each of the teams. The minions that had no enemies just flown along the field (ultimately leading them to the enemy's home base). If there were enemies we switched to navmesh or pathing grid.
This is all definitely doable. Note that we only did that at editor-time, since it was pretty expensive to generate (and the Paragon's maps were not that large).
existing (green π ) nav mesh
I see what you did there π
they're being worked on. Should have something reasonable useful in 5.2
Right, will probably save it for a future project then π
or try to figure things by stepping through the code - you're guaranteed to learn a lot π
Been looking at Smart Object plugin and I feel like I'm missing something. You can use a SmartObjectComponent directly, but there's no way to get the ClaimHandle then. The ClaimHandle is basically required for everything, from finding slot locations to releasing the claim (and thus ending any GameplayBehaviors that arent instantly completed in Execute). The only other way to use an SO is by box querying using tag filters. That means if you want to use a specific SO, this needs its own SO definition and its own tag. I know its currently in beta but its PR in 5.1. Looking at the 5.1 branch, nothing has really changed in this regard as far as I can tell. I tried making a custom BTTask that exposed the ClaimHandle but it blew up spectacularely.
I guess one of the pain points right now, is that the navmesh system isn't really ready for large scale open worlds? We're looking at open world stuff and thats one area that seems like its not currently possible (i.e. for large populations across a large landscape)
True true π
I've added EQS support for SO finding, should be in 5.1. Also messed around with BT tasks for SOs, and BB should support handles (if not it would be super easy to add)
Luthage keeps talking about how the navigation stuff supports that stuff out of the box with the nav stuff automatically being cut up to w/e map it actually belongs to
I guess everyone is confused by the navmesh invokers?
I haven't had any issues with invokers yet personally. But people have said they do get a lot of bugs due to them.
Wonder if it works with the new world composition thingy?
I can never remember which name it is.. world composition? is that the old one or the new one π
Haven't tried yet. That stuff has been fairly buggy for many people, so I haven't even bothered.
Very cool! What I've been struggling with is, having a direct reference to a SmartObjectComponent and using that (AITask_UseSmartObject::UseSmartObjectComponent) as I dont get the ClaimHandle. For this use case I want to directly tell an NPC to go and use this particular SmartObject. It would probably work if the GameplayBehavior was fire and forget, but I wanted to be able to control when it stops. Also need the slot location/rotation. I might be misusing the purpose of SmartObject here π
Idk - I just call it the new World Composition π
Trouble is the old name is similar to the new one
My brain can't be bothered to store both, so it just sort of vaguely lumps them together
Same
is world partition new or old?
I basically did a copypaste of UBTTask_FindAndUseSmartObject and changed it to grab the SmartObjectComponent instead, and store the ClaimHandle on the BB, but for some reason it blows up in AITask_UseSmartObject.cpp:241 when I exit play mode π¬
I'll just wait for the 5.1 release I think π
So yeah, same use case then! I also want to modify the generated flow field vectors with splines that act as a sort of "brush" that will influence the vector direction to point the same way as the spline. In that way I can define the lanes of the map. It would even be neat to be able to encode movement speed modifiers into the flow field vectors (defined by spline data). That would allow for faster movement along the center of the lane but slower movement when chasing players into the jungle.
Um, any chance you could share that bit of paragon's source? ππ lol
Hey guys this is my first time using behavior tree and AI controller. I currently having problem when i want to spawn an AI using the spawn ai node, i'm using a cast to get a reference of my character in my AI controller but i'm getting access none on my cast ?
This is setting the boolean properly, but not the "TargetActor" object variable
Is there something I'm missing?
A connection between the last two nodes
π lol, thank you. For some reason it's still not moving towards the player but at least I know why that wasn't working
Dropped my headset on the keyboard π
Make sure you have the variable setup correctly in the behavior tree
Yeah, the problem was just that I forgot to connect it lol, also the MoveTo problem was fixed by removing it, readding it, and then changing the location back to TargetActor, not particularly sure why that is but it worked lol
Gotta love those 'i swear I'm doing exactly what I was before ' moments π
Yes it does. At least theoretically. I haven't actually tried it, because we use Havok. However, I've looked at the generation changes between 4 and 5 and they made updates for world partition.
Isn't there functionality in the smart object subsystem to get the handle from a smart object component?
If you know C++, making a new EQS type isn't actually that difficult. Then you can use the EQS for it. I started down that road and then abandoned smart objects, because they don't work for our needs. But I made a new EQS item type for my interactables system.
"Stimulus Successfully Sensed" apparently changes to false whenever the player leaves the sight, what method can I use to actually have remembering the player for at least a tiny bit lol
You can get the smart object handle, but only in C++. Then you can indeed Claim it using the subsystem. I did do that in a bttask, using BTTask_FindAndUseSmartObject as a reference. But for a reason I couldnt figure out, it crashes on a check in AUTask_UseSmartObject::Abort when I exit play mode. Seems the pawn is destroyed before the Abortis called. My UE foo isn't stronk enough yet π
But just the fact that it's not exposed to blueprint suggests (to me) that maybe you're not supposed to do these things π€·
I did like the concept of smart objects invoking encapsulated behavior, though. I'm sure I could cobble together something similar with enough effort, but feels silly not to use what's already there π
Are you calling external cancel on the AI task during abort?
Nope basically just running that bttask node
but the behavior that is running is not completed
When your BT task aborts, how do you stop using the smart object?
This crash happens only when I exit play mode. So the engine cleaning up is (apparantly) what's causing the Abort
oh that might not be what you're asking π hmm
Gimme a min π
Right, so .. AITask_UseSmartObject does release the ClaimHandle in OnDestroy
I did release the ClaimHandle manually when the BTTask aborts typically, but the AITask_UseSmartObject crash happens before that, while the GameplayBehavior is running
Apologies for the confusion π Just woke up π« But coffee is on the way π
What is the crash?
There's a thing with aborting a BT when using AI tasks that don't have cleanup until OnDestroy
Well crash, its more of an exception. It's a check for the controller and the pawn
Does cause my editor to crash though as I cant seem to recover from it
Meanwhile, I'm not sure if having long running tasks in a BT is best practice anyway
I was testing out very simple things, like sitting on a bench. Making the sit/getUp animations play on the GameplayBehavior trigger/endbehavior
seemed like a good idea at the time
meanwhile the BTTask, AITask and the gameplay behavior would be running until interrupted
Yaay. Any EQS update is a good update.
There are parameters for the perception component on your pawn, search for 'age'
I have a nav link problem, The zombie rotates before jumping does anyone have a fix?
Has anyone used the "Actors Perceived by Querier" EQS node?
I've got a situation where if I manually update the BB value in the Enemy's BP, it'll find the player, but if I run the EQS node (which I assume should do the same) it doesn't find them (or anyone!)
Anyone got any ideas?
Do you have a reservation system for this, ala Claim/Release?
Hi. BT/EQS question - Is there a way to decrease EQS point score by the amount of other AIs taking the same point with that EQS as well?
Let's say I have 3 enemy AIs. Got 3 EQS points.
- First AI takes 1st point (closest).
- Second AI takes 1st point (because it is still the closest one, and decrease of the First AI picking it was not that much)
- Third AI takes 2nd point (because first two AIs took that point, now the score has decreased for that point).
And by decreasing score based on picked point I want to do it before AI is on that point (this can be solved with Distance), issue comes when they all are far from the point and decides to go to that point before any one of them is on that point.
Thanks.
You can create a context that is Get Allies Move To Location. Then do a distance check on those locations.
Yes. The difference with mine is that I can replicate the claim status to the player client so they don't try to use the same smart object as an AI.
Alright, I expected replication to come built in with an UE feature.. But I think Im definitely rolling my own system at this point
Mind if I ask, do you handle reservation with a subsystem or gameplay tags or something else?
Yes I use the EQS for targets. Have you looked at the visual logger to see what is failing?
I was very surprised as well. It's clear that it was built for a specific use case and didn't generalize it very much. It's also not built to be subclassed and altered like everything else.
I use a subsystem. However the component knows it's claim status and does the replication of it. I ended up merging some of the ideas I liked from Epic's version and the one I've built for a few other games.
That's my impression as well, ie Mass and the Matrix demo I guess..
I'm far more disappointed in Mass. Building my smart objects system only took a couple of weeks. Mass is entirely unusable for anyone who works with designers.
And alright, i suppose the two is not mutually exclusive. I like the idea of filtering EQS queries on tags, but you said you had a custom EQS type? I have so much to learn lol, I jumped ship after 10+ years of Unity when UE5 came
Yes. You can subclass UEnvQueryItemType to make a new one.
UE5 seemed so tempting at that point, and completely disappointed with Unity with their lack of commitment to features and a stable development experience
Im getting a similar vibe from UE as far as new features go, but its still a lot better
Slightly different, but stick with BTs for the time being while ST's kinks get worked out.
From what I've gathered its a sort of combination of state machines and BT
Epic doesn't really use the AI systems. So they made a bunch for Paragon and then went years before they built the new ones for The Matrix Demo. Other gameplay systems are less...rough.
Hm but at least the BT is pretty battle tested right?
Very much so.
I kinda want a goap-like system or utility ai, but i feel safer leveraging a proven system
I suspect StateTree is a better base for that, but cant really wait π
I use a hybrid Utility and BT system. It's works really well. Shipped Psychonauts 2 with it.
Ohh I loved psychonauts π
I looked into VisAI which has some of the same concepts, but I think I'd rather do it on my own and get it exactly how I want it
I also use the EQS for utility scoring of things. Such as abilities, targets, smart objects and movement locations.
My combat subtree consists of 6 nodes.
Thats pretty interestning.. so you're using EQS as a sort of planner?
It's not really a planner. It's utility. The tree tells it when to look for things and then it uses utility to to do a selection.
Planners make a plan to execute tasks in an order to complete a goal. Utility tests each thing to decide it's usefulness at the given time.
For example, abilities. The character has x number of combat abilities. The BT doesn't really care what they are. It runs an EQS that generates all the abilities with a certain tag. Say combat for example. Then it runs tests on it like "how close am I to the range of this ability?" Then it picks the best one.
Hehe, right! My head is spinning with ideas rn π
Anyway thanks for the insight @uneven cloud . Movie night is approaching πΏ Have a good one π
Then I use a utility system to decide which BT subtree to use.
You're welcome!
Isn't the player state owned by the controller? The AI controller only exists on the server.
No
You're thinking of the player state for a player controller
It can't replicate to something that doesn't exist.
Players are client owned and AIs are server owned. The functionality is very different.
If you need to replicate information down to all the clients, you have to use the pawn.
It's called a PLAYER state. AIs don't function the way that players do, because it's not controlled by the client.
how do i set an enum value as blackboard key?
is it as easy as just adding the enum as variable and making it public?
Set value as enum in BP and SetValue<UBlackboardKeyType_Enum> in C++
but then you also have to use a blackboard key
even though the enum is a blackboard variable
i will figure it out
i am on 4 hours of sleep
today is not the day for this
lol
I'm not saying anything about the player. I'm talking about AI.
Hello! I'm profiling AI (30-60 controllers) and I'm wondering what are good practices for far AI, like not ticking pose, or reduce updates, etc. Any tips to keep the far AI using the bare minimum for the movement component or to optimize AI that is not visible in camera?
This is the only age variable, and changing it doesn't do anything lol
Also, change auto success, be sure to trash the tool tip
The difference between BP and c++ is a big difference? in terms of performance
If you haven't already, be sure to check the box for detecting neutral
I have, I've also tried changing Auto Success lol
Is it supposed to work like how I want it to by default?
I'm not sure if it's a problem with my code, since all I'm doing is switching to the chase state if the "Stimulus Successfully Sensed" variable is true
No, but changing some of those settings will. If you haven't, be sure you player pawn has a stimulus component
Sorry I can't help much more at the moment, but good luck! You can always debug by pressing the ' key and using the numbers on the keypad, 4 is for perception I think
Actually yeah, you were right. I thought "AutoSuccessRangeFromLastSeenLocation" was based on time and not range, despite it saying Range lol. It works fine now. Thank you lol
I recommend looking into the significance manager to do AI LOD. You can then turn off things that are too far away from any player.
It can be depending on what you are doing.
Hey guys. I'm probably missing something obvious here, so let's see if anyone can help:
I have this decorator on a selector which sets the variable "TargetCharacter" if it finds a good target nearby.
The selector's first child checks if TargetCharacter is set, and it fails the first time after TargetCharacter is set.
The next time this runs, the TargetCharacter is unchanged, and it works as expected. It's almost as if the child nodes are running before the decorator
Break points indicate that the variable is set before the Blackboard Based Condition runs, so I don't know why it skips to the 2nd set of nodes.
IF I add this little sequence with a Wait, it works as expected, but I'd prefer to avoid this workaround π€
around x20.
Make sure you have Call tick on search start enabled on your service or implement Receive Activation or OnBecomeRelevant (depending on whether you work in BP or C++).
That's incorrect.
- all the UE4-era AI systems are being constantly used in Fortnite and all internal game projects' development.
- the new stuff (StateTrees, SmartObjects, Mass) are as rough as they are since we're not done with them yet (the fact that's reflected in them not being marked as production ready).
- I don't recall any AI systems added in Paragon timeframe, just improvements that came from the systems' intensive use.
Looking forward to see what's changed in 5.1 then π
What is the difference between path isValid and path isPartial? which one should return false if there is a hole in the navmesh and the destination shouldn't be reachable?
neither iirc. Both will be true.
Depends on if you have "allow partial path" enabled when you do the pathfinding request. If you use a MoveTo task in a behavior tree, that's a setting on the node.
So what is isValid exactly if it's true even when the destination is not reachable?π€£
I'm using FindPathToLocationSync in code
If both IsValid and IsPartial are true, that means the destination itself is not reachable, but this is a valid path that brings you as close as possible to the destination.
Oh ok so i should check for isPartial false?
If i want to know in advance if a character can reach a destination. I mean Not just advancing trough it but exactly getting to the point
Yes.
Thank u man for your wisdom!should i also check isValid or just !isPartial?and also is this only if don 't set allow partial path true?
both IsValid() and !IsPartial()
When you call FindPathToLocationSynchronously, it runs a FPathFindingQuery that has bAllowPartialPaths set to true by default.
If you want to control that, you should make a FPathFindingQuery yourself and supply that to NavigationSystem->FindPathSync (or FindPathAsync). See how FindPathToLocationSynchronously does it.
If you set bAllowPartialPaths to false, then IsPartial should always be false.
I can just keep it default and check both IsValid() and !IsPartial() if i understand correctly to get what i want right?
yes
Thanks again manπ
Been waiting for this node to be deprecated forever π Finally
so whats replacement of it?
There was a function does the same thing with that, with almost same name
GetRandomLocationInNavigableRadius iirc
its just not pure function unlike deprecated one
only difference is that
since pure nodes are executed multiple times if you connect their pins to multiple inputs, to check if Return Value is true you were running the function twice in BP
they favored non pure function and deprecated this to fix it
That's not what I've been told by Epic staff, though it was a years ago. Interesting to know that's incorrect, but more disappointed that more quality of life improvements have not been made.
The older systems are really great and easy to use, so it is a bit frustrating to see the Mass be significantly less design friendly. Is that part of the changes that are coming?
The early UE4 talks about the AI systems centered around how they were used in Paragon, so it is reasonable to come to that conclusion. I think it was at the European AI conference, but I could be wrong about the specifics.
It's reporting that it can't find the AI Perception Component. π¦
This is where I have to confess I just realised that all the examples given show the Perception Component being added to the AI Controller rather than the Pawn BP!
Edit: Yep, that's solved that problem ... so the question is now, is it standard practice to have a different AI Controller Class for every class of enemy, or is there a way I can continue using one class and defining different perceptions in the enemy BP?
all internal game projects
Interesting
Hi, anyone know why if the Blackboard based condition returns False (when "IsBlocked" is set to True) the "move to" continues instead of going back to FindNewRandomLocation ??
That's not what I've been told by Epic staff, though it was a years ago
Iβd love to know who told you that π Unless that was more than 10 years ago then fair enough, until I started on UE4 AI toolset Epic indeed didnβt care about AI that much.
it is a bit frustrating to see the Mass be significantly less design friendly. Is that part of the changes that are coming?
MassEntity has only been recently declared Beta, and the other Mass modules are not even that (i.e. theyβre experimental). Making Mass more non-programmer friendly is definitely on our to-do list. We just need to prioritize tasks based on available work force.
The early UE4 talks about the AI systems centered around how they were used in Paragon, so it is reasonable to come to that conclusion. I think it was at the European AI conference, but I could be wrong about the specifics.
I did indeed give a talk about AI tools use in Paragon at nucl.ai (RIP π₯² ) back in 2016 or something like that. But the systemsβ first client was Fortnite StW, we just werenβt allowed to talk about that π
really hard to say without more details. I suggest looking at vislog - it gathers a lot of BT related info and might directly answer your question π
thereβs always something brewing π
Fortnite StW
Never forget π
Thank you I'll try that π
I need to stop a task with a service, is it possible ?
I think not directly but you can do this by communicating with the task with a BB value, or you can listen for any callback like a delegate
If you are on C++ UBTTask_MoveTo is a good guide to how to manage task state
Tried using a decoartor checking for a vlaue but I think it's only called once (when the task is called forthe 1st time) and it's a move to, how can I "listen for any callbacks" in BP ?
It's simply using a delegate (event dispatchers in BPs)
Oh yeah, the perception component should be on the controller. It's best to divide logic between the controller (decision making) and character (execution of actions).
Some people make different AI controllers for different AI. I don't and instead use a data asset to define them. You can configure the senses on possess, but you need to call request update listener on the component after you do so. Or maybe it's just needed for setting teams.
Decorators are calculated each frame if they are relevant to the tree
How should I implement that in a behavior tree ?
Uh that's werid then...
What is your goal? In what conditions you want to stop MoveTo task?
In your case it's better to use decorators
thatβs not quite correct - Blackboard-observing BT decorators only reevaluate the condition if the observed BB keyβs value changes.
The decoartor basically checks if the ai is stuck, and if so sets the IsBlocked variable to True, even if tyhe value is correctly set, the task is still "active"
Oh I thought they're being calculated each frame if they are bound to selectors. Thanks for correcting
I want to stop it when the character is stuck
how do i make set focus, focus on something other than the pelvis?
UI don't get it
Make sure your BB-observing decorator is set to actually observe the value - I donβt remember the property name, but it has values like Abort Self which you need here.
and use "is set"
If your focus is an actor, handle this with IK/Animation directly, you can provide a location by an interface etc
i don't know how to do animations and stuff
IK also isn't great to work with for what i am using
Uhhh I see it seems to work thank you!
is there a way to make the AI focus on a specific bone?
I'm not sure I understood but MieszkoZ answer seems to work fine π
Yep it works thank you guys!!
But I don't think I understood the use of "observer aborts" tho
it configures the behavior of the decorator if the condition valueβs changes
Yes, your AI rotates towards the focus on tick inside of a C++ function called FaceRotation, which is called by AI Controller
It directly rotates to the focus's location so if you are on C++ you can override the FaceRotation and implement your own custom logic make your actor rotate towards a specific point in your actor. If you are on BP, I dont know if AIController has a relevant function to override but if not, disable Use Controller Rotation options in your pawn and handle rotation automatically, get the current focus and implement your own behavior in tick
I don't remember who it was. It was either the dev relations person or on UDN. Probably in 2015 or 2016. All I remember is that I was asking about nav link regions (I think that's what they are called), because I was working on a nav link editor tool.
nucl.ai was the conference.
without it itβs just an βentryβ condition, being checked during βnext node searchβ
you might also enable/disable Use Controller Rotation options if you have a valid or invalid focus so you can continue with rotating to your controller rotation
Uhh okay it'll only check once if set to None, thank you so much for your time! β€οΈ
Does it do what you want it to do? Then it looks fine. I personally would prune it into subtrees, but I work on a game that needs a lot of flexibility.
prune means make into smaller trees which have more options?
Most people use set focus as rotation of the capsule and look at is separate functionality, usually done in the animation stuff.
Right now you have it set up that if you made a different AI that needed to change the tree, you'd have to build a new full tree. Maybe that's fine for your game.
Hi all, currently experimenting with AI and behavior trees, but worried as my tree is getting pretty large. I have a LOT of cases I need to check through, and I'm combining some c++ on the AIController, I just want to make sure it's normal to have huge behavior trees before I go further down this rabbit hole lol
What would be a good way to do escape mission scenarios? I want my ai to stop chasing the player and despawn after some distance
You can set up distance conditions in your AI's BT, based on blackboard key, and control flow / abort tasks based on that. Not that for performance reasons it is be better to have a discrete "distance to player" blackboard key (to contain enum values like 'melee range, close, medium, far, too far, etc) as opposed to a regular float value.
Despawning needs to be done by a separate system, it's a game-specific thing.
I despawn from the actor that spawned them'
I meant that there needs to be a dedicated system that decides whether to despawn an AI agent, it shouldn't be the agent's decission. It can however be based on agent's state (like BB's "distance == too far")
Yep I manage it centrally. I have a mission actor that spawned them and that despawns them and completes the mission
What do you mean by "pretty big". I know some projects that manage their BTs just fine, and the have like 180 nodes in the bigger ones. I would however caution to not put too much low level details in the trees - our BT design works best when applied to AI's decision making (i.e. what to do) and leave the execution to AITasks (i.e. how do to it).
Ok... so what's the question again?
It was more approach based. Is that the right way? So if I exit the ttigger, despawn after 10 seconds and cancel if it enters (this came to me now)?
there are so many ways to approach this and it heavily depends on the kind of game you're building. What kind of level of persistence do you need, does forgetting match creature/npc design, how often can such a "mission" start, be canceled, resumed, etc. Do whatever and see if it works and iterate on what doesn't.
It is open world kinda like GTA. Currently toying around with barriers until all enemies killed vs escaping without killing.
Ok, we're getting somewhere π I'd create a MissionManager what would host Mission instances that contain mission's state and state transition logic (basically small FSMs). The Manager would know about "active" missions and on events or tick would reevaluate each mission's failure and success conditions, with optional behavior on entering each state (like granting points/item, progressing story, [de]spawning actors, etc). Mission's states could also be objects that tick and contain state- and mission-specific logic.
Something like that π
I'd say it's more of a gameplay than AI question.
I already have a graph that runs what mission has to begin and all which is stored on a Game Instance Subsystem, and actors that tally to the mission. I'm thinking of using that to manage this stuff. The thing is how do I not make the despawning look cheap quality was what I was thinking. In Cyberpunk, they don't chase you too far for example
has anyone faced issues with navmesh with streaming levels. I mean parts of the map get loaded depending on the position of the player
I would make it it's own subsystem personally. Probably a world one at that to be honest. To make the despawn not "cheap" looking, just despawn them off screen. After X seconds of getting out of your AI's chase range, have them find a place off screen and then just despawn them. At least, this would be my first approach. I'd then just iterate from there.
Maybe you changed the hotkey accidently? No AI is actually in view?
What is the basic tick rate of a behavioural tree?
How can I improve AI's path finding ? It feels weird when AI selects path close to wall and cuts corners so sharp when there is a lot of space.
Thats called string pulling
You can use detour crowd controller to help it a little bit
But one way or another it will select closest corners
If you are willing to dive into depths of navigation system we made a conversation with zoombapup about possible implementations to make this better: #gameplay-ai message
Though it's confusing af if you dont have PhD for AI systems π
And if you ever use detour crowd, it might not work at all because detour is too authoritative and does its own string pulling
If I am not mistaken Unreal Engine already use string pulling when finding path, so that means UE's (Detour's) string pulling is not good enough ?
Its good enough, but it what makes your movement being close the wall and cut corners
But original detour framework has better features
based on zoombapup
UE's detour implementation is not exactly same as open source detour iirc
even though it's taken from there
Easiest way to overcome this is rolling a crowd system like detour or RVO, then trying to tweak values until its good enough
but if its not good enough you'll have to dive into depths of nav system
The video shows what I want exactly. They did a good job with that.
yeah thats what I wanted to achieve too, and zoombapup gave some high-level insights about how to achieve it but framework was too complex for me so I couldnt do it yet
Tbh its more of the math part rather than framework itself, and too much R&D time is required
because string pulling part is pretty straightforward if you are familiar with low level parts of AIModule
if you have enough knowledge maybe you can just take some specific part and tweak it as you desire but I'm lost in the code
Yup, that's about what I've been doing. Right now I have a lot of tasks in the lower-level until I get his traits all worked out then I'm going to create some more custom ones to clean and group up what I can. Just wanted to make sure this was the most effective way to do it but I think I got my answer. Thanks!
I would however caution to not put too much low level details in the trees -
Thank god our BT system is not like Ubisoft's Snowdrop π A few months ago I was complaining a lot but over the time I understood it was a good decision to use BT as decision maker only
When I add a custom Task in my BT, I cant choose which BTKey to use in the Task, I need to open the Property Matrix
It shows in the Matrix
But isn't there a way to see it directly in the Behavior Tree ?
Is it a public variable?
There, thanks, that's what I was missing π π
subsysten would kill off all npcs on the map. I would need it for a certain area so a director AI would make more sense right?
My Pawn is a boat, with Buoyancy and stuff, from the "Cartoon Water Shader".
The way it can move is based on this screenshot.
So I cant really setup a BehaviorTree using "MoveTo" or anything related to "CharacterMovement".
Is there a way to implement this in a behavior tree without reinventing the wheel ? I would like an AI to be capable of controlling that ship Pawn
How should i handle navmesh with unlockable Doors?basically they should block the navmesh when locked(as they do with static navmesh), but once unlocked (they will always stay that way once unlocked) the navmesh should generate trough the door
Nav Areas or nav links.
has anyone here successfully used mindmaker for reinforcement learning in unreal engine?
(if so, please @ me!)
I thought you typed mindraker then for a second π
Yeah, what @uneven cloud said. Using areas or links is better than straight up punching holes in navmesh, because you can still plan a path through those doors, just do some fancy stuff when you reach that part of the path.
there's also Epic's own MLAdapter. Still experimental, but there's already a lot of good stuff in there.
I wrote my own ML integration for UE use.. mainly because I have to support other tech too
Looks like we just won a bid to do some more work on it for a few years
It looks like mind-maker makes it very easy to do experiments (I'm not an RL specialist, but I've run other forms of machine learning, like dreamfields --> https://www.instagram.com/p/Cjjb9RSPbJn/ which are kind of advanced), but I want to get into RL, and it seems like the easiest way to do it in the engine? Maybe I'm wrong and I should use their adaptor, idk.
The UK govt just standardized on another engine for simulation use, so having to work with that
I'm just having trouble with the docs... like can't run the example.
Is there a realy good tutorial for the epic adaptor?
This mindmaker thing sounds simple enough, socket client on the UE end and a server on the python end.. which is exactly my setup too
Whats the problem you're having with it?
My problem, and I'm sorry, this is probably so stupid, is that you can use their engine (here: https://unrealengine.com/marketplace/en-US/product/neurostudio-self-learning-ai) to connect to their training environment, internally. For some reason, I can't figure out how to do that, or I can't figure out how to start it.
Tried this tutorial: https://towardsdatascience.com/create-a-custom-deep-reinforcement-learning-environment-in-ue4-cf7055aebb3e
?
I did try that one, and for whatever reason, it did not really work for me. As in, total learning style clash, of some kind and/or it's not written in a way that I could digest (I learn from tutorials a lot).
what was the reason?
Like, he has this video:
A demonstration on how to generate emergent behavior in AI characters using Unreal Engine and the free machine learning plugin MindMaker. The aim is that the interested viewer could use this as a guide for creating emergent behavior in their own game project or embodied AI character.
Relevant Links:
MindMaker Github :
https://github.com/krumia...
which is pretty amazing.
And, I am just trying to make the absolute stupidest version of that.
Which could be the cart pole, but something about the way the article is written is just not working for me.
Do you know unreal engine well?
I know the engine pretty well. I've made four games.
So its not likely something engine side?
Well, I went deep in his documentation and I think this is thing that's confusing:
Download Latest Plugin Release from GitHub or UE Marketplace
Download a compatible MindMaker Learning Engine or use the one included with the example project.
Move the learning engine and its accompanying files into the Content directory of your UE Project. The exact location of the learning engine should be "Content\MindMaker\dist\mindmaker\mindmaker.exe" if the location isnt as specified the plugin will not work to automaticaly launch the learning engine at the start of play and you will have to manually launch mindmaker.exe before begining training.
Place the MindMaker AI Plugin in the Plugins directory of your UE Project.
If you have downloaded the MindMaker DRL Starter Content & Example Project than simply open MindMakerActorBP blueprint or MindMakerAIControlerBP blueprint from the Content\MindMakerStarterContent\Assets\MindMakerStarterContent\MindMakerActorBP directory and begin creating your custom learning agent using the functions supplied. Be sure that the Socket IO address and port your are using is set to http://localhost:3000 .```
The exact location of the learning engine should be "Content\MindMaker\dist\mindmaker\mindmaker.exe" if the location isnt as specified the plugin will not work to automaticaly launch the learning engine at the start of play and you will have to manually launch mindmaker.exe before begining training. <-- like, I don't have file called mindmaker.exe
so what is he talking about?
Did you download the example project?
Ah, I get it.. so its basically a free plugin, but the server that supports it isn't free
sneaky
The plugin is basically a socket client
you need the server part to have it run (client needs to connect to it)
So, I have the plugin (free I think) and the engine (not free).
Right, so the engine should have that server then? if not, maybe contact the guy?
Sigh, yeah, I did that earlier today, was just wondering if anyone had used it, and gotten it working.
Well, without the server, you aren't going to get it running
After getting the dreamfields to work (which was a longtime goal), I got really re-hyped about rl again for unreal.
Yeah, this is a bit weird.. not a fan of open source that isn't π
It does say that the server engine is included with the sample project?
I might have it, but bc I just really can't understand this documentation, I can't figure out how to use it, lol.
Like I have all these files in that directory.
There's just not like a very clearly explained "hunt for berries" example.
In his tutorial, he doesn't really sectionize things out, so it makes it pretty hard to understand.
And the cart pole example is way less interesting than hunting for berries, even though I know for RL it's the hello world.
Well, yeah, get that up and running and the rest should be easy enough
Ugh, looking at linked-in for jobs is tragic π
I mean its saying something if the job ad is putting you off already π
"must be able to work in a fast paced rapidly changing environment" = "we have no fucking clue what we're doing and we'll blame you for the chaos before we take any responsibility ourselves" π
Sets the standard doesnt it
There's a lot of it about though..
That's the majority of jobs. Sadly hr departments are in charge of hiring and they're the most clueless bunch out there.
Still, kind of depressing, I'm interested in looking at new jobs, but most of them actively put me off
usually a copy-paste sentence or two that red flag me instantly π
I mean once I've filtered out the blockchain, nft and other crap obviously
what makes you think they aren't already AI?
No sign of intelligence.
I'd argue that is not without precedent for AI π
I'd agree, but we see signs of it solving more problems than it's made. For now.
Certainly wouldn't say that about hr anywhere lol.
right, off to work.. ttyl all
the default key doesn't work on some keyboard locales. Try assigning some other key to it or use gdt.Toggle console command.
An interesting tidbit - I dug up bot BT from Paragon - 110 nodes including all decorators and composite nodes.
Hello, not sure exactly where to ask this so I'll phrase it as an AI/behavior tree question. If I have a passive/ambient "NPC" actor and I want them to switch up how they're standing or sitting every 10 seconds (could be just changing a variable and the anim graph will handle it), maybe take a drag from their cigarette (play a montage) every 7 seconds, scratch their head or kick dirt, etc:
What's the more performant method to do this? Timers? Or using only the behavior tree, or some unknown secret 3rd option?
Especially if I mention that there may be 7 or 8 of these passive NPCs in this area.
Various ways to do this, but if that "idle" behavior is not stateful I'd just have a task managing this
performant method
performance is not a concern for a simple thing like this so you can go yolo with most maintanable method imo
OK, that's all I need to hear then haha.
when using multiple behavior tree for different enemy type it seem the variables are getting confuse and being invalid for the behavior tree i want to up date a vector on. is there a way to specifically have that vector update on the behavior tree with out it causing confusion to it self? i even selected the correct blackboard key
For a second there, I read it as the minion had 110 nodes, completely forgetting about actual bots in the game π
I miss Paragon π
I remember I downloaded Paragon and next day Epic declared they will shut down it
I was like: 
Because Fortnite π° π° π° π°
It was a really fun game imo. And graphically gorgeous, as usual with UE games from Epic.
They just really botched the way you would do items. And that's why it didn't really take off imo. The card system was too confusing for a lot of people, especially people just getting into MOBAs
what would be the reason a vector would be invalidated even tho the vector is updating and is selected as a blackboard key.
Even confused some veteran MOBA players.
that sounds too vague, try checking visual logger
most changes are logged there
otherwise its probably your code
@crystal hatch Sorry if stupid question. But why are SmartObject / GameplayBehaviors tied to AIControllers .. or why would you not allow a player controller to use them?
BT does not have an utility to invalidate BB properties on its own
ima take a screen shot as it just a simple ai move to BTT
so instead of getting the vector i should set the value as a v ector?
ok i see it updating now on the blackboard.
i cant believe i didnt see that myself lmao
we kinda do, it's just not released just yet π I mean: we're working on it.
Alright π
Also a request.. if SO Comps could have events for on claim/use/release, so you dont need gameplay behaviors and configs for one-offs that you could handle in the BP.. π
that could be arranged. Or you could prototype it and post as PR π
I change agent radius in project settings, but every time i open project, the radius is back to default 35. I also tried changing from recast nav in level but always it goes default when i open project. Is there a way to do like begin play on level and changing the recast settings?
Are you using source control?
Great to hear it is planned!. My colleague experimented with SO for interaction system which is used for both player and AI and was a bit upset because of it being tied to AIController. Making it work with player required some boilerplate what!ve made him doubt if it is actually expected to be used also by player. Looking forward also to see what will happen with the Gameplay Interaction / Behaviors stuff.
Make sure your DefaultEngine.ini is writable.
At what mapsize would you consider using navigation invoker instead of in editor generation?
when running my behavior tree it correctly go to my last player location and move to it, but once it there the sequence does not continue going from left to right it automatically jump to another node with out me even having any code /condition to make it change to that particatular sequence
it jump from bt_search zone to move to and then jump to the chase player move to when connected
it super weird..
it doesnt continue to the wait node either once it hit move too that is in the guard searching
Hey there, I'm studying EQS and I wanted to do the character stop when there is a free path to the left. At the moment, it it's just choosing the farther path.
Someone can has any suggestion about where should I start?
You want it to always choose the most left path point?
For now, yes. Otherwise, it will go forward and get blocked by the wall
Oh, I thought I misread for a second
You might need a custom test for that, that written in C++
where you calculate and score most left point
or....
set EQS method to "all results"
run query in blueprint
receive all FVectors evaluated in EQS
filter on your own in BP
I've done this before for a client, they didnt want C++ but since generated points was too much and for loop was very expensive in BPs, it ended up causing some overhead
but it wasnt running frequently so didnt end up being a problem
π€― And I thought that I was starting slowly .. this sounds not that slow
Our custom test is inherited from which class?
Thank you, Eren! I will check it out!
Speaking purely theoretically. I always wondered if blackboard could be one day replaced with just a normal UObject having uproperty variables of any type. Especially now with https://github.com/DoubleDeez/MDFastBinding/wiki/Field-Notify-Properties it might be a bit easier to create event based systems. I guess it would be too big of a change for PR, right?
Mieszko told they can only start updating old system in around 2 years, iirc. So one day maybe we can start to get radical updates, but i wouldnt hope they will happen in near future π
Be the change you want to see in the world. Make a PR
Hello guys , what am i doing wrong ? I want to damage the AI via colision , but only the first swing ( sword animation ) gets registered.
it all depends. If for whatever reason I get assigned to a game project the updates will be plenty and frequent π But as things stand we do indeed have at least of a year of work ahead of us on the new stuff.
Posting PRs is however a good way to start us (or at least me) on a feature - often we take a PR and pimp it up. If you post a PR you increase a chance a given thing will happen
almost trivial!
But as things stand we do indeed have at least of a year of work ahead of us on the new stuff.
That's understandable, creating useful stuff takes time
often we take a PR and pimp it up. If you post a PR you increase a chance a given thing will happen
And I'm very happy to hear this. We always went "get insta rejected when you do PR" mode in community chats but seeing an Epic staff encouraging people about this is something very valuable because I think with communication between Epic and community can cause good beginnings
I always encouraged my AI team teammates... team-mates... guys from the AI team π to be very proactive in considering and responding to PRs because that's the best way to encourage people to share their stuff with us. Last year or two we haven't done too good of a job due to the work load, but I promise we'll get better.
AI team's policy is therefore "No insta-rejections!"
I think that "get insta rejected" meme/myth came up because of other frameworks, I saw the Instanced Struct's PR, even though people went sarcastic over it in community from what I can see actually Epic staff was interested in the PR
So I'm pretty sure AI team wasnt the cause of that sentence π
Mikko did actually pull the BP-accessibility PR with great joy and relief that someone did most of the work for him.. Or was that replication? We have too many systems on our plate! π
Or was that replication
both π I also already pulled those PRs to my own source build too
thanks for the information about your PR policy btw, I'll spread the word to encourage more people for making PRs to AI Module
we have some solid programmers at #cpp that are willing to make PRs sometimes but they are not doing anything because of that meme I told about
also spread the word to tag me in any AI-and-other-stuff-AI-team-does-related PRs so that those don't get lost in limbo when our git-to-jira bot goes down or bonkers
Alright 
Hello everyone, have a problem of not being able to cast to IGenericTeamAgentInterface in Blueprints.
Is there a way for me to get the IGenericTeamAgentInterface via Blueprints, because i don't want to cast to a specific controller which has this interface
It's not a blueprint type. Why do you need to cast to it?
to get an implemented version of GetAttitudeTowards
because it's kinda cringy to cast to a specific Controller for it
it would be trivial to add a BP-callable native function that would do that, I mean, call GetAttitudeTowards
i see no other options but do an interface, which can be called in BPs, which will be calling GetAttitudeTowards
but anyways, it's kinda lame i can't cast to IGenericTeamInterface in BP, don't even understand why did they make it like this
Well as I said why not just make a function you can call for it?
That's a pretty simple solution for it
cuz i will have to create another interface just for that
No you don't :)
ETeamAttitude GetTheAttitude(AActor* Thingy) const
{
//cast thingy into IGenericTeamAgent
//call function to get attitude
}
and make it BlueprintCallable
now you can get it directly from it
You could make it part of a blueprint function library
since it's quite generic as it works on any actor
Yeah those are usually a decent way to expose C++ functionality into BP's in situations like this :)
When I finally get a local version of the source cloned and built, I already know my first AI PR. It will be glorious. Fix a long-standing complaint I know people have. Just need to get a new drive first. Specifically for UE shenanigans π
How do you feel about an optional parameter to copy matching keys' values between blackboards when injecting a subtree? Then it could function as a stack. I saw someone from the team mention this on UDN somewhere, I think it could be a nice contained and positive change. I should still have it somewhere in a local branch
Also I think the AI team has been quite responsive to PRs in the run-up to 5.0 and after, thanks π
what's the PR?
Something in your sequence is likely failing.
Never. Invokers are expensive and cause a significant amount of bugs.
Smart objects and gameplay behaviors aren't tied to the AI controller. Sure there's a BT task that is, but you can easily make a driver for the player.
Are you changing it in the nav mesh settings or the agent settings? If you are doing it in the nav mesh settings, you need to create a default agent settings first or it won't work. It's the supported agents array in the navigation settings.
To be honest I haven't used dynamic BBs myself, I never needed to, so it never crossed my mind, but the idea is foreheadslapingly-obvious! Brilliant! Please PR it and tag me and I'll pull it in (after some massaging and potential iterations).
Might not be as straightforward after more thought, now I remember why I dropped it. It would need resolving key selectors again if raw data pointers don't match up, right? Especially once we inject more trees in different locations, then inevitably we need to frankenstein the BB data a little bit. I'll see if it makes sense over the weekend. Haven't needed it at work either cause I just made a higher-level decision maker.
On that note, I've noticed the GameplayBehaviors plugin, watching with great interest π
What s the difference between changing navmesh settings(cell size etc.) In the recastNavmesh object vs the ones in project settings?
Changing them on the object affects the currently generated mesh iirc, and if you had to regenerate it it would use the options in project settings
So if i have it dynamic it would use the object settings at first, but at the first change it would use the project ones?
No, it would keep them. It will reset if you delete the actor and generate fresh. Also in any new level ofc
I don't understand then. I set it up dynamic with modifiers only. Then once i change the class of a modifier at runtime(to open a path), the whole navmesh is different with holes it hadn't once started playing
Navmesh generation parameter changes are mostly ok (voxel size, tile size, etc) but if you change agent properties too much the navmesh might get discarded on load time if it doesn't match any of the declared SupportedAgents
What do you mean ok?i asked the difference between the project settings and the local recastNavmesh in the map. Which one wins?
Why can they even be different?
Project settings are defaults, and navmesh instance can have theirs changed. And on top of that there's SupportedAgents that can control what gets discarded and auto-created.
Instance's changes will persist unless the whole navmesh gets discarded due to not matching SupportedAgents
So if after i change a navmodifier area class at runtime the navmesh changes elsewhere too, does that mean it got "discarded" as you say and generated with different settings?
I don't understand what navmodifier area changes have to do with navmesh properties.
Doesn't it trigger a new generation of the navmesh?
NavModifier(Volume I'm guessing) changes will indeed trigger navmesh rebuilding, but only local to the modifier's bounding box. In principle.
No not a volume, the component you can attacch to actors. I start with it as null, then i change it to default at runtime at some point, but it's not only the navmesh area around that objects to change, it changes elsewhere too
sounds like an issue with your setup and it's hard to guess the details from what you describe.
if you're changing an actor instance then only that one actor should be marked as "navigation dirty" and only its neighborhood will be rebuilt.
Yeah it seems the case, i can see which area get rebuilt now(becomes red for a sec) and it is the one around the object whose nav modifier gets changed. Only problem is this area is pretty big (20m) and doesn't reconnect with the Neighborhood properly, leaving gaps
Do you know with what settings that area get rebuilt dynamically (so maybe i can adjust it), the project ones or the local recastNavmesh ones?
I don't understand what you mean.
Ok so, when i change a navmodifier at runtime, a portion of the navmesh gets rebuilt(i can see it gets red for a sec). Do you follow?
clear so far except for the details of how you change the navmodifier at runtime.
It has an area class, it starts at null(no navmesh in the modifier area), at runtime i change it to default so that it opens a path
you change it how - directly assigning the AreaClass or calling SetAreaClass?
Set area class
ok. Then what happens?
I want to know which settings this rebuild uses, because even though the path i want gets opened, the rebuilt area (the red one for a sec) gets isolated from the rest of the navmesh with an annoying small gap. What settings does this rebuild use, so i can modify them and get maybe a better result?
My runtime generation is set to "dynamic with modifiers only"
What settings does this rebuild use
This is a wrong question that got me confused. It's not "using settings to rebuild". It's just triggering local navmesh rebuild, based on given navmesh instance's properties. If you're usingDynamicWithModifiersOnlyit shouldn't result in any gaps, unless you already have a pathological set of parameters (something that only happens to work); or the actor itself has an awkward collision shape/setup and/or is placed at an unfortunate location (like at an unlucky distance from nav tile's border).
Double check if your runtime navmesh instance is indeed configured asDynamicWithModifiersOnly
the settings look correct. Can you post a screenshot of the before-and-after the SetAreaClass call?
fwiw, have you just tried to see if it works ingame? The visualization of the navmesh is known to sometimes be a bit janky, and this could just be an artifact in that part
The visualization of the navmesh is known to sometimes be a bit janky
How's that? Navmesh debug-drawing is based directly on the Recast-data of the actual navmesh. If it's janky the navmesh is janky (and that does indeed happen).
I've seen it render at the wrong coordinates sometimes, tbh not sure if it would have any other issues besides that but it seems like a fairly simple thing to test that could save some time debugging it :)
oh yeah, being drawn at wrong location is an issue I've accidentally introduced at some point by letting people manually modify navmesh instance location. Sorry about that π
haha :)
I don't remember if I actually ever ran into it myself, but I think it came up here a few times and it did usually fix itself by just hiding/showing the visualization again or some other simple fix like that
yeah, it doesn't. the gap is real
before the door is open (nav modifier null)
after it is open (nav modifier default). You can see the weird gaps are the boundaries of the rebuilt area and where it connects(badly) with the unaltered navmesh
here i set the nav modifier to default BEFORE pressing PLAY, thus not at runtime. The navmesh is good and there are not issues. So the problem is when it gets rebuilt at runtime, it's different
looks like a bug and I can imagine how it could happen. If you could report a bug with a repro project should be able to fix it rather quickly. We're not utilizing "ModifiersOnly" mode internally so it could have rusted a bit.
What are your reasons to not use fully dynamic generation? Can you try and see if the issue persists?
My reason would be performance i guess?(not very expert on navmesh stuff). Do you recommend to use dynamic instead of modifiersonly?
I'd stick to dynamic generation unless there are (confirmed) performance concerns and the game doesn't need nor would benefit from being able to dynamically create walkable surfaces (which is not possible with "modifiers only").
@crystal hatch Anyway it would seem it fixes it to set BOTH recastNavmesh in the map AND the project settings to dynamic. If just only one of them is set in an other way, the gaps appear when i change the area class of the navmodifier
Hello, I was following this page for for AI character to move to a destination. Its simple setup, where i spawn my character and behavior tree tells to move to a certain destination
But my characters are simply not going to given destination they flickering here and there
Are you generating a random location? It looks like wherever you're setting the Random Location is constantly updating so his destination keeps switching, hence the flickering effect
What is your code for SetStartMoveLocationTask?
@crystal hatch is there a generally favoured way of triggering GAS abilities from AI that's not reliant on input bindings i.e. mimicking a player? I assume that's how Paragon did it cause you had knowledge of what the QWER for each character was. I'm figuring this out for a game where NPCs can have quite fluid ability sets and it feels like choosing which toe to shoot myself in
current idea is: code Ability subclass with an explicit "Ability ID" tag property, which then is copied into a spec's DynamicTags, and we trigger abilities by Dynamic Tag
(or is this a question for another team)
I suggest recording a vis log - I bet it has all the info needed to solve this issue.
The way I implemented that for Paragon bots was:
- I added a BB key to store an ability spec handle
- implemented a kind of a native service that would constantly (i.e. every tick) pick the best ability based on current state and target
- for every ability I had an EQS query for positioning
- had a AIDataProvider with a bunch of data on "currently selected ability" -- used this to configure movement, EQS queries, ranges, etc.
- I had to hijack some of the ability tasks creation, the ones that do require input and/or camera, and created AI alternatives instead.
It was a lot of work initially, but once it was all in place it just work almost seamlessly for all new characters.
That's some food for thought, thanks!
Here's the log, sets the target
After that its all the below logs for all frames
looks like your navmesh is being rebuild constantly. Does your character affect navmesh by any chance?
vislog should visualize the path that has been taken - can you show it to us? The log also says the path is partial which supports my guess.
Yes the AI character is set to after nav & in settings navmesh is set to dynamic
My bad* the can even after navigation is turned off.
And here's
is that a nav modifier component on the character? If not - what's that then?
Its on Capsule Component
It's like I said - your character is invalidating navmesh as it moves. I strongly recommend not having characters affect navmesh, at least while they're moving. If for whatever reason (that I'd be interested in BTW) you really need to have that then with some code trickery you can make characters follow invalidated paths to not react to navmesh changes, but that's asking for trouble down the line.
What's the setting which is affecting navmesh?
you've made the capsule a nav obstacle - that results in the capsule marking underlying navmesh with the indicated area class.
hahaa what a nightmare!
it's a kind of a mistake you only make once π
Can Affect Navigation Generation was turned for Capsule Collision but was on for Pawn!
Turning it off there fixed it
Thanks ^.^
np π
Why can't I assign here?
sys_Y_em
aside from the warning saying that NavArea is of type UNavigationSystemV1*... what's NavArea's type?
I found out the issue, thanks dude
are there any significant changes to state trees in 5.1? I read somewhere here a couple of months ago that some parts of it were planned to be reworked in 5.1
Why when I try to run AI debugging with the ' (apostrophe) key, the whole game just lags and after a few seconds I get like 1 frame per 5 seconds. Even if there is no BT running on AI. (UE 5)
Have you added anything to the gameplay debugger?
Does anyone know if StateTree is intended to be a replacement for Behavior Trees in UE5? I cannot seem to find a lot about it other than it supports MassAI
No. Just another tool to use.
Yes. Mikko's working on the StateTrees full time and refining the design and implementation with widening internal adoption. The API is getting stable since in 5.1 StateTrees are marked as Beta (and it means no crazy changes will be done to it anymore)
In principle what StateTrees can do is a superset of what BTs can do, but due to BTs wide use and some unique advantages over the StateTrees (at least currently) we're not planning to discontinue supporting BehaviorTrees, not for the foreseeable future. Having said that, Behavior Trees are more in a "maintenance mode" - no development is being done for BTs, we're just keep them running and fixing rare issues reported by internal teams and licensees.
Thanks for the info. Also is there a MoveTo-like task for the state trees in 5.1? I remember not finding anything familiar back in 5.0
No. But that sounds like an interesting thing to look into to get to know the codebase better π
Hah, I actually tried and thought that I'd have to adapt the BTTask_MoveTo internals and make my own STTask_MoveTo, but then I thought like hey it's only 5.0 they are definitely going to make some common use task like they did for behavior trees
we definitely will π
Also Mieszko I can't miss the great opportunity to ask the man behind UE AI some abstract questions if you don't mind.
For example why aren't dynamic behaviors injected recursively? I could probably do it myself since we have custom engine on our project but maybe there are some considerations your team haven't done it?
I mean afaik if I have a run dynamic behavior in a BT that itself is injected in the root BT - that 2nd layer BT won't get filled and hence not run
To be honest I never tried that π It should work and if it doesn't then it's a bug. A bug that to my knowledge no one ever reported π
but we do have some limitations in our BT implementation (like not supporting fully parallel composite nodes) that are a consequence of our focus on pushing the even-driven approach to the limit.
the man behind UE AI
I'm the man behind UE4 AI, along with a lot less vocal Εukasz Furman (still at Epic, but no longer working on AI). UE5 AI is a team effort (which is my excuse to not know all the details π ).
Hmm then I'll check it again. Also I was always wondering how could one extend the default perception sight sense in a way that bots could see players by witnessing their heads or limbs for example. Because as I understand the default sight implementation traces (shape sweeps) to the actors root (which is on around pelvis level for humanoid characters) and hence bots won't be able to see a player behind, say, a wall which is 2/3 height of a character. I was hoping I could just add extra stimuli source components to my characters but those are actor and not scene components. Could you suggest anything here?
This is actually supported out of the box - all you have to do is have the player pawn implement IAISightTargetInterface and override CanBeSeenFrom and perform line-of-sight tests to whichever parts of pawn's body you like!
Oh wow, cool, thanks. I hope you are going to stay here in slackers for a while π
I intend to, but if I disappear feel free to summon me (I can always ignore it π )
I'm not aware of anything, only possible if its done via hotkeys because I fat finger them all the time π
If couple of AI bots want's move towards a desired location, AI move to stops working on Proxy's.
Have turned on RVO avoidance but still they get stuck
Why use navlink in such a case? My guess is the issue comes from mismatch between PathFollowingComponent's expectations (navlinks are for jumping or custom movement) and the character's movement mode ("walking" in this case)
I had created empty space for navmesh to build path, but the result was same. Hence tried out nav link
you'll have similar issues with multiple agents trying to access given location, regardless of whether it's a chokepoint or a navlink start location.
it something you'll have to solve on the level design side, or add a system for coordinating AI entering such problematic places
i guess coordinating system only would be wise option
@crystal hatch speaking of navlinks, I remembered one more question I was curious for a long time. How do I understand when a bot finished traversing over a smart nav link? I remember there was a delegate when the usage of the navlink starts, but I couldn't find anything to subscribe to when it's time to stop the custom navlink movement. Like for example climbing a ladder or sliding under an obstacles where you need to start an indefinite type of movement which must be finished only after reaching the second navlink point
@keen crow
UPROPERTY(BlueprintAssignable)
FSmartLinkReachedSignature OnSmartLinkReached;
/** called when agent reaches smart link during path following, use ResumePathFollowing() to give control back */
UFUNCTION(BlueprintImplementableEvent)
void ReceiveSmartLinkReached(AActor* Agent, const FVector& Destination);
I think that's the one when an AI actually starts using the navlink
Ah yeah it is. ANavLinkProxy::ResumePathFollowing will be when you are done with it
@keen crow Which calls
/** call when moving agent finishes using custom nav link, returns control back to path following */
virtual void FinishUsingCustomLink(INavLinkCustomInterface* CustomNavLink);
It's a bit painful to deal with these sometimes depending on what kinda behavior you want for it :\
Eg. let's say you have a path which goes into a link, and you want to use another path to go through the link for whatever reason, and then resume the previous path
Not very simple to do this, and if you use the builtin moveto nodes for it, they won't really work for it at all because as soon as you switch paths they will exit
hmmmm, nevers seen it before. thanks
It will work to a degree. If you push a AITask_MoveTo while there's already one running then the running one will get paused and then resumed after the pushed one finishes. If after resuming the AI agent is on the original path it should just pick it up. At least that's what should happen by design π
Awww yeah - got my extra drive set up for source build of UE. Now, I can actually attempt some PRs π
Yes Mieszko, I went out and bought a whole new drive based on your word that you'd appreciate PRs for the AI team π
Interesting, I'll have to play with it some more... not sure if I was using the AITask version of it which might have been the issue π€
right π Regardless, my stand behind my word.
I just need to get one in before @celest python π
you're probably going to beat me to it, because unlike you I'm quite low on free space π
But alas, I have very little time. Quite the conundrum
For reference, this is "low" at Epic π
What's the proper way to deal with this?
you could extend the query box. Use navigation data's DefaultQueryExtent or pass as a parameter to projection function.
Can anyone recommend any source/documentation/project on using Deep Learning models in Unreal?
Hey guys, came here looking for ideas. I'm developing a 3d navmesh volume, for flying ai and stuff, that I plan to release to the marketplace, but I'm unsure of what features would make it more useful to ai developers. It works properly with the ai move to nodes, some things I have on the agenda are a nav modifier volume like a blocker, and a way to link volumes, but other than that it feels lacking In features. What does the AI community think?
Coming with airplane, drone, helicopter proof of concept implementations is my first thought. Being able to take into account their own capabilities to slow down in time (air braking) to avoid obstacles while flying
I'd taken a look at what Mercuna offers - they have features they do for a reason π
Hey guys, is there a way to make Detour Crowd work with multiple supported agents with different agent radius?
Ideally, I would like to subclass the necessary classes and just override implementations, and not build-off engine source code if possible.
Or some guidance on how to change FindPath implementation to search for a path that considers the agent radius (and exclude the tiles that for which current agent does not fit) from one main recast nav mesh (rather than multiple) would be welcome!
Hello.. do you know why my last task is not being run ?
The print string doesn't pop on
My first guess, going on the scarce details you've provided, is that one of the preceding tasks in the sequence failing which would instantly fail the whole sequence (by design).
all of them are running properly. I see them while playing the viewport + if they wouldn't work the ai wouldn't be able to return to idle state
Here i see -1.. why ?
I fixed the number but still I don't see any print string showing up
ah! That (-1) usually happens due to BP compilation errors, but your BP screenshot suggests it's fine. Have you tried re-adding the node? If that fails, I suggest looking at vislog.
Yes I readded it and now it's 25
but the task still doesn't work
god I hate being stuck for these stupid stuff
vislog and gameplay debugger are the tools you should always consult first. Often times they contain data sufficient to nail down the issue.
Meh
I bruteforced it
Now it works 
I just merged it with the previous working task
what will you do the next time you hit an issue like that, but "merging back" won't be available?
About Smart Objects
Anyway of getting a Request Result of a SmartObjectComponent?
I want to claim the SmartObject from a SmartObjectComponent reference and not via the "Find Smart Object" function.
what about a multi-slot scenarios?
Don't get me wrong, I see the need for this functionality, I just want to know community's expectations or intuition in such a case.
I would claim a random slot. I have an example where an AI sees a dead teammate and the dead teammate has a SmartObjectComponent. If it has multiple slots for multiple AI's investigating the dead body, I doesn't matter which slot they claim.
How about having an enum param like All, Random, FirstAvailable etc?
FirstAvailable would be checked by distance to the querier? And All that one Querier can claim them all at once? (I have a usecase for that)
FirstAvailable would be "first on the list" but we could also have ClosestToX. Or we could let caller supply a lambda that would return true for every slots to claim π Ok, I have some ideas. Will think about it π
Nice, looking forward to it π
won't happen
famous last words π
is there a way to stop playing the behaviour tree with a node?
i want the ai to stay still where he catches me
you'll have to implement a BT task node that you'd run once the AI "catches" the player, and execute "StopLogic" on AIController's BrainComponent
Is there a way to force decorator recalculate? I want to let users recalculate utility scores when they request it from AI Controller. Currently I'm listening one of the properties in AI Controller with tick in decorator, and I don't really like that method so if anyone have a better solution I would love to try that.
Is there any way to have an AIController call inputactions and inputaxis?
Like if I want to have my pawns as agnostic as possible to whether or not theyre driven by AI or Player Controller, it'd be super sweet to just have AI call input events
Use a BB value and make it listen for changes #gameplay-ai message
otherwise you need some wrapper layer.
InputactionDoThing -> DoThingEvent -> Do the Thing
AIController.MyPawn.DoThingEvent
When I'd like
InputactionDoThing -> Do the Thing
AIController.MyPawn.InputactionDoThing
maybe you can set up an input component like how player controller does, but I'm not sure
It seems like you should be giving the pawns an interface for it instead of using the input actions directly
so the wrapper layer in other words.
I really need to avoid blackboards but thanks! π
Then that sort of defeats the purpose and simplicity of having input on pawns
Perhaps, but if you want to support AI's working in the same way this seems the most sensible way to do it
Having fake input components etc. might be an option as well but it seems it would just add additional indirection without any benefit
Instead of polling an AIController's property you could add a broadcast delegate to your AIController class that would trigger when that property changes. Then an instanced BT node (a native node marked as such, or every BP node) should be able to bind to it and react. In principle at least, there might be dragons on the edges π
That sounds great, thanks!
Why AIs call "inputs" though
That's just so I don't have to have a layer of events between input and what the input does.
I'm just asking if anyone's done that or knows if it's easy to do
Where the pawn behaves the exact same, just it's getting input events from an AIController and not a Player
Take a look at UMLAdapterActuator_EnhancedInput::Act, it procedurally executed input actions on a UEnhancedPlayerInput instance. UMLAdapterActuator_InputKey::Act works similar for the OG UPlayerInput.
You might notice from the very name of the relevant input components, that they're Player(Controller)-related, not Pawn-related. In general Unreal has not been build with AI-having-input-capabilities in mind.
I think Adriel is on like 4.26
UE4ML then π
I said "look" not "use' π He can look at the code on github π
In that case it's just simple to have a wrapper layer. I was just asking if it was an easy thing to whip up really.
Just seems redundant to have
Inputaction Attack -> Attack -> Do attack stuff
well, that was fast π
I was wondering if it's better to make a single behavior tree, adapted to different NPCs, or if it's better to make a behavior tree for each one (BT_Enemy, BT_Animal, BT_AnotherAnimal, etc). What's your opinion?
It depends on how much the behaviors differ. If it was multiple different humanoid opponents I'd say try sticking to one tree. In the Enemy/Animal/NPC/WhatNot I'd have separate BTs. There's not much overhead for having multiple BT assets in use (we only instantiate minimal amount of data per BT user, the rest is reused across all given BT's users), and having one big tree with exceptions and "is animal" conditions would be a maintenance nightmare, not to mention perf inefficient.
Had to start up a new 3rd person template project or something π
Nope, just some cooking and compiling some rarely used game+config+platform combination and poof... there goes my free space π
I'm trying to prevent the navmesh from creating a navmesh island inside of my building ( ignore the fact that the building is hollow, even if it was a solid c onvex mesh.. the navmesh will STILL be generated inside of it ).
So I placed a NavMesh volume modifier, but the problem is, the shape of it is restricted to simple shapes like box, circle, etc.. Is it possible to make a custom convex shape and use it as a navmesh volume modifier ?
There's a couple of things you could try:
- for solid shapes you can make them navigation obstacles with
Nullarea - that will result in the building punching a hole in the navmesh matching its actual size. - if you're using static navmesh you could filter these islands out as a navmesh generation post process
- you could try changing navmesh's
MinRegionAreabut that won't be feasible for large areas.
After checking mercuna out, the only feature difference I could find is this, which shouldn't be too hard, as my current tech generates a bunch of points to move to, I can just dynamically draw a spline across them. Is there smth more I'm missing?
cool ill try those suggestions thank you
Kythera AI also seems cool
they showcase their features more than Mercuna
you can check it out
kythera ai seems to be a little lacking in the 3d navigation, as in the showcase video the ai doesnt take wide turns around obstacles, and just goes forward until it senses smth in front of it, then turns. My system has smooth movement, where obstacles are seen much before the ai is upon them, and the ai will go around it much more smoothly
forgive me if thats not the case though, I just watched a couple of showcase videos, most notably this one
specifically what features may you be referencing?
they had 1hr showcase video I thought it could provide something if they have anything different than the rest, I dont have any specific example
never mind ran my own test and it was because move to kept asking for a new location
Most important feature would be the ability to draw boxes around areas that actually need a navmesh volume. For space games, much of the area is blank and you can assume there is nothing in between the actor and his goal.
It's nice to just mark up areas around asteroid fields, planets, etc
im making it as a navmesh volume, so you can just put it where it needs to go
This is what I mean:
I have areas marked off where AI can expect obstacles, but I still want them to be able to steer and navigate (dynamic avoidance of other AI) when not inside one of those volumes.
And when requesting navigation for a far distance, be able to construct a spline/path spanning volumes and voids
My AI can move from an area outside a volume into a volume, but it will travel straight to it without obstacle avoidance until it's in the volume
Hey, does anyone know any good resources for multiplayer AI?
I need the AI to be able to interact with players and follow daily routines, in which all must be replicated. I wanna use Behavior Trees for this, but Im rather inexperienced with them - whereas coding the above system in BP sounds like a breeze, but obviously lacking EQS and all its beauty π
you don't need to use BT's to use EQS
the BT would more or less just control the choice of action and such, the replication etc. should probably occur on the pawn/controller level
Oh right, because all the targetting of player/selection of work space would be set in the AI BP and then referenced in the BT? That makes sense
Yep
It might be good to think of the BT as sort of a director/orchestrator type of thing which works on a higher level
Awesome. So I can set a variable and then connect that to a blackboard key right? Cant wait to test!
If you want to "mirror" a variable on a BB you need to set up some logic which will assign it to the BB when it gets changed
However there's nothing that says you have to set all your things to the BB - BT nodes can access your actors directly too
The AI is server only. The only thing you need to replicate is the character.
This is gonna be a weird question but has anyone tried to make their own AI perception script, and if so how hard is it?
What specifically are you trying to do?
You can create custom AI perception senses which shouldn't be too hard, you just extend the base class for it if that's what you're asking
basically all im trying to do is make it so that the AI detects anything with a stiuli source, not just characters
so on my character i have a AIPerceptionStimuliSource and it works perfectly
but on anything that isnt a character or pawn class it doesnt work
its probably simple i just dont know how to do it
hey btw are there any new features for smart objects in 5.1?
If you add a stimuli source to the others you want to detect it should work. It's basically a matter of registering the object with the perception system, which the stimuli source should do. Just make sure it's configured correctly.... Pawns are registered by default (characters are also pawns)
this is what i have but it doesnt work
you need to check auto register as source I think
otherwise it will require you to manually call the register method on it in the BP graph
HAHA see i knew it was easy
thank you good sir
UE5 is so easy(the basics) there are just so many small things that i dont know
I think I finally found a way to make curvy path following like Death Stranding in UE 
I dont even need to alter navigation system
Do you just do setup the CMC to force slow turns?
I'm still brainstorming on the idea, but I found PathFollowing sends a normalized vector to CMC that indicates a direction towards next path point in followed path. I think I can use the curve fitting algo you sent yesterday and provide a direction to point with an exponent
Ofc I need to project point to navigation too, to ensure calculated location with exponent will be in the navigable area
Yeah, that will be the trick: handling keeping the path in bounds and not bumping into things too much.
Though maybe using short navmesh raycasts can clear that up?
I think so. Somehow it ended up being so simple after understanding how curve fitting works. I was keep bouncing between cryptic math formulas and depths of navigation system π
UE even has functions for curve interpolation in UE::Curves namespace
Hey guys, so I'm trying to play an AI's anim montage across to the client (works on server), but the anim montage does not play for clients, and when printing the variable is empty. Not sure what Im doing wrong here, does anyone spot the red button? π€
The anim montage is a variable that's set to Replicate, and is selected in the world as a Public variable.
The animation is called in a specific BTT set to play the animation decided by the above variable:
This is the event set to play the animation (Multicast - set to replicate)
The event to set the animation across server/client is triggered on beginplay:
Hello, I'm trying to use this "Rotate to face BB entry" for my AI, but it just gets stuck on it in the sequence. The vector that I'm setting it to is for sure the desired one and I have "Use controller rotation yaw" disabled. Not sure what else to do at this point. Anyone have any ideas?
Server functions don't work the way you are expecting on server owned actors. The client can not call anything on the server. It's only the server that can call a multicast function to all of the clients.
Your AI should not be doing anything with replication. The AI Controller and all of it's components (including the behavior tree) only exist on the server. The AI should tell the character to do a thing and the character should handle the replication. Players are the exception, not the rule when it comes to replication and you need to build AI differently.
Is it rotating at all?
It's rotating with my MoveTo tasks just fine, no matter the location. Even the same vector I'm trying to use to rotate to
I meant is the Rotate to face BB entry task rotating your character at all? Is it a valid BB entry?
Oh sorry no it's not rotating at all it's at a standstill. BB entry is valid
What are you setting the BB to?
Well at first I tried setting it to the player location which I've double checked the Vector and it matched the player's Vector. Then I created a new key and set it to the player's actor because I know that task can take either. Both of them resulted in the same outcome, no rotation at all. I've checked to make sure the controller wasn't rotating separately from the AI either and it wasn't
Oh, so the only change I had to make was to ignore setting the animation on any RPC, I just set it directly, since it was called by the server already. Thanks for your insight, got it to work! π
I have a question. is there any way I can have my AI on a certain path? I want the AI to be stuck on the x axis and move about on that. I've tried constraining to plane and all that but they don't work for the AI because they'll just stop moving. Is there any way I can do that?
Assuming you work in native code you can extent the PathFollowingComponent and override UPathFollowingComponent::FollowPathSegment - thatβs the function that instructs the movement component where to move via a vector (see the MovementComp->RequestPathMove call). You could transform the vector into whatever plain you want. Note that it will affect PathFollowingComponentβs capability to detect consecutive βpath point reachedβ events and the βpath finishedβ (due to the AI agent potentially not reaching those points). Increasing movement requestβs acceptance radius and relevant parts of UPathFollowingComponent::HasReachedInternal should help.
Did anybody experiment with the new NavCorridor based path following? Looks super interesting.
Did they ever fix AI teams in UE5 ?
I followed this guide in UE5 but the ai pawn never does anything, https://docs.unrealengine.com/4.26/en-US/InteractiveExperiences/ArtificialIntelligence/BehaviorTrees/BehaviorTreeQuickStart/ it seems like the behavior tree runs all of the tasks but the pawn itself never moves around
the only thing that seems to make sense is that it's possibly not updating the actual value of patrol location, etc. but in the patrol task it's definitely finding a location so perhaps it's just not setting the variable somehow?
so maybe this is failing?
Ah this might be the answer I need https://forums.unrealengine.com/t/set-blackboard-value-as-vector-in-ue5/506320
What would be a good way to have an AI follow a road? I wanna make him 100% follow the road, so I was thinking to use splines for this, but as of right now the AI just walks up to one point and doesn't select a next point to move to.
I want the AI to do a task at his workstation, and once he's got leisure time I want him to follow a spline path to a tavern. So I need the AI to collect spline point path closest to where he is when he finishes work, and also end it when he gets close enough to the tavern to use basic moveto to an available bench to sit on. Any tips on doing this would be most appreciated!
I havenβt, but you should π Iβve seen Mikkoβs videos and process on this stuff and itβs awesome! Itβs super fresh so there are bound to be issues, but the more usage it gets to sooner the kinks will get ironed out.
What do you mean? Would you mind elaborating?
Make sure the PatrolLocation BB key selector is actually tied to the right key in the blackboard (usually done by exposing the key selector property and binding it via BT).
@crystal hatch https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/ArtificialIntelligence/AIPerception/
@crystal hatch ^^
Currently, Affiliation can only be defined in C++
I know about tag workaround, but I wonder if this was actually properly exposed to BPs in UE5.1+
btw, it's nice having you on Unreal Slackers π
You said βfixβ which confused me since being able to do things in native only is not a bug π
if itβs a big deal I can come up with something.
Hey Mieszko
, while you are here
What do you think about this idea? #gameplay-ai message
I'm trying to achieve this: https://youtu.be/lL-NJMRMyDo
I guess Mercuna did this with a different way than my idea since they seem to have a persistent spline in path points, but I guess same result can be achieved with my method too, right?
much appreciated !
Your idea would work, meaning youβll achieve something akin to the behavior presented in the video.
On the topic of more natural path following I suggest taking a look at aforementioned Mikkoβs NavCorridor path following.
Thanks 
Hey guys I still am not able to figure out why I can't get my AI to use the "Rotate to face BB entry" node. It just gets stuck on it. I have the controller rotation yaw set to disabled, I've used every combination of "Use controller desired rotation" and "orient rotation to movement," I've verified that the blackboard key was setting correctly and I've used both Vector keys and Actor keys. The MoveTo node works just fine, but no matter where I put the rotate node it does the same thing (even unplugging all nodes from the tree and just attaching the one rotate node). I ran a vis log and nothing is failing I'm just not sure what else to do π¦
I think it needs to enabled instead
Messed around with that too, same outcome
What is this NavCorridor about you guys are discussing here?
It's a path following approach that instead of using a string-pulled path is taking advantage of the whole nav path corridor to create a more natural character movement.
Sounds cool. How do I start using it? π€
Does BB have a valid value?
if not, I'm out of ideas, maybe movement component overrides the rotation
You don't π I just checked and it seems the code is not public yet. There's the NavCorridor plugin but it doesn't contain the path following part just yet. Sorry about the misinformation.
Yeah the BB keys are valid and set to what they should be. I'm thinking about just making a completely separate base class for my AI instead of using the player's base class. I just recreated an all new AI with same base class and settings and got the same issue.
Oh well,np. But how am I supposed to be using it when it's out? Will there be a new PathFollowingComponent or an extra parameter in the BTTask_MoveTo?
If you are on C++ level, you can debug it directly
Yeah so far everything is in C++. You mean like logging the AIs CharacterMovement booleans to see if they're being overridden when the game starts? I will try that
nope
debug the RotateToBB
and FaceRotation function in APawn
generally having a shared base class between AI and player is recommended btw
if you are going with inheritance route
New PathFollowingComponent
That's the other thing, I can't seem to pull up the RotateToBB in the controller script. Like the MoveTo just shows up when I start typing
FWIW I just tested it an works as expected. Can you post a screenshot of your BT?
It's stuck here, but on top-right I have just a basic sequence with just that task and it does the same thing when used
The white line isn't constantly flickering either, it's the smooth flow animation
what's the type of the BB key you're rotating towards? A Vector?
Yeah and when testing I compared the vector with the actual player location just to make sure they were the same, and I also made a key that grabs the player actor (tested this to make sure it was successfully grabbing it too).
Just tried a different set vector too
can you give the actual player actor a try? Meaning an Actor-typed key?
How crucial is it that I keep the enemy and player on the same base class? 95% of the things in that class are only being used by the player
Like this right? This is the one I made when testing and in the controller's BeginPlay it grabs the player and logs the player's name just to make sure
it's not crucial if you never-ever plan to have AI control player pawn. But most games end up doing that, so there you go π
yeah, what happens if you use that for "rotate to " BT task? Just for testing.
Same thing he doesn't rotate gahhhh
I will try making a new Base Character class really quick and reparent the AI to it
You'll have to debug AAIController::UpdateControlRotation, that's where the controller is attempting to set Pawn's rotation.
Note that Pawn.bUseControllerRotationYaw = true is required for this to work.
Sorry for the simple question, but where am I supposed to put that? I put it in the tick function for the controller because I saw it takes a deltaTime variable. When I pressed play, the enemy was facing the player but didn't follow it. I'm sure I just did it wrong
Put what? AAIController::UpdateControlRotation? It's called automatically from AAIController::Tick. Maybe start by making sure that gets called in the first place.
But you can take a look at GameplayTask_MoveTo.cpp in ue5-main. It is already using NavCorridors. When I looked into these new GameplayInteractions tasks it seemed to be exactly like some sort of new path following based on gameplay tasks.
but I guess the new path following component is probably the glue which will glue all of it together
Or that! I'm very vague on the details π Just play around with it and see what shakes out.
I've taken this line out and put it back in with no change still, but I'm curious as to if this could be causing issues:
SetControlRotation(EnemyPawn->GetActorRotation());
I had to do this to get the AIPerception component to actually follow movement/rotation of the AI
It wouldn't cause any issues assuming that:
EnemyPawn != nullptr- you want to mimic rotation of the enemy's pawn (not rotate towards it).
Ok cool yeah I have the check with a log in case EnemyPawn is null. It's weird I put AAIController::UpdateControlRotation(DeltaTime, true) into my Controller's tick function just for kicks, and the enemy now starts the game looking at the player, but doesn't seem to update after that
Why do you need to add UpdateControlRotation to your controller's tick? It should already be called by AIController's tick. Don't you call Super::Tick?
Oh my god where did my Super::Tick go
Fml
One moment I bet that was the issue
Where would we be without you man, that was the issue. I appreciate you
You'd be writing your own AI systems π
No problem π
I had a look and there's a couple of ways to support that. How would you envision configuring/using it?

" mode in community chats but seeing an Epic staff encouraging people about this is something very valuable because I think with communication between Epic and community can cause good beginnings 