#gameplay-ai
1 messages · Page 10 of 1
"waiting for in your bt move task" is there some other "wait" method im missing other than ticking on a branch (gate) here?
empty task or not
is that not what you're suggesting happens here?
read the 10 messages 😛
what?
i am likely just misunderstanding how tasks are fired/handled
are you suggesting i bind to an event/dispatch notify in the task?
Tasks live for the entire duration of the Behaviour tree, so you can subscribe to an event within your task and wait for that
thank you that's much more clear.
i assumed erroneously without a tick event in the task, the task just dies after it's been handled, with or without a Finish node
I'm not entirely sure of the exact lifetime, but I am quite certain the tasks live on as long as the tree does!
Even if you've finished with FinishExecute, in fact
ohh wait actually? does this mean i can finish with success immediately and let the tree continue running, but before that if i sub'd to the controller's GoalReached event it would still get called?
not exactly the use i have in mind obviously but good to know what is and isnt possible with task "lifetime"
so apologies, it would have helped to communicate that i assumed you needed to tick a task to get the behavior tree to "stop" on it.
You'll want to return InProgress in such cases.
Thank you! I didn't know about this but that's a good thing to know! Is it C++ only?
I only see FinishAbort and FinishExecute in BP
I believe that in BP InProgress is the "state" of a running task until FinishExecute or FinishAbort is called.
for the record, no Tick implementation required
Gotcha. And I assume it's not a good idea to keep doing Task logic after either of those, even if it's possible?
Since I noticed it would keep running events and such inside the task... but it felt hacky.
I would strongly advice against that.
yeah, plus asking for debugging hell it that logic caused issues. If only the active branch is making changes it's easier to narrow down what's causing issues.
@crystal hatch @misty gale
Just to update you, i migrated the entire project to 5.1 and the nav is still not working.
In a new blank 5.1 project it does work so somewhere somehow something broke.
I am attempting to migrate the project to see if it can be restored
Check the world settings
i never touched them
@crystal hatch @misty gale
Migrated assets in 5.1 new project works... so something failed in the initial project. Will turn off plugins one at a time to see if something is amiss
Such a trip !
Is there anyone familiar with Smart Objects around? In particular, for 5.1.
depends on what you want to know 😄
They've changed how the definitions work and I can't wrap my head around it.
Okay, a sec!
It's this, honestly
In a smart object there's a slot for gameplay behaviour definitions
Before we upgraded, that accepted GameplayBehaviour
But now it seems to only accept USmartObjectBehaviorDefinition
And I don't know how to create one!
Their docs are outdated.
"The API is consistent compared to UE 5.0, which allows for backwards compatibility when migrating projects."
Yeah right :(
enable GameplayBehaviorSmartObjects plugin and use use that as the behavior "class", then you can use any GameplayBehaviorConfig you want
Right, hang on!
Where do you define the config, if not inside the definition?
The panel for reference
OH!
The arrow!!
Ah, you're a lifesaver!
Thank you! And dang, that's much nicer than doing a custom definition for all of our SO:s
We probably took the stupid route even before 5.1!
we're still working on the UX side 🙂
Ah, you're an Unreal dev?
Well, Smart Objects kick ass even if they're a bit hard to navigate!
It was such a blast to get so much life in our scene with such (relative) ease
and it's only getting easier! 😄
Looking forward to it!
Speaking of SO, what would be your personal opinion on something like this? Do you think it is a good idea? :D
Spontaneously, I feel like finding cover would be better suited for EQS
I don’t think so if you want them to be persistent, contain cover specific data and query them quickly from many agents
I would still use EQS to filter them but the generator would return pregenerated covers as the initial set
Ah, right
I'm sure it would be fine having tons of SO:s!
Spawning them dynamically I can't utter a single word about so I'll refrain!
Where can I bind to the OnSlotInvalidatedDelegate?
C++ only? I can't seem to find it neither in the AIController or NPC.
C++ only, call USmartObjectSubsystem::RegisterSlotInvalidationCallback to register a delegate
Gotcha, thanks!
I found it
wow
what a bug
In the engine settings
[/Script/NavigationSystem.RecastNavMesh]
bAutoDestroyWhenNoNavigation=False
bCanBeMainNavData=False
when you set this to false once, it never goes to true if you reset it
regardless of what it shows
in 5.1, i can reset it
Very excited for the UX improvements
I saw the contextual animation SO definition in the City Sample and got:
a) Excited for how powerful it seemed
b) terrified
Say whaaat, you sourced it !?
I tried with new project settings transplant
and then went back
then did an analysis line by line
So its a 4.27 bug? Are you gonna stick with 5.1 or do soucce edit to fix it ?
Gonna stick with 5.1 since everything else was fixed from 4.27 and 5.0
for some reason the package is also 100 mb smaller
Every 100mb counts!
I feel like I'm still missing something with Smart Objects, so apologies for the barrage of questions!
I'd like something like this for my NPC:s:
Where I can control from my BT when they enter and exit SO:s -- i.e. the TargetSmartObject task would hold until they've entered an SO successfully
Then they remain there until I call LeaveSmartObject.
This node makes it easy to enter a smart object, and using it makes the avatar call the OnTriggeredCharacter event in the behaviour
So it's easy to ENTER a SO, but I'm struggling with forcing them to exit.
There doesn't seem to be an opposite to the UseClaimedGameplayBehaviourSmartObject function.
The StopGameplayBehaviour BT Task stops the behaviour (and calls the OnFinishedCharacter event) but doesn't release the SO.
But simply Releasing the SO doesn't call the OnFinishedCharacter event in the behaviour!
The reason I'm struggling is that the documentation for SO:s seems to focus on Behaviours that themselves define how long they persist (i.e. they call EndBehavior after a montage finishes). I'd like to get this right the first time, so I don't have to re-write too much! I'm sure I could do some hacky thing with Messages or C++, but if there's a "correct" way for things like this, that'd be ideal.
Is it a good idea to divide my AI states into separate BTs. I was thinking of keeping one for each state like patrol, combat, etc. I heard someone say switching BTs are expensive. I plan to keep the blackboard same. I would thus have to do less exception handling to get my AI to the respective states.
Anyone know of good resource on how to set up a BT in C++ and not in editor?
Intuitively it seems like a good idea to have your states run as subtrees in RunBehaviour nodes of the main tree.
So will parent tree logic run when subtrees are working? Currently I swap out trees from the controller
I wanted to keep it modular and take which tree I want to run on the pawn
I haven't used subtrees extensively, but I believe the flow will be more or less identical to just having the subtree nodes be part of the parent tree?
I.e., the RunBehavior node can be thought to "expand" into the nodes that it consists of.
So execution enters the subtree, and while it's working in there, the parent tree is holding on the RunBehavior node.
There is also RunBehaviorDynamic, which will allow you to swap the tree at runtime, but that will incur the cost of creating the tree (when it first runs, I presume?)
The problem with the subtrees is that they get hard coded which is my main confusion. I could hand over a separate tree to a junior and they could work on it quarantined for a specific state instead of altering the parent tree. If I just run them as is
But that should be possible with subtrees?
Since they allow you to refer to another tree entirely
I store what tree to run on the pawn. The controller grabs it via interface
Easier to manage junior does not even need to touch the controller or the parent tree
Regardless of how you do it, I would think the main consideration would be this:
Building a BT is costly because it needs to construct every node and decorator, which requires memory allocation -- so if you destroy the tree for your state when you switch, that cost will be incurred every time you do. If you let it live, perhaps by having it as a subtree, then the overall memory usage will increase, as will the cost of initially creating the tree -- but you won't incur a significant cost for switching states.
Since everyone has a lot of RAM nowadays, I don't think the memory usage of a large tree should be a problem. And if you have one large tree, the cost of creation will most likely be done on level entry, so you can have a loading screen and avoid little hitches at runtime.
I'm thinking something like this, with Observer abort pulling execution back whenever the state changes?
Then your junior should still be able to work on each state independently without having to consider the main tree too much.
But perhaps that's too simple for your use cases. If you need to pull the trees by message, then perhaps RunBehaviorDynamic would accomplish it. Then you could have the trees as blackboard entries, and update them at runtime. Then I would assume they incur a construction cost when first run, or when set, but never again after that?
I haven't had need for dynamic trees, personally, so I don't know the exact mechanics behind them.
I believe this is a valid way to assign a dynamic subtree from the AIC, identified by tag: so you could create some game tags for the different states and then push the subtrees that way.
Look at BTTest.cpp, that's where BT's unit tests are. We create BTs procedurally for testing purposes.
Thanks a lot, will do 😄
That seems to be exactly what I needed ❤️
Also, your advice on looking into source code was spot on, the previous issue got fixed 😄
Code is the ultimate documentation!
I think I might condense my previous question down to this: is it misguided to attempt to use Smart Objects non-blocking?
I.e: sit down on a bench (claim & use), play a looping sit montage -- let BT logic continue, do some more things in the tree -- and then get back up (release and end) based on some condition (having seen the player, for instance)
it's not misguided, in principle, but we might be missing bits to make it happen.
Hm, I see. Well, those parts I might be able to fill in just by combining the best bits of StopGameplayBehavior and Release into a custom BTTask
We had a system working before, but it went through the Pawn in a way that grossed me out a bit -- because it was a little tricky to find a good spot to anchor the logic where all the puzzle pieces were accessible (claim handle AND current behavior).
I'm sure it'll be fine!
Thank you for the reply! There's not a lot stopping us from doing what we want, I mainly wanted to know if there was a design pattern in place for something like it already, so I don't re-invent the wheel.
(although I'm sort of coming to terms with the fact that Unreal holds so many little secrets that you're bound to re-invent a buncha wheels during a game)
I guess it's a function of codebase size and amount (or lack of 😄 ) documentation
Haha, plus the constant desire of the game dev to get started before being fully read-up!
The "36 things you don't know" video that made rounds certainly helped.
(oh gosh the sequencer camera blending!)
Interesting
Ah yes another Unity deserter 😆
Respect++
Hey guys im really new to unreal engine 5 its been a month and i finally got to the ai part of my campaign fps game but i cant find a single tut or template with a ai with a gun and stuff
so can i make dude like this for my game
any new statetree learning resources yet?
you can make anything you want
That node is an AI task and cancelling that should stop the gameplay behavior. It really should be done with 1 BT task instead of the 3 you are trying to do. Make the wait a parameter of using the SO. Set a timer for the wait, cancel the AI task when the timer ends and finish the BT task when the AI task is done.
hey folks i am so new to this but i would love to make an Ai that tries to run from me instead of chase me! i want to make a game where im the killer chasing after people
Are nested ai BT a thing where depending on an enemy type if its a melee or shooter focused enemy it uses the right BT accordingly like making a master Enemy where I can just pull from
I know, I know... I think I'm going to commit crimes against BT. The thing is, the wait isn't the only thing I want to happen while seated. I'd like some dynamic character behaviour. For instance, we use BT to print conditional dialogue lines above the heads of NPC:s. I'd like that while they're seated, too.
does anyone know if Environment Query System is going to get out of experimental soon or is it commonly used in shipped projects?
Is there a reason you can't just select the appropriate BT to run in your AI controller when the enemy is spawned?
You could certainly make a big tree with subtrees for each type of enemy, then select the correct one at runtime -- but it would increase the overhead for each enemy a bit
The only advantage to doing it that way seems to me to be that you could change the type of an enemy very dynamically.
and I'm back with another weird problem in UE5!
My nav mesh volume is present in some levels and it works in some but not others. In the ones that work, the preview shows the overlay. In the ones that do not, no such preview. I tried to delete it and put it back, no dice. I tried creating a new level and copying it over, didn't work. I tried copying the level as well and that did not work. I tried rebuilding it but that also did not work.
So how can a nav work on some levels but not others??
ok, solved
apparently the mesh did not have primitive collisions and that is a requirement now in 5.0
That's a lot of crimes against the BT. BTs aren't dialogue trees or decision trees. With the way that you have it set up, you can't abort the using a SO if they need to do something else.
You can use Run Behavior Dynamic and set the subtree per enemy type using a gameplay tag.
It's commonly used in shipped projects. It's been experimental for years.
It's been the backbone of AI in every Unreal project I've seen shipped.
I believe that the pathing grid only projects onto the nav mesh and does not check if a path exists. I only use donuts, so not 100% on that.
Gonna be starting some simple enemy AI for my game. I'm hesitant between diving into behavior or state trees. Any recommendation?
I'd say BTs because there is more material for them currently.
I'd certainly be on my own with state trees.
behavior trees with c++ is nice
kinda becomes just a glorified debugging tool since I put the vast majority of logic inside tasks instead of the BT
I have a problem that i dont know if it has a solution.
I asked already in #blueprint and we didnt find a solution. Was told to try asking here in the #gameplay-ai .
Im trying to change the Root Collision size of an actor and make it navigate through the nav mesh with this new size.
Meaning it should be able to go around obstacles and not collide against them right?
But its not. Increasing the size of the of the root collision, apparently doesnt affect the way the navigation is calculated, making the mesh calculate the path as if it was still a small capsule.
That will cause it to overlap or collide against obstacles when trying to go around them.
So what can i do to fix this problem? Is all navigation in unreal made for actors of only one size? So we cant navigate properly with actors of bigger size?
in UE4 you used to be able to make objects and actors into obstacles to avoid at all costs. In 5.0 and 5.1, this feature seemingly disappeared? how can I make an actor/mesh avoidable at all costs other than height?
i had to put a collider that collided with vehicles (for some reason) to block that off but it still had a navigable area. I want this to not be navigable at all
Could someone help me with understanding nav meshes? Is the nav mesh generated affected by any particular characters movement capabilities? and if so, which character?
For some reason on my level the navmesh isn't generating paths on top of blocks, does anyone know how to fix this?
turns out the fix for the above was just that the box was too small for a path to be generated on top 👍
would still appreciate it if someone helped me with the understanding of nav meshes as I asked above
In the project settings there are navigation settings. In there you will find an array for Supported Agents. You need to make one to fit your collision size. It needs to be set as 1 unit larger than the collision.
The nav mesh is generated based on agent settings. The default is hard coded, but you can make your own in the project settings with supported agents.
To get an AI to go onto the box, you need a nav link to link the ground nav mesh to the one on the box.
I want an ai to be teleported randomly to a pre defined location that is closest to the player. So it would check which pre defined position is closest and move the ai there when told to.
Does anyone have any idea how I could implement this idea?
I would say do the simplest solution first and then iterate from there. Break it down into steps.
- Place locations
- Check for closet location to the player
- SetActorLocation at that location
do you know how to check for the closest location
Yeah
A got fit there is to use EQS to generate valid locations around your player target and pick the one you want (filter them by distance, visibility, navigation etc)
Oh so there is hope. Thank you. I just create an agent and it fixed it. Though there's an issue that might not have a solution.
Is that i have characters of different sizes.
Is it possible to make the agent change according to the character size you are using?
Because so far i was only able to fix the issue by changing the Default Agent in the World Settings.
Would be nice if i could change it at runtime. So if im moving a dinossaur i make the agent the bigger one. Where if im moving a cat, i make the agent a smaller one. Is this possible somehow?
Or maybe it needs a Nav Mesh for each agent?
There must be a way?
The navigation settings in the Project Settings has an array for Supported Agents, which can support multiple agent settings. You posted an image of the World Settings.
Yes but i created a supported agent in the project settings before. So how do i make it apply to specific characters?
Like, as it is now its only applied to all of them
The navigation system finds it for you. It finds the best fit based on the agent properties on the movement component. By default the radius and height come from a character's capsule settings.
oh wow i see. so all i need to do is to make my agent as close in radius to the actor and it will self-adapt when i move it
thank you
You're welcome. Multiple nav meshes get created when you have multiple supported agent settings, so there is a memory cost. I have in the past been fine with small, med and large ones. Grouping them works really well.
So this wont work if my character grows into specific sizes at runtime? It must have predetermined sizes
i see
So a lot of Supported Agents its bad for performance
well it will just get the closest size agent to its root collision
I need help from someone regarding tags.
So my AI relies on tags to identify targets.
Can i just use one find node to write [Survivors, Tamed Creatures , Herbivores] ?
Or do i need multiple nodes?
I need some help debugging my game. I have an AI moving to a random reachable location for the patrol. I generated the navmesh and it looks fine.
The function that returns a random reachable locations is unable to find such a point for some reason. Could someone help?
The AI logic works perfectly fine on another starter map so I have to assume its the static meshes in this map that are causing this, but I can't figure out how to fix it
infact if I say put a huge plane above my level and put the player and enemy characters on it, it works completely fine. So, it has to be an issue with the floor assets I'm using being not navigable even though the navmesh appears green on them. Does anyone know a fix for this?
the moveTo calls on the AI also end up failing
i made a comment earlier, check if your mesh has collision. If not, it cannot use nav
it does have collision
i mean actual static mesh collision
open the static mesh
@terse stratus
this
if not, add it
Might want to consider using gameplay tags instead.
what does VisLog say?
has anyone used state tree's for general ai (not mass specifically)
my ai isn't moving my character, i've assigned it to the character as the controller and tested that the location generation task is running but the MoveDirectlyToward doesn't seem to do anything
familiarize yourself with vislog and gameplay debugger
Hello 👋
I wanted to ask if anyone knows how to specifically set the mechanic the AI uses to move around. Most tutorials operate around AI just being instantly turn and move, much like a character would while I would like my AI to behave in a less snappy way and more like a ship; in the meaning it moves only forward and has to turn left/right in order to actually change direction.
Most tutorials that achieve something similar mostly operate on already created in-engine cars so they aren't all too helpful. If anyone could at least point me in the right direction or tell me how that specific thing I am looking for is named, I would be grateful.
why am i getting this error message?
why am i getting this error message?
what error message?
controlled pawn is not valid.
are you sure the AiController's attached to a pawn?
can you show me the options for "auto possess ai"?
select the last option
that didn't change anything
how do you run the BT?
hmmmmm
that's in my AI_Enemy_Master
oh! move that to the ai controller
AI_Enemy_Master is of class AIController
huh. go to controller begin play and check if the controller pawn is valid
i don't know how to do that
beginplay->get controller controlled pawn->isvalid--true-->print string
controlled*
it's valid
wait so the player is not valid?
do a valid check here
valid
so the player is not valid? did you start PIE on simulate mode?
me too, i followed a tutorial exactly then went back over it two more times looking for something i missed
I have a king of the hill system set up and my ai goes to the nearest un-owned control point.
However if it is captured by another team member while the basic "move to" task is happening how can I get it to stop and look for a new point?
My first thought was a decorator, but I'm not sure if would be better to make a custom move to task
@main talon in the move to method I believe there is a parameter to check at runtime if the destination is still valid and if it isn't to update or in your case make it fail
@bleak plaza @sudden stag
Where do you set your vars in the bb? You must set them to know what to do. If a var is missing or is not set up. It fails
The player isn't valid. This can happen if you placed the AI in the world. You should always check references before using them. Also I recommend that you try the AI with Blueprints course on the learning library. Whatever tutorial you are following is not good.
You have to set them in pawn as well
both my validity tests were successful so i don't know what you mean about the player not being valid
Your validity tests were for the controlled pawn, not the get player function.
i also have this random location task that doesn't reference the player, it returns a value but the MoveDirectlyToward task does nothing
i used the debugger and can see the MoveDirectlyToward task is firing, but nothing happens
they are set in the tasks and read in the behavior tree, as far as i'm aware the only thing you do in the pawn is define the ai controller
tested the get player function, it's valid, and the BT branch for when the player is detected is firing
Hello AI friends, my blackboard nodes seem to run simultaneously if there is a delay in them.
For example, here are 2 different nodes:
BB1 - Cut tree, wait 5 seconds, go to lumberjack
BB2 - Enter house
The problem is, if I fire BB2 while he's waiting the 5 seconds, he'll start BB2 then finish BB1 when the 5 seconds is up.
Is there a way to ensure only one Blackboard node is active at a time?
Just a general question on AI programming. During combat I want the AI to change position to make it more difficult for the player to aim, I do an EQS query to find a new position for the AI with requirements like trace to player is valid, distance at least X meters etc, however, the EQS query does not check whether the target is on the path to the new point the whole time visible. This leads to the problematic result that the AI moves out of visibility of the player to reach the new flanking position. Any idea how to avoid that behaviour (maybe something like continous wayfinding?!) ?
Very noob question. I have two types of enemies, one navmesh. I want to make some volumes obstacles for one enemy but not for the other type of enemy, how can i achieve this?
Not a noob question. I've been doing this 3 years and still haven't figured it out
You CAN make 2 navmeshes, and each type use one or the other
That's all I've found
Weird, seems very common behaviour. Lots of games have enemies with different path behaviours. So i guess in the navmesh modifiers/volumes you choose which navmesh it affects somehow?
so u want to have different logic for same nav agent or what?
i think u just need to create different agent type for that enemy type
And how can i make volumes obstacles only for a specific agent?
Use navigation query filters
https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/ArtificialIntelligence/NavigationSystem/CustomNavigationAreasAndQueryFiltersLanding/CustomNavigationAreasAndQueryFiltersPreparationGuide/
Hi, I'm using Motion Warping Plugin to have my Ai attacks End at desired location. However when the warp location is clipping or behind the wall it teleports my enemy to random locations. Does anyone know what might cause it? When using root motion from animation it works normally and Enemy stops at wall, only when motion warping is enabled then this stuff happens
If you mean BT node, then you have to add abort functionality.
You can either use nav areas and nav filters or different supported agents set up in the project settings depending on if the size of character is different.
Can i setup a navmodifier to only be default for an agent and null for others?
Sorry. Had to actually look at nav modifiers. Looks like you can only use filters for them. It's nav links that can use both. You can set a default nav filter on the AI controller, so you just need to set it up.
I'll try then. Thank you for your help and effort🙏
can i apply trough a query filter, that by default the normal green navmesh(the one you see with P) is not viable and the enemy can only pass trough custom nav area modifiers i create appositely?
Has anybody had success importing and attaching a navmesh to a movable actor? I know ways/plug-ins to export the data but not sure how to use in game.
Did it ever work out?
Behaviour Trees are strange. Anyone know why execution might not leave a branch immediately upon the condition of that branch's Decoration changing? I have the Decoration's Notify Observer set to "On Value Change" and Observer Aborts set to "Self" and there is a Task that changes the value of the observed blackboard key in the same branch.
Trying to make a dragon take off.
This dragon:
I can see this branch execute 5 times in the same second in the Output log:
@sick kayak does the task have a success and fail flag?
Yes both
Restarting the editor
Might be a bug
Didnt help
I think it must not be executing all nodes in the sequence successfully so it doesn't reach the node which sets a different value on the observed key, so it tries the branch multiple times until all nodes in the sequence succeed
I'll put a breakpoint on one of the other branches that it switches to and try to Step Backwards and see what is going on
Looks like a MoveTo failed. I don't get how that could fail. Its a really simple node.
And I have a nav mesh.
LogNavigation: Error: Navmesh bounds are too large! Limiting requested tiles count (5248800) to: (1048576) for RecastNavMesh
Any idea how to fix this?
I'm using a navigation invoker
Whats a nav invoker do?
well it limits the navmesh generation around the player so only nearby AI moves... this works fine except for that error warning message in the output log as the navmesh volume is pretty big, but it doesn't do anything, it's just there to tell where the nav invokers should work or not.
it does work, it just complains and I htink i'ts cutting the navmesh which isn't good
ah
there's probably an easier solution because it would be quite popular to do large navmeshes if they came up with invokers
oh i think i can increase tile size in recastnavmesh
@sick kayak if it failed I means it found no point to move.
I have been having a lot of problems lately with BT moveto
Instead I use the ai BP node moveto
I'll give it a try , thank you
Yes I think that was a solution, thanks. I also found another issue where I was casting to the dragon's blueprint class within a BT task and then getting some variables out of it several times but sometimes it would fail to get all of them . Seems like storing a local reference immediately and using that instead of the pin from the Cast To node is better.
@sick kayak really?! Interesting. I have been trying to use movement BT in mobile forever and for some reason it fails. I don't understand why at all...
Hi, I'm currently trying to figure out how to abort the default MoveTo task when it's in progress. So far I have tried referencing the UAITask_MoveTo and calling EndTask, as well as referencing the UBTTaskNode and calling WrappedAbortTask. Both stop the AI from moving, however any following move tasks then immediately succeed, causing the AI to basically freeze in place. I saw this comment in the OnBlackboardValueChange function of "BTTask_MoveTo.cpp": // don't abort move if using AI tasks - it will mess things up
That would explain the strange behavior of subsequent MoveToTasks after aborting. Ultimately does this mean I would have to write my own moveto task if I want to be able to abort the task while in progress?
Lastly I have also tried sending AIMessage_MoveFinished as failed, but without any observable effect.
@obsidian bramble how about aborting the BT entirely and then restarting it?
I'll give it a shot.
Let me know, I'd be curious to know what happens when you stop and restart. I don't have a good test case atm
It looks like it's leading to the same issue in my case. The following MovementTask just gets stuck in succeeding immediately forever, but thanks for the suggestion. I'll double-check the logic just for my sanity. If it turns out it was a mistake on my part, I'll update you.
kind of a vague question but could anyone help me optimise this? bipedal enemy that runs around and goes through a shooting sequence where it stands still and fires 3 bullets at the player before running away again. i've had some problems with the enemy working properly and was just wondering if there's a smarter way to go about this
For a ranged AI, I'm not sure I'd use the "TargetActor" as a location target. Instead, the first branch for me would be something like:
- Do I have a target? (your 2nd decorator there)
- If so, pick a firing location from EQS in a proper location where I can shoot
- Toggle focus and move to that location, then fire 3 times
- Repeat 2, while I have a target.
Then the 2nd branch would only be triggered if you don't have a target (since you are running the in a selector). So you can just keep wandering EQS locations , moving there and probably waiting at the end, before moving again.
will give this a try! thank you so much
@dusk pewter Alright, so unsurprisingly the mistake was on my part. There was a problem with the location getting fed into the second movement task. Stopping and restarting the BT did work, but in my case it does cause the AI to stop for a moment. I'm using EndTask now that seems to work fine, so far.
// don't abort move if using AI tasks - it will mess things up
This shouldn't matter. I'll have to investigate.
Right, so the comment is wrong then? 😄
I believe so, at least the AI hasn't gone haywire yet.
glad to hear. I'd be astonished if aborting AITask-based movement caused issues since that's the main way to issue movement and we do it all the time 🙂
There is a technique where you spawn a MoveTargetActor, give the AI a command outside the BT to MoveToActor with Tracking enabled, then when you want to stop you just teleport the MoveTargetActor to the AI's position
makes for far less headache with the BTs
you also don't have to handle animations breaking for a frame when you change target location
i can't figure out what is going on here, the MoveDirectlyToward is firing but the character never moves and the Wait never fires, why is the sequence not running all the way through? (TargetLocation does contain valid coords)
What does the VisLog say?
If you read the contents of what you've posted you'll notice the movement has failed, which matches what your gif shows. This usually means the AI's or goal location is not on navmesh, but you're using non-navigation movement, so you might be using a movement component incompatible with AITask_MoveTo (like FlyingMovementComponent I believe, not sure, been a while). Need more detail on your setup.
it's a paper2d character using walking movement, the coords are only changing in X by about 100 units, the area is just flat ground, no obstacles
is there anything in the regular log?
not that i can see
code bugging is the only way I can see then
i only know blueprints
are you sure X is the right axis to use in this case? I've never used Paper2D, but when you use 'Front' view in the editor Y and Z are the right axii
just for shit and giggles give it a try 😉
what you're doing for the player might be in local space
i used to use non-AI movement for my enemy, they moved in X, i removed that and switched to AI to learn AI
anyone knows any good open source UE AI BT plugins like say BTUtility? 🤔
BTUtility didnt work for me this year btw, fyi
i was hoping to set up a quick utility system with BT nodes with it but it did nothing when I run the tree etc
hmm, have you tried replacing OnNextChild.BindUObject(this, &UBTComposite_Utility::GetNextChildHandler); to overriding GetNextChildHandler in the composite? This line in the constructor gives warnings about this delegate being deprecated
it was around May when I tested it, probably I wont need it anymore, but also binding delegates in ctor cause serialization errors
so if its a default behavior of plugin I suggest to move it to somewhere else
what happens if multiple navmesh modifiers overlap?who prevails?
the one with higher cost iirc
👆 that. Assuming RecastNavMesh.bSortNavigationAreasByCost is true (the default value).
Does using multiple supported agents work with navigation invokers? Seems the AI have a hard time picking which one to use
What if one is NavArea_Null? From my tests it would seem NavArea_Null wins. So if i put a viable nav_area and a null one in the same area, pawns cannot pass trough it
I'd say that's reasonable. The "null" area means "no passage" so no matter what other areas might say, the "no passage" should trump it.
Makes sense. Is there a way to override null_area(for example ignore it) in a custom nav filter(tried to just set isExcluded in NavArea_null but failed)
Is there a working example or tutorial for StateTree anywhere? I don't want to use BehaviourTree for this one. I'll be making a typical enemy that chases you, and gives up after a while.
I've done the BT version and want to replicate it using StateTree
thanks for any assistance
Gave it a brief read - no concrete example like the AI agent although it mentions the suitability for using one. I would guess it communicates to a regular BP I set up for that purpose?
That kind of connectivity and architecting is what I need to learn, basically how does ST work with the rest?
Well - when I checked it out in 5.1, it expects you to tie an actor to it. Then when you are in situations where you need the actor, it is already passed to you.
You can also bind to stuff directly in that class
So, when you're setting up the evaluators and what not, you can bind directly to variables in the class that you marked this StateTree is for (as an example)
So there is no concept of the blackboard really
The BP would be the blackboard I guess. Thanks, this has all been really helpful, I was imagining the StateTree not tied to an actor
Right, that could be pretty cool. Apparently, StateTrees are evaluated really efficiently
Is there a way so make a custom shaped field of view for AI perception sight? For example, using a box and seeing anything in that box?
I know you can make a simpler version of perception by detecting things in the box, but I would like to make use of the features of AI perception
@quick bobcat use dot product
any ideas why the nav mesh won't complete on any of my stairs?
yea those stairs would fail an inspection too 😛
why are blackboards are opened instead of behavior trees when I restart the editor? how do I fix this? 🤔 UE 5.03
The first step of the stairs looks too high. To confirm that's the case you can increase AgentMaxStepHeight in RecastNavMesh's nav generation properties and see if it fixes the issue. Then you'll need to decide whether to keep the change (which could result in navmesh being where AI won't be able to reach) or lower the staircase.
But it's also possible it's due to your navmesh's voxelization resolution. I can imagine it happening easily if the stairs are not axis-aligned. Reduce RecastNavMesh.CellSize and see if it fixes the issue.
Thanks I’ll try!
hey there everyone, can we make custom shape navmesh?
i tried to edit the geometry box and change the actor type but the results are not what i expected
Has anyone managed to find this in EQS?
Or am I misunderstanding it? I was expecting there to be a test already defined for Smart Objects 😄
No idea why, but the SmartObject EQS generator didn't make it to 5.1. You can always grab it directly from github: https://github.com/EpicGames/UnrealEngine/blob/ue5-main/Engine/Plugins/Runtime/SmartObjects/Source/SmartObjectsModule/Public/EnvQueryGenerator_SmartObjects.h
That's not really how it works.. it generates the navmesh based on the collision geometry in your level, it generates within the bounds of the navmesh bounds volume.. so you don't edit the navmesh so much as add content to your level that then impacts the navmesh generation
so like we have to use multiple navmesh if we want to like make a custom shape type something ?
yes. The navmesh volumes only show where to apply the navmesh logic. Once you place them and the navmesh is calculated, it will do so at the desired locations
So for ai perception, when you configure sight you can set an fov and a range for the sight and that creates a sort of cone where it can see things. What I am wondering if there is a way to change that cone into something like a box or any other custom shape
Yes and no.
Yes in the sense that it is possible but no in the sense that you can't do it with AI perception.
I use math to draw out my shapes and if math is not your forte, you can use meshes set to invisible but that have overlapping properties.
If you want a cone, using the dot product you can get the angle of importance and a specific range will result in a cone
if you want a cube, you can use a two pronged method to check within 2 dot products with range
Hmm yeah I know I can do it manually. I was hoping to just be able to change the shape and area that ai perception can see in so that I can use the functionality it already has, but if I can't do that I guess I will have to do it that way. Which isn't too much of an issue, but I think ai perception is really cool
does anyone know a way to distinguish AI Perception senses on On Target Perception Updated? I want to have different behaviors between the enemy seeing the player and enemy hearing the player
I have the hearing and sight senses but it seems like the only distinction I can give is the tag that provides when I report a noise event
Hey, I'm tinkering around with StateTree to try and become a little more familiar and it looks like states can subscribe to events? Does anyone know how to send an event with a tag to a StateTree state?
I cannot seem to find any documentation surrounding how to use this
You can use the returned Stimulus. The Type member of the Stimulus has the id of the sense. You can compare this with the SenseId of each of your SenseConfigs.
EX: Stimulus.Type == SightConfig->GetSenseID()
Awesome, thanks
unless it's get sense class for stimulus
Oh yes sorry you can use the Get Sense Class for Stimulus block in blueprints. I was thinking in c++ mb
You can make a new sense, so yes you use perception.
@uneven cloud in my experience it is more of a hassle than simply doing math and outputting a boolean
Well, I am a lizard so it only makes sense 🦎
I find that difficult to believe 🦎
No, you can use a single navmesh, it will work around the geometry you add to the level. Try looking at the documentation for how it works.
I want to draw a 2D tree (similar to a behavior tree) in screen space within a gameplay debugger panel. Does anyone have good first suggestions on how to achieve that easily? Any libraries worth integrating or should I actually just figure out how to space out a tree myself
Are animation notifies not expected to work on a montage when it is played via the "Play Animation" task in a behaviour tree?
this looks really good, thank you!
Do consequent eqs tests include filtered out EQS items? like say I have 2 consequent tests: trace and distance. trace test filters out 100 out of 200 items, will distance test have all 200 items or only 100 which haven't been filtered out?
Also how do (can) I distribute EQS test calculation over few consequent ticks? Right now I'm about to have an EQS test that can have around 500 line traces inside of it and fire frequently in some occasions and I feel like that can be too much for one tick
How can I make an AI that uses CMC rotate in place? The AI rotation is determined by movement, not by the controller direction.
I have an AI that should move towards a player, and then attack, but if after the AI reaches the player, and the latter moves around it (very closely, just to be inside Acceptance Radius) just to be behind, it won't be able to hit the player with attacks that are in front of the AI.
I thought about making a custom C++ BTTask that will rotate the AI, but I found no functions in CMC for it.
have you tried using BTService_SetDefaultFocus?
I have never heard of it
it might work fine unless you have disabled bOrientRotationToMovement in CMC (or maybe some other flags like bUseControllerRotationYaw on character IIRC). just put this service on the composite where your AI starts approaching its target
I haven't disabled bOrientRotationToMovement, it's active, while anything related to rotation on the controller is disabled. I'll try it, thanks 😄
@keen crow By trying to add the service to my composite, I have found that for some reason the only available blackboard key is SelfActor, but my blackboard contains other objects as well. Am I supposed to specify the target to rotate towards in there or not?
do you have your target actor in BB? have you set the object BB field to be restricted to Actor descendant?
Yes, I do have the target actor in there. I don't know about any BB restrictions, so it probably set to default. Where can I check it though? 😅
Ah, yeah, just found out, didn't know about this feature, thanks 😄
Bear in mind that agents will prioritise their next pathing point as default focus while moving. To make absolutely sure there is a higher priority, Gameplay Focus, which you can set through blueprint by calling "Set Focus" on the controller. You can make your own decorator with it.
Now I can select it in there, but I still need to check whether it's the thing that I'm looking for
The AI should rotate only when it has arrived to the destination, so I think it should be fine
cool, just keep this in mind for when you want it to strafe around the player 🙂
Uhh, after setting the target as the blackboard key on the service it doesn't seem to work as supposed, the AI rotates very slowly to the target, which is probably caused by the MoveTo BTTask. To give more information: the attack and movement related part is on screenshot. The AI is able to attack only when the target is in front of it.
Edit: After moving the service to the MoveTo node it still doesn't work.
the AI rotates very slowly to the target
try adjusting rotation rate in CMC
try playing with Use Controller Desired Rotation and other rotation flags. I remember that they can effect rotation in different cases, but I don't remember right combinations in each case
After reading a little bit more about the service, I have understood that it changes what's returned by GetFocusActor on AIController (or maybe just Controller). I suppose that after the service has taken place, the controlled should rotate, and if CMC Use Controller Desired Rotation is set to true, then this rotation will take place on the pawn as well. The problem, however, is that the controller doesn't rotate. 😄
or maybe the problem is actually the default focus priority. I usually forget about this service and always implement my own where I set the focus priority to Gameplay 🤔
I didn't really hear about focus priority, what's that about?
After investigating a little bit further, I have found out that the AIController has a FocusInformation with an array of priorities, which has only 1 item on my runtime, thus I think it's not about priorities 😄
Do consequent eqs tests include filtered out EQS items?
No. The items failing tests are filtered out so that following tests have less work to do.
Also how do (can) I distribute EQS test calculation over few consequent ticks?
There's time slicing build into the EQS Manager
I have found out that the service did it work perfectly, the only issue was that the controller didn't rotate, and by looking at some controller parameters I've found out that Set Control Rotation from Pawn Orientation was checked preventing it to rotate towards the focus actor set by the service. Now it does work perfectly, thank you for helping 😄
My "Ai Move To" node is working only if I use "Add Movement Input" in an "event tick".. is it normal ?
I guess I won't use NavMesh since it's weird..
is it possible to set a behavior tree service's interval using a blackboard key?
No. Animation notifies should trigger.
No that's not normal.
Hello do someone knows how i can make an ai actor through blueprint task move to an Niagara location?
I can't find why, I'm searching for hours..
Have you tried the visual logger?
No I did not but when I set my "Add Movement Input" in the "Event Tick" it's working I don't know why
The visual logger is telling me that
Looks like it's idle. What does it say when you try to move? Usually there is logging for why.
When I try to move what ?
This Visual Logger is from when the "AI Move To" node is executed
I have multiple "RecastNavMesh" in my Level I don't know why
Maybe this is the problem?
it says you don't have a path.. which usually means you don't have a path
But I have a path, and a "Nav Mesh Bounds Volume"
And the NavMesh is green on the floor so..
does the path render on your agent?
How can I know that ?
select the agent, it should draw the path in the visual logger
The agent is the "NavMeshBoundsVolume" ? or the "RecastNavMesh" ?
the thing thats meant to be moving
No nothing is rendered I can only see the green floor
Oh wait my Actor does not have "Gravity" maybe ?
yeah, you definitely don't have a path.. its probably failing.. check the log files and usually there's an error
When I "play" and try to move the Actor up, it does not go down
I strongly suggest you very closely follow some AI-focused UE4 or UE5 tutorials. You clearly miss some very basic information. Way too much to explain in a discord chat.
Is it possible to overlap two modifying nav volumes? I have a general nav mod volume on in a place, and there are different objects that modify the navmesh by adding some cost as well, but for some reason they don't work when the volume is overlapping with them
Does anyone know how StateTreeSendEvent works exactly? I've tried calling it within a task in a StateTree and it does not appear to trigger the On State trigger in StateTree. I can't seem to find any information on it, what its target is, what context I can call it in, etc. Just trying to tinker with StateTree to see what it can do.
Hey! Did anyone had any success with setting up this IAUS plugin https://github.com/ProjectBorealis/IAUS I tried setting it up both on 4.27 and 5.1 and failed, seems that the Evaulator never runs till the composite node gets selected which never does because it needs the evaluator to actually set scores on the behaviours 😅
should i be attaching an AI perception component to the character or the controller? I so far have it tied to the character but is there a benefit to it being on the ai controller?
Once I spawn in a certain number of ai controlled enemy pawns (about 50 it seems), in the ai of pawns created after reaching this threshold Move To no longer functions
They still run their behavior trees, but calling Move To will do nothing even though there is a clear path to the target
The problem persists even after destroying the existing 50 pawns, and spawning in new pawns
Any idea what is causing this?
_ _
Turning up the setting for crowd manager max agents seems to fix this
but I still don't understand exactly why the problem persisted after destroying the existing pawns (bringing the number back to 1)
My enemies were fine when I first made them, but now that I have them in my level environment they've decided to not move or rotate at all. I've got my navmesh volume, their chase player task is running and they follow the rest of their AI (attacks and whatnot) like normal. The character movement component values hasn't changes since they were working. Any guesses where else I could look?
Let me specify that they move and turn using a simple move to location in their behavior tree
Being on the AI controller helps separate the AI (brain) and the character (body)
thanks!
i'm trying to access the owner using get controlled pawn but it doesn't seem to be working :/
There's a limit on the amount of crowd agents for path following, because it's a bit more expensive. It's been a while since I've looked at it, but if I remember correctly the check happens on spawn.
From what?
from my AI Controller blueprint
since I want to call an event on my BP_Enemy class but both Get Owner and Get Controlled Pawn seem to return null
When are you trying to get the pawn? Get Owner won't work.
On Target Perception Updated
I had the AI Perception component on my Character but I realized it seems to be Unreal standard after reading the documentation to put it on the controller instead
exact same settings too
never mind, had to ensure that friendlies, enemies, and neutrals were all ticked
Anyone have an idea how to add an enemy to a Lyra Team?
hello. just curious, but outside of just making a whole new task and copying the logic from the multiple tasks together into one, is there something i can do for behavior tree organization in the way of combining a branch of sequenced tasks together? sort of like in blueprints collapsing to function or another graph etc.
perhaps in a way that would then allow me to use that section of the bt/that branch elsewhere via just duplicating that single "node"
Oh hey.. found some talk by Mikko online: https://www.youtube.com/watch?v=zbJlIE05nN8
All footage from the nucl.ai 2015 conference, for archival purposes only.
These videos are no longer available now that nucl.ai has shutdown, so I am uploading them so that the knowledge is not lost.
Glad someone put up the Nucl.ai stuff up
I had membership access to nucl.ai stuff and then the fucking site just went offline
massive rip off
why not make that branch its own BT and just run BTTask RunBehavior?
cool ill look into that
oh good find!
Is it possible to add my own option to Run Mode without getting into the engine code? I'd like to have a parametrized option like pick single best option of some "intelligence" variable which takes value from 0.f to 1.f. Or is my best option to fork the run eqs BTTask and BTService, force Run Mode "All matching" and then manually sorting and picking best item?
or yet another dumb idea - parametrize scoring factors on scoring tests, make intelligence a BB float field and provide it as parameters in EQS BT nodes
I bet you haven't read the eula 😛 nucl.ai was up as long as it was possible without active maintenance. We're all worse for it no longer being there, but as long as it was it brought AI community value.
How can I make a bunch of AI character move inside a corridor in a natural way? I want them to not move just along the cheapest path, but in a kind of good looking way.
what do you mean by good looking?
I mean in a natural way, not just in a one straight line
got an example?
Nope, I don't. What I mean is that I want that the AI will spread out in the corridor, just to fill it up
use a steering force then.. simple seperation would do that
not exactly "realistic" though
Uhh, I guess that's not it. I was looking for something for a hour or so, and the closest thing that I have found so far are the splines, but the thing that I'm trying to achieve would require creating many splines or do something fancy with one spline.
its hard to tell what it is you want
Lemme explain a little bit more. I'm creating a tower defense game, and the problem that I'm struggling with is the AI movement along a path. The pawns turn the edges sharply, if there're many of them, they'll walk into each other trying to follow the cheapest path etc
What we've done in the past is take the string pulled path points and perturb them with a vector away from the edges so that you don't follow a perfect string path
that and use the detour crowd controller so it has some local avoidance sampling
and turned off the capsule so that collisions aren't rigid
How would I do these things? I'm not really experienced with AI 😅
You wouldn't.. its easy enough to do, but you need to use the C++ code really
the path you get from the FindPath functions.. so you can modify the path points
detour crowd just requires a different controller and default initialization
Not something I'd recommend trying for your first AI implementation
kk, thanks 😄
Is there a way to make the navmesh that is generated always fully connected (from a defined point), i.e. there are no polygons that are disjoint from the rest of the mesh, remvoing those?
try kicking max step angle and height to the sky in project settings-navmesh or your recast navmesh parameters
oh my god i totally misinterpreted what stepping does, so this is what would allows to go between two disjoint polygons like on stairs, got it!
well yeah but keep in mind that if your AI's characters CMC doesn't allow them to step over some height or angle they'll just infinitely stuck
by default navmesh disjoints are handles by nav link proxies (simple and custom) but you'd have to place them all over the navmesh. i personally don't like it
Ah yea, i saw those links but i dont want to use them either. Thanks for the hint though.
Regarding what you said about the CMC i dont think i understand it fully: if my navmesh is fully connected and my CMC characters can cross any height the navmesh agent allows and the cmc never is allowed to step, then i would believe there is no issue, or is there?
if my navmesh is fully connected and my CMC characters can cross any height the navmesh agent allows and the cmc never is allowed to step,
yeah. I mean I don't know what characters you have. I only mentioned it because default CMC params for stepping over heights and steep angles are good for humanoid characters. If you have some flying AIs then it should work nice
You could consider them flying for gameplay purposes, but they are set to be walking for animation purposes
I will look at my cmc and recast params and see if i can get them stuck, thanks
/me puts QA hat on
does setting the cost of a nav_area to 340282346638528859811704183484516925440,0 make it null?i notice that extending nav_area_null it has that cost by default. Is it like that just as a marker or is it actually that value that make areas not viable by characters?
That value is FLT_MAX, the largest value a float can be. It's used as a magic value in pathfinding code to represent non-traversible areas.
That makes sense, exactly what i was looking for thx
Do games usually have multiple navmeshes or do they just use nav_areas and filters to deal with enemies having different pathfinding?
Multiple navmeshes for charaters of different sizes is the norm.
Just configure multiple entries for different types of character in SupportedAgents in the project settings. The right navmeshes will be auto-generated in all levels with a navmeshboundsvolume
But among characters with the same size, do you use filters to make an area traversible by only one and not the other one?
If you're sure that the characters will always remain the same size (e.g., humans with different permissions of where they can go, as opposed to different types of monsters that just happen to have the same capsule size at the moment), then I'd use filters.
If you want to be able to plop down a volume that says that only certain types of characters can go there, you can just make a subclass of UNavAreaMeta_SwitchByAgent and assign different actual nav areas for different agent types. So if you have a NavModifierVolume with this custom NavAreaMeta, it will paint NavArea_Null on navmeshes of some characters, and NavArea_Default to navmeshes of others. Either way you need to add distinct character types to SupportedAgents, which means they each get a separate navmesh.
Very informative thank you!is the cost higher the more i add supported agents? especially since my navmesh is dynamic?
Performance cost is definitely higher if the navmeshes are dynamic. Avoid that if you can, dynamic navmodifiers might be enough if it's just doors locking etc., instead of fully procedural environment generation.
But does (specifically) adding supported agents increase it much?
Adding a supported agent means adding a new navmesh. So whenever something moves, dynamic navmesh generation will have to update all the navmeshes, so the more supported agents, the more navmeshes, and the longer that takes.
If not for dynamic generation, I wouldn't expect much of a performance cost increase though.
Anyway from what i see only the portion of the navmesh where there is some change is recomputed with dynamic and it shouldn't happen frequently in my game
Thanks again though, great help🙏
Any ideas on why my service is not ticking?
Do I have to use receive tick ai or receive activation ai?
❤️ Check out Runway and try it for free here: https://runwayml.com/papers/
Use the code TWOMINUTE at checkout to get 10% off!
📝 The paper "GET3D: A Generative Model of High Quality 3D Textured Shapes Learned from Images" is available here:
https://nv-tlabs.github.io/GET3D/
📝 Our paper "Gaussian Material Synthesis" is available here:
https://us...
This is freaking insane, in 6 months you will probably get any type of 3D model from there
I have a question about using navlinks to connect disparate nav meshes. I have a "cliff" and when I run off as the player, I want the AI to follow me off. This works fine if I tell the AI to jump once it reaches the nav link. However, I would like them to just run off the cliff as a player would. I have tried adding a World Offset, but the character butts up against the ledge and is not pushed off.
I'm not sure if this is an AI issue or a CharacterMovementComponent issue (I am using ALS), but I would appreciate any insight!
If Target is not set the whole tree won't run.
I suggest reshuffling the tree. The ROOT node is not an actual node in the BT, it's there just to provide a place to indicate a blackboard asset, so I suggest adding an actual root selector node, and then add a "fallback wait" task that would get hit whenever none of the tree has the right behavior for the given world state.
How do I make OnBecomeRelevant and OnCeaseRelevant executed on decorators? I've set the flags bNotifyBecomeRelevant and bNotifyCeaseRelevant to true in constructor but the methods are still not fired. For example built in decorator BTDecorator_CompareBBEntries have those methods overriden but they also don't get executed
nevermind, figured it out. You have to set abort mode to self/both to make it work
The step size put to a very high value indeed solved the issue of having gaps. Now however I wonder how I can add costs to the navmesh at generation time. I want to apply a cost that increases exponentially based on some steepness metric or roughness. I know there are Modifier Volumes but i dont want to place those on my gigantic terrain. I want to derive it by the navmesh steepness or the terrain mesh itself. What's the best place to insert code for such a cost calculation for the navmesh polygons?
honestly I have no idea, this sounds too hardcore for me. I don't think you can do that without getting into the navmesh generation engine code and AFAIR there's not much to override. And if you were to get into rewriting navmesh that much, you might as well just implement your own navigation system for flying AIs instead of adjusting the default one for this
but anyway my guess would be to calculate height difference and/or navmesh poly normal (wether it's looking more upside or rather parallel to XY plane) and then perhaps assign some "weight value". but then again, I'm not sure how is navmesh generated for steep surfaces - is it a single huge polygon or is it a sequence of uniformly small polygons
hmm ok thanks
rolling my own solution is not really acceptable because of the amount of work needed to fully integrate that, i d rather prefer to modify what exists
The odd thing is, i see a lot of posts about this but no solutions
probably because using built-in nav mesh for walking for flying AIs is not the best idea
it is not a problem anymore
My problem now is that i want to assign a cost to the navmesh based on e.g. landscape, so it could be painted on
ah, ok
basically like this person asked: https://forums.unrealengine.com/t/navmesh-pathfinding-with-slope-and-surface-costs/472202
Use navModifiers to set cost for specific volumes (actors) - i can’t afford to place volumes on every slope fragments of a landscape manually.
that's my problem too
I can go deep into code, i just need to find out if this is feasible and whether it has been done, before i dive into it
Yes its feasible, because you can calculate the cost of traversal from one navmesh edge to another, although personally I'd probably make a different solution using some form of heirarchical pathfinder
There is a EPathFindingMode for regular and hierarchical in UE, i just stepped through and noticed it uses "Regular" in my case, which i assume is the default. How would switching to "Hierarchical" help? or do you mean i should roll a custom solution? For me the current solution works fine, all i need is these weights for the navmesh
you can calculate the cost of traversal from one navmesh edge to anothe
hm so rather than baking the costs into the navmesh you mean the solution is to let the pathfinding functionality query the costs in a custom way. I am checking where I could insert this
Looks like dtQueryFilter is needed for this but this is deep down in detour 😮 In UE it is taken in as FRecastQueryFilter retrieved from FNavigationQueryFilter::GetImplementation() which is taken from FPathFindingQuery::QueryFilter which is taken from AIController::BuildPathfindingQuery via a FAIMoveRequest, which in my case is created in AAIController::MoveToLocation which uses DefaultNavigationFilterClass of type UNavigationQueryFilter so i guess i need to make a custom UNavigationQueryFilter and set the class as DefaultNavigationFilterClass in my AIController(s)
Another finding: UNavigationQueryFilter uses FNavigationQueryFilter and all of those operate solely on an array of FNavigationFilterArea so the weights can not be on edges or nodes specifically, but only on areas, which i guess are the navmesh polygons
Area is a property of the recast poly, see dtPoly.areaAndtype
Ok so polys can share areas
and then areas can be interpreted differently by nav agent to determine a cost for an area
areaAndtype is where the NavAreas get encoded. Every area has a defined cost, but using a virtual filter you can essentially do what ever you want.
Is there a way to allow for AI to freely drop from ledges (higher navmesh to lower navmesh) without hand placing loads of nav link proxies all over the place?
It can be a pain during level design when moving stuff around to realize you forgot about the nav link proxies and have to realign all of the start and end points once again. Though maybe this is just how it's done and the goal is to place as few as possible while accommodating all possible ledge drops?
Also in general do you place many separate NavLinkProxy actors per level or just one actor and then make many point links?
Anyone remember what you use to make a parameter an input param on a blueprint callable function? is it ref or some such?
UPARAM(ref) ahaha...
what would be the best way to assign areas for the dtpolys during navmesh generation?
i found out that status = dtBuildTileCachePolyMesh(&GenNavAllocator, &BuildContext, *GenerationContext.ContourSet, *GenerationContext.PolyMesh); is where it sets the areas field of the dtTileCachePolyMesh which are then used to set the areas to be encoded into the dtPoly.areaAndtype
dtBuildTileCachePolyMesh()seems to use the area value from dtTileCacheContourSet, which is supplied via GenerationContext.ContourSet, which seems to have its area set by GenerationContext.Layer
this is like an onion
and now i got to the point where one of the onion's layers is literally called "layer"
Ok so the FRecastTileGenerator sets up the layers and applies the areas to them. Basically this handles the NavModifierVolume
I wonder if i can make a custom UNavArea and use that to define areas dynamically based on my landscape terrain's layers
has there been any recent addition to statetree knowledge?
ah there is a quick start now
It looks like each UNavArea just ist really for one area value
Ok i now believe that my idea of "painting" areas based on landscape values is not feasible, there is no interface whatsoever for that. So my new idea is to create a custom navmeshmodifier that i somehow trigger to be generated to create a volume for itself based on the landscape's values to encompass its supposed area
I suppose a single ANavModifierVolume could tackle all variances of areas at once in this way
whats even more insane is this
Prompt: find the point in array closest to A and furthest from B in unreal engine 5
#include "GameFramework/Actor.h"
#include "Math/Vector.h"
class AFindingPoint : public AActor
{
GENERATED_BODY()
public:
AFindingPoint()
{
// Define the array of points
TArray<FVector> arr;
arr.Add(FVector(1, 2, 0));
arr.Add(FVector(3, 4, 0));
arr.Add(FVector(5, 6, 0));
// Define the points A and B
FVector a(1, 2, 0);
FVector b(3, 4, 0);
// Initialize the point that is closest to A and furthest from B
FVector point(0, 0, 0);
float min_distance = FLT_MAX;
float max_distance = 0;
// Iterate through the array and find the point that is closest to A and furthest from B
for (FVector p : arr)
{
// Calculate the distance between the point and A
float dist_a = p.Distance(a);
// Calculate the distance between the point and B
float dist_b = p.DistanceSquared(b);
// If the point is closer to A and further from B than the current point, update the point
if (dist_a < min_distance && dist_b > max_distance)
{
point = p;
min_distance = dist_a;
max_distance = dist_b;
}
}
// Print the point that is closest to A and furthest from B
UE_LOG(LogTemp, Warning, TEXT("Point closest to A and furthest from B: (%f, %f, %f)"), point.X, point.Y, point.Z);
}
};```
I'm trying to figurate out if it's sarcasm or if there's somethig particular about the code xD
isn't this regular ant algo?
it's ai generated from the prompt
idk. I find it impressive that it knows how to use unreal 5 libs instead of just hitting me with a bunch of std stuff
oh yeah, I have been playing with ChatGPT and you can do quite impressive things
you can improve coding speed A LOT at the moment using it and in a few years it's probably going to need little to none supervision
I was looking at the code you posted and thinking "Maybe they found a faster way to figurate it out, like they did with matrix multiplication recently" xD
yeah though unless I feed it my entire repo I'm not sure it will be useful for figuring out how to get my various systems to play nice with each other
which is like 90% of my dayjob
at the moment I see it like a very advanced "Auto complete" and it can save a lot of time
great tool for adding missing mathy/algo funcs to my blueprint libs though
Anybody tried a navmesh transform technique like this? Hoping to not making something from scratch if possible. https://youtu.be/mZOZyCenz1E?t=952
In part three of my series looking at the AI of online pirate adventure game 'Sea of Thieves', I explain the AI behind the three boss enemies that exist in the open waters. The Megaladon, the Kraken and the Skeleton Ships - also known as Megan, Karen and Skevin - have their own unique AI systems and we hear first hand about their development fr...
thats neat
make a boat somewhere unaccessible put a navmesh on it
then modify your character movemement component to query that navmesh
will probably be a PITA to hunt down all the funcs you need to override
but the concept is impressively simple
Yeah I think I can use the same@ones some plugins use
And override
Yeah if it’s just about changing what’s queried… maybe
it gets alot more complicated if you want it to be dynamic though
Like@moving ship?
no like the mast falls down making part of the ship inacessible
Yeah I already have solution for slightly moving so I do want full moving
Oh yeah
Don’t care about that
🤷 would be cool though
Haha sure but getting this working on a FAST moving ship would@be enough
have to replicate the changes from the real ship to the "fake" ship so it's navmesh updates
for a fast ship might want to start with getting the characters to not jank out even without bringing AI in the equation
Yeah jank is the real issue so far
then you add replication and it makes things even worse
Haha yeah won’t be doing full multiplayer
Just want this to work on fast moving ships like it does on slow ones and stations https://twitter.com/SubtollD/status/1596513413710372864
hi. my AI's behavior tree is running before my game has finished loading (so it's spotted my character through walls that haven't loaded in yet)
i have an event that's dispatched to tell actors when the game has finished loading and the AI controller subscribes to this, and I'm trying to call this once the game has finished loading in:
BehaviorTreeComponent->StartTree(*AIPawn->BehaviorTree);```
but even without this codeblock the behavior tree seems to run automatically during beginplay. how can i delay the start of the behavior tree running until i'm ready for it? is there somewhere i can disable auto-activation?
ok, BrainComponent->StopLogic() on beginplay seemed to work
i am trying to make a state change based on float compare but it refuses to work
i have tried a boolstate, same thing.
oh it seemed to not work because there wasnt a task attached to idle
what was the demo with the statetree in it ?
I'm using BP and AIPerception but I can't change where the sensor is on the target. Any help please?
Stack o bot 5.1 has statetree examples I think. With the moving platforms
thanks
im just doing this to figure it out
need a working example
it appears it as a control rig... might this be a confusion?
maybe it was just a stream where they demonstrated statetree. I definitely saw statetree being used in a Stack o bot scenario
yeah no stress
Question: if fully BP am I best off just using traces? I can't seem to control AIPerception's locations it works at
are we assuming StateTree is working with AI Perception?
I didn't have problems using StateTree, just problems in general with BP + AIPerception (I tested it with and without state tree)
i havent learned alot about ai perception. but i thought to remove the controller and assign perception to the actor.
throws warnings
"they are designed to work with AAIControllers!"
yeah but it works fine even so. It's just there appears to be no exposed functionality to change where you'd like to sense on the target actor. For example the head instead of the default chest
huh ok
I think it's a BP missing stuff issue
in C++ land it's probably fine
(I'm trying to avoid C++ as long as possible, I've coded since 1982 and want to fully grasp UE in a BP context first while learning it)
Also BP is less vulnerable to code changes/churn, it's a nice way to learn IMO
Re: StateTree, I did the epic documentation on it a few times until it clicked, and it's fine now. You can make little BP tasks to do what you want from within the statetree
But logic isn't really the problem atm for me
@supple plaza how would you handle things like movement and acting on senses?
with StateTree
Shouldn't be much different honestly. Senses are a separate system from state tree and BTs
They simply give you information about what is going on in the world around the agent
In a BT setup - you update a blackboard's values.
In a ST setup - you just update variables directly on your agent and the ST is binded to those.
Yeah so i would still use senses to manage some aspects
entry condition for that in ST can go into that leaf (child task / block) if it needs to fire one off
the Tasks are just tiny blueprints you make that can share the data etc
ok
I think a better question is this. With StateTree, is the aicontroller still the acting brain?
no, it's just the body
it's the thing that acts out stuff
move here, run this code etc etc
ST is the brain, the BP that has the ST component is the storage and general stuff
https://docs.unrealengine.com/5.1/en-US/statetree-quick-start-guide/
I followed this a few times. I had to do it a few times because it's not written that clearly, and easy to miss bits. Instead of a block moving along a spline, I used an actor based off the third person demo, with its camera deleted etc. I set it's pawn to AIController.
The state tree is then added to it as a new component and they talk / work fine
i see
It's worth noting that all of this still works with detour and even AIPerception, just those are really optional
the AIController for RVO navigation (so agents avoid each other as well) - same stuff really
i see
basically that can be changed later
but for a generic purpose AI study i want an actor, an ai controller, statetree, AI perception...?
really though it all begins with a simple actor/pawn like the third person BP. I copy that, and then add my StateTree to it in the components with +
and the guide I linked has the details, works the same if its a BP for that or a cube, still talk the same in the BP <> ST
And yeah i finished the quick start on my current enemy template bp just fine.
it's a bit confusing at first but I feel practise will sort it out, and it's a lot less files and messing around than behaviour trees (which imo suck a bit - I was surprised to see them still used in Lyra)
mostly for me its a confusion on these anatomical aspects of it
Right now I'm not using State trees or anything, just plain BP for the AI as I want to get to grips with the other parts UE offers like AIPerception (I'm not new to doing AI myself in Unity or other engines with traces etc).
So far though AIPerception seems like it's not very useful without using a proxy object or C++ to modify where casts begin and end... kind of essential really
I read around a bit.. seems epic stopped work on the BP part prematurely
i managed to make ai perception give me a closest desirable object
out of all sensed
Interesting, I usually use BP to do that (I actually have one that uses closest point on line so I can do target switching, better object selection etc)
yeah i wanted to approach my AI with 2 basic states. Armed and Unarmed. Unarmed would have it look for an object that can be a weapon, go to it and equip, enabling the armed state.
I found this extremely cumbersome in BT
But what i am looking for is to get an AI that is expanding on its states so i am hoping StateTree is the goto. It already looks promising but i just need to figure out the rest of it.
going back to this question, is this the approach i want?
My main experience with the senses stuff is sight and you can definitely configure the range and all that.
actually it seems to me that i would want the AI controller to hold the statetree comonent here
Yet you never had problems with there on the target the sight works? using ' then a number pad number (reconfigurable) will display a lot of debug info
yeah that is pretty annoying
you can see it stop sensing if you're too close to a wall
Nope. Never had a problem with sight
cos the raycast clips it
took me half a day to figure out the numpad was key
Yep you can rebind those though (I have a TKL keyboard so no numpad hehe)
🤌
I think the senses system is one of the nice things about doing AI in UE personally.
But I also just like the tools in general.
I don't have many complaints honestly.
i have a more philosophical AI question
in a melee setting
how could an AI strafe if i dont want to lock AI to player
I honestly don't think you've encountered the shortcomings of the AIPerception system yet though due to probably the nature of your game's design. It has some glaring omissions in BP land which are available for tweaking in C++
Meh - I just don't find the things problematic personally. I've done various games with it as well.
And w/e is lacking in BP, just use C++ honestly. UE is designed to use BP & C++ together.
Trying to go too heavy on one or the other is going to be painful regardless.
I agree! I just want to delay moving to C++ which I'm familiar with - while I really get to grips with BP and all that which I am unfamiliar with. Epic staff and joe wintergreen also recommended I begin with BP as it teaches the general landscape / architecture as well
It's been a surprising journey though - I expected the BP approach to be cumbersome and slower than coding, but in a lot of cases, if used right - it is actually quicker, once you know how!
(to develop in, not execute)#
probably been asked, and answered before, but with the documentation of unreal being what it is, its just easier to ask here:
is it possible to add a new thing to perceive in the AI perception system? like for example if I wanted an AI to know when there is a disturbance in the "the force" could that be possible, or am I limited to sound, touch, sight, and smell? (is smell even available haha?)
and if so do you know of anything other than the god awful unreal documentation that I can learn how to implement it?
I really appreciate the help.
You can create new custom senses. C++ though.
thats 100% fine. no problem with C++ just looking to know if its possible and a direction to figure it out. lol
Examine the current senses to see how they are setup and then imitate that.
good idea
if i add StateTree to ai controller ue crashes when pulling up the debug view
i will assume the statethree is for the actor 😄
Didn't happen to me when I was messing with it when 5.1 first released. Post the crash and the code in question
im testing different configs
not a code to link per se
i seem to have stumbled on something that has put some of my asset in a bad digestive location
yeah its fixed now it seemed to have become a problem somewhere while linking and unlinking statetree on ai and actor
adding a sensor to ai controller, adding stimuli to item.
what else is required for the debugger to show stimuli
trying to figure out why my almost identical setup is not showing sensor stimuli in overlay
has anybody tried building ai based on neural networks. does unreal have a solution for this?
i had to enable neutrals and friendlies
i dislike these small checkboxes that just seem to be a launch checklist for no reason
There was a plug-in called Neural Network Interface (NNI) that could expose game/engine data for nn-based ai, haven’t actually used it though and I’m not sure if it’s compatible with 5.1
looks like there is another plugin called "ML Adapter". Did anyone tried that out?
it's a rename and extension of UE4ML that was made (silently) available in 4.26 I believe.
Rider was in love with that plugin that it keep including it randomly during EAP a while ago 😂
Would it be hard to have characters move along or within a threshold of a spline only? I am thinking through ways to have local “navigation” and really don’t need much—I just want to make them look like they’re walking on a fast moving ship. Anybody know if a character would still animate if I make some custom moveto that only follows a spline to their target?
Moving any actor along a spline seems pretty easy so the big question is will a character with skeleton use the right animations…
Even without a legit navmesh
where would i put movement and which method for move in a StateTree context ?
derive from path following and use PostProcessPath to provide a direction to next movement direction
and build your spline on top of the created path along navigation
or just follow the spline and add movement input with direction
both would work easily and characters would animate assuming you are using CharacterMovementComponent
Hi everyone, I wonder how to add detecting player flashlight by ai perception, any idea?
what do you have so far?
I have all behavior tree for sight and hearing but I wonder if it's possible to detect player spot light without adding cone that will simulate light
but you want reaction on the light?
is there nothing in sensory update information you can get about the simuli source ?
yes, i want ai to detect player when he point light at them
i dont know if the light volume or whatever its called can be identified in itself
but it seems simple enough to just add a collider to it that is aprox the same
i thought about it, the problem is that this collision will go through walls in tight spaces, so player could be spotted through walls
thanks for help, I will try this approach
i would start with a thin detectable collision ponting in the light direction. then i would activate/deactivate it if it collides with environment
and see where that takes me
how to solve this?. Navmesh is not filled on entire area
i've gotten this far. This makes the AI move to player always.
where would i introduce that AI has reached a player?
Navmesh generation parameters, CellSize specifically, make it smaller. You can also change the agent radius. You might need to add a SupportedAgent in NavigationSystem settings in Project Settings for that last part.
what mean by acceptance radius in AI move function?
distance it will stop move at
how can i get sensory data into StateTree
state tree exists on AI actor, ai perception exists on ai controller
On my Dedicated Server, I have these dragons flying around , landing, taking off and walking around. After a while they get stuck in the air (not flying or moving anymore). Any ideas why please? Here is a screenshot of one of them with SHOWDEBUG AI enabled. Not all the dragons. About half of them (2 out of 5). This screenshot shows they have no controller apparently. Maybe it dispossessed it after while?
don't use SHOWDEBUG AI, use gameplay debugger and visual log instead.
Actually I'm not really sure how SHOWDEBUG AI works, but I'd assume it shows "local" information, so the AI controller being null on the client is perfectly normal.
could and should i get AI perception updates in StateTree tasks or evaluators ?
thanks
any tips on getting ai perception into state tree?
is it just me or cant an AI controller be used as a context actor for StateTree
I'm having some difficulty with AI Nav Agent Radius, looking for some advice.
I'm using default Lyra characters moving around a procedurally generated world.
The issue is some of the generated corridors are too narrow, and the agent thinks it can traverse it, but in reality it gets stuck. See screenshot for an example.
I modified Project Settings > Navigation Mesh > Agent Radius, but this seems to have no effect. I've also tried explicitly modifying the Agent Radius in the generated RecastNavMesh-Default actor in the Level, which works temporarily and then is always reset to the default 35 when the nav mesh is rebuilt, which happens every time I regenerate the world.
Looking through the code it seems like the size of any given Character's Agent Radius is computed at runtime based on its collision cylinder? Do I just need to make that cylinder radius bigger and all problems related to this are solved?
Or is there some way I need to globally configure the Nav System to ignore these smaller corridors? (And if so, how?)
for now i will just assume statetree can be run on actors and smart objects
I'm guessing it really isn't supported all that much anymore? On this topic, what is Epic's stance on just removing depreciated stuff more or less? I've found code that has been depreciated since like 4.12 😅. I know ya'll have clients to consider and all that, but surely, 4.12 is old enough to be removed? 😅
We're supposed to cut out the old stuff after a couple of revisions, and last I've heard we're only expected to support stuff from 4.25+ (IIRC). But cutting out stuff is work too, so we're sometimes lagging on that. But I do plan to cut out old AI stuff for 5.2.
So I can go in an cut off old stuff and make PRs 😅
Add an entry to NavigationSystem's SupportedAgents (via project settings).
sure. Cut stuff up to 4.25 and I'll take it (as long as it compiles) 😄
I'll do it on a Friday without testing 😈
to be clear, my testing will boil down to preflying it on multiple platforms via our distributed builder 😉
First step is still that checkbox I mentioned before though. Just take forever to compile source 😭
I need an Epic loaner computer 🤣
I don't know what you mean 😉
I was going to refactor some of the _BlueprintBase class utilities to native BTTasks.. like automatically resolving keys in InitializeFromAsset and auto generating text with reflection data in DescribeRuntimeValues etc..
what do you think this idea as PR?
So _BlueprintBase classes will only have required things to have logic in BP, like being an instanced task etc
Thanks @crystal hatch, I'll look into that. 👍
sounds interesting, but I'd need to see the code to form an informed opinion.
Alright, another question: is there any reason why users are able to automatically resolve the keys? Is it for performance reasons or does it even matter whether all keys declared in the UCLASS get resolved automatically in the InitializeFromAsset?
Don't ya'll have like a beefy CPU though? Like 3 trillion cores or something like that
Because if we add the feature of automatic resolve of keys in native classes many people were doing it manually and they will end up being resolving same key twice if PR gets accepted.. So I'm thinking maybe its not the best idea
-- or maybe it should be a flag in engine settings like old bUseAITasks thing
yeah, a 64 core ThreadRipper 😄, and unlimited RAM (256GB, close enough :D)
Just convince Santa Sweeny to gift me one. It's like 0.00000000000000000000000000000000000000000000001% of an hour of Fortnite monies 😅 (I say this in jest)
Ah yeah - that's pocket change 🤣
Not if you just don't compile the engine 🧠
TIL we could actually use static cast if we know the cdo type 
UBTTask_BlueprintBase* CDO = static_cast<UBTTask_BlueprintBase*>(GetClass()->GetDefaultObject());
I compile the engine multiple times a day
Overnight process for me
Probably takes like an hour & a half. Using an 8 core Ryzen
Takes around one hour for me with Ryzen 2600
3700 for me
4.27 was 45 minutes, 5.0 added 15 additional minutes
I guess it all depends on the execution
omg - I want to see how fast @crystal hatch can compile Godot from source 🤣
That only takes me about 8 minutes.
I'm forbidden by the legal team to try 😉
I figure'd as much. Just a thought experiment, lol
This weekend I skimmed through godot, it really feels weird to read how its written from an UE-only user perspective
UE source code is amazing to read compared to other stuff I've seen
I really enjoy the lack of snake_case_everywhere though 😅
I guess trying to mock C# pays off? 😄
but anyway a question for you in #lounge
Is there any good way to modify the polygons in a ARecastNavMesh? I thought I can iterate all tiles, then iterate all polys and modify them but i m stuck with NavNodeRef and no way to modify the navnode it seems. I also cant find a system that does this, only the Generator seems to build data and then it is all pimpl'd and inaccessible
All i really want is to get access to those pimpls and squeeze them out, make those sweet dtPoly's ooze out of there
someone know anything about statetree?
trying to make a task to create a new random location
but it seems i cant create outputs from tasks
and evaluations seem to run once or at tick
You can get to very usable times even with 7950x ($600). Should give you engine build time around 10mins. Similar with my 5950x ($450).
You want to set up the supported agents settings in the project settings to be a closer match to your characters.
Oh really? I got the 3700 because I thought it was the last one to support the AM4 chipset. I didn't want to have to upgrade my mobo as well.
And you're saying 5950x is giving you about 10 minute build times?
does anyone know
how to get output from statetree tasks
and does anyone know if there is any demons including statetree?
Our new machines have 5950x and compile times are ridiculously fast. I used to have time to go make breakfast during the morning build, but it's done in a few minutes now.
I just upgraded my CPU earlier this year too 😅
can you use the HW for statetree ?
Has anyone messed around with SmartObjects much? The Smart Object Subsystem returns me a list of smart objects, but I can't seem to filter this list down further, or at least perhaps I do not understand. I'd like to get the smart object that matches my filter that is closes to my pawn, and has line of sight...but I can't seem to get their transforms without a Claim Handle?
Is there any way to get the Smart Object actor from a Subsystem Find Smart Objects return?
I looked for delegates, registered structs, virtual functions, i looked for it all, i think this RecastNavmesh pimpl is unsqueezable! Unsqueezable i tell ya. So i guess the only way is to reroll this from top down by using a custom class deriving from RecastNavMesh / FRecastNavMeshGenerator
Which is probably also cleaner because i can then integrate all my changes into the regular flow of tile generation
I have to say tho it was fun to dig through all of the code to see how engine professionals integrate such a complex library as recast / detour
tested now with 5.0 + big project + bunch of enabled plugins (3800 compilation units in total) and it was 20mins with 5950x (ubt configured to use also multithreading/32 processes). Iirc with clean UE4 it was closer to 10mins.
10 min is crazy fast
I think i need a new CPU after reading all of this. i was thinking of getting the 7950x, but i will wait 2 months and then reevaluate whats the best AMD cpu for price
You can make a claim handle without actually claiming it. You just need the data from the result. Smart Object handle and slot handle. The get transform function doesn't actually check if you've actually claimed it.
I believe there is also a function to get the smart object component if you have a smart object handle or a claim handle.
Anyone have any ideas why my ai when it's running after me head on it sort of moving very fast side to side insted of straight at me
Also any tips or tutorials anyone would recommend on making a smarter AI
have a look at the pinned messages
This EQS Item passed the "PathExist" Test and then the move to task failed because the point couldn't be projected onto the NavMesh.
Shouldn't the PathExist test if the Item is reachable? 😅 This seems to be wrong.
MoveTo settings
I can't for the life of me figure out what's drawing these blue boxes, but it's related to SmartObjects I think.
They're positioned everywhere where there's an SO.
Sorry if it's a stupid question, but I feel like I've turned off every possible AI debugging vis I found!
(that's in game mode, PIE)
yeah, that's a visualization of SmartObject's space partition. It's always on in dev builds and it's a bug. I believe it's on the Game show flag so try disabling that. Or just gut USmartObjectSubsystemRenderingComponent. It should already be fixed in UE5/Main
any epic demos with statetree yet?
not really
its unfortunate
ill keep throwing stuff on the wall and see what sticks
I'll try statetree this month
I have a feeling like it's either going to cause me to replace half of my AI systems or just barely use it
yeah
i keep thinking i should just write a basic AI placeholder in blueprint and wait for knowledge to drop.
i need AI now
but i dont want to do double work for when knowledge drops
I'd go with trying statetree, Mieszko and Mikko is already hanging out in the #gameplay-ai so it's a good time to ask questions if you encounter something weird
the weirdest thing i encountered is i have no clue how to work with it 🙂
but for real. Am i understanding it wrong or does ST tasks not have access to output
i tried creating a random location and go to that location as tasks but i dont know how to pass the new location from the previous task
i would be more confident if the statetree also an event graph
IIRC the task output and input get bound via the ST editor
ok ill check
I was messing with ST a little bit last night. Going through the docs quick start that is. I got to the task where you destroy the actor. It has you do 3 tasks in the dead state. Debug printing, then a delay, then the actual destruction of the actor. I decided to only use the destruction of the actor task. When doing so, it seemingly would not run the Exit State function. That is the one the docs want you to override.
Once I added the other two tasks though, it would work. So, not sure why that was behaving that way. From my understanding, it should've gotten to the dead state, went into the destroy task and then do its transition that I setup to automatically happen and Exit State should've been called. But it seemed to only be called when it had other tasks with it.
¯_(ツ)_/¯
World partitioning just unloaded my navmesh on startup (seriously wtf?) and i cant load it back in again, i tried loading the entire world in but it omits this, i tried restarting but it is the same. I cant edit its properties like this anymore. Bug? The navmesh is custom but i didnt even change anything yet on it (just overriding the classes)
Here. in statetwo output state the bind doesnt have access to the stateone task.
but if i have the task in the same state it becomes bindable
i guess this helps me now
😄
I believe it's like that by design. The tasks should have access to previous task stuff.
In the first screenshot, StateTwo is a different state from StateOne. So they wouldn't be active at the same time.
yeah
you see.. im at the level where i have no idea what im looking at.
despite reading the docs a couple of times.
now you're that one step closer to the wisdom!
Just need to go slower then and practice more honestly. I found the docs to be quite helpful
yyp
its just that i have been confused about where to create definite change to be reflected in action. i went into this more with evaluators in mind than the tasks.
@crystal hatch btw - the ST editor's compile button doesn't follow the other compile button patterns! I have to hit compile and then save like some kind of savage. (It doesn't have the option to save on compile like in BP stuff)
were all savages on this glorious day
well, there's this https://github.com/EpicGames/UnrealEngine/commit/3a0621e0f93c94f0f6a73a60f74f1fa69a004196 (will be pulled in)
i just had this in mind now
i wanted to create a random location goto loop
each state had a text, didnt loop
gave each state a delay, started looping
and something else is overriding the task text
states with task blueprints connected to them dont need a delay task
this logic continues by making a state into a group state. pieces starting to come together
Thanks! I'll take a look into it
ok so now that i got a handle on making basic stuff in StateTree
what sort of tools do i need to make an AI move around as if they are an FPS controller
@crystal hatch is the statetree tasks and evaluators running on the actor
ie the scope starts with actor
ah nvm me i accidentally disabled context
I deleted it, recreated it, saved and exited the engine, started the engine up and it is now not unloaded so this is 100% some quirky bug but i cant repro it
I can reproduce it! I set the cell size to a small value and get a crash somewhere in static dtStatus removeVertex(dtTileCacheLogContext* ctx, dtTileCachePolyMesh& mesh, const unsigned short rem, const int maxTris) and then the navmesh ends up unloaded forever and unchangable
Have the sense update a variable on the AI. Bind the state tree task to that variable. Can also use it as a trigger condition as well.
I'd say yeah, look at them the same way. Just with a direct binding to the actor instead of going through the blackboard
ah right
i havent looked at conditions yet
this time i will try and make it all via tasks
It's how you'll go from state to state
It's the transition stuff
That's how the ST goes from one state to another
Based on those transition rules.
Might not need to.
yup
It has a few conditions already.
my approach atm is to decide state by "enter condition" and just read a variable on actor
What I'm saying is you just update a variable, say, bHasTarget or w/e. Then some states are binding to that variable. When the variable is true, it transitions to a new state Chase Target.
So you just need to set up a transition rule really.
I need more detail on my navmesh when it comes to height-changes, how can i achieve this?
Basically i need around 2x of the current tesselation. I tried to play with the parameters but to no avail. The slope and step height is intentional like this because i dont want gaps in the navmesh. Ideas?
cellsize isn't it?
it crashes on low cell size 😛
You went too low 🙂
Really? I'm pretty sure its cellsize
cell size works great when it comes to the overall edge of the navmesh or gaps
it tesselates a lot there
but what i m looking at is a tile that is fully covering a navmesh without gaps
change the simplification settings
Cellsize should be the overall size of a single chunk of the navmesh generation, so the tesselation size of the tile part? unless I'm thinking of another value.. but theres definitely a tesselation value I tweaked
if I go below 1 it makes a horrible zigzag at the overall edge of the navmesh, like a saw
yup
do you need the z axis to be at the same height?
it wouldn't change the topology of the navmesh
I ll play around a bit with these 2 settings, thanks. Btw these were also the ones i had put my bets on but at low cell size i got the crash i talked about early which permanently unloads my navmesh (bug!!)
I dont understand the question
same height as what, z-axis of what
I mean, why do you need more detail for height changes?
got it
isn't the navmesh just clipping through the terrain there? 🤔
Yes it is
meaning the whole landscape is navigable
I just want more polygons because i want to paint areas on the navmesh without navmesh modifier but by going from triangle to triangle
it is!
What i am doing is admittedly a bit of a hack, i dont want to place hundreds of navmesh modifiers or paint a complex geometry for the modifier to set my areas
I want to modify navmesh generation in a way i can pick up values from the landscape layers to determine areas
So for that i need higher tessellation by default, perfect would be a min edge length
I tried to make the tiles small but that makes generation real slow
I hope this makes it clearer what i m trying to do. Maybe I am approaching this from the wrong angle, then feel free to slap it into my face and lead me to the right direction 😛
yea I understand, I had the same issue earlier
some sort of plugin that could automatically place navmesh modifier volumes based on a texture would be nice
😄
this was my 2nd idea actually, but i decided it is a complex problem to try to determine a hull based on a texture around areas, then extrude it at the right height etc and place these all over
Hmmm
I suppose
So right now i m trying to just modify the generation of the navmesh itself and bake it right into the navmesh
But now that ithink about it again, maybe the modifiers would be the cleaner solution after all 😛
it is hard to say
the navmesh modifier volumes can be concave in UE 5 too
whereas in UE 4 they could only be convex
just a random observation