#gameplay-ai
1 messages · Page 2 of 1
thank you
Thought this would be useful for someone so I wanted to share this.
How would I make a Behavior Tree Service check to see if the player is within range of the pawn sensing component?
Why not have the pawn sensor just update a blackboard key? Like bCanSeeTarget?
Then you don't need the service at all. It's handled by the sensor.
unless there's a more efficient way to do it (there probably is lol)
by pawn sensor do you mean the pawn sensing component?
I'd have to update that through either service or tick since that needs to constantly be updated
The AI Perception component is what I'm referring to. Pawn Sensor is old I believe. AI Perception is the newer version of it.
ah alright
You slap it on the controller or pawn, give it a LOS config, then connect to the Perception Updated event
I'm using Pawn Sensing Component either way, I know it's either AI Perception or Pawn Sensing but I used Pawn Sensing since that was the one I've used before
When the perception updated event fires off, you just update the bCanSeeTarget (or w/e your project calls it). And you don't need a service for this at all.
hm alright, i'll look into that, thanks
the other problem I'm running into is that the way I'm doing it in the code above works fine, but if the player keeps moving, the AI will only move towards the last known MoveToLocation, so when it chases the player, it goes, start, stop, start, stop, start, stop so I'm gonna have to find a way to update the MoveToLocation constantly instead of just when the AI sees the pawn
In the move to there is functionality for updating based on blackboard changes. You just need to turn it on.
Also you should be using blackboard key selectors in your service instead of hard coding blackboard key names.
awesome, thanks
figured it out
I'm trying to make a super super simple AI work, but using the Spawn AIFrom Class node doesn't get me a character that spawns with an AIController and I don't know what to do now
The Is Bot Controlled node fails.
nevermind...
Checking via Is Player Controlled works perfectly fine. Guess the bot node is just faulty.
You are trying to spawn a player class as an AI. Under controller settings in the character class do you have an AI controller set up when you spawn it?
is theres a way to set a command for every ai tree to do 1 thing when another thing happends?
for example i want all ais to start dancing when the player dies,
im using the behavior tree to control them
how do i make an AI look at the rotation of a specific actor?
he has to walk rotate in place though
he can't just slide to look at
that looks weird
this is during the "wander" method
You should project your points to navigation (in the generator) and add a batch pathfinding test to filter out all unreachable.
yup, just added a pathfinding test and it seems to have fixed it, thanks lol
The pathfinding batch test is actually a lot better.
just changed it, thanks
sorry i didn't pick up on that initially 100% lol
@ocean wren did you see#generative-ai yet? I think you might like it 😄 You are only one using disco in this server
hello - i am working on some "tasks" in my AI Behaviour Tree - but it seems I cant create the timelines there - I tried other things but nothing seems working. what i am trying is to get AI to location (working with move to) = I want to create a task "turn around" - rotate to new rotator - but smoothly
Rotate To is a built in task that does that.
It sounds like this problem is solved, but another trick is that you can create a "fallback" EQS by adding another generator and placing it to the right of the first generator. That way if there's no valid point on the donut, you might use a pathfinding grid or (maybe a smaller donut) to find a point that works.
Hey guys how do you handle multiple AI actions in unreal?For example let's say there is an enemy which could chase the player if it sees it, moving towards an interaction object, or Just return to the respawn. Do you just order all of this actions in the Behaviour tree, or do you decide what to do in code (maybe a service) to have more control?
It depends™️
You can do it in any way of those you listed, or others too, it's just a question of what makes sense for you and the logic that you need
"Move To" Fails on all my characters. I do have navmesh bounds volume in level. Tried rebuilding paths. Patrol Location is set. Any ideas? Using UE 4.27.2
visual logger usually shows more detailed info on stuff like that so check there
I fixed it! I found this error in my output log. So I just deleted all the navmesh bounds and dragged it back in to recreate the recast navmesh and now it works
That's good to know, never seen that warning myself
Yeah I've been scratching my head over this one for days...thanks
is there a way to set default Gameplay Debugger categories to be enabled or disabled? Only place I've found is the hardcoded value when they're registered.
Yeah that's a weird bug I've seen caused by some buggy clamping code whenever cell size gets adjusted. Fixed here: https://github.com/EpicGames/UnrealEngine/commit/cd813f6703d8808c2cafaa01f74885b71a98505d
ok nvm found it
a whole lot of navigation fixes lying in the main ue5 branch waiting for 5.1 hopefully
https://streamable.com/1zg0gi showcase of my companion ai
is decorator's OnNodeDeactivation and services OnCeaseRelevant both guaranteed to be called when the execution flow switches to another branch by an another decorator higher in the hierarchy? In my case I have a core BT that has a selector with 2 "Run dynamic behavior" nodes and inside one of dynamic behaviors I have a decorator that relies on OnNodeActivated and OnNodeDeactivated methods and for some reason OnNodeDeactivated does not always gets called when the root BT switches to another dynamic behavior.
upd: ok I tried doing the same with services OnBecomeRelevant and OnCeaseRelevant and OnCeaseRelevant also doesn't always gets called when a higher priority decorator switches to another branch
upd2: ok nvm everything is working correctly, I had errors in my code
I tried changing my Tile Size UU value to be smaller in Project Settings > Navigation Mesh and now my Nav Mesh agents just don't work at all
I can't seem to get them to work with any setting changes
pretty sure I'm going to have to create a new project
Is it ok and safe to store TWeakObjectPtr to actors in node memory structs?
I didn't see it 🙂 hahaha.. thanks for letting me know.
I built some ais that seem to be slowing my game down is there a good way to troubleshoot what could be causing this? like to figure out if its related to the Blueprint or the AI controller? or all of the animation blending or something?
Unreal Insights can be used to profile the game and get information on what's taking time and where
there should be some docs on it somewhere
I have used stat StartFile (do things) stat StopFile --> then open the file in the Session frontend to get decent profiling info on what's taking up frame time.
Is there an easy way to visualize a FNavigationPath?
i.e. the path generated from FindPathSync/FindPathAsync
I think visual logger might have those at least in some cases by default
but if not, you could probably just use the debug draw helpers to draw it out as lines or arrows
Thanks @misty wharf
would there be a way in C++ using a service to see if the path exists between an AI character and the pawn? I saw there was a function in the base UNavigationSystem called TestPathSync but I'm worried it might be expensive
right now my service is going "okay, if the target actor is not null, then set the Move To Location to be the main pawn" but I need to do another check, that being if the Path Exists, which the problem is that I'm setting the Move To Location in the service as soon as the player is within the line of sight of the pawn
i can probably cut this off into a separate service but yeah
being CheckReachable
If there's anything like that the EQS Generator for pathfinding grid would be a good place to look for it (since that generator guarantees that all the points on the grid are navigable to from the context location)
I suspect it's just using TestPathSync, since that's decently quick for short distances.
FindPathSync and FindPathAsync which were just mentioned above should do it I think?
Test Path Sync is a lot cheaper than finding a path, especially if you use the hierarchical test.
Sounds like that is probably the way to go then
Pathfinding is typically not that expensive to do, so if you need to sometimes check it, it should be fine. It's easy enough to spot if it causes performance hitches later on with more checks or whatever
Is there a way that I can tell my AI to rotate then move
But not just on the initial call
also like throughout the course of dodging obstacles, the rotation is very jerky
or will I have to design my own custom AI
basically, if I go from Move To -> Move Directly Toward just fine. but not the other way around, UNLESS the AI gets to the exact point that the main player is at, then it properly switches to MoveTo
Remind me please how do I make an AI perception sight sense to detect only enemies/hostiles? So far I've implemented IGenericTeamAgentInterface::GetGenericTeamId on both player and bots classes to return different values and set custom attitude solver FGenericTeamId::SetAttitudeSolver(BotTeamAttitudeSolver) in one of constructors, but that doesnt work good. The attitude solver doesnt always gets called when the player gets in AI sight. Is there anything missing?
Is the perception component in the AI controller or character? Is the team interference set up on the bot character or AI controller?
the perception component is on the AI controller (didn't even know you could put it on a character). I've solved the issue, I was getting player team id from a wrong place, everything else is working as it should
do BT services run immediately when execution enters node/sequence? or do they tick only after first interval?
Is it possible to replicate variables to clients from the BT server only logic?
They tick after the first interval, but you can set it to tick on execution start.
The BT can't directly replicate, because it's server only. It can trigger changes in something that does replicate which will handle the replication.
@uneven cloud yeah
Do i understand correctly that EQS dot test returns a value between -1 and +1?
And so if i want to make sure something alligns with something, i must do positive scoring?
Every time I reset ue5 the speed variable keeps getting reset to zero. How do I fix this as it's extremely annoying?
What is a synonym for service?
Because I can't seem to make connections for when I want to use them. I have movement and queued movement working without services.
maybe something else is setting it to 0? What is the value of Speed variable when the game starts?
The dot product is a test for how similar 2 vectors are. 1 means that they are in the same direction, 0 means they are perpendicular and -1 means they are in opposite directions. Here is a good visualization of it: https://twitter.com/FreyaHolmer/status/1200807790580768768
dot product - visualized ⚪
the dot of two normalized vectors, as shown here, can say how similar they are
a • b = 1, same direction
a • b = 0, perpendicular
a • b = -1, opposite directions
you might also be able to see why it's sometimes called scalar projection~
3178
748
Services are background tasks. You can use them as periodic checks while the branch is executing, such as updating a target's location. They can also be used as "do this thing when you enter or exit this branch."
When I spawn AI why it causes hiccup, is there anyway to prevent that? Maybe I can manually init the Behavior tree or anything else after spawning.
Anybody knows?
you need to prove its because of BT first
so profile
you need to have a gigantic amount of BT node count and tons of hard references to assets in your BTTasks to cause a hiccup
good point. thanks
You could just say "yes".
Speaking of services. When i put my working normally EQS queries into services, they stop working correctly. Any idea why?
Has anyone been able to get @buoyant geyser's cover system (https://github.com/GlassBeaver/CoverSystem/) working on UE5? I've had a go, removing checks for UE 4.26, etc. Project loads, builds and runs, but no cover points are generated at all.
It worked fine on 4.27, never tried on 5.0
You could ping him at HORU discord though, rather than pinging in here, since there is a specific channel for it?
Ah ok, didn't realise there was another discord, thanks, I'll ask around there.
I want to handle agent rotation myself, including playing turn on the spot animations if the agent isn't moving.
Is this logic suitable for a service, or is it okay to include it as part of EventTick on the BP, or somewhere else?
I have, I got it working but saw warnings about Octree being deprecated in an upcoming release - to be replaced by Octree2 was it?
Not sure how long the warning has been there though, maybe it's always said that
ever since octree2 came out
How come? Would you not recommend using it?
I've never bothered to upgrade
no I've nothing against the code itself, just that I'm not maintaining it anymore and people sometimes come to my server and ask about it
Fair enough, I don't want to hassle you about it.
There isn't much I can find about dynamic cover generation generally, so your article tends to be top of search results. It's excellent and very educational.
if anyone does manage to get it running on ue5 btw you can do a PR and there's a good chance I'll take it as-is
So far I've just removed the checks for minor engine version < 26, so it should be using Octree2 but that's as far as I've got. The coverpoints are just empty. Will keep looking into it and if I get it working will send you a PR.
What can cause a basic AIMoveTo to start failing after a while? My driven character starts just heading to a random place almost like it is being told to circle around a random point in space that isn't even inside my NaveMesh.
I put a placeholder sphere in the updated target, and it does a few, then just veers off wildly into nowhere
I'm thinking my NavMesh is configured poorly, but I've tried tweaking everything (which has certainly at least educated me more on how all this works!)
How do I set the value as an actor instead of just getting it? there's no option to set it
Use Object
what's the difference between getting it as an object versus getting it as an actor in that case?
does it still store the actor?
It seems to just cast it for you
Actor isn't a type the Blackboard stores, it's only objects. The Get function seems to cast it for you just for convenience sake
Got it working. The cover generation tasks weren't running, but since I haven't seen it working before now I'm not sure it's working as "as intended". Excuse my ignorance. I'm very new to UE. https://github.com/GlassBeaver/CoverSystem/pull/3
I want to make AI detect ledges and position itself in such a way to kick player into them (i.e. walk around the player if needed to get into proper position). Here i use one EQS to get ledge context and trying to use dot test to make AI prioritise positions between player and ledge. But it does not work. Am i doing something wrong?
Is it possible to have a possessed player pawn use AI functions like MoveToLocationOrActor?
Hey,
In my game when I run as client and run the game under one process the bots in the game seem to be moving but when I run it under multiple processes the bots don't move at all but their tasks get updated. Looks like something is not replicated. I have replicated the task enum, and turned breplicates to true but I am trying to figure what is not making it to move
when should you use EQS?
There's no rules for it. Just use it when it makes it convenient to do whatever you're trying to do
It's convenient for generating sets of points/locations or actors and filtering them based on various rules
@misty wharf do you think that Splinter Cell used it?
@misty wharf as that is the kind of game i am trying to make
I've not played it enough to really be able to say
You could certainly use it for some kind of mechanics in a stealth action type game I guess, like finding cover spots or search spots or whatever
they have some sort of a cover system for sure
but no idea if its EQS or not
could be designer placed cover points too
Hey guys, i'm using ai perception on my enemy. At some point, i want to extract the last sensed location of the player and tell it to go to that place. How do i do this?i try getKnownPerceived actors but it gives me only the actors not their last sensed position
store them bro
in the on sensed function(or how is called lol)?
make an array of vectors mapped with the actors,
bro any idea if blackboard keys are replicated or not?
afaik no but don't quote me on that :P
makes sense, thx
I see 😛
Use Get Actors Perception to get the perception data of a sensed actor. The return struct should have the perceived location.
The AI controller and all of its components, including the blackboard, only exist on the server.
👍
I tried simplifying my design to match this as much as possible (the only difference being my own assets): https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/ArtificialIntelligence/NavigationSystem/UsingNavigationInvokers/
After the Character reaches and gets new points a few times, it just randomly (ignoring the last requested location) heads outside of the navmesh volume and starts going around in a circle. WTF, its like it is intentionally spiting my request and saying "no, I'm just gonna leave and run around in circles over there"
so it must be something to do with (a) my landscape, (b) my Character's CharMoveComp. or (c) some other objects within the navmesh volume.
Can/should I abort branch in services (or maybe just disable services from ticking) if in OnBecomeRelevant I can understant that I am missing some variables (i.e. AI pawn is of wrong class). I can't call OwnerComp.RequestExecution(this); as it is usually done in decorators
Services cannot affect BT execution flow directly afaik, at least not without significant hacks
If you want a "service" which does that, make it a decorator... they can more or less do very service'y tasks plus affect BT execution flow
I would recommend using the visual logger to debug why that is happening. Also why are you using invokers? UE5 made large world navigation easier and full regen of the nav mesh is actually significantly cheaper.
Thanks for the new direction, I will look into that! Regarding invokers; because I, like most new users running into silly problems like this, are unknowingly following old and/or outdated documentation.
Do you have a link handy that talks about these improvements? I feel like I missed this.
No worries. I only asked so I could point you in a better direction. Nav Invokers have always been really difficult to work with as they cause a lot of navigation bugs. It's one of those things that the people writing the docs don't actually build games, so the recommendations aren't always great in production.
I haven't seen anything written up about it. I have dug through the code in how navigation changed with world partition. Level streaming has always worked with static navigation, but it was clunky to use and caused a lot of broken navigation bugs. Now world partition cuts up the nav mesh automatically and streams it in.
Ah, I see. So it's particularly when using world partition that the mesh gets divided nicely.
Guess I'll be taking the scalpel to my landscape 🙂
Yes. The actual navigation data is saved with each chunk and loads it when streamed in. Then you can use static, regen with modifiers only or full regen settings depending on your project needs.
That sounds extremely nice. Definitely something I'm going to experiment with.
what causes this?
the behaviour tree keeps flashing
like it doesn't know what to do
i followed this guide
also, the AI is able to keep track of me through walls
which is not what i want
The flash tells you that it's returning to the root and re-evaluating the tree.
Here's what's happening
a) The first node is a selector: In Combat.
Your decorator is returning successfully so it enters the In Combat selector.
b) the first node of the selector is Attack: a sequence. This decorator is returning successfully, so it enters the sequence.
c) the first node of the sequence is Rotate to Face BB entry.
d) when this node returns successfully, the Attack sequence is considered successful, since it has no other nodes (Sequences are successful if every node underneath them succeeds).
e) So now we check the In Combat selector. Selectors are successful as soon as one of their nodes succeed.
f) This returns to your Root selector.
Root is also a selector and since the InCombat node is successful, it is also considered successful, and it returns to the Root of the BT. The BT debugger flashes to let you know that it's re-evaluating the whole thing.
so what should i do?
I'm not sure what you want it to do 🙂
i followed the official documentation
i want the AI to look at the player and when he disappears behind a wall he needs to try and find him by going to the last seen position
as it does here
i am using older documentation because the images in 5.0 are broken
the guide is the same other than that
I think, to get this BT to behave the way you want it to, you need targetActor not to be set.
Which means, when your player goes behind a wall, you need to clear targetActor from the blackboard.
nope
Watch the area in the bottom right of the BT debugger.
Does Targetactor ever go to None?
Yeah, I think the problem is related to the LostSight event.
You'll want to see if it's called.
Those nodes look right to me.
Check the collision on your wall. Does it block the Visibility channel?
Hmm. try just dropping a Cube Actor in and scaling it up?
That will let you see whether it's collision or not.
help plz
i am making a little project for fun and am having ai trouble if anyone could assist me.
Sure, I can spare 5-10 mins.
anyone?
plz @ me if you can
Don't ask to ask - just ask your question.
Turns out it was because I had my animbp using the max walking speed constantly.
I think I should be multiplying the length of the last input vector by maxwalkingspeed as the best resulta so far, but it gets stuck somehow missing the target and looping around it constantly after a while.
Like, it is visually passing through the target point, it isn't just circling around it (which would happen if my turning params were wrong).
Hi, I can't seem to set a blackboard's key.
As you can see, I'm giving the value pin an actual value (BP_MainCharacter), but the value inside the blackboard doesn't seem to change
Any idea what I'm doing wrong? Do I first have to set this key in the controller, somehow?
Is the blackboard key of the correct type? Have you selected the appropriate key in the BT properties for the node? How did you determine it isn't changing?
Has anyone quantified how/why blackboard vs blueprint is better for AI design?
It's quite easy to see if you try it yourself I think... BT's aren't better for everything but they do some things more easily than BP's
The key is of the correct type, BT_MainCharacter like the value I'm assigning it, and I think it doesn't work cause it's set to None in here
Have you selected the appropriate key in the BT properties for the node?
Not sure what you mean with this though
For example if you have sequential logic which takes some time to execute, a BT works quite well for this. Attempting it in a blueprint like AI controller would require a lot of custom nodes for it to be easy to sequence the logic
What I meant was that it looks like you have a variable for the blackboard key to use, which needs to be set to the correct BB key
You mean that I'd have to "tell" this Player variable that it's supposed to edit the blackboard's value with the same name?
I'm sorry I'm really new to this
Correct
How do I do that? I thought it was like the controller, and it would just set the BB key with the same name
If you click the variable and look at its settings it has a checkbox called instance editable or something like this - enable it
Assuming this is a behavior tree task node or such, you can then click the node in the BT, and it should show you a dropdown to choose the key
I'm not quite sure what you mean "like the controller and set ..." because I don't think anything gets set automatically anywhere unless I'm forgetting something :)
It's a service, but I can't see any dropdown menu to choose the key to be honest
Found the Instance Editable and enabled it though
what's the type of the variable?
oh wait it probably is blackboard key selector since it connects to that pin
if you click the service in your BT, it should show up a selector for it in the properties panel
similar to how you can change settings in the built in nodes
(you may need to press compile and save in the service BP first if you didn't)
It's there :)
Damn am I blind
lol, yeah sometimes it's hard to see them for some reason
Alright, everything is working, thanks a lot
👍
OMG. If you pull a random value for multiple inputs, set it to a local variable first, please. Sigh. So much time wasted.
Yeah that's a bit of a gotcha that most people run into at some point :)
All "pure" BP nodes (that is, nodes which don't have a white exec pin) will run the same number of times as they have pins going out of them
Randoms are just the one where this behavior tends to cause problems, there's a few other common gotchas relating to this with modifying arrays and looping
If an AI controller is not applied or is disabled on an actor, does a blackboard still fire its execution and attempt a MoveTo but it just wont move?
I think I am currently encountering this
So this is definitely an issue with AI with rootmotion or something. Eventually, some kind of calculated leftover accumulates and the Character will be left trying to hit an AIMoveTo target and keep having to circle it more and more and until it is left in a perpetual loop where it never hits. No matter the Acceptance Radius or other parameters. At first I thought it was because my animation Blendspace was too precise (accurately depicting the speed-playback curve), so I lowered the rates to accommodate. It helped. But eventually it still happened. The lower I set the rootmotion rate than what it "should be" the longer it takes to eventually enter an infinite loop. But it does, eventually, and the Character just keeps looping around the AIMoveTo target forever and never reaching it. Additionally, changing the z-axis rotation rate helps, but it still enter an infinite loop eventually!
You need to pause or stop logic on the behavior tree.
Are you debugging to verify that is actually the problem? If not, I'd recommend using the visual logger.
yes, but I'm not sure I'm capturing EVERYTHING that could be at fault here.
it is a setup that works perfectly for 5-10 minutes, with success every 5-15 seconds depending on the target, and eventually it just devolves into a perpetual "spin around the target"
Did you turn off using the bounds of the agent or the goal in the acceptance radius? Does turning off root motion fix the problem?
I mean, turning off the root motion turns off the movement, but in the spirit of the issue description seems disingenuous
how do I "turn off the bounds of the target agent"? what would be the implications? sorry, agent
Does it turn off the movement? The point is to pinpoint if it's an AI problem or an animation problem. Using the bounds in the acceptance radius is a parameter in navigation. The problem that you are having is that the AI can't get close enough to the goal, so it'll circle the goal.
Ai is not chasing
Does any know what is causing issue with breakpoint not running and EnemyActor NOne & Sight false you can see in video end ?
It might be the ActorHasTag check in the Enemy Controller always evaluates to false
Try this: On the blackboard decorator: Has Line of sight on the details panel ensure that you abort lower priority
Let me try it on my end
i was following ue5 off documentation quick guide
So i have done it on my end and it works
Hmm, than there nothing wrong in doc.
Let me check once again
AF PC
one more question: did this work for you i have use makeblackboardseletor node
for location patrol
Double check the variables of type name: EnemyActor and HasLineofsight
yeah i copy pasted that
Yeah it did
In the details panel?
with Name variable ?
👍🏾
Not sure i get the question
But make sure you tick instance editable for it to appear in the behavior tree
Not sure if that was the question
Patrol Location is not working as for me like image above im using makebBselector node
sry, miss typed
Default value is not changable right ?
What you can do is on the PatrolLocation variable in the details panel check the option Instance Editable
After that go to your behavior tree and select this task and there you can select the dropdown and choose the value that you like
I can't find any docs on navlinks. Can someone point me in the right direction?
I have a system of doors that open and close and affect a dynamic navmesh at runtime. I would like to be able to have enemies attack the doors if they need to get through them to reach an opponent.
And also don't understand if it's the nav link that would tell the unit to do the door attacking behavior or if it's just the navmesh says you would try to go through here and then another task would need to be triggered that says attack the door
I'm trying to create an AI, but for some reason things are called in the wrong order. In my behaviour tree I have 2 node which are connected to a selector node.
The left hand node checks if my character is inside a certain sphere collider, and if he's so, the enemy starts to chase him, otherwise fail and go on the next node, i.e. the right one. The right hand node checks if there is no character in the collider sphere, and if so, the enemy just patrols some area.
The problem is that for some reason whenever my character enters the sphere meanwhile the enemy patrols, the left node (the one for chasing) starts before the previous one gets terminated.
Patrol related functions set a boolean variable which makes the character have a run animation to false, but the chase function sets it to true before calling AI MoveTo function. So I have the following situation - The enemy is patrolling (the boolean variable is set to true), my character enters the agro sphere, the chase function starts running, while the patrol function keeps running, sets the boolean variable to true, calls the AI MoveTo, and only after that the patrol function ends and sets the boolean variable to false, making the enemy have an idle animation.
Any ideas what's wrong?
@celest python What exactly you didn't understand?
Basically somehow your bool is not what you wanted to be when your patrolling starts?
My bool gets wrong in my chase function
It's very difficult to guess what is going wrong since I can't see your code, did you debug to understand when exactly it's being wrong value after chase starts?
and if you are on BT, how do you call AI MoveTo?
Arent you suppose to use the BTTask
you can just set a service set a boolean on top of the BTTask
Yes, I did debug, by using strings obviously 
At the very beginning and very end of the functions I have a print string. Chase means Chase function call, Make accel means that the bool has been set to true just before the AI MoveTo, and Patrol Fail is pretty self explanatory.
Given these string I can understand that chase function is called before the patrol ends, I have no clue why it can be a thing.
Uhh, I just call it? Like this
Ah, well, yeah, I have created a BTT, and I'm implementing the logic from there
I'm not sure what you mean, but I alter my bool in a function twice, before calling the MoveTo function and before finishing the actual function
You have a Chase BTTask right?
and when chase is active a bool is suppose to be true
Yes, both for chase and patrol functions
When chase starts the bool is supposed to be false, but the chase function will set it to true before the MoveTo function call
alright, instead of setting the bool in the code, you can just create a BTService and set your bool to true there, and on relevancy ceased you can set it back to false
No need to handle this inside of the BTTask
But the thing is that after the chase function the bool may be true or false, depending on the MoveTo result
Because if the enemy will fail to get the player, it has to run back, otherwise stop and do something
Is it possible to implement such logic with BTService?
I'm pretty new to AI though, just learning a bit about it since today
I think you should just use the Move To task engine provides, is there any reason you are not preferring it?
and handle the execution flow based on if that task is failed or not
this looks like a choice between handling the logic either on BT or either in BTTask graph, which is both fine and depends on the complexity of the logic
BTs will snap to most prior task so its not easy to branch and jump into different nodes
meanwhile BTTask are better at this but it has its own disadvantages too since BT is authoritative
I'm just following my book, so I probably can't give some strong answer for that, maybe the logic will become more complex later
Which book is that?
I didn't read it, but I'd say be careful with AI part of the development, you mostly learn UE workflow rather than philopsophy of AI development
though anyway, lets get back to topic
print this
and see if its failing etc.
and use visual logger
to see why its failing, or succeeding, or something else is happening
It's difficult to guess why it could be being false etc.
and debug with breakpoints
can't say much more than that
Where should I print this?
I think one way or another you'll end up debugging 😄
This looks like a debugging issue rather than something is wrong about UE framework
Why the chase function is called before the patrol function finishes though? I mean, is it even possible that two different functions run in such a simple tree?
I didnt/dont see a chase function in the images you sent
Unfortunately there isn't any good docs on nav links. How you would implement attacking a door to get through it depends on if you are using C++ or BP. In C++ you can trigger it via the nav link in the path following component. That functionality is not available in BP, so you would need to detect if there is a destructible in front of the AI and stop to destroy it.
what the best way getting the ai to shoot randomly towards you?
if i get the actor location and plug it in the line trace it to perfect. hit me everytime
c++ or bp?
blueprint.
Take the math from Reid: https://youtu.be/x2vMOPZEgSY?t=835 - edited with exact time
ok.
Ignore the shotgun part, you just need "random point from circle" part
On part3 he explains how to make it more configurable by using curves, if you are also interested
alright thanks, been trying to rack my brain around it but bad with the math portion of things
Dw, this one is very easy
aight, bet. thanks again.
Does anyone have any earthly clue why nav link proxies simply do not work in UE4? I have never ever been able to get them to work in my project and it's super annoying. Like literally the nav link is right there, and he just ignores it. His move commands are just normal BehaviorTree Move To requests too, it's ridiculous. I have tried before to get it working with doors too and nope
legit don't get it
rubberducked it and I think I know why, when player is spotted he does his chase routine in a parallel
Had to stop yesterday, but I continued today, and I saw that for some reason some of my nodes are marked with index 0. As I know each node must have an unique number, but it isn't so in my case. Can it be a thing?
It may be the issue because on my chase node I have a decorator with Both as a parameter of Observer aborts, but since the nodes above (BTT_EnemyMoveToLocations) are from different subtree, and have indices greater than the node that has that decorator, it does not cause them to stop
That seems weird, nodes should have unique numbers
I would try moving or recreating the node that shares the 0 and seeing if it changes because it should
actually pretty sure only the root node of the tree should be 0 🤔
so if this is a custom C++ node your code may have some bug in it that's causing this
I tried to add a new node and the 0 ones got their correct values, the behaviour didn't change though 😦
Okay, guess it was just a visual glitch with the BT editor then
It isn't a custom C++ node, the tree logic is made only on BPs, the entity it's managing is made on C++ though
I'm trying to get a behavior when NPCs are avoiding going directly through player at some radius but still able to approach the player. I've tried adding NavModifier (and NavInvoker) components to the player character with a custom area with some reasonably high costs and created a NavQueryFilter which I've set to the NPC's controller default navquery filter. And it kinda works if I set the navigation mesh generation to dynamic in project settings but I'd like to keep it at least dynamic modifiers only. But when I set it to dynamic modifiers only the navmesh fails to generate around the player and NPCs can't approach the player at all. What am I doing wrong here?
my ai is stuck in root no matter what it wont switch states, the one on left is broken
i think my ai is not running the correct tree
oh i got it
aparently kill player was not working since the ai that was using that code wasnt bfeing casted inside
🙂
Navigation regeneration under a constantly moving character is not a good idea. It's incredibly expensive and it will cancel the paths of any nearby AI. A better solution is to use the EQS to get the behavior that you want.
Eh, okay, thanks
Hello, people!
Do you know how to implement different navmesh for different AI actors? I want a specific type of AI actors can move through a duct but other type of Actors can't.
Thanks!!
@rapid garnet You can navigate to Project Settings->Navigation System and add additional "Supported Agents" and modify the required properties for each AI archetype there to allow/prevent certain areas for the archetypes. You will probably have to rebuild the navmesh for changes to appear on the map.
I've already done it. I created two supported agents, configured them and set in character movement the same characteristics. But it appears to use just one of the agents for both characters.
What could I be doing wrong?
Thanks for your answer
no practical benefit
what about avoiding casting on tick?
Cast itself almost has zero overhead
For BPs it would only matter if you have a lot of same instances of task/service
At that point avoid BP not the cast
and if i'm already in C++? should I cache pointers to frequently accessed actors into TWeakObjectPtr in node's memory?
Caching TWeakObjectPtr is a good idea but not on the header, as a local variable
how do i cache something as a local variable 🤔
void UTask::SometFunction()
{
UObject* CachedObject = MyWeakObjectPtr.Get();
}
What I'm meaning is avoid accessing your object via TWeakObjPtr's internals since its accessing global uobject array
Its still wont generate any overhead at all but you wont call operator[] on array each time
every time? didn't know it, thx
is there anything i need to look out for when my ai doesnt move when i use randomnavpoint. i have a navmesh, and i set blackboardkeyboard vector and set all my nodes correctly. i see the vector being change and the behavior tree is succeeding but the ai is not moving
this seems fairly straightforward. why is get controller returning null when i try to un posses an ai?
Do i need to RPC server call this or something?
afaik a controller is replicated from server to owning client only, in this case there is no owning client, so it should be called on server
I tried a server rpc, and the controller wasnt null, but un possess didn't seem to stop the running AI, should it?
AI controllers only exist on the server. AI controlled pawns are also server owned and do not have server or client RPCs. The server can replicate to the clients via a multicast RPC or replicating variables, but the client can't send anything back to the server.
How does this decorator work? Should I be updating the Destination before this decorator? Currently if I remove that decorator everything runs the same. Just want some understanding about this.
Everything is working and would like to make it so MoveTo is interrupted when the Destination gets a new value.
Currently, If I press RMB, Destination is updated, but if I press RMB while MoveTo is running, the AI/BT just ignores this new value and doesnt change where it is moving to. AI just moves to the point it was moving to regardless of me updating the Destination while MoveTo is executing.
Yes the destination needs to be set for the branch to execute. With move to you can have it update when the destination blackboard changes.
Does anyone know how to stop a MoveTo if the capsule overlaps/bumps into another actor using a behavior tree? All my actors generate overlap, and my MoveTo has ReachTest and StoponOverlap checked. Thx!
Navmodifier volumes are the way to do that, set the navarea type so that only specific agents can use those.. I believe rama did a video like 5? years ago about this..
Interestingly enough the branch executes even though the GetDestination node runs after the decorator.. But to clarify you are saying that I should have the GetDestination node BEFORE the decorator?
You have too much stuff in there.. you shouldn't need to check idle, you should need to get destination either, because you would fire the subtree when destination is changed right? So your tree should just be moveto, not even sure why you've got the updatepathpointindex thing in there either
you should idle in one subtree, then branch into a moveto if the conditions for moving are ok (i.e. has a destination set). The priority should be the thing that changes what you do.. i.e. if moving has higher priority than idling, then you should move.. the conditions for moving being able to take over are having something to move to right? so "aborts lower" should work when move to destination value is set
But watch out for those "is set" because last I tried at least, "is set" doesn't mean its actually a valid place.. just means it had a value at some point
To handle the moveto destination changing, you can just rerun on value changed
is there significant difference whether to initialize service's node memory in OnBecomeRelevant or in InitializeMemory?
Thank you so so much!! We could finally make it!!
I'm sending de video!
https://www.youtube.com/watch?v=xwdVQQtQa8s&ab_channel=RamaUE4Plugins
You can download the project I created for this video here:
https://forums.unrealengine.com/showthread.php?3851-(39)-Rama-s-Extra-Blueprint-Nodes-for-You-as-a-Plugin-No-C-Required!&p=350702&viewfull=1#post350702
In this video I show you how to use UE4's AI Nav Modifier Volumes to create custom pathing for different types of units.
Thats the fella
Hi everyone, Im trying to debug why my AI is moving extremley slow, I notice during game play if i debug the navmesh looks like its z fighting. Could that be the cause?
checked my movement compenet and max speed is all setup
no collisions are detected
Nvm its some new UE5 thing u have to check off in char
Is there some way to rotate an AI to a specific local rotation? for instance, when I spawn the AI i have them all looking as so:
When I move them, they look in the direction they were just moving:
I'd like them to start looking the way they were before, once they're finished their movement
The only rotation task I see is Rotate To Face task which doesn't help me at all
Hey all quick question with anyone familiar with EQS, is it possible to only query specific meshes (so spawn the points only on the surface of a mesh) rather than a radius?
yea was kinda wondering if I could hijack the eqs system for a demo project to create a priority item decoration system
so generate potential spawing locations for props based on input criteria like distance to another prop, proximity to focal point props etc
@celest anvil I've seen someone use the system to test against threat levels for aggro, the custom test would all have to be written in cpp though...i would say its possible
hey everyone, I currently have an AI build that is supposed to follow the player but also the different enemies are not supposed to overlap each other. but that leads to the enemies jumping around if they collide with each other. how can I change that?
As you can see they jump around. My behavior tree is quite simple
If my state switches to attacking, the previous idleWander move to has to complete before i start following the new target. How should I cancel that?
I put a 'stop current movement' in the follow service, which did stop the old move to, but it also caused a stutter in the new move to
hey everyone, im curious to see if anyone here has an idea on how i can spawn a character in UE5?
Hi all, I'm facing this weird issue when using the a Behavior Tree with a Character Movement Component, when using the MoveTo task it doesn't trigger an acceleration value, so in my instance the walking animation doesn't get triggered
Have you checked void UPathFollowingComponent::FollowPathSegment(float DeltaTime)?
You have to enable bool UseAccelerationForPathFollowing() const { return bUseAccelerationForPaths; }
And are you using bRequestedMoveUseAcceleration
Thanks will check it out
Turn off character collision on the character capsule.. use the detour crowd controller for navigation to keep them apart instead.
A plugin for running self-contained behaviour trees etc. Pretty much the pattern that's been becoming the industry standard
anyone seen any communication from Mieszko et al about it?
Any current work?
What do you mean?
@ocean wren thanks for giving me the clue! 🙂
Yeah, honestly, I always thought it was a silly idea to have character collisions like that.. but its REALLY bad for AI, because they get stuck on each other a lot 🙂
What do you mean what do I mean? 😛
I don't know how else to ask to be honest.
I mean - does anyone know if there is any further work planned for that plugin, because it's pretty much a stub. I'd guess it's on its way to be abandoned in favour of an ever-growing mountain of Mass and ZoneGraph work but it's been added to the main branch late 2021 which isn't that long ago
A plugin for running self-contained behaviour trees etc. Pretty much the pattern that's been becoming the industry standard
This is what I was asking about
Right, well basically at scale you shouldn't run your entire AI in one behaviour tree, you make one for each behaviour and you manually run them as directed by some other top-level decision system, for example utility logic
the idea that your AI should trigger one BT at startup and then run that forever only really holds up for very very simple AI
Sure - but as far as I'm aware, you can already do that
and splitting them out into separate assets and using the Run Behaviour node doesn't fix things, you're still running them all in one stack
Of course I can, but there is boilerplate to make (currently doing that for work). That plugin is an attempt at having that boilerplate ready for everyone
I suspect statetree overtook this
They appear to be moving that to production status next release according to the roadmap I read the other day
Sure hope Chaos improves
The new AI features are kind of interesting but it's being so fussy with Chaos physics for me that I'm currently avoiding it :P
I managed to improve it a fair bit by heavily tweaking the settings, but I don't know if it's going to perform really badly or have some other sporadic issues that I currently don't have with physx
Why? whats it doing?
Things have a tendency to vibrate especially if stacked
Ooh, we kind of solved that two decades ago.. you sure there isn't a "go to sleep" value you can tweak?
Not an obvious one at least lol
I talked about it on the other channels and it was just like "yeah it does that" and "change the <whatever setting it was>"
There's usually some number you can tweak that basically says how long things should be simulated before sleeping.. they have the same in physx and havoc
havok
which did actually improve it but I had to turn it up a lot so I don't know how badly that would end up shooting myself in the foot in terms of performance or such
oh righty, yeah, hard to trust shit that doesn't "just work" aint it
I wouldn't mind changing settings if they actually had explanations on how the settings affect it and what are reasonable ranges for them for how many physics props and what to expect
But there isn't anything like that :D
Yeah, that doesn't sound likely ever 🙂
We all know how much Epic loves to document systems right? 🙂
Considering 5.1 is supposed to bring Chaos improvements I'll probably just give it another go then and see how it is
Thankfully porting the project is fairly easy
I'm starting a new project with my students in a month or so.. looking forward to doing some dumb game stuff again
mostly houdini based PCG and whatnot.. and ML powered PCG plugins for research
I'm writing an actual design document for my project to hopefully actually get it rolling into an actual direction again lol
shit, you know you're in trouble when you have to write a DD to ignore 🙂
hehe
I'm mostly just hoping to test out large scale terrains in UE5 right now
I don't know, I think it's just that the game is kind of complex and it's hard to kind of have a feeling how to do all things for it when you only have a bunch of random lists and wiki entries describing your random ideas
i.e. see how the practical stuff holds up across a large landscape
I suspect it'll be a shit show
it seems like it should probably work, weren't some of the UE5 demos kinda in that direction
trouble is, trying to actually use it properly? I mean do the nav invokers work with the new world system? and one file per actor and all that?
plus, I want to run this on the steamdeck eventually.. so that'll be an adventure
Ah yeah
I thought heard something about not needing invokers anymore with the new system but not sure
Hey does anybody here know of any good tutorials on making quality ai?
Read books. Tutorials won't really do that for you.
You need to understand the overall concepts of various types of AI and then implement them.
Or just say screw it all and just implement with work, architecture be damned 😅
Game AI pro is available for free online. Good enough read
I’ll check it out ^^
This is still the best overview on behavior trees in UE imo: https://www.youtube.com/watch?v=iY1jnFvHgbE
In this presentation, Epic's Paulo Souza uses Unreal Engine's built-in AI features to build smart enemy behaviors for a game with stealth-like mechanics.
By relying on the Gameplay Framework in Unreal, we're able to quickly create convincing AI using Behavior Trees. Behavior Trees are great for creating complex AI that can be presented in a way...
Any tips for a nav volume that could generate pathing onto a sphere?
Seems I can only get the nav volume to project pathing onto horizontal surfaces, but would like to do that for a sphere/planet instead.
I doubt navigation system is able to do that
I wanna give working on AI another shot, I wonder how open world games have free roam AI work.
Like in ue4 we place a volume down and have it calculate all, I’d imagine this would be very costly for a big open world. So how would flying AI in particular deal with that?
Behavior LODding
see #mass @deft pumice
but flying AI is another story
its not officially supported
so you'll have to roll your own framework
Hi, Slackers. I'm pretty new to AI and am trying to figure out how to structure this behavior tree.
It's working okay for now, except that it relies on the FireAtPlayer node to finish execute on tick, so the tree re-evaluates every frame when shooting.
It's fine, BT will reevaluate tree every frame
I thought you can have it stay within a particular task node?
Maybe I need a different structure? the problem I'm trying to solve is sending an alert when the turret changes from waiting to shooting.
Depends on what you mean by re evaluate though, BT will always check if more prior node is eligible to execute or not
Maybe I can set the field every tick and just send the alert if the field is different.
Nodes from the left and current node will be evaluated every frame
if current one also fails, next one will be counted next frame too
until it reaches to the end point
this is how BT prioritize the tasks
you can't communicate with BT and say "hey you can evaluate the execution flow now"
it'll be authoritative about this
this is both an advantage and disadvantage of BTs
you can have that behavior in FSMs, you're the absolute authority with it but it introduces other problems etc.
It seems like a FSM is more appropriate in this case.
I wish there were better examples of good AI available.
This a decision you should make after a huge planning process
What you're doing looks suitable for BTs
FSM is only required when you need to jump from a node to another node
or when you need total control of execution flow
So you're saying I should accept that behavior tree nodes will execute over and over and accomodate them?
Yes
They're perfectly optimized
You should worry about the content of your BTDecorators, BT's execution flow itself wont generate overhead
and if you use BTServices properly BTDecorator's context wont cause issues too
If I understand, BTServices will run repeatedly as long as its task is active, and decorators will stop the task if the decorator is no longer valid?
and decorators will stop the task if the decorator is no longer valid?
If they are bound to selectors
Sequence will just skip and fail
composites have their own rules
Right, sequences continue until a subtask fails, selectors continue until a subtask succeeds.
Root selector will continue forever
What do you mean? wont it restart if a subtask succeeds?
It tries its child tasks until one succeeds
Root selector will be "active" or "relevant" forever and when reached to end point, will restart
each frame it tries to select the most left node in the BT
by their index
if something is found eligible, that composite (be it sequence or another child selector) activates and it does its own thing too
Right, like any selector node. The difference is that since it's the beginning of the tree it will automatically re-evaluate after it succeeds or fails.
Yes
You might want to look into how observer aborts work so you can continue to fire until certain conditions are met. UE behavior trees are event driven instead of constantly updating like typical BTs.
UE behavior trees are event driven instead
Hmm? 🤔 Can you elaborate more?
Observer aborts can influence the execution flow but I wouldnt call it event driven at all
There isn't a top-down influence
The tree isn't continuously evaluating. If you are in a move to node, the BT waits until it completes or an observer aborts it.
It's being managed in node's tick function though, not a BT functionality
BT calls FinishLatentTask by constantly checking path movement state
So until it receives Succeeded flag it waits but still continuously evaluates to switch to more prior node in the tree
It does not continue to reevaluate.
It does though, it even aborts the Move To task
Only if there is an observer abort. The entire tree does not continue to evaluate.
Maybe I'm missing something but I remember UE's BT implementation does not rely on observer aborts for the more prior tasks
So even if there isnt any observer flag it should abort the current one and switch to more prior one
Unless I'm misremembering they only affect less prior nodes
It does not. "Event driven" is Epic's own explanation of it. Higher priority nodes will only cancel a lower priority node if there is an observer set.
"One of the ways UE4 Behavior Trees differ from other Behavior Tree systems is that UE4 Behavior Trees are event-driven to avoid doing unnecessary work every frame. Instead of constantly checking whether any relevant change has occurred, the Behavior Tree passively listens for "events" that can be used to trigger changes in the tree. In the image below, an event is used to update the Blackboard Key HasLineOfSight? . This causes any lower priority Task to be aborted in favor of executing our left-most branch which has higher priority."
So to confirm, TL;DR are you telling me if the MoveTo in the middle is active and if ClosePlayer becomes valid while its active, BT wont switch to the MoveTo on the left and continue executing middle one even thought left one is more prior?
Because I think there is a misunderstanding going on, I agree observer aborts can skip the nodes on the right side of the currently active node but more prior ones always must be updated in selectors
Correct. You have to have an observer abort for the left one to cancel the middle one.
Interesting, if you say so, it's probably true. Actually I switched to FSMs a long time ago, and I remember we needed observer aborts to do that now. I needed a memory refreshing 😄
I was even confused about this and asked relevant questions when first time implementing the BTs
I remember better now
Thanks for taking time 👍
You're welcome. It's a bit confusing, but it saves a lot in perf.
Is there a way in blueprint to access each polygon on the nav mesh like in an array
There is not. What are you trying to do?
Well the question is also a bit tricky here. Because, Blackboard Based Condition of the most left mode could be set as observer and cancel the middle Move To. But it isn't: check the little description text below the decorator title, if there is no 'aborts' mentioned, it's not in an observer mode, such as it won't cancel the middle nor the right node. Only the middle decorator is set as observer and would abort the most right, if a 'Blackboard value has changed event' is send and the condition of the decorator changes.
How can I make crowd avoidance work better than this? I don't like how the last skeletons take such a long time to find a standing spot. I'm using the CrowdFollowingComponent for avoidance
switch off collision capsule interactions between them
and don't try and make them go to the same spot
If I make them chase the player, what positions should they choose then?
usually what you want is to choose a spot near the player, I usually use EQS to select the positions near the player within a certain distance
And if the player is moving? Do you update the eqs at intervals?
There's an EQS generator that forms a ring around the target.. use that and select the position for each one based on closest distance
yeah, you can do different things for the generation.. look at the predicted position of the player shortly in the future etc..
Do I switch off capsule interactions by making a collision channel "AI" and then set their capsules to ignore AI collison channel?
Yeah, been a while, but that sounds about right
Thanks for the help, I will try it out 🙂
You might have to tweak the detour values to make them move the way you want to
Which detour values give the most impact? I've tried most of them but haven't found any that makes it better
You probably saw a lot of issues due to the collision capsules.. once you turn those off you should start to see detour working properly
things like how far to sample in front, number of samples etc.
How did you learn this stuff? I haven't found that much info about this system
You can get the original recast and detour codebase and take a look at how it works
I've known Mikko, the guy who wrote it for quite a few years.. so played with the code before someone at Epic used it
Mikko's demos are far more useful for understanding.. he used to have a blog called DigestingDuck that discussed the development of the library too
And we used to do a few conferences and stuff together, back when aiGameDev.com was still active
Interesting, you've been around for quite some time then. Where is the original codebases, and is DigestingDuck still available?
it was a blogspot account, so you might have to use the wayback machine
the original codebase was on github, I should think its still there.. I think someone else took over maintenance
Mikko works at Epic now (back in the day he was at CryTek), so this stuff might well be changed in the future
A few months ago he was working on navigation corridors
Whats a wayback machine, some software? Is navigation corridors like crowd avoidance?
its a website that keeps copies of other websites
if you google for it, you'll find it
navigation corridors is a way to store navigable space on the navmesh so that you can have crowd agents passing each other I think.. haven't really seen what they're implementing yet
So it might be something like how crowds in real life seems to create lanes like this?
Yeah, might well be.. we'll have to wait and see I guess.
You can follow Mikko on twitter, maybe he'll post about what he's working on
This gentleman?
Yep
Thanks you've been very helpful zoombapup! Me and another guy's working on this game https://store.steampowered.com/app/1830730/UNAKI/ where our main issue is the AI sometimes acting weirdly (like crowd avoidance not being set up great), thank you for taking your time and taking us a little bit closer to the finish line 🙂
Unaki is an action-adventure set on a tropical island filled with cunning creatures and eager adventurers, all in search of the great treasure Unaki, unaware of the island's dark truth.FREE FLOWING COMBAT- Responsive fast paced combat- Weapon types with different attacks- Chain movement-combos to travel fasterUPGRADE YOUR GEAR- Upgrade any item'...
Coming Soon
looks good 🙂 nice art
Thanks, that's @carmine ruin doing his magic
how to make the Attack task to be executed more than once until the wait time finishes
There was a decorator that limits the maximum time can be spent on given composite
Time limit or something
use it instead
u r telling me the opposite
Meanwhile time limit is active you can run attack more than once
with a delay of timelimit / numberOfLoops
or just use a loop with delay on the beginning
Essential I’m trying to make a nav mesh like valves where there are different sections on it that have different tags, like mob battleground etc. I could manually do it but having access to each polygon I could assign a role so that it can be done more procedurally. That plus I’d like to use it as a flow map to track progress, as in how far the player has gone in the map, or more so if they’re backtracking or moving forward
time limit get u out from attack if it takes more than that time
then you need the info of how much that attack takes
and set the time based on that
i meant it takes u out after 3 sec for exampe
if the attack takes 5 seconds it will do 3 seconds of it only
i just want to stay at this node for 3 sseconds
he might attack once or twice
idk
just the needed time
time limit then? thats what it does basically
nope
time limit: limit the time that u stay in a node
You can get the navmesh poly's if you're able to do C++ stuff. Its not really a thing you'd do in bp
if a node takes 1 min
and u limit for 5 seconds
it will go to the next node after 5 second
so you want to range your attack task's time to a specific time?
Add a time value to the BB which is attack duration.. loop the attacking branch if that value > 0 and have a BT service that reduces the time value over time
what attack task even does? it's up to context
playing animation? moving to somewhere?
as he saying
yes playing 1 animation montage at once
calling it twice call the 2nd animation
3rd
and so one
ah, I see
on*
cool i got that and where to set the start time
i mean if i am starting the time with 3 every time i get inside the branch
i mean the attack sequence
hey there everyone
any idea why this might give error
if( !SightSense->GetSenseImplementation() )
{
return;
}
its rare but i am getting a crash here
I mean couldn’t I expose it to Bp?
By writing a function
Yeah, don't see why not.. its definitely there in the navmesh code, I use it to grab the navmesh for cover point generation
I do wonder if they'll refactor for the new world composition thingy
For making the nav mesh have different sections with tags, you can set up volumes with different Nav Areas. Unfortunately most of the things you can do with navigation is C++ only.
Sight sense might be null.
Yes kinda what I was thinking. Is there any documentation I can find on it?
They have refactored nav generation for world composition, but it's not a significant change code wise. It's mostly how nav data is stored and streamed in.
There's a bit of documentation on nav areas. It's mostly focused on changing costs, but that's not the only way you can use it. https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/ArtificialIntelligence/NavigationSystem/CustomNavigationAreasAndQueryFiltersLanding/CustomNavigationAreasAndQueryFilters/
What I was thinking was getting the nav polys from c++ maybe make it in a function library so I can reuse it, then essentially spawning nav areas base off of the size and location of each nav poly
Does that sound feasible?
Yes. If you know enough C++, I would hook into the navigation generation and do it when it's generated. You can subclass the nav mesh to add your extra functionality.
Is that for the new UE5 whatever the world composition thing is called? Damn Unreal naming
Oh yeah. Still waking up. I meant changes for world partition.
Have a look for glassbeavers stuff, he did some good work in that area
Yeah, that new UE5 thing might well not have proper support yet.. given Fortnite doesn't use it
at least for navmeshes
The whole thing needs a huge refactor to be honest
It does have proper support for world partition. They just didn't need to make a lot of changes.
It does need a huge refactor. We switched to Havok AI a few years ago and it's significantly better.
Pity Epic doesn't really give a crap
I'd think they'd buy in one of the better nav middleware or something, navpower or something
I guess in reality every large commercial dev just licenses another solution if they need it
Epic essentially just did a wrapper around recast. And the guy who wrote recast abandoned it years ago. To be fair it's easy to extend, but it certainly lacks the features of all the other available middleware.
When someone abandons Epic with an incomplete feature it takes ages for Epic to start reworking stuff 
They actually employ Mikko now, but still it doesn't seem like they put a lot of effort into AI side of things
Do they have a YouTube channel or something?
Its quite weird to be honest
Me? yeah, youtube.com/zoombapup
or mikko?
I don't think Mikko does
I guess GB? 😄
oh glassbeaver sorry
Mass and smart objects were made for the Matrix demo, but they aren't even close to the quality of the other systems.
erm... good question, I don't think so.. you can get their code off github though
Were you talking about the cover generator? https://horugame.com/real-time-dynamic-cover-system-for-unreal-engine-4/ && https://github.com/GlassBeaver/CoverSystem
Think so
It's a miracle they managed to decide on working on something like this though 😄 I'd guess it was to draw attention to AAA industry
Apparently smart objects are going to be production ready in the next release
I doubt the UX will be very nice though 🙂
I remember they will also finally include multithreading for mass too
They outsourced the Matrix demo. I believe it was to prove out the new UE5 systems. Unfortunately for an engine that is geared towards multiplayer, smart objects don't work for MP.
I’ll check out ur channel too lol, thanks btw
Mikko was working on the stuff for the matrix demo apparently. Honestly its hard to get a read on what Epic are doing regarding dev.. so many features that seem weirdly managed
Sorry, my channel is mostly ML based art generation right now 🙂 and Houdini based PCG shenanigans soon
Do they suppose to replicate? 🤔 I couldnt find a chance to deep dive into them yet but I was guessing they were server-only stuff like whole AI system
I ended up completely rewriting smart objects, because you couldn't have players and AI use them in multiplayer. And the system is not exactly extendable.
The claiming is not replicated. It's handled in a world subsystem.
Yeah, I think for the most part if you're doing professional AI dev with Unreal, you might as well roll your own tech
or buy in at least the navigation and roll the rest
Recently I started to hear about Kythera a lot from colleagues: https://www.kythera.ai/kythera-ai
Turns out it was very popular already
Nah there's a lot that you don't need to roll your own for. All the other systems are easy to extend.
Yeah, Matt knows what he's doing
I'd rather roll my own and actually have some usability, I don't much care for many of the setups because they're just not very designer friendly
If you are a slate wizard and have a lot of free time it's fine I guess 😄
Meanwhile I'm still trying to understand how to create multiple outputs for a custom BT composite
Honestly, slate isn't that bad.. I've been using QT for the last few months.. if you want bad 🙂
I looked into Kythera, but it's usability isn't better.
I mean most UI stuff is kind of a sick joke.. but trying to get synchronized per-frame video ouput in a UI seems practically impossible apparently 🙂
Are you building a tool for your ML projects?
QT will give you a signal per-frame, but it actually has another decoding thread, and doesn't advance one frame at a time
Yeah, building a viewer for video annotations
I mean technically I can do it by just ffmpeg'ing each frame, but I wanted an interactive scrubber
I'm even tempted to use a webview control in QT and do the video in the embedded browser.. using a video element
Is this for the pick-up line creator AI you mentioned at the earlier days of this year?
Its for a large scale effort to enhance video annotation using multiple ML models
based off of the movienet dataset
You work on too many projects haha 😄
things like per-frame skeletons, per frame facial features etc
Yeah, this is for my main research, although that's kind of sidetracked because I got some money to do a VR based voice-to-scene generator
using clip guidance
Nice
Got so many ideas right now, but not enough time, or students to make progress on them 🙂
Last time you were thinking about making your students work on Houdini and procedural generation?
Oh they're definitely doing that this coming semester 🙂
Theyre building a smaller version of houdini in Unity and using Houdini itself in Unreal Engine
Because I'm mean 🙂

To be fair, its not that hard.. basically write a single node class that does some simple vector maths
But whats good, is that its all unit tested, so I don't have to grade it 🙂
a single node class each week, pass the unit tests.. get marks.. easy!
Sounds fun tbh 😄
Houdini is a beast
Also unit test idea looks very clever
having fun playing with it for my notes
Still cool to look at
Yeah, most all of my students will have never done any Unit tests or CI/CD stuff, so figured it would be good experience
I'll showcase some new tools once I get the model weights from stablediffusion.. then we can do some nuts generation stuff
Are you a CS teacher in general or specifically focused on ML/AI?
I'm half CS and half Games, but my research is mostly ML and my background is mostly AI 🙂
I think it's quite unique combo 😄
Yeah, tell me about it.. hard to get any funding
😄 😅
And kind of annoying that games industry doesn't really take ML seriously yet outside of casual games
and animation tech I guess
I think your students can come up with very cool things in the future though
We pay attention to ML, but it's not close to being designer friendly
Especially since fresh (and rich funded) studios come up with ML solutions
like Arc Raider
Yeah, got a masters by research student starting this semester, hoping to do some fun stuff with him
I spoke to a CEO from a big UK dev about 6 months ago.. they totally dismissed it, with no hint of irony
in the meantime, its being used in a few places extensively and having quite a lot of $$ value.. so hey ho.
@ocean wren https://github.com/darbycostello/TileNav
Tile-based navigation plugin, for pathfinding solutions across variously oriented floor meshes. - GitHub - darbycostello/TileNav: Tile-based navigation plugin, for pathfinding solutions across vari...
This actually looks fascinating, I can make tiled sections as a component in bp
Well..to be fair that's the CEO. You need to talk with people doing the work who are the ones that convince leadership.
Yeah, but you'd expect the CEO to know the direction of travel right? Look at other industry adoption? at least be open to it?
I mean this was just wilful ignorance
mind you, companies with CEO's who came to be CEO because they were early into the company is probably part of that
It's going to depend on if the CEO started out making games or not. They know the business side and rarely the dev side.
Can't really say who it was.. but it was kind of a shock, they'd been in the industry a hell of a long time
I'd just assumed that savvy business people would be less conservative I guess
Last year I went to a conference on ML held by Microsoft (I was working at an Xbox game studio at the time). So it's not the entire industry that is dismissive of it.
Yeah, I think the bigger publishers have an eye open.. EA Seed etc.. But even middle sized companies seem to be totally ignorant, unless they've got some savvy leadership I guess
Its not the whole industry thats ignorant, I know Zynga and the like do a load of ML, but I do worry about the SME's missing out
At the end of the day though for AI behavior, ML is not yet to the point of designer tunable to be useful.
I'm not really thinking about it for AI behaviour, I'm thinking about it for tools and design and player modelling and such
I'd appreciate an AI that able to optimize lighting and manage LODding etc
and locomotion and learning editor preferences and generating cinematics and scripts
reducing designers "boilerplate" would both decrease development cost and effort
considering whats out in the market it doesnt even look difficult to maintain
in the end lighting is pure math
Well, we'll have some fun messing with it this year so will have a few fun demos to show
If anybody is going to AAAI this year, i'll be there presenting some AI research I think
yeah ML is still a bit too difficult to integrate into games as of yet. I think RL seems to be making some big strides, but we'll see where that goes
also neurosymbolic stuff is potentially an option. I've been kinda doing that
anything that fuses ML techniques with symbolic representations
What scenario would you choose a selector instead of a sequence? I've just tried them in various orders with some waits and move tos and my stuff is breaking lol when im just trying to find the the different use cases.
A sequence continues until the first one fails. So you use that when you want a sequence of actions to happen as long as they succeed. A selector continues until the first one succeeds. So you use that when you're looking more for a choice between actions or branches.
Are there any tips on making pathfinding more realistic and randomized so to speak? My bots all kinda go the same way each time and hug corners, they look like they’re just taking the shortest route each time.
Thats exactly what they are doing 🙂
What is your use case? we did some stuff like jitter the navigation point of each patrol point for the squad members.. so basically each would get an offset within some radius of the patrol point and go to it.
Never give them just one point to go to if you're doing a group
I’m basically trying to make bots for a pvp game, and when they fight each other they wrap around the same corner, pile up and shoot each other to death in a cluster lol
Kind of like I have a 5v5 running and they all randomly pick and enemy to run to. But they all happen to run the same direction and they hug corners lol
Something like that might help them look less dumb maybe
This would require some C++ probably
It does string pulling as part of the funnel algorithm it applies, maybe you could relax the string pulling per-path?
R u saying it gets the two points and tightens it up to make it straight?
what is the difference between On Result Change and On Value Change? I need someone who can explain it to me 😄
in Decorators
when to use On Result Change and when to use On Value Change, some example
'On Value Change' - I think the point is how e.g. a Boolean variable will change to true or false
but On Result Change
I don't know what doing
Have you tried the advice on adjusting the destination? That will help considerably.
Be careful about trying the hard solution first as it's usually a waste of time. Often the simple version is more than enough to get the behavior you are looking for.
On Result Change is the result of the decorator. So if you are observing a target actor blackboard, it will trigger if the blackboard key is cleared.
On Value Change is when the value of the blackboard is changed. With a target actor blackboard, this will trigger if the blackboard is cleared and if the target changes.
Its takes all the points and straightens the lines between any convex corner. So basically it pulls towards the inside edge of any turn
Does that for the whole path once the path itself along the polygon's is found
if you follow the code for FindPath.... and see what it does, you should find a reference to string pulling or funnel algorithm
I have no idea, maybe someone will help me ... I have a object to which AI is to go and I would like it to walk towards this facility gradually, e.g. every 20 m, a break of 3 seconds and then goes again 20m etc.
how can i do that :p
I have the location of the object and the current location
AI, what's next?
I would use the EQS.
Interesting I’ll have to take a look, and learn cuz I’m not too skilled in this field
But in terms of AI hugging corners and path finding being really weird, I’m gonna have no choice but to go into c++
The default path finding is way to robotic looking
I mean unless I use EQS to add some calculated randomization
3rd option would be doing what Death Stranding did
but what luthage said makes more sense
Adding path offset to target movement goal almost always makes a visible difference and very easy to do
but it can be done on behavior tree
what is difference
EQS can be a part of BT
at most minimal level its just an object that processes the data you give and returns it back, can be implemented to anywhere
BTs has Run EQS nodes
it can be done without EQS, there is better performance in EQS or what?
It's just easy to design and very powerful, and probably wouldnt matter at lower scale but yeah its more performant
since it's time sliced
You could hack something in BP, but that would be a lot less performant. It would also be harder as most pathing functionality is not exposed to BP. You could do it in C++, but that's going to be inflexible.
EQS gives the flexibility and performance. Plus it's a lot easier.
Oh ya that’s kinda of exactly what I had in mind lol
I don’t know if the EQS thing was referring to me, but I think that might be the best route for me to go because pathing in bp is not exposed and C++ is harder to be flexible with
Which probably means that I will have to find out some other way to move my ai other than the AI MoveTo node
ok, but in eu5 it's already worked out? not it cause errors?
Has anyone here implemented some kind of task/order queue in conjunction with state tree or behavior tree?
I am trying to wrap my head around this
I am using a State Tree in conjunction with MassEntity
I've been using the EQS since 2015 and have shipped multiple games with it.
I think if I learn how MassStateTree manages the lifecycle of tasks, then I can do that manually for a queue
I have with the BT, but not the state tree.
Did you have overall lesson learns, would do/not do if you had to do it over again?
It works great if it makes sense for the behavior you want. It will simplify the tree, but make debugging harder so add good logging. Have good fallback behavior if they don't have a task/order. And my typical advice: keep it simple and only make it complicated when you absolutely need to.
can you give a link to these games? 😛
I wonder if DONs 3D path finding works with navigation invoking.
I looked into how open worlds deal with navigation, basically creating them around the pawn at runtime.
I doubt it
Would it be feasible to create my own A* 3D pathfinder for multiple small creatures or would that cause a giant performance bottleneck
Depends on how will you architect it, I'd guess any good optimized implementation would take some at least a few months
Invokers are really expensive and would be significantly worse in 3d. Open world games stream in the navigation and don't constantly rebuild it.
I think 3D navigation data can be asynchronously created when any agent attempts to move somewhere though, if distance is relatively small it can be negligible
The idea might work out for something simple like this: https://github.com/reidtreharne/Navigation3D
Ruh roh. State Tree stopped opening up after compiling a change to one of my state tree tasks 😮
happens for new state tree assets that I make
I can't open up any state trees anymore
Thanks @celest python. I tried deleting intermediates and no dice. I don't see any relevent errors pop up in the terminal in jetbrains rider as I do a debug session. Do you know what log file I'd look at?
if you dont see it on output log, probably you wont find any on other place
i wouldnt think something like this be logged as verbose
this file? /Saved/Logs/{projectname}.log
poopenheimer. I tried running a debug session of Debug Editor but it didnt catch any errors
Debug the function that opens the asset editor
the on run on double click
no idea what/where it is though 😂
at this point if no one encountered same error you're up to a hardcore debugging sessions
lol
I even stashed all changes on the project, did a git reset --hard on the engine/editor itself, pulled latest
rebuilt the editor..
how about doing a full clean rebuild
and maybe backing up your saved folder
and removing it
saved folder in the editor?
Project folder

by the way, did you have reinstancing enabled on live coding?
not sure
did you live coded?
yes, ctrl + alt + f11

i bet it's the issue if you had reinstancing enabled
check it on project settings
reinstancing is enabled

reinstancing == new hot reload
Epic bamboozled us by removing hot reload and enabling reinstancing by default
lol
even if its not the root of the issue disable it to be safe on the future
but yeah its easy to blame as hot reload
but you also say you rolled back your changes from VCS
I found the state tree editor module folder
indeed m'lord
I'm confusion 
How about
using widget reflector
and seeing if widgets are even being displayed
what is widget reflector?
LOL
time to reinstall the engine 
and update your drivers
and scream to the void to express your suffering
last one is optional
the screaming sound snice
I've been saving the water that I use to pressure cook chicken wings (before I fry them), and I will use that water for deglazing or when boiling pasta or rice
Today I double dipped. I use the water that I pressure cooked chicken wings with a few days ago (I store the water in the freezer so it keeps for long time), and I used that to pressure cook the new batch of wings
is there any chance to minimized your windows sooooo small
and you wont be able to see them
I used windows key + arrow key to full screen it and nothing happenned
maaaaybe mouse is not able to focus to the window
holy shit
I opened up a different project, on a version of the engine from EGS (5.03), anD IT HAPPENS STILL
your comrade in destiny https://forums.unrealengine.com/t/cant-open-any-assets-in-4-23-0/456689
From previous post from this forum I guess this bug returns from 4.11 - 4.12. Basicly when I try to open asset white window pops up in the tray. It’s shared across all 4.23 projects and at the same time in 4.22 everything works perfectly. I’ve verified and reinstalled engine. Nothing helps. I’ve also pocked derived data cahce. Is this issue f...
I wish he replied later saying, "nevermind I solved it!" with no explanation
good news he seems to be an user of this discord channel
bad news he has no messages at all
This is amazing, I will give it a try ASAP
It's a simple approach to this though, not an answer to everything
I was meant the theory behind it, (the math + algo) can be asynced easily to improve the perf
it relies on volumes to create the 3d path so not very nice
@fading coral Hi there. Were you able to resolve this issue https://forums.unrealengine.com/t/cant-open-any-assets-in-4-23-0/456689/2? It is happening to me right now, and all has become despair.
so the link was just to provide an example to answer of "would it cause performance issues" question
Wow they have an awesome icon - Raiden
lol @normal mist
🙂
Ah i see, yea I just need a algo for many flying creatures in a big space.
OMG
I disabled my third piece of shit USB monitor and it works
this was never an issue before
That plugin relies on procedural mesh iirc, you could maybe find another way to generate path points (be it octrees or anything else) and apply same algo on top of it to create pathpoints
no idea though
just throwing random ideas
What I'd do is do a very wide research of this topic and ask on SO's gamedev topic, then after deciding on a specific implementation I'd constantly bother people in this channel to verify I'm not doing something stupid
and this is how AlexusLexus learned how to solve this problem after 3 years
I documented my scientific findings to the forum in that thread
Sounds like a valid plan
just thinking about it
if AIs only active around the player you can even have a 3d navigation manager that just creates and destroys path points around player etc
which is something would act like an invoker at most minimal level, in theory
regarding recast nav generation, is there some kind of callback delegate that I can subscribe to to figure out when the navmesh has been generated in that area?
I am utilizing the recast navmesh generation at runtime but am completely bypassing the invokers LmAo
Going directly to the source
const FNavigationInvokerRaw Invoker(Median, GenerationDistance, GenerationDistance * 5);
for (TActorIterator<ARecastNavMesh> It(World); It; ++It)
{
It->UpdateActiveTiles(TArray{Invoker});
}
I'm using this to pathfind for off-road navigation. I'd like to get the path once its finished generating. However, what I'm doing now, is just continuously rechecking on a 1s interval waiting for it to generate
ALSO, it seems to start generating from world origin. This is on a world partition level (ue5). IDK whats up with that, if I am to blame, or where my family has betrayed me
That’s smart, in my project you have an airship with which you will explore the skies, I am yet unsure about the size of the environment since I have been so focused on the airships flight system and building aspect.
The 3D algo also needs to work dynamically so creatures don’t crash inside my ship
There is a delegate in the navigation system you can bind to for when regen has completed, but it's not specific to an area.
Invokers are ridiculously expensive and cause an endless supply of bugs, so I don't recommend using them.
Thanks @uneven cloud. This is on a potentially 32x32km map. Is it feasible to pre-build a navigation mesh to accomodate it?
If you are using level streaming, yes. World partition cuts up the nav data and streams it in.
oh cool!