#gameplay-ai
1 messages ยท Page 35 of 1
Itโs not just the decorators that can fail
how do I make it switch to the left side the moment everything there is passable?
nothing is failing
because the logic doesn't even get there lol
it's not like it's quickly flashing there and going back
Did you use the pause button?
Just to make sure itโs not happening faster than you think
Ok, then you need to try using the gameplay debugger at runtime (โ) and if that doesnโt give you any clues use the visual logger
I can't find a pattern
okay but if everything on the left is passable, and there are no nodes that could fail in that branch, should it automatically switch to the left branch even if stuff like "Wait" is being executed in the right one?
should the wait be cancelled in the middle?
because that's kinda what I need
I'm not sure if I understand it correctly ๐
You say there are no nodes that could fail but you havenโt tested that
Moveto could fail instantly
on the very left, the branch that we can't see at the bottom, if it passes the selector stops running
Just because your decorators pass doesnโt mean everything passes
u could be having a problem with some other tasking passing
Yeah good point
Pausing and stepping through with the arrows should you usually show you that
I'm testing it again and sometimes it works, sometimes it just hangs in the right branch for no reason
BTs confuse me sometimes ๐
the one off-screen?
yes the left-most child of the target exists and distraught selector
that one doesn't change anything because it cannot fire
well try disconnecting it
I tried, nothing changed
if it can not fire why have it?
because it's not being called at all
well it CAN fire but not with the current AI i'm testing
it's for aggressive behavior
the one I'm testing now is scared behavior
the aggressive one actually works properly
but this AI is not aggressive so the left-most branch never even fires at all
the way you enter that child might "pass"
if any child node succeeds, the selector succeeds
well it is entirely possible that some service somewhere upstream is setting that value to aggressive erroneously for a split second
it's really not though :D
but maybe this is a red herring u r right
I'm 100% sure that's not a problem
scared type cannot possibly become aggressive in my logic
but I'm testing more with pausing and going one by one
Use gameplay debugger and visual logger, guessing will only take you so far
what does the visual logger do? ๐
Pretty much what it says ๐
Itโs kinda like Insights for AI
Youโll find it in Tools -> Debug
I wonder if having a selector node with a decorator only will be a success and stop executing children?
I have encountered difficulty trying to nest subtrees. is it possible that there needs to be something on the selector other than just the decorator and a child node?
if the parent, distraight and target, was a sequence, then either could still fail/abort from the decorator
I managed to get it work like once now, I paused and going on by one, it sets all the BB keys to non-passable suddenly, for some reason
I'm gonna have to go deeper ๐
might be an issue in my AI controller
working with 3 senses is confusing sometimes
That node could be a sequence and it would maybe help prevent early exit of the subtree
although no
because then it would never pass
if u need it to pass sometimes, to prevent further selection, than yeah
I think something might be wired wrong where I deal with the senses in the AI controller
but I'm not quite yet sure how to test it at the same tick when the left tree fails
I am tending to deal with senses in EQS and services
Are you setting keys on your ai controller itself?
yeah I'm using the "OnTargetPerceptionUpdated"
I actually had it working pretty nicely but I added some stuff since and it kinda broke
The newly discovered magic that I have found from being here is that using services you can guarantee that a key is set or not when a node activates or deactivates
ah, like eliminating the possible "void" between the service updates?
yeah exactly like when you know a key should NOT be set you can make sure it's not when the node it's needed for exits execution
as long as some other service is not also setting it
but IMO it is easier to time and track down if everything is done in the BT than the controller and BT unsynced
I have even realised you can just pinpoint your inquiries to the senses
I'm not sure how I would move it over to the BT though
like you have a suspect actor, just test for the senses perceived on them only
in the subtrees that you need senses active for, have a service ticking to add any sensed actors to whatever keys you need
then when you leave that subtree you can ensure all those keys are cleared or whatever you need. Leave it in a known state and don't touch it.
This is still a bit overwhelming for me ๐
but yeah look what it's doing
for a moment it works, then it switched back to the right
and then it doesn't switch back at all even for a tick, even though all of them on the left are passable
and you can see that even in the moment when the left switched to the right side, none of BB keys changed at all
I want the AI to keep repeating that bottom left part
if all of them are still passable
I think I'm just gonna have to put "Not distraught" decorator on the right side ๐
okay yeah that makes it better I think..
the one thing different about that agrressive node is the type. everything else is a bool or checking if something is set while that node is searching for is something equal to another. is it a string? an enum?
Is it possible to bind to a delegate from my actor, in a C++ non-instanced task?
I dont work with AI so forgive me for not knowing, but is there any requirement for the blueprint type an Ai can control? Can I use a character BP or does it need to be an empty Pawn
Char bp is fine, you usually want a movement component in it anyways and that comes with it
Excellent thank you
Any good guides on setting up an EQS generator in BP?
Planning on using it to query for valid cover spots, but I'm struggling to get it to return any points at all...
Ahh nevermind, looks like I just forgot to set the default generated item type to be an eqs point
The custom generator used by the query on my eqs testing pawn seems to only show/generate items when I'm in simulation or play mode... Is this standard behaviour?
As opposed to when?
With default generators like SimpleGrid it will generate whenever the pawn is selected outside of play or simulation mode
Makes debugging way easier
You mean like on construct?
Yep
Oh weird, maybe thereโs some flag your custom generator is missing
Yeah it's gotta be, just don't see any other settings that could fix it
Looks like it's actually generating, just not showing items
Heya devs, I'll be brief.
Problem: npc follower disappears when follows player far away from a spawn point.
Details: made large world, deep underground dungeon with long elevator down. After taking elevator from the surface and moving a little into the dungeon, there appears to be a line that npc can't cross and simply disappears.
If I move npc, so does the line moves. If I return after disappeared NPC it it appears again. But trying to move further repeatedly makes it disappear another time.
(its not kill zone, I lowered it way lower)
Any setting I can check to adjust actor's distance from spawn parameters or something? (couldn't find solution on google)
how far away from the world origin are you, do you have large coordinates enabled, and do you have any other weird issues in those areas?
Spawn point location
Approximate disappear location.
Haven't ever tried enabling large coordinates before. Might give it a go. (Think it will help?)
it is possible it is related but not for certain.
are you familiar with floating point number precision?
No, I'm sorry. Im not. Less than 1 year xp.
Care to ask a question that doesn't require me reading my UDN answers from years ago? ๐
@crystal hatch Sure lol, basically i want to produce navlinks for placeable building building pieces automatically, in this post you said something about "Edge" links
thing is i dont want designers to manually place links and have to determine the link positions, etc
Ok well in computer science in general, floating point numbers can only really accurately represent like 6 digits for single precision, 15 digits for doubles. afaik, if you do not use large coordinates, most stuff uses a single float in UE. I could be wrong. But your numbers are withing the order of magnitude where maybe you will see problemts but not certainly.
If you are using doubles (large coordinates) then you should see no problems, unless there is a bug in the implementation and they missed a few floats somewhere lmao
Right. The thing I mention is an extension of ANavLinkProxy that makes it easier to set up navlinks along some line. There's still manual setup required, but just makes it way easier to place lots of consistent links. It will eventually make it to the engine (it's in Fortnite sources right now and I can't seem to find time to move it out). In the mean time here's something that still worked sometime this year when I tested it. Jus put it in the right places in AIModule ๐
Does anyone else have issues with state trees and property binding in 5.3.1?
I have an evaluator that gets the movement component of my pawn. But when I try to bind some transition condition to the velocity of that component, I get the error:
StateTreeCompiler: Error: Root Condition 'Distance Compare': Input property 'Source' on Condition 'Distance Compare' is expected to have a binding.
StateTreeCompiler: Error: Root Failed to create condition for transition to 'Test'.
Thanks will take a look when I log into work ๐
If I have a composite/node with two decorators on it: one that is set to abort everything if value changes (for example), and the other is just an entry condition.
What happens if the aborting condition becomes true, but the second decorator is never true. Will the first decorator abort the lower priority nodes, but then fail to enter the subtree?
Or will it never abort anything because not all decorators evaluate as true?
I can refactor what I wanna do anyway. On the watched value, where it is set, only set it if that other condition is met too.
@crystal hatch I saw also in that post, that you said there was a way that static meshes can generate navlinks, only thing i can see kinda useful is NavLinkDefinition, but i am not sure how it is used
start by looking at FRecastTileGenerator::AppendModifier and follow the breadcrumbs from there
yeah i am currently doing that :P, btw is there a way for Partial Path to ignore certain modifiers and not allow pathing through it? (its a high cost not null)
Man Person, you're milking it! ๐ I don't remember anymore, I haven't worked with nav code in years (when did Fortnite BR add AI? That long ago). You should be able to achieve something like that with virtual filters.
haha, sorry ๐
I am currently looking into creating a GOAP (Goal Oriented Action Planning) system for the AI in my RTS game, purely as practice. Looking online there aren't many games that have (publicly) shared they are using GOAP for their own games. Is there a specific reason for this, or is it just a matter of GOAP being so common in games nowadays that no one really finds it worth mentioning anymore?
Hello everyone. If known, can someone point me to some good resources regarding connecting UE game/sim to an AI Chat engine?
Is this even possible? Let's say as an indie project, there were 10k users all using the code at the same time. Would this dictate using a local system vs. something online? How would you do it? The goal, imagine an AI compainion in a simulator that assists with operations, alerts to treats, and has general conversation time. Picture the computer in Star Trek, where player could request information, give cammds to do duties, etc. Thank all.
This channel is generally meant for the in-engine AI system, not so much LLMs. You can try #lounge maybe
Understood. do you know of any like kind AI examples? I will ask around regarding my initial questions. ๐
Meaning example of what has been done natively.
Idk, I hear lots of companies are trying to use LLMs now but idk any specifics
I would think that could lead to trouble if there were a large user base. OK, well, appreciate that input this morning. ๐ I am on a crash course as it has been years since I did any coding. I am using Python and learning much quickly. I am mainly using it to create and interact with databases. I have yet to connect UE to those databases and that is the next learning phase. I am one of those Jack of all trades types. ๐ I do nearly every aspect of game dev but I am weak on coding although I have the aptitude as I wrote entire applications years back. Thanks again.
Hello amazing people. Learning UE at the moment from the Lyra sample - I've built my own custom map but the AI just stand still. This seemed like a navmesh issue but the Navmesh volume was repositioned and everything that's supposed to show as green does when viewing the navmesh in editor - HOWEVER, after futher debugging using the " debugging menu, I've isolated the issue to what I believe is the AI using the old navmesh as seen in the picture.
How on earth do I go and fix this? My scene has a NavMeshBoundsVolume and a RecastNavMesh-Default, both presumably there from the original map, again I've updated the navmesh bounds, but have no idea what a recastNavMesh is.
The same view, but from non PIE view. Instead using the show>Navmesh view in the viewport.
Clearly something is not playing nice here.
Lyra bots need ability spawners and other players to move. And yeah a working navmesh.
Go to build menu, and click build paths. Then save your level. Then they might work.
Thanks, sadly still no luck.
Ability Spawner: Check
Weapon Spawner: Check
EQS Working: Check
NavMeshVolume in scene covering map: Check
Doesn't work in build either.
What's confusing me is the discrepancy between the nav mesh shown in the viewport, and the navmesh shown at runtime via the " menu. Surely it should be the same?
Notes: Using Dynamic for runtime generation "fixes" my AI, however performance is pretty dog ๐
So issue is definitely navmesh related.
The main problem with GOAP planners is that it's not really worth the effort to build one. It usually ends up being cumbersome and error-prone to add new actions to the action domain (not to mention usually requirng a programmer to do that), and the resulting plans are really short in practice - usually 2-3 actions long.
did you build paths THEN save your map? I have to do that for the generated navmesh to really work sometimes
Yeah no luck :c tried both:
Build > Build Paths > File > Save Current Level
Build > Build Paths > File > Save All
Forgot to mark my response as a reply ๐
default lyra method, they spawn at the player starts. Again, this is 100% looking like a navmesh issue.
What's the chance that this is a bug on source?
yes I believe you this does seem like that
I bet it is very unlikely a bug that can't be worked around
if there is a bug it's a small one that is causing a hitch that can be worked around
ur navmesh should work
Ok so the ability spawners need to be REACHABLE on the navmesh. possibly other enemy players, too
your navmesh might be too small at points to be reachable
I have an ability spawner that is reachable - when setting navmesh runtime generation to dynamic the AI works as intended - I've also turned off the part of the behaviour tree that looks for new weapons to prevent it from getting confused.
you can't just turn off part of the BT, because something has to pass or nothing will happen. It is not a stable BT lmao small changes really mess it up
I am making a level with lyra bots and lots of stairs too. You must be careful or thy won't be able to reach
Have you messed around with navmesh generation properties of the RecastNavMesh instance in the level?
Your points are completely valid and I really appreciate the help, thank you - it's just so strange that it's "fixed" when setting to dynamic. Yet baking when static doesn't save it correctly.
If I did it was by accident, any settings you have in mind?
dynamic might have different settings so it makes more mesh/enough for them to move
You can, but I wouldn't recommend it. Better to use an AI task to bind to it or make it instanced.
Interesting :?
but also, yeah, there is some issue with navmesh building and saving correctly in some scenarios
As MieszkoZ pointed out, check the RecastNavMesh actor in your level
Anything in engine that I can take a look at on how to handle that? (I'm at work right now, so can't browse the source). Like an example task/AITask
I also had to mess with settings there to get it working on my level things were quite messed for a moment
BTW that actor kinda messes with OFPA a bit... source control will try and add one but it's not real then it gets messed up lmao
the recastnavmesh should be in the level file itself, even with OFPA (from what I can tell) so when UE started adding it to perforce changelists things got screwy for me. I had to go and delete that OFPA file then everything was fine
Recast Navmesh Settings
When you spawn the NPC, what are you giving it for the owner? If the owner is streamed out the NPC will be as well.
Lyra does not give u many options to spawn bots by default. They are likely being brought in by the LyraBotSpawner and they should be working correctly
But you might be right that maybe the streaming is affecting something, but lyra uses world partition in their levels by default
I don't know how navmesh is setup in Lyra, but:
- make sure there's no additional "navigation" sublevel. If so, remove it.
- delete all the navmesh actor instances in the level
- manually rebuild navmesh
- save and reload map.
even tho there are like 4 cells
As far as I can tell there is nothinig special happening with lyra and navmesh it's all basic so do exactly what MieszkoZ says
GOAP is not common, because it's too expensive and difficult for design to work with.
Very interesting! I will give it a shot and ultimately run into the same conclusion, but a little wiser about such systems ๐
Thanks for the explanation!
- I don't think there is, but also still quite new.
- Should I delete the navmesh bounds volume?
- And then re-add it or just build?
- Then save and reload?
Gotcha, that sounds logical. Let's see if I can even get something functional, for then to fall into the trap of the system being absolutely unworkable ๐
Building the system for learning purposes is definitely a good idea. Have fun ๐
Thank you ๐ฅณ
The move to task uses an AI task.
open the "levels" tab and see if there's anything there.
Re deletion, just remove the RecastNavMesh instance.
Levels tab says "This feature is disabled when World Parition is enabled"
i recently had an issue where just deleting the actor did not work, I had to find some errant OFPA external_actor or whatever, that had been added when I edited that file. In the outliner it would shoe a RecastNavMesh actor but it was not selectable, greyed out as if unloaded but did not say unloaded.
Something interesting though is that the world partition window is still showing the old map.
this might have been after I duplicated the recastnavmesh actor, which is a bad idea. Or maybe it was just when I deleted the first one and had the editor generate a second one, but source control freaked out... I forget
Oooh nice! Good to know, busy generating it now.
You know... I use source control in all my projects - except in UE. Git repo absolutely just bent over and died, and I haven't gotten around to perforce yet ๐
It's still generating ๐คฃ ๐
I finally found the issue. Thanks @unborn sphinx @crystal hatch - the issue seems to be that my RecastNavMesh-Default was not 0'd. Zeroing its location, building and saving fixed the issue. Thanks you legends for pointing me in the right direction โค๏ธ
oh nice cool thanks I will make sure I keep that in mind if I have any issues
should we be checking if an actor is valid every time before we set focus to it? Or only when we are "accessing" something on the actor?
Sounds extremely reasonable, but how could I know what am I giving it for an owner?
In lyra the bots should be setup with a playerstate and everything just like a real player
unless you changed it
These are the only settings i see for "owner" in both blueprint settings of the actor and in world screen settings after it's placed.
do not place thebots in the world by dragging the BP that will not work
Im a bit blown away though curious. How do I place them then? Through a spawner bp?
void ULyraBotCreationComponent::SpawnOneBot()
{
FActorSpawnParameters SpawnInfo;
SpawnInfo.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
SpawnInfo.OverrideLevel = GetComponentLevel();
SpawnInfo.ObjectFlags |= RF_Transient;
AAIController* NewController = GetWorld()->SpawnActor<AAIController>(BotControllerClass, FVector::ZeroVector, FRotator::ZeroRotator, SpawnInfo);
if (NewController != nullptr)
{
ALyraGameMode* GameMode = GetGameMode<ALyraGameMode>();
check(GameMode);
if (NewController->PlayerState != nullptr)
{
NewController->PlayerState->SetPlayerName(CreateBotName(NewController->PlayerState->GetPlayerId()));
}
GameMode->GenericPlayerInitialization(NewController);
GameMode->RestartPlayer(NewController);
if (NewController->GetPawn() != nullptr)
{
if (ULyraPawnExtensionComponent* PawnExtComponent = NewController->GetPawn()->FindComponentByClass<ULyraPawnExtensionComponent>())
{
PawnExtComponent->CheckDefaultInitialization();
}
}
SpawnedBotList.Add(NewController);
}
}
you can expose that function to BP
then spawn them in bp at will as long as it is run on the server
I want my NPCs to detect the player if the player stands too close behind the NPC for x seconds. I have two ideas, but I'd love to hear thoughts if anyone has a better way:
- Create a custom perception sense that detects when the player is too close for too long
- Create a collision sphere around the NPC that starts a timer when the player enters; when the timer fires, the NPC perceives the player
if you don't want to do any small c++ changes, then you can only spawn bots by changing the experience settings
there is a data bp somewhere for each control point, elimination mode that sets how many bots to spawn
or using the cheats system but that does not work on shipping builds
Still beyond my current comprehension. Im sorry. Looks like this month's version will have a bug that needs fixing later.
I am not good at explaining things I am sorry lmao
Yeah that's like a weak part of trying to find answers on this discord. Really wish people were more keen on hoping on voice chat with screenshare together to show/solve problems quicker. I kept asking it here sometimes in DM, even for money, but they never answer. Contacted a guy in hire channel suggested same he ghosted me. Is something wrong with me or what I suggest? (inb4 ghosted again.xD)
U can set back the vision cone, behind the NPC shoulders, to simulate that kinda thing. Then just only "detect" them after some time.
It's a parameter when you spawn it.
is that last note clear? ๐
People are busy, sometimes at work, so they can quickly post a msg here and there, they canโt join a full-on zoom meeting to mentor you, nor should you expect anyone to have any interest in spending their time doing that for you here. Your options are thus:
- pay someone a ton of money to mentor you
- take your chances and pay a ton of money for some โmasterclassโ
- be patient, bump questions when they get lost, spend some time to try to figure things out when someone gives you a lead, wrack your brain and get to the answer eventually, by asking better questions progressively
Most of the time that I'm here, answering questions, I'm at work. Definitely can't jump in voice.
Thanks, I'd like to avoid derailing this subchannel's conversation flow any further though.
I just drag and place an NPC_BP from my bottom content bar.
Perception sense. Collisions are expensive
That's why. You really shouldn't do that for a range of reasons, but also it ties the NPC to that specific chunk of the world.
Mmmm... I never heard that I shouldn't do that before. Apart from @unborn sphinx just saying that few minutes ago, but way he described I should do it seems waaay out of my scope of understanding atm.
It's something specific to world partition
Yeah I have world partition.
Like, if you had just a regular ol' classic style level - it'd be fine to do it the way you're doing it (IE - drag n' dropping)
Makes sence the npc disapears if I go too far away then
I don't use WP though, so I don't know any caveats to it.
In lyra it probably will not work without spawning the playerstate. components, and the ASC itself, need the playerstate in lyra
Actually no it's not OK. Any changes to the NPC requires a map save when you do that. Can also cause data corruption.
Always spawn NPCs dynamically.
Sure. But if you're the only dev, it wouldn't be that big of a deal. Plus, OFPA works with non-WP stuff. At least it has been for me for the past like 3-4 years.
All my AI is dynamically spawned as well
I just don't want to tie it to a specific actor.
How does one spawns an NPC which can follow the player as far away as they go then, provided world partition is used?
It's also a waste of perf having AI doing stuff when the player isn't around.
You spawn it using spawn actor (or spawn actor deferred) and don't give it an owner. I'm not sure what extra you need to do with Lyra though.
Ooh. I see now. still dies from thinking exhaustion
If you're asking me then Idk. I installed it to ship my first version a month ago, but didn't touch it since.
I've been in this for just 8 months now. 1 of which I gave up for at the beginning, 1 in a village without pc or internet on holiday and about 2 first ones just poking around building map a little with a gasping mouth.
Wouldโve given up if it wasnโt for this server tbh
if u wanna play with lyra u gotta be comfortable messin around with c++ once in a while
You mean you have to be mental, like you ๐
๐
I will be less mental when I finish this first playable prototype in a few weeks lmao
I have not much code or blueprint to release, because they are just modified epic files, but it's gonna be an open source community-driven game so like yeah I will spam the crap outta this place with the link I'm sure lmao
I will refactor everything into new classes and stuff so I can release it but rn I am seeing what needs to be done for basic functionality and seeing if the core mechanics are even fun
(release the code/bp that is... the game will be released on github regardless lmao)
development builds only tho. eventually the game might cost like $5 on epic games for a full copy playing on live servers not test ones (no dedicated serves yet tho just p2p)
I feel like any "pain" involved with lyra is short lived and GAS is our lord and saviour bow down
๐คฃ
Hey ppl , how do i access the character possesed by an ai on a bt decorator?
i just found this, seems to help OwnerComp.GetAIOwner()->GetPawn();
Please don't spam here.
Hey guys so on every task in my BT, the first thing I have to do is cast the owning pawn to the actual actor running the BT, is there a better way to go about this?
Basically this is step 1 in every single task because I need values within my base human class, but this feels like it cant be the right approach...
im a noob on this, but i get the same feeling. i think the idea is that the bt is as detached to the pawn as possible.
if i have several pawns, all running an different instance of the same ai controller, with an instance of the same bt, do they share the same instance of the blackboard or is a new blackboard instance per pawn?
Its a different blackboard per pawn, individual variables can be set to be shared across all blackboards for that unit
too late
(but just on-topic rambling spam, no link spam)
Why do you think that isn't the right approach? That's how programming and pointers work.
Curious about the standard way to find cover points at the ends of walls with EQS? I made a generator that draws a circle of points around the player, casts each one towards the player and then stops when it hits the wall. Then I'm moving along to the left and right of the points at a series of intervals (max of 5 atm 100 units spacing between each) and tracing forward again to find the point the last point that hits the wall to hopefully find a spot close to the end of the wall.
Is this sorta the right approach, or am I way off?
Hmm that sounds inefficient, here is my approach
- Generate points around target
- For each point, line trace 150cm towards the target starting from knee height of the point
- For every point that hits a wall in the previous step, I do an additional line trace at shoulder height from the point all the way to the target to confirm line of sight.
The first trace already confirms that the point is cover AND is close to wall as it has limited range. The second trace confirms that cover spot has line of sight to the target.
Ahh sorry yeah that's a good system for "duck" point, but I'm after a system to find the edge of a wall, so the character can lean out of cover to shoot.
The screenshot was confusing, my bad
This kinda scenario
Ahhh I see now why you are doing it like that
Personally, I kept a cache of all accesible points active, then I just do shoulder height traces and if one point succeeds but its neighbor fails, I know I've got a "lean" point.
Oh interesting
Yeah and in larger maps I just move the cached point grid to always keep player in center.
How often do you generate the points? Would have to be super expensive
Not really. I generate them once and I'm done.
Gotcha, and you could share the grid between agents I guess
Exactly, I have a "query orchestrator" that caches the grid for sharing across all units.
IMO its way more efficient than the EQS system as you have to regenerate locations you can move to for every decision when they likely are not changing often.
Ah awesome, love that kinda stuff, I might try something like that then and see how I go
But thats off topic haha, my approach could work for you if you do more fine grained inital traces to decide navigable locations but that may be too costly.
Gotcha, thanks for the help I'll give that a shot
What's the benefit of doing it through an AI Task over making it instanced? Seems like extra work (AI Task) over just making it instanced. Going to have a UObject created either way. Does the task interface with a different system better or something?
I like using AI tasks, because you can use it in other places outside of the BT. It also only gets instanced if it's used, instead of at load time.
Ahhh
Alright - so there is a chance that it never gets created if that branch is never hit for w/e reason
The EQS is time sliced, so you aren't saving as much perf as you think you are. Plus you are generating a lot of points that need to be tested, so you are saving a lot less than you think you are.
I dont test all points each decision
I exclusively test points that are within a given weapon range.
What my system does more efficiently is purely having the nav points pre-set up so I don't have to trace down like the EQS system does to find points to evaluate first
Can I ask what time sliced means, I'm not sure what thats implying
You still have to find all the points within the range of a given weapon.
It only does X amount of stuff per frame
Yes, but instead of line tracing I just iterate through an array of vectors and do a distance check
It's spreading the cost across multiple frames
My personal testing showed that it was more cost effective than tracing for points each decision.
Gotcha thanks I figured as much, I've got something similar for my system!
Just a simple "only evaluate X amount of points each frame" so probably much less complex than whatever EQS uses.
Time sliced means the EQS only is allowed to run for a set amount of time per frame. That amount is configurable by ini. We use EQS for A LOT of things in our AAA game and it runs at max 1ms per frame.
I'd bet its fast, but I still think my system cutting down on initial line tracing would be a faster first step (establishing points to query from).
From there I doubt I have them beat LOL
I still think
Should measure rather than think
I did measure! I compared tracing for points each decision vs caching vectors and iterating through them for a distance check.
Cache vectors and do dist check for applicable points to evaluate won out over making new line traces to query from each decision.
So why are you saying "I think" and "IMO"?
Because I am not an expert and who is to say my testing is a true comparison of what EQS is doing. Haven't look at the source code, just saw that their very general docs descriptions 'seemed' inefficent.
But they could very well be caching line traces behind the scenes as well and not directly describing that in the docs u know?
Do you have a valid proof what you are doing is expensive right now btw?
Doesn't matter if you're not an expert though. Would just need to state your findings and how you tested. Then someone who could be more experienced could point out any flaws in that part. Just a tip.
I have proof its not expensive lol.
EQS would break actions into pieces and limit them by X ms per frame, and wont evaluate anything else if budget is reached. Your problem would be latency in action rather than perf
if it ever gets expensive
like if your thingy would take 1ms it would take 1ms / EQS budget to finish that process, but overhead will merely reach EQS budget
Caching off that much data, especially line traces which are cheap, is actually a memory concern. As well as a waste of dev time to reimplement a system that "seems inefficient".
I dont cache line traces, just the outcome of the traces which is vector positions.
So my query system that I work with per-decision is an array of 3000 vectors which I don't believe is a memory concern?
I meant EQS btw
So as you can see in the image above, the only vectors I keep are the light blue dots. Thats a debug of my initial personal navmesh/query system setup, and those go into my array of vectors that I use in all position decisions going forward.
3000 vectors in a small test map. 3000 vectors that you must iterate over for every decision.
Yes, my understanding is that 3000 vectors is absolutely nothing to iterate through performance wise compared to line tracing a good amount to reestablish vectors to query from.
And then, each "decision" filters vectors down further. So each subsequent check (cover/LOS/height/whatever) is iterating through less and less vectors.
Plus keep in mind that grid is dense as hell
I do not normally see people query with that kind of density using EQS.
Have you ever perf tested projecting onto the nav mesh? It's ridiculously cheap.
And vector iteration + dist comparison is cheaper.
There is someone around here who is doing like 10k linetraces on tick and don't have a perf hit from it.
Well, not one that they complain about anyway
Perf certainly is relative.
Everything has a specific cost, but whether it's a problem is relative.
if I'd be micro optimizing EQS I'd go for the route parallefor per point in the grid and use traces inside of the parallel since they are not GT bound anyway
and wouldnt cache anything as it would make things slower implicitly
I am yet to see EQS is slow though
I have yet to see it be a problem. At least not after changing the default time slice amount.
When Mieszko??? ๐คฃ
among other 3 message bus systems 
The ProvideSingleActor override I've implemented doesn't seem to be getting called when I'm tracing to my player context... After some testing, it looks like it's calling the ProvideActorsSet method to find the player. Anyone know why this is happening?
There really isn't much on the interwebs about UE's AI systems. Wild.
I want to use detection by affiliation without using C++ atm, unless I might be shown how to easily set a bp as friend/foe in c++ (which would be my first text programming) but it says here I can tag npcs for such system. Anybody tried it? Shame they didn't elaborate better. Does it involves array blueprints or?
they are just saying you could filter the actors that trigger the sense (within the event) based on what tags they have within blueprint to get a similar effect
less a "it has this capability" and more a "here's a workaround if you don't want to do c++"
Absolutely, and I tried it. With it set to neutral npcs attack every other actor, but how does one does this "tag" thing to an NPC with friend/foe team. It cannot be as simple as just giving a tag in the other npc settings, is it? I tried it, just in case, nope.
TBD ๐
Actor tags is most likely what they're referring to. So your perception gets a hit for a target and then you check if the actor has a specific tag and then do logic based on that.
Almost, but not quite.Afaik, Itโs tied into the GameplayTagsInterface that needs to be exposed to blueprint before you can use it that way.
So actor tags but specifically, Gameplay Tags
I've typically seen Tags just mean actor tags in the docs and they specifically say Gameplay Tags when they're talking about...well GT
Not to mention, all actors have a slot for actor tags, where as all actors do not have a slot for GT
When you expose the GT Interface they come with a GT container, or rather you implement one in the process
Sure, you obviously subclass from Actor or w/e and then add a thing for GT
Yeah
But what if you're using just a raw actor?
Like, say you want to make a wall a "hostile"?
(I have no idea why on Earth you would, but w/e)
Well the docs and the Epic video basically tell you to go in your .ini and bypass it altogether
has state tree gotten any epic examples yet?
I'd favor GT over actor tags anyway.
I still think Matrix demo is the only example from Epic. But I haven't been paying attention
ยฏ_(ใ)_/ยฏ
i havent looked at that but its mostly the crowd parts right?
im doing a browse for it anyway
iirc crowd stuff and statetree overlaps?
i wouldnt know. but im searching now.
just a quick ask ๐
@harsh storm you were right, I checked the docs again and it specifically says Tags. I was thinking of the wrong interface, itโs GenericTeamAgentInterface. I did find a vid here: https://youtu.be/HwBdnviT2vs that shows how to implement it but then he goes on to say he doesnโt know how to change the teamID at runtime so, usual tutorial caliber. Still, least he shows what needs to be #included
Does anyone have any idea why an AI controller would use the Minimum analog speed when walking?
im doing an rts AI. so i have buildings and recruiting of units. its mind blogging for me to understand when its the appropriate time to build or to recruit.
At first i thought i should check the prices, or if i have enemies around, and that would decide if i should Boom (build buildings and economy), or should rush (build lots of units to attack)...
At the current time im merely going by random? is this okay?
So basically it will build 50% of the times, and recruit 50% of the times.
When it has enough units it will simply attack the most vunerable and closest city?
is this okay?
There might be GDC talks with good practices out there, but Iโd wager that the way for you to find out what actually works in your game is extensive testing.
yeah. thats what im doing. im going for randomization for now. and if the ai is too dumb ill start making it complex
the truth is that a degree of randomization will make it more human
humans do random stuff
so its like, ai should in general boom then attack. but sometimes it rushes, or should do stuff unpredictably
like humans do
Has anyone tried running StateTrees dynamically? Eg. deciding which state tree needs to run at runtime? It seems this isn't supported because of course a "general purpose state tree" is as un-generalpurpose as possible... :P
I thought about using state trees to process some basic conversation options I have in my game which is currently done via very clunky behavior tree stuff for it but seems that idea goes out of the window immediately because of not being able to choose which state tree needs to run except in edit-time
Announce Post: https://forums.unrealengine.com/showthread.php?88199
In this multi-part series, Ian Shadden and Alexander Paschall show you how to use all of the relevant systems and features (Behavior Trees, EQS, Navigation Meshes, AnimBlueprints, AnimMontages, and more) to design, create, and optimize AI for use in a game environment with all ...
Is worth it to watch this fucking +10h playlist from Epic?
I wish Epic would actually do other documentation for these than these several hour long livestreams that are impossible to skim
I wonder if you could just have ChatGPT watch it and produce a summary? :P
๐
Probably, yes, or rather watch what is relevant to your situation
Theyโre usually broken down into separate videos and so far every Epic official video Iโve seen was worth it. Docs are good, but they only take you so far into showing you how to use a system in practice
Yeah but they could just write these out in textual form for people who don't feel like spending hours and hours watching the videos, especially when you already are fairly familiar with UE
โฆyou can prly extract captions from the vids, idk, first world problems
It's also made worse by the fact they are this type of livestream in their video format, so the pace and everything is just all over the place. If it was edited into just the good bits it would make it a bit better even in video format
lol yeah it might be possible
I just have better things to do than figure that out :D
Granted, thereโs one really cringy one and yet you can still glean good info from it ๐
The thing that I hate from UE live streams is that is common to be explained by people who didn't work too much with the system (As in the tour of 3 hours of GAS, KaosSpectrum is correcting some things about the system)
MieszkoZ made the system so anything he says in those you can take at face value
Nice
It is not valid to have a composoite(selector/sequence) with simply a service and decorator on it, and no child nodes, right? Or can you just put a service that ticks on entry and have it work?? no right?
If thereโs nothing under it, whatโs its purpose ?
I guess the use case I had in mind was when I had a service that did what I wanted and no other tasks to do
it does seem stupid but just wondering if it is technically possible or not even an option whatsoever
Ok yeah so even if the service is doing something it will just leave immediately
Might as well run it outside the BT then
Tick or timer
ah yes good point. I'll just put the idea aside as not a good one.
You can always delete your posts like a ninja ๐
Are you talking to urself? 
Listen, I'll be done this prototype AI soon and be outta your hair dw ๐
Are Run Behavior and the dynamic version used often? Does the run tree only execute once, when the run node is activated?
It is basically like grafting the tree in as a subtree, with the limitations of the dynamic one being the root decorator, etc.? It doesn't hand off execution to the new BT?
Would be a good way to make modular behaviour trees right?
Does it make sense for you to run state tree within a state tree? I mean having a ST task which contains whole ST and can dynamically pick which ST to run.
Is there a way to show distance that will be traveled and visually show the path for navigation before movement
I tend to avoid nesting things like that whether in BT or ST because this is a problem HFSM solves without limiting you much, it makes me feel like I'm using the wrong tool and making things more difficult to maintain
yes
UPathFollowingComponent API
GetPath() function has tons of helpers
Cool
Gahhh yes just make this shit into clear, concise documentation!
epic? clear and complete reference docs? I don't think they have it in them
bad documentation practices, a Hallmark of a developer tools company
Epic at least "tries" to have documentation to market things but I wonder if they really have code reviews or not ๐
I think the problem is that the folks doing the documentation are not the folks writing the code. it's the tech artists / developer advocates and it seems the way epic does things-- those people don't have commit access to go add doxygen directly
but that's where the work is needed -- if UE docs were half as awesome as the videos and articles epic's marketing docs were to put out, they could save a lot of time and effort for themselves and for us
but the docs you get in UE docs are basically worthless. No better than your IDE can give you. If there's literally zero descriptive text on a class, that page is useless
I dont want docs for everything, i just dont want to get confused
The code is the docs
if only unreal were simple enough for that to be true
especially AIModule
Is this equivalent to checking if the BBKey is set or not?
Hi, in this node, when is OnSucceeded called? does it getting called when "EndBehavior" inside the gameplay behavior is called, or maybe at the moment that it is available to use and the agent started the behavior?
In my behavior I play a montage, and after it call the end behavior, so on succeded will be called after the montage finished playing or it could be called even before?
I recall it gets called after the behavior has finished succesfully
Easy way to find out for sure either test it or look at the C++ code for it
yes, I've put logs in various places, and as i see it for now, after calling EndBehavior (inside the behavior instance), it gives back the control to this node and the OnSucceeded flow continues, and only then it returns back to what after the EndBehavior..
But i'm not sure if it is maybe async or something, but after repeating this several times the logs' order is consistent
Which should I use, the AIPerceptionComponent or the PawnSensing component?
Hi guys i have a question does making an AI with pawn or character have any difference i wanted to make ai that will move to the player on the Pawn it doesnt work but when i will implement AIController on my Character it is working
I assume because the pawn doesn't have movement component compared to a character
iirc it fires immediately on the same frame... I vaguely recall there is a gotcha in there, that if your behavior ends on the same frame as it starts, it might not fire the event
PawnSensing is the old system, AI perception is better
Thank you. Should this component go on the AI controller?
Yes
It does work on pawns too, but it's intended to be used on controllers and you will get a warning if you put it on a non-aicontroller
Thank you. I will stick it on my AI controller.
Guys why i cant put PlayerObject into Move to ?
Hey all!
I'm building a prototype that includes a village simulation.
Using utility AI as the method of choice, but wondering about some best practices to get things working.
I already have something functional, but feeling like it's quite convoluted and like walking in mud when I try to iterate on it.
Is there any good reading material on this that u'd recommend?
I'd also be happy to do a consultation with anyone who's got experience with that.
You have to change the blackboard key to Actor
what do you mean by reading material?
If it is theory, I would suggest http://www.gameaipro.com/GameAIPro/GameAIPro_Chapter09_An_Introduction_to_Utility_Theory.pdf
if it is implementation, you could look at this for general software design https://github.com/rdeioris/UnrealUtilityAI
Reading material specifically on implementing a village simulation.
I can work with utility AI, but the specific usecase of making a village simulator, with villagers having a daily routine, jobs to do, needs to fulfill, etc - that's where I'm looking for best practices
why is my AI Debugger not showing? I've rebinded it to "comma" and even tried to manually turn it on but it just wont show me anything
umm this will be harder to find, I'm also going that way, but for now I'm just preparing the AI system by trying to add each functionality i think ill need and trying to make my system support it, so for now i have some thoughts if you want to discuss it but not something specific.
okay I figured it out, I somehow can only use it in simulation mode
Yeah it's been hard to find information =
Would be great to chat if you're up for it.
You should be able to use it in PIE as well
It's pretty hard to find AI info for very specific things like that
Check the Game AI Pro books' website, there are a lot of different topics covered in those and you can get them for free
Probably not that specific thing though, but maybe there is some topic which is at least a bit related and can give you some ideas
In general, I would suggest trying to keep your AI systems as straightforward as possible if you're unsure. If you keep them like that, it won't be a big problem if you need to change them to work in a different way later
You can also take steps to insulate your other non-AI systems from being affected by changes in the AI systems themselves, eg. via information hiding, delegates, etc., again to limit the impact of changing the AI systems later
Yeah, it's quite a journey =\
What would be the best way for an AI to detect a body of water? I'm working with an ecosystem system where the AI can already feed itself when it feels hungry, but I'm a bit confused about how to deal with the part of the AI going to a pond to drink, unlike plants, the AI should only go to the edge of the water to drink, and not enter it, since it should only enter to swim, I wanted to make a way for the AI to detect where the edge of the body of water is on the terrain and then start drinking.
Should BTservices (BP) strive to use only BB Keys for caching values, etc, or can a variable on the service be used to cache values reliably?
as in, can a cached value set to a variable on the BTS bp survive to the next tick?
Depends on how you want to do it. You can use phys materials and do ray casts. You can also use smart objects if you want more control.
If the variable is needed outside of the service, it's best to use a BB key. If it's only needed in the service and the node is instanced (BP nodes are all instanced) then you can just use a normal variable.
The biggest problem i have is that i have to find a solution that is not peformance heavy and could work in a procedural generated world
Considerind this i don't really know how good a smart object coudl work for this
since the border of the water body will vary with the terrain
You can use smart objects with procedural generation. The smart object is spawned with the generation to give a general location and then while walking to the water, do a few ray casts to find the water's edge.
Thank you. I'm guessing the performance impact is not huge, so I will use a BB key in case the use case for the variable grows. Thank you for the answer
The only issue is having an unmanageable amount of BB keys
Raycasting is needed anyway right?
True that makes sense. This is the first variable of this type I am making but if I need lots more I will consider carefully whether they can live in the service.
That's really the cheapest option.
So in summary, raycating down in front of the AI to detect it as soon as it's in front of the water
Yes
fwiw, you could also generate some kind of markers along the edge of the water and you choose one of them to walk to
But I think the raycasting method is going to be entirely fine and likely simpler to implement
Is this the correcy way to get results from an EQSQuery?
I don't know why I'm binding to the event someone said it had to be done...
That is on a BTService
Why aren't you using the built-in service?
I don't know. I'm making this as a service that randomly injects a different movegoal and also randomly sets focus on random actors, on tick. I suppose I could run the EQS separately, but it only happens if a probability is achieved in a random bool...
I don't want to constantly run the eqs on tick unless the bool triggers true, which could be a ten percent or less chance each tick
stupid? yes. ugh
Hey I'm trying to have 2 nav meshes in the same scene for actors of different sizes. Also because I have an fish and birds that steer into the correct direction, and so need some extra space to keep them from slipping off the nav mesh.
Does anyone have any good tutorials that go in depth on how to do this?
Also if I click this button the whole engine crashes. It doesnt matter which version of unreal or project.
I'm at a loss on how to get these nav meshes working right.
I am trying to make my ai vehicle slow down when turning.
Turning is a float from -1 to 1, when the turning value is nearly equal to 0 I would like to increase throttle input value by a relevant amount, and when closer to -1 or 1 I would like to reduce throttle value by relevant amount.
Using floats in blueprints how could I do that?
It's actually really easy. You go into the project settings. Then to navigation settings. There is an array for supported agents. You then just create 2 and fill out the settings.
Hmm something else must be going on with the project or my code because this is where i started
ok this is weird went into a backup of my project and its all suddenly working
How would you implement SmartObjects considering optimization?
In my example there are 2 floors, when I am on the 1. floor the 2. one is , with it's SmartObjects, not loaded (LevelStreaming).
My idea is now to keep the BPs with the SmartObject inside the persistant level and maybe use the significance manager to turn most things off in order for the AI to still be able to interact with it. Not sure if that's the way to go though
I didnt use it but I'd go with however citysample went with
in the end its used on scale there in a huge city
I've had the issue where the nav mesh just isn't working, and I've just deleted/replaced one or just reset my editor and boom it works. Sounds similar to what you just went through haha
by "ai debug" what exactly are you referring to?
if you mean the gameplay debugger, eg. the one which overlays a bunch of text on top of the viewport - for it to work, you need to be in PIE and you must be possessing something, so if you detach from the player pawn, it won't work
you can also change the shortcut key to enable it from somewhere in options which might be worth a try because on non-US keyboard layouts the shortcut might be a bit weird iirc
we've had issues with the EQS debugger not opening on a non US keyboard in 5.2.1
I need to demystify AI somewhat.
This relates to StateTree but perhaps UE AI in general.
When i am designing an action as an instruction by name
For example Attack. Relative to StateTree, where would this instruction be designed? With the ST or with the character or AI controller?
I can also ask it like this.
However the instruction Attack is componsed.
For each sub instruction (walk to target, charge weapon swing, release weapon swing)
Would these be hierarchies in the state tree? Or would attack simply be one leaf state and there be stepping through sub actions of attack?
Anyone knows why the node Get Current Acceleration (AnimBP) don't works on AI?
it gets it from character movement
not animbp
https://www.youtube.com/watch?v=iY1jnFvHgbE
This video was really helpful for me on my first ai
In this presentation, Epic's Paulo Souza uses Unreal Engine's built-in AI features to build smart enemy behaviors for a game with stealth-like mechanics.
By relying on the Gameplay Framework in Unreal, we're able to quickly create convincing AI using Behavior Trees. Behavior Trees are great for creating complex AI that can be presented in a way...
I didnt some study on BT but not a lot of work. Ill see if the video helps.
i have previously looked at this and most AI solutions appear as if every action is broken down to their states.
state: running
state: running+attacking
Theres a node in the behavior tree to run actions in paralell. That attack node should run based on the condition of how close it is to its target
perhaps i ment a philosophal approach
what is the driver
the collection of instructions or the action by name.
Hi..
I'm using the Easy AI Utility Plugin.. And it works really well and fits my Flow..
Now i strugfle with a small thing, that seems to be a Problem of the "AI MoveTo" Node of Unreal..
On my Screenshot is the Task i created to make the NPC move to the last Known Location of the Player.
What i struggle with is the Thing, that "Aborted", is printed out many times.. And in the same time, the Last Location Value gets set to 0,0,0.. Which only should happen on Success.. (And yes.. The FinishThis is the absolutely only place, the LastLocation Value gets set to 0,0,0 in the whole Project)
And this makes the AI move to the World Center instead..
I'm a bit confused about that.. And maybe someone here knows, why this happens...
Woah since when does this exist
I had some kludge for this which converted the tag into FName and back again because it didn't use to exist :P
Although confusingly enough, it uses a Gameplay Tag Container as the Value instead of a Gameplay Tag...
5.0
duct tape
Huh? lol
No idea tbh. A container can contain multiple tags so I have no idea what their thinking was with this :D
BlackboardComp->SetValue<UBlackboardKeyType_GameplayTag>(KeyID, GameplayTagValue);
GameplayTagValue is of type FGameplayTagContainer... I wonder what this actually does...
Hm, it does actually somehow keep a gameplay tag container in there?... okay...
So it seems the "gameplay tag" BB type is infact... a gameplay tag container
Is it possible to have this node use a seperate navi mesh to the main pawn? I'm trying to have it path so that it gives itself some leeway
If you make the context object your AI controller, I think it should use its navigation settings such as agent settings etc.
So if it uses an agent which uses diffferent navmesh settings that oughta do it
But beyond that no - if you need to have more control over it, you would probably need to drop to C++ where you have more control over how the navigation query is done
Could be a navmesh issue or a bad vector. 0,0,0 could be above or below your navmesh. Try placing an actor on the navmesh, copy its coordinates and plug them directly into the AIMoveTo goal location
That's a good point...
But i really fon't want to place an empty actor judt for the location..
But.. That gave ma an idea..
Take that Last Location and find a navigatable Location inside a radius around that spot..
Worked well right now.
You donโt need to leave it there itโs just until you copy the coords
So you know youโre not telling your AI to move to an invalid location
Itยดs just strange that the Stimulus Location, that sets the Last Location on Prediction.. is not reachable..
the location is not invalid.. Or at least it does not fire the "invalid" print.. It just gets aborted..
Ok so since having a lot of control over what aspects of a pawn access which nav mesh is a pain without c++
Whats the easiest way to make a pawn try and keep distance from obstacles when pathfinding? In other words how do I keep a pawn from walking right along the edge of its nav mesh?
There is some way to see when is executed each service?
Because I can see the graph in action but I want to see how much gets to update...
Idk, you superimposed those streams so Iโve no idea if you plugged the print in the right place, not to mention you only really needed one print string
The point is to test with something other than 0,0,0
The 0,0,0. Ist the reset coordinate.. It's not the coordinate the NPC should run to...
Ok, where is the get runtime vector grabbing coords from and did you try printing them
The Location gets set in the Prediction sense Function of the AI Controller
and read back when the Investigation Tasks fires..
I see
the Locatio is correct.. until the AIMoveTogets aborted...
but on Aborted, i donยดt reset the location to 0,0,0
so.. there is something strange..
Pawn Sensing was replaced by AI Perception btw. Iโm not sure why youโre using these keys instead of just normal values but who am I to judge?
Try using the Visual Logger next
It should shed some light as to why your move is aborting
I'm not using behavior trees and systems.. So.. No blackboard..
I'm working with the Easy AI Utility Plugin
You donโt need a blackboard but yeah I havenโt used that plugin
Debug using Tools -> Debug -> Visual Logger
How do I make an AI move to a place that the navmesh hasn't loaded yet? I'm using a dynamic navmesh generated by the AI's actor to save loading time for generating the navmesh of the whole world, but I'm having trouble because this makes it restrict itself to objects that are within that area
Acceleration doesn't work for AI unless you turn on Use Acceleration For Paths in the movement component
The Prediction works fine... based on what i see in the Logger..
I didnโt say anything about prediction
I donยดt use PawnSensing.. i use the Perception system
I know, thatโs why I said that ๐
The AI should decide what action should be done and then tell the character to execute it.
AI being state tree or ai controller?
State tree if that is what you are using.
So in practice the states are instructions by name
And functions on the character are instructions executed
i really canยดt figure out what the logger is printing to me here >_<
I have a hard time working with both ST and BT by constructing executive decisions
i mean reaching the level of state vs action controll
It could be functions on the character. Or it could be in the character's components. I use GAS for attacks. So the AI decides which ability to use then executes that ability on the character's ability system component.
gotta read theabout GAS quick
GAS = gameplay ability system
i have some shallow knowledge about it.
never had relevance until now ๐
a quick look tells me that GAS might be what im asking for in terms of executive functions by name
I use GAS, because it handles animation replication. We also use it for the player, because of the prediction functionality.
Also because we don't want to write our own ability system when there is already one available.
i see
im not so versed in all that UE offers so i usually design from a blank actor
@uneven cloud is GAS the system that was only in c++ ?
it looks to me that isnt the case now. still reading
No.. just the base classes.. you can write all the functionality in Blueprint after that
It's not entirely C++. There is some setup that needs to be done in C++, but there is a plug-in available on the marketplace
rihgt
with BT and ST i never got past the point of doing move to and attack outside their basic introduction.
moving to target and attacking always felt a bit flimsy
you can click on each frame and see what happens. Try checking what happens before your move to aborts
I think before that.. i start this all over and try to be more precise in the States and their Tasks.. maybe i need to doublecheck the locations and void overwriting of older ones... maybe.. many maybes..
Since my head is melting.. I think i'll go to bed now and start a new try tomorrow ๐
could you perhaps point me to the plugin ?
You need to debug, visual logger is the best way to debug AI, instead of making assumptions and guessing.
the one i would guess! but thanks for confirming
"Blueprint Friendly, no need to dive into the cpp side, you can implement Abilities right away"
Just bringing it up again because it's too high
Youโre invoking nav mesh generation on your actual AI ? @timber pecan
You can't make it navigate if there is no nav mesh. You can make it move there, but it won't be able to avoid obstacles without some kind of a navigation solution.
I do not recommend putting invokers on moving actors. Invokers are incredibly expensive, specifically the most expensive navigation option, and it's made a lot worse to have them move.
Luthage how do you recommend doing a raycast as perception on multiple bones?
What do you mean? Does the perception system not do what you want it to do?
@uneven cloud
since you are on the topic. Would you recommend invokers for proc gen maps?
Because this object is not updating the perception, and as I see the sphere is on the chest of character
Sorry for my bullshit english
No. Invokers are expensive and they cause a lot of navigation bugs. Dynamic navigation is far cheaper. Just generate it after the world is generated.
ok. i assume its all within the navmesh eco system?
The debug sphere is on the root, because that's how the drawing works. If it's not seeing the target where you think it should, you can make your own sight sense.
Okay thanks I will try to learn how to
Yeah
Are there any better options? because I don't think the regular navmesh is any better because it has to be updated and the world is too big to be able to load everything quickly
Are you using world partition? If so, you should be using navigation streaming
I haven't heard enough about navigation streaming, AI is quite new to me compared to other systems so I'm much less competent when it comes to it
My biggest problem is that I have to rely on the classics of base building survival, the navmesh needs to be dynamic and not take too long to update as the world is constantly changing.
Thatโs what that system is for
i want something like when they are too far the ai ship make a rotation to face player ship and move towards it
Is that only for 5?
Yes. World partition is only in 5. World composition has a different setup.
I don't know how much it can help me considering that, I was sticking with 4 because I had a huge performance drop when I imported the project into 5, I had heard that 5 had some good functions for large maps but this event stopped me a lot, for some reason the post process and the shadow depth of the converted project became extremely heavy
I don't know if this is a common occurrence in projects made in 4 after being moved to 5
Where in the ai controller is the setting for which navmesh to use? I cant find it anywhere.
for context this is the issue. Green should be for pawn, and the highlighted area for drawn paths. just trying to stop it getting stuck on stuff
https://www.youtube.com/watch?v=-E21NmF5LHU
right now I have a system like that. Basically made a component that spawns an object and uses rinterp to match the look at rotation of the target actor it then rotates that vector. Than theres an ai move to to chase that object
You don't set it manually. It's based on the agent properties in the movement component. It finds the best fit nav mesh based on the settings.
Is there any setting to make it avoid the edges of the nav mesh? I need it to have some leeway since it steers rather than turns in place
Yes by changing the agent properties in the project settings to better fit your characters.
Well I increased the agent radius and it was constantly getting stuck.
You don't have it avoid edges. You make the edges valid. If it's still getting stuck then you need to adjust it more.
Ok that works with characters that turn in place like normal but here it takes time to turn. I dont know how to keep it from slipping off those edges than. I tried them at near zero and way higher. (the dot is its goal
Anyone know if theres a good tutorial out there or have advice on flying AI? I'm trying to make some birds~
that looks really nice btw
You need to keep looking for the right settings. In your earlier video there isn't enough room from your walls.
I'll record it with the extra room. The issue is it gets stuck still just farther away from the walls. I'll record another video to show what I mean
This is the same set up with the extra room from walls
https://www.youtube.com/watch?v=Bwd60odremM
Maybe I need to just build a new system where it precalcuates all the points and throws away the ones that fall out of the nav mesh
Just remembered that they use world partition and that handles SmartObjects automatically.
Thing is, I've chosen LevelStreaming because I want to stream stuff not only horizontally but also vertically, that was the reason I didn't touch it for a while
so the ai dosent need x y component?
can u show ur code
Do you have more than 1 supported agents? Where is the actor center? It looks like it's trying to navigate off the nav mesh.
Yeah let me go through it
This is the point to target component
and this is how it chases its target
I think I found something that hints at the issue. Will grab a gif to show what the problem is.
ahh ai move to
not working well with ship
So cranking up the distance of the chase target revealed the problem. I'm not sure how to fix it yet, but this is definitely the core of the bug. I think the chase point is whats fallling out of the nav mesh and thats why its freezing.
Ai move to node only work well with ai characters
Nice dragon
Its getting there. Once I have this issue fixed its gonna be awesome.
Are these other ships players? I thought they were npcs in your description
No no the ship itself is a ai
In first I wanted an ai character to control the ship. But later I realize that is a too complex task
I still think your solution is going to be a combination of 'get look at rotation' combined rinterp to. But I'm really novice
I used that in this video logic. When ai ship get 3000 meter away from enemy ship it rotate like this
But i want something like when the ai ship and enemy ship is are too far and then ai ship make it rotation towards the enemy ship and then move towards it
Quick question: Would I place a bool that stores true/false of a npc attacking in the npc class, ai controller, or blackboard component or it doesn't really matter?
I'd do it in a blackboard struct.
I'm interested in creating a project to emulate pikmins gameplay. I was attempting at first to have some primitive characters follow behind a player character using behavior trees to dictate their behavior, but they all favor moving individually as opposed to a group formation. I did some googling and found some people talking about a crowd simulation. Would this be a good fit for what I'm trying to achieve?
Does anyone have any suggestions (either for the crowd manager or otherwise) for where I can look into creating a system to manage 100 or so pawns individually and/or as a group?
iirc there's a plugin for crowd control in unreal, but never used it.
hey people i have a very basic issue on eqs. ive been searching but could not solve yet.
i want to find "the closest enemy that i can pathfind to"
the system seems to detect it, but the scoring is bad. im missing something but not sure what.
Is there a Delegate thats exposed for when the NavMesh is rebuilt in editor?
I want an Actor to run something when that happens.
try ARecastNavMesh::OnNavMeshUpdate
Thanks ill take a look
Is MainNavData on the NavigationSystem the best to listen on?
no idea. i know that when yo uadd a navmesh on the level you also get an ARecastNavMesh
What Id really prefer is a World delegate or something
there isnt that I know
Say in that course 'Learning Agents - Getting Started' after you start the training, isn't the vehicles only supposed to reset if they go off the track?
Because on mine it is reseting from what seems like the same distance in any given direction even if it's running straight down the track.
As far as I can tell so far, I haven't done anything wrong but it's possible I might have misunderstood something in relation to setting up the Spline for them to follow
is there a way to chain an eqs node ? eg "get actors of class" and then from the best spawn a grid?
BTService Event Deactivation: is it called every time the tree re-evaluates? So if it is on a selector, and the first task of the selector keeps firing, passing, and then the tree re-evaluating, is deactivate called every time if there is a service on the selector?
@celest python @hasty lake Ive decided to utilize FEditorBuildUtils::RegisterCustomBuildType
Which will trigger after a "Build All" is done.
Since I cant find any other reasonable delegate to subscribe to
So Apparently it's timing out, it is supposed to do that. I think you can adjust the a value on it to increase the steps but I'm not sure why the first time I ran it, it failed. I think it may be a bug or something related to communication between the python script and unreal idk.
I'm running it again from where I left off though and it seems to be doing fine
They are slowly figuring out how to turn corners
ok implemented this BT from start to finish now let's see if it works lmao
Hey, for VR I'd like to have a player navmesh and an AI navmesh.
Since I can't find any info about this online, I setup two different agent types under Project Settings -> Navigation System.
Should I now somehow create two navmesh area classes and set their supported agent types? Then just put nav mesh modifiers with those classes to demarcate player vs AI areas for navigation? Thanks
Hi, why, in a BT, at the start, the cooldown is returning "fail" directly ?
if I remove the composite node, it works
in the first case, i have to wait 10s before the burrow task is executed
in the second case, the task executes immediately then waits 10s before executing again
nobody ?
Would anyone happen to know why the nav mesh isn't covering this tiny bit of landscape? It is by no means more steep than other bits of the landscape, nor is it blocked by anything
UT_EmptyTargetLocation::UT_EmptyTargetLocation(FObjectInitializer const& ObjectInitializer) : UBTTask_BlackboardBase{ObjectInitializer}
{
NodeName = "Empty Target Location";
}
EBTNodeResult::Type UT_EmptyTargetLocation::ExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory)
{
if (auto* const Cont = Cast<AAIC_PM>(OwnerComp.GetAIOwner()))
{
if (auto* const NPC = Cast<APM_AI>(Cont->GetPawn()))
{
TArray<AActor*> Computers;
UGameplayStatics::GetAllActorsOfClass(GetWorld(),ACS_Computer_1::StaticClass(),Computers);
for (auto ComputerFinder : Computers)
{
ACS_Computer_1* Computer = static_cast<ACS_Computer_1*>(ComputerFinder);
if (Computer)
{
if(Computer->Status == ACS_1::Empty)
{
Computer->Status = ACS_Computer_1::Full;
GEngine->AddOnScreenDebugMessage(-1, 3, FColor::Red,TEXT("32"));
FVector TargetLocation = Computer->Chair_1->GetComponentLocation();
OwnerComp.GetBlackboardComponent()->SetValueAsVector(GetSelectedBlackboardKey(),TargetLocation);
OwnerComp.GetBlackboardComponent()->SetValueAsBool("SitSearch",false);
FinishLatentTask(OwnerComp,EBTNodeResult::Succeeded);
return EBTNodeResult::Succeeded;
}
else
{
OwnerComp.GetBlackboardComponent()->SetValueAsBool("SitSearch",true);
}
}
}
FinishLatentTask(OwnerComp,EBTNodeResult::Succeeded);
return EBTNodeResult::Succeeded;
}
}
return EBTNodeResult::Failed;
}
I wanted to check if there was a seat the player found and fill the empty computers.
and I tried to make a system for NPCs to move around randomly if they cannot find a computer, that is, if all the seats are occupied.
but
"OwnerComp.GetBlackboardComponent()->SetValueAsBool("SitSearch",true);"
this code here enables random location
characters only start travelling randomly
If I delete that code, they don't browse randomly at all.
I only want random navigation if there are no seats occupied
Anybody got any ideas?
You could run a service that checks if any seats are occupied.
Try widening it on the Z axis
for (auto ComputerFinder : Computers)
{
ACS_Computer_1* Computer = static_cast<ACS_Computer_1*>(ComputerFinder);
if (Computer)
{
if(Computer->Status == ACS_1::Empty)
{
Computer->Status = ACS_Computer_1::Full;
GEngine->AddOnScreenDebugMessage(-1, 3, FColor::Red,TEXT("32"));
FVector TargetLocation = Computer->Chair_1->GetComponentLocation();
OwnerComp.GetBlackboardComponent()->SetValueAsVector(GetSelectedBlackboardKey(),TargetLocation);
OwnerComp.GetBlackboardComponent()->SetValueAsBool("SitSearch",false);
FinishLatentTask(OwnerComp,EBTNodeResult::Succeeded);
return EBTNodeResult::Succeeded;
}
else
{
OwnerComp.GetBlackboardComponent()->SetValueAsBool("SitSearch",true);
}
}
}```
this Shouldn't he be checking it out anyway?
the first time they go towards the seats and then they start randomly wandering
Yea I tried that earlier, with no success though. I reckon it has something to do with the nav mesh resolution in the project settings and how it is being mapped onto the landscape. Something to look into at a later time when it becomes a bigger issue ๐ Thanks for the help though
Different question; The move to location or actor node has an async task reference output. Could I use this reference to, at a later time, cancel this specific move to node?
Where can I read up, what invalidates a nav mesh tile? I would be fine too if you could point me to some cpp code if the answer is long
They're somewhere in the recast related classes
FRecastTileGenerator, FRecastNavMeshGenerator and such
Bumping this Q... I could test it but it would take a while to be sure lmao.
Why not look at the source
I suppose I could search the project/engine for "OnEventDeactivationAI"
hmm no that's not it
ok si it is OnCeaseRelevant. so I will see what ceases relevant
ooorrr
u could just tell me ๐
It just says "service became inactive" as a comment, and it is hard to drill down farther into how or why those specific methods are called
is it inactive when it is decided not to execute it anymore? or is it inactive for any brief moment when the BT is cycling and not actively executing the node with the service?
I donโt know myself, sry
I havenโt tried this, but can you set breakpoints on the source code?
Sadly with breakpoints, at least in VS community edition, u can't go backwards lmao
I think in the paid ersion you can step backwards :\
The thing with UE source is that often, the trail is broken. It is hard to tell where or how a specific function is called lmao because somehow it is not called explicitly by name?
or it is just called by some obscure base class we don't know about?
like this little guy
๐ญ
in my short experience, the ReceiveActivation does not seem to get activated each time the tree cycles... but I could be wrong about that
"cycles" lmao wrong term
If the activation doesnโt fire each time Iโd suspect the deactivation also only fires once
I am not sure of it though I will have to verify just finishing up some things before I can set up a pure test where I can be sure of what I am seeing
Alright, so I'm following this guide 'Learning Agents - Getting Started' and it's saying it should be trained in 2 hours and it's saying also that the 'Average Reward' and 'Average Return' should increase over time.....but on mine they are decreasing further into the Negative with each iteration and I double checked to make sure I didn't miss anything, going back through the entire guide a second time.....
Anyone have a clue as to what's going on and why my Average Scores would be going further and further into the negative? Is it possible I'm looking at this wrong and a Higher Negative is actually a good thing? LOL
I swear I followed the guide to the T, I made sure everything was done just like the guide said. This is why I like videos though, it's easier I think to not overlook something when you can watch them do it
It may be working this time...idk for sure but I ran it twice last night with really bad results and errors at the end something to do with Training Failed
It looks like its coverint it, its just so low resolution that the mesh is underneath the ground
Yea that seems to be the issue indeed, something I will fix at a later time (famous last words)
It should work just fine as is. As long as there is a green mesh under those occluded regions.
I think deactivation might actually execute every single time the tree evaluates ๐
yeah this tree is MESSED lmao dammnit me and my assumptions
how do i add a gameplaytag to a character so that it works with behaviours and EQS? it seems to me that characters don't have a member or attribute to set them
You need to implement the GameplayTagInterface in cpp
cant getpawn() in ai controller
been having this problem for days... ive tried a lot
As I remember days ago, like suggesting to get the pawn while OnPossessed?
Because the pawn and the controller is not spawning by sequence, so it will be a problem you try to get a pawn at the beginning of the controller is spawned.
onpossesed wont let me access my blackboard though. it says my blackboard key is invalid
when in onpossessed that is
Is it a failure that you can't get the blackboard component? Or other reasons?
i think its a timing thing with the blackboard
It is the same. Because you need to RunBehaviorTree, maybe just put the whole block of your running behavior tree to onpossesed?
ill try that
When determining where to store information, is there a best practice? For example, if I want to keep track of how many resources my worker AI has collected, would it be better to save this in the AIController, or in the pawn itself?
Do you have any idea for more detail of your information?
Not sure if I understand what you mean. But if I want to track how much wood my AI has collected over time. Would it be better to save this in the AIController, or would it be better practice to save this in the AI pawn. Just want to avoid having to refactor the system later down the line ๐
Ah, okay. I mean it is not really related to the controller logic. I'd prefer to save it in the pawn. Just my personal opinion.
Gotcha, no worries, in that case I will follow that example too ๐
Hi! I have a question on combat. How do you deal with alerting the AI that the player or other AI is attacking them ? This is so they can dodge or do something else. I'm thinking tracing from the weapon during the animation but not sure
It can be done in many different ways depending on how you want it to work
If you need it to detect when someone else is attacking and before the actual damage has applied, then yeah you could trace from the weapon and use that to alert the target, or some other method of testing what the target might be
Hello. I am currently trying to run an EQSQuery off a component. I have went into simulate and enabled AI Debug Tools->EQS but it says that there are no queries running (and I also can't see any results.) However in the query's profiler window it shows the correct amount of executions. This is my current setup:
I have also tried adding tests that only scored results but it changed nothing.
Hello, I'm trying to make my AI move properly in the navmesh, however I have some problems. I have many AI character that should get to a point, however since there are many characters the ones that are behind always stay there, even after the characters in front reach the goal. I would like the AI to try to walk around others when they cannot walk any further, because other character are blocking them. Can someone help me with that? What would I need to do to achieve that?
On the picture there are 3 character that are always stuck behind others, and are trying to walk towards them with no success
You can try using either (not both) RVO or the DetourCrowd AI Controller
I'm trying to use RVO with 250 consideration radius, but it doesn't seem to work properly ๐ฆ I've tried to use lower radius values, still no success
I'll try to use detour if it's the only option left
Turn off RVO when you do
Sure
Yeah, it seems to be better, however my characters sometimes do weird movement, and are pushed away in a non-natural way
That could possibly be related to the controller/pawn rotation speed. Set your CMC rotation speed on the Z axis to something like 360-720, and ensure on the pawn, the setting to use controller yaw is NOT checked.
And instead check the setting on the CMC to use rotation i forget what it is called
The thing is that it's already the case. Rotation rate Z is set to 720, and they're using Orient Rotation to Movement only
u must ensure the pawn setting is unchecked or it doesn't work
this looks like lyra. I am familiar lmao
Yeap
go to the character BP
on the pawn there is a setting with the word yaw and controller
disable it
That's it, that's the AI character
I'll give it a go
nvm ๐
they aren't usually right beside each other I didn't realize u filtered the page lmao
Yeap ๐
is there anything else setting focus or anything on it?
Well, it doesn't really seem to be the issue
wdym?
hmm yeah but there does seem to be something weird in the way they are focusing on things
I get that when the character goes from focus to clear focus
They essentially walk towards the box that is the most distant relatively to them
they snap back to their movement orientation
wdym? Once they finish walking, the don't do anything
not movement orientation I guess
Like when my bots are "SetFocus" on something, they watch them and turn smoothly
Oh, I don't have any focus
but then when the ClearFocus is used, they snap right to the normal controller orientation
hmmm ok
how are you commanding the move to?
is it to an actor?
I have a BT that determines the farthest cube, and all it does is move to towards the cube actor
yeah that causes them to set focus on the actor
use the cube location as a vector instead
they won't look at it
kk
like maybe use an eqs to find any cube actors and add them as movegoal
then it will be a vector
if movegoal is a vector, that is...
It doesn't seem to be the problem either. Now they're using a location instead of the actor in the moveto, and it's the same
it looks like you have things fighting over the focus/rotation
it might be related to rvo, try disabling it, but I think it is a symptom of another problem that is highlighted by RVO maybe
The log btw looks like that
LogCharacterMovement: Foe_Fishman_C_11 is stuck and failed to move! Velocity: X=-29.67 Y=-26.82 Z=0.00 Location: X=1771.20 Y=571.74 Z=120.60 Normal: X=-0.96 Y=-0.08 Z=0.28 PenetrationDepth:5.288 Actor:Foe_Fishman_C_14 Component:CharacterMesh0 BoneName:fishman_index01Left (31 other events since notify)
LogCharacterMovement: Foe_Fishman_C_5 is stuck and failed to move! Velocity: X=39.99 Y=0.63 Z=0.00 Location: X=3356.86 Y=210.14 Z=121.90 Normal: X=0.78 Y=-0.56 Z=0.29 PenetrationDepth:1.552 Actor:Foe_Fishman_C_4 Component:CharacterMesh0 BoneName:fishman_middle01Left (39 other events since notify)
LogCharacterMovement: Foe_Fishman_C_14 is stuck and failed to move! Velocity: X=-57.61 Y=51.47 Z=0.00 Location: X=1903.36 Y=515.99 Z=122.49 Normal: X=0.93 Y=-0.36 Z=0.10 PenetrationDepth:5.707 Actor:Foe_Fishman_C_11 Component:CharacterMesh0 BoneName:fishman_handRight (0 other events since notify)
LogCharacterMovement: Foe_Fishman_C_6 is stuck and failed to move! Velocity: X=38.21 Y=-11.84 Z=0.00 Location: X=3385.01 Y=404.38 Z=120.10 Normal: X=0.66 Y=0.68 Z=-0.31 PenetrationDepth:1.791 Actor:Foe_Fishman_C_4 Component:CharacterMesh0 BoneName:fishman_head (4 other events since notify)
I'm using detour for now
With RVO it was worse
ohhhh
I have never used detour but I think it technically uses RVO kinda but yeah
I think that is simply highlighting some other issue maybe even something is being triggered in the animation bp
wdym? By ABP is essentially one single BS1 with locomotion, like idle, walk and run
With no root motion or whatever
oh ok I don't know in specific, but ABP can take in any value really and do stuff with it. Velocity, acceleration, angle, etc so anything could be messing with that
bvut if you have a clean simple one, it won't be the case
๐
I'll try to look for the warning on the forums
Perhaps something will come up
Sadly, I didn't find anything really. Only a few questions rather than answers ๐
So the "Move to location or actor" nodes are giving me a headache. Could someone explain to me why this node continues to execute even though a different Move To node has been called? is this because it is being executed on a seperate thread and persists in an order of priority, executing its most recent move to request before finishing the others it had running?
You need to use stop movement if you want it to abort, otherwise itโll keep going.
Right so, I need to do this before I activate any new move to node to ensure the AI always moves where I want it to move?
Yes
Okay, thanks for the help, then I will do that ๐
after the initial MoveTo completes my AI fully stops before starting the MoveTo node in the simple parallel, what can I do to get around this?
it seems its intended to be that way, ai stops 100% of the time when move to is finished before starting the next move to seems like i gotta make my own logic for it
you can change the BB key that the moveto is moving to and it can watch that key for changes in value and update the move
Switching UCharacterMovementComponent::DefaultLandMovementMode to from Walking to Navmesh Walking fixes the pushes, however the character that are behind are stuck regardless ๐ญ
Hi all, I'm trying to optimize a game to run with 45k pawns at the same time, with 10โ20% of them moving at any given time. Is node "AI move to" optimized enough, or do I need to use a BT?
I donโt think thatโs a consideration
The BT MoveTo and the AIMoveTo are virtually the same afaik
Ok, thx
you need to use mass and forget about pawns
All of them will have their own separate data and needs. It will be an airport sim.
#mass is great but very much still being worked on
Theyโve got the best people on it tho ๐
Ok, i'll look into it
Turn on Use Acceleration For Paths in the movement component and adjust the deceleration speed.
I have previously been using an EQS to find perceived noise locations. I have a need to gather both the actor and the location of the noise (in case of a bullet hit), but I still want to use EQS to choose the best sensed actor based on tests like distance, etc...
How can I set it up so that the EQS selects the most relevant noise location, and also can provide the actor associated with that exact same stimulus?
I can't do it in the custom generator, because I don't know which generated noise location ultimately becomes the chosen one?
Is it possible to set the stimulus itself as an object in a BB key? Then just get it when I need it? But wait then that doesn't contain the actor either ugh lmao
Should I be making a custom struct to contain both the actor and the location?
How to setup different nav meshes for different agents? I want to make some areas traversable by AI and some by player (VR teleport)
- Have 2 agent types - 2 nav mesh bounds volumes (each supporting one agent type) - this doesn't seem to work at all and in the editor only one RecastNavMesh is visible, the other won't draw
- Have 1 nav mesh with 1 agent type for everything but use filters somehow to divide into "player areas" and "AI areas"?
Thoughts/help please!
I think I will just immediately abort lower to a HeardActor is set subtree. Then, the first thing I do in that subtree is set the noiselocation from the last sensed noise from the HeardActor. Should catch it in time and be accurate
is there a simple way to run an eqs query with a blackboard actor as the origin?
i have an ai, with a blackboard variable for enemy, i want to generate a grid around the enemy, not the ai.
Yes, of course
You need an environment query context
may i ask a question here?
yes
you mean like this?
https://docs.unrealengine.com/5.3/en-US/eqs-node-reference-contexts-in-unreal-engine/
should i make a class to get a bb key?
im assuming there's no generic class that does this. right?
can i change a key's name in my blackboard after its been created
my ai is not detecting my character
Iโm not sure what you mean but the docs should help quite a bit
Yeah go to the blackboard and rename the key
Not sure thatโs gonna help you detect the character tho
yeah
thanks :)
probably not lol
my AI isnt chasing but i am not sure why i gotta do some looking around
Press โ at runtime for gameplay (AI) debugger
im sorry where do i press it
At runtime
at runtime?
Yeah like when you run the game
oohhhhh
Itโll give you some info like whether or not keys are set properly
Ai perception, eqs etc
you want to see or something im very new so idk how to say whats wrong yet
its not detecting the player with the pawn sensing
Use AI perception, pawn sensing is ancient stuff
Just follow the docs to the letter
Especially the affiliation part
Also 3rd link pinned here will show you how stuff is done
so i found out how to crash the game
i dont understand how to get the sight setting menue to edit the sight settings
You add an AI perception component to your AI and go to itโs details panel
where are the details to the ai perception
I just said above
i only see the basic ones not the ones to change the sight details
im sorry im just confused
Did you add an AIPerceptionComponent to your AI?
Ok, so do that part. And then you want to add a perception stimuli source on the actor you want to detect
And you select which kind of source it is
o
Again the video and the docs go over all of this stuff so you should go through them carefully
ty
You need to set up separate supported agents in the project settings. Not separate nav bounds volumes.
oh boy
is there another way to show the debug ui without a key? my game doesnt capture the mouse and itล impossible to use a key. ive tried like 5 different hotkeys on the settigs.
I'm learning EQS and have a quick question just to validate my approach.
I made a pretty basic AI that runs away from my player and hides, I generate a grid around the AI, do hit tests to the player to pick a point.
I wanted it to be a little better, so that it would get close to the object it's hiding behind. I made a task which takes the winning EQS position, performs another line trace to the player, and updates the new position.
Is it possible to do this entire thing inside EQS, or are we limited by initial generated positions.
Question. I've found for most of my AI needs an FSM works really well. What kinds of games would suit BT or FSM and why? My games tend to have AI that is quite simplistic and predictable by design. Do BTs start becoming more useful when AI needs to think a bit more?
Someone hates BT loves FSM and someone is the opposite. But BT is basically good for adding more states or patterns you want the AI to be. However, in FSM, if you add a new state, you have to consider about other states to switch to this state or not.
Yeah I'm not keen on casting it as good/bad, since each will definitely have their best use-cases which is what I'm hoping to learn more about.
So it seems like BT is better for more flexible AI
For my games I often want players to have predictable outcomes
I suppose that's one end of the spectrum, and the other end is fuzzy logic
Yeah, for instance, you have an enemy design with different combat skills and movement. In this case, behavior tree is much better than FSM
You want to tweaks the combat feelings during developement
BT = Sandbox/fluid environment where you know all posibility on a top-level layer and able to prioritize (half life alyx & stealth games & simulations)
FSM = I want to jump from a node to another arbitrary node (more scripting & more flexibility & DOOM Eternal is a good example - wouldnt want to do that AI in BTs)
At 2023 modern game engines combine tools so its never one works and other doesnt
Hmm the way I design my combat/abilities is actually detached from the AI. I'd have different FSM for a ranged character compared to a melee character, but different melee characters would very rarely require different logic.
Yeah, that's what I meant, sorry ๐
There's one plugin for Unreal IIRC
I use Logic Driver Pro, its rare to see a marketplace plugin made with such great knowledge/foresight/design
I like doing everything in the graph without carrying things to code classes, so I would like my combat system in LogicDriver
This plugin is rad.
The dev is actually amazing
You can use BTs without coding too if you want
Unrelated to AI but I was even able to make a GAS based melee combo system while using it just for designing the combos and link detection
BTs are not feasible for my combat system
even if its so simple
I'd need more flexibility, so either my own C++ system or HFSM
Yeah, combo system is basically a FSM
That's a typical user case
problem with UE AI is its BT is designed to let you do things in BTTasks, so you dont use tasks as blocks to construct the behavior but encapsulate things inside of it. this cost a lot of flexibility when doing something other than paragon bot AI
meanwhile you're suppose to use BT and FSM graphs as scripting layers
I'm sorry I don't understand this well. Could you give more details?
Based on Mieszko (told us about this earlier this year in this channel) UE's BT is designed to encapsulate AI behaviors into BTTasks, rather than having abstract BTTasks that can be contructed individually to form behaviors in BT. So we're not able to chain tasks and use data efficiently like how we do in StateTree
If you used Kythera you must have seen tasks are more like functions in the BT graph
LogicDriver is also able to provide same design if you build your SMTasks with this mindset
but BT graph is designed badly
it limits us to blackboard selectors, AIControllers and blackboard component
I notice almost all gameplay dev jobs that involve AI are advertised with the need for knowledge of BTs
But I suspect that's because its what UE offers and not because its the best job
As it stands I've yet to make a game that requires BTs and tend to roll my own solutions that are better suited
Maybe I should stop avoiding those roles and just ask what their reason for BT is (or maybe I should just make a game using them already, lol)
You may get others from your AIController, right? Not limited to blackboard, you can actually get other stuff to do with your AI even without blackboard
well BT editor would limit you nevertheless
not impossible but why would you do it without writing editor customizations
one of the plugins I like: https://www.unrealengine.com/marketplace/en-US/product/behavior-tree-extension
solves some of the issues of UX
never encountered a client knows how AI works
but I also intentionally dont work with big companies to work short term
This looks like just adding a custom BTTask node I mean, you can do it yourself๐
its giving an interface to inner tasks
so you can edit and bind variables through upper layer
Actually, if you are using GAS, it solves a lot of these costs
Anyway, I like how the way BTs fallback rather than FSM, since you don't need to assign a specific state for it which sometimes is confusing or very difficult to tell in runtime. (Maybe you need to set a very complicated conditions to tell which state the AI should jump to though)
@pine steeple Hey, I remember that you're making a game about zombies, and I'm wondering how you handle their movement (I suppose that there is a lot of them) so that they don't get stuck. Do you mind sharing it? ๐
navwalking + custom checks on CMC to steer AI back to navigation if it goes out of navmesh
and significance manager to set tick rates
He explained that one day but couldnt find the message
tl;dr checking if AI is stuck, which means navwalking is not possible since its not on navmesh
then raycast closest edge on navmesh
and move AI to there
a system in UE to scale the tick rates
behavior LODding
Oh, I see