#gameplay-ai
1 messages · Page 154 of 1
Each ghost instantiates (creates) its own copy of the above Behaviour tree, and runs it independatly. It is not one BT instance for all ghosts.
right so the method I am using should work fine then
yes if your branches are set correctly
oh way hang on
does the AI do same thing it does with BT with the BB aswell
or do they share the BB ??
they dont share the BB
so they do same as BT
create there own copy
bassically at game start the AI passing in it's own Enum Values
show us where you set the keys
so we begin that image above in the AI Child
The AI Child set the value here which is passed into the AIC setup
The AIC then takes in the values and send them to the set of blackboard kays
That sets them here
Then the decorators make sure each Ghost only runs "it's Branch"
The Pink Ghost Runs fine with this
Red Ghost no work
Yet it's value is correctly set here
if I remove the specific Branch for the Pink Ghost the BT runs fine for next Ghost along
It's like the BT won't run unless the most Left option is allowing when it runs the scatter
It looks like you're using a sequence
if the blackboard decorator for the enum doesn't pass, it counts as the node failing
which means that the sequence entirely aborts because that's what sequences do - they only execute nodes until one of them fails
a selector node would be probably work better in this instance, since a selector will keep executing nodes until one of them succeeds
could you clear up something please
so Finish Sussces - would move onto next instruction in the sequence but not marked as success
or would move on to the next sequence so got up to first selecter then back down ??
then finish abort sends it straight to root to retry complete again ??
Finish Success and Finish Abort? You mean in a BT Task?
yeah
Finish Abort is used with the abort event only, it should not be used for the normal execute events
the Finish Execute node's success flag just controls whether the node counts as success or failure
so if i say have AI Move to and the fail
Been banging my head on AI issue for a while figured I would reach out. I have some back melee ranged AI that I would like to try’s to swarm around the player. I think maybe 5-6 would circle the player nicely. Then after that they could kinda just line up or what not since there wouldn’t be any space. I have been playing around with the detour crowd controller and EQS but I can’t seem to get a good result at all. Wondering if anyone could share an approach or any ideas to get me kickstarted.
lets say I want it to go to next thing on selector above not go back to root I would use finish execute not success
but if I wanted it to say go back to root to come back down I would finish abort like forcufilly go to root and retry ??
It would probably be best to not try using your tasks to control what happens in the tree in this fashion
The success flag should indicate whether your task completed successfully or not
and if you need something to happen depending on success or failure, you can do it using the appropriate BT nodes like wrapping it in a selector, or using a force success decorator, etc.
but like, isn't each ghost behavior fairly unique? you can consolidate similar behaviors in subtrees and build up unique trees per ghost with said subtrees
have you looked into RVO?
so technically yeah each ghost has it's own behaviors that are based on simple behaviors
so chase / Red aggressive / Pink Predict for example
all have goals of catching the player but different ways of doing it so red is simple get actor location and move to player. Pink is predict there location go to location hoping to meet them there
this seems like 4 unique small trees to me
tbh thats what i was palnning to do
each ghost has it's own tree but all use same BB
I enabled it on the AI character movement component. But it didn’t correct the issue really… lots of jitter and extreme slow down when pathing around each other at times.
but for some reason i ended up doing this with decorators controlling flow of which ghost can do which branches
sounds about right
also your refering to having the run behavior dynamic in the BT just seen that
that's all I have for this. I generally think this is a design problem before it is a technical problem
I mean when you spawn the ghosts, they would already have unique trees
they do thats what was mentioned further above
but you can use RunBehavior of the static kind to add subtrees
they all have there own copies of the one I set
but that's just one tree
whereas I'm saying 4 different trees
with some similar behavior
e.g. when a ghost gets killed is the same for all ghosts
well the killing of ghosts so far haven't sorted
but i am close to begin implementing that tbf which is simple code in it self as literally it's a destroy of actor pretty much with maybe a call to ghost manager that it's died
so here's my take: each ghost has unique active behavior, that is part of their respective tree. the remaining ghost behaviors can be classified as common ghost behaviors that can made into subtrees shared between all ghosts
is there a way to tell the pathing to never allow the ghost to turn and go back on it self ??
so IMO the work is to separate what is common behavior and what is unique behavior
i may implement tbf
the pathing has no jurisdiction over ghost behavior. only the ghost AI itself has that jurisdiction
that's fine
bassically I looked up the Ghost and there movment is so they never turn reverse
they will always path in the Forward direct but if they wish will make left turns to be able to come back on itself
so IMO I'd save the previous navigation query's direction and when doing the next navigation query, ensure that it cannot go against the previous direction
I agree. Pretty new to behavior trees but I understand The components (services, queries, tasks etc…) I was trying
Query (Area around player)
Move to that location
Move to player from that location.
Seems like I need to make a queue around the player that could assign slots to enemies but that gets a little confusing when I think about the player moving. Also not sure where these things should be housed in the BT framework.
what you probably need is an AI director handling this
so the AI director has each AI register themselves to it when they spawn
and from there, the director can give high level directions for what the AI is supposed to do
for instance, create formations around player etc.
can I even grab the DIrection Query ??
oh yeah
Movement Result
I don't know I don't use EQS. I use my own system
Is AI director an unreal component? Or just logic I would drive via gamemode?
yes but keep previous point you've moved to as a variable, and then check against it with the current position so you don't move back towards it
it's an abstract concept. I've made mine using subsystems, which seem particularly geared towards something like this
I would also generally be careful with using any of the given AI stuff as most of the implementation seems half assed at best
I've created a custom perception system (that links AIs to the director as well)
and use BTs with custom tasks and decorators
hmmm
wondering now how would i take the old location and the new location and work out if that would cause AI to turn 180 as it were ?
So I wouldn’t be stating Behavior Trees. The director would be micro managing each ai? Sorry for dumb questions. New concept for me.
find look at rotation between old location and current location, -> to forward vector -> dot product with current forward vector. if it is -1 or near that, it is going backwards on itself
each AI has its own behaviors. the director doesn't care about how each AI behaves. the direction gives high level instructions for complex behavior. for instance when one AI doesn't have sufficient information to do something. like in the case of formation, the AI director knows the formation, and delegates each position of the formation to different AI. none of the AI know anything but their own location they have to move towards
got it
So at this point
the target is coming from the location the get reachable point has found
use GetActorForwardVector for the second pin
So that
well or you could say get owner actor
oh haha
either would work you think
or would be safer just to do get owning actor
so as this is on BT task it won't allow owning actor
but this method still grabs the right method so should be all good
always safer with a direct link
blackboard values can be null for whatever reason
well at game start the actual ghost set there actor refs etc
if owner actor is null, the tree won't run in the first place
so there will be a link
yes but if something flushes that
the fact that it can be flushed in the first place even
I always use owner actor
for self
I can do that but to get that node i've had to untick the thing that only shows node that should be shown
you can get owner actor from OnActivation and save it as a variable
not seeing that node
you have to override it
oh nevermind stupid me
controller pawn is what your refering to on the recieve execute
Not from what I'm seeing here
the Recieve Execute AI passing through the ref of actor running the tree
if it's a task you'll have receive execute
so should work
if it's a service you'll have receive activation
well that answers that then haha
it's task this
so if I say if DOT is nearly Equal to 1 with error tol ____ = True I can allow it to proceed
-1
Right that should be all good
Thanks. I will give this a stab
if you imagine a circle with radius 1 around your actor, the dot product takes the projections of two vectors onto that circle and tells you how far they are apart. if it's 1, then they are the same. if it's 0, then they are orthogonal. if it's -1 they are opposite
right so
generally, try to do things on true instead of on false
i've put in a Not
yep
so it flips to use true as I prefer that aswell tbf
no it's completely limitless
that's why we put in the bAllowSentience bool
it's our only weapon
no of course the AI is limited
but you'll need to specify your question
Basically I planned out a scene in a game where the player rushes towards a door, it slams shut, and the ai teleports behind it, and then walks towards the player, basically im asking if its possible to switch between teleporting and walking whenever
sure
Yeah thats possible. Those sound like states and behavior trees are fsm
the AI doesn't care about that
or put differently
as long as the AI exists, and it has a behavior assigned to it, will execute that behavior
it doesn't matter if the AI is in a closet or on the moon
Ok more specific question
How can I create a "cutscene" to tell the ai what to do and WHEN to do it?
I don't want the ai just to do things out of order
if you're making a cutscene you're not looking at AI
ah
you're looking at animations
I mean
this doesn't have anything to do with the engine
I can't imagine setting up AI to do cutscenes in any engine
that's just asking for trouble
🤦 so you mean to tell me, I've been coding an ai system in C# JUST for a cutscene
when in actuallity I could just use tweening and stuff
yes
I feel stupid
ah dont worry about it
Timothy: Unity has a cinematics editor toolset you know?
explicitly for cutscenes and the like
As does unreal
In Unity its called CineMachine, in Unreal its called Sequencer
Unity's Adam Myhill demos the latest Cinemachine features at SIGGRAPH 2019, including Technocrane film camera rigs, CM 3.0 DOTS preview (with support for tens of thousands of active cameras), hybrid procedural/keyframe cameras for virtual production, the Mixer camera module, and a preview of the new Reactor module for driving games.
is there a way to force something to re-run the EQS if it is seen by the Player
so like the Ghosts are in frightened mode, they see player I want essentially the ability to say from MyAIC player is seen re-run EQS and move to new location
well like I said I don't use EQS so I'm not much help here
yeah I have it at the moment but it dosen't run like it won't force run if it's value becomes try it will work like another task
anyone good at EQS would i generate the location points around Player or around the quierer so the Ai ??
there is an EQS query task, it will fire once based on the EQS defined parameters, this sounds like it does not get called multiple times though, and that would be based on the conditions which tell it to perform again or not
it's there as a service so technically in this case it would be firing reapetly until obvs that brance itself stops getting called
Hey, I ended up banging my head against that for quite a while in the past. The general logic for the method I'm currently using goes something like this:
EQS to find units with gameplay tag of enemy faction within range (tests for closer distance and dot product with distance given priority);
Search through each enemy and see if they are already engaged (each unit has an array, currently I allow up to 4 units to be added to the array, however, I sort through each unit the EQS returns to prioritize unengaged enemies and avoid unnecessary clumping);
If not engaged unit is found, break the for loop, add yourself to the engaged unit array and set that unit as your "TargetEnemy";
Use EQS to generate a circle around the Target Enemy (EQS tests for overlap with pawns, number of points determines the number of potential places the AI can go to which also helps to avoid overlap), set point as Target Location;
Move to TargetLocation while monitoring the overlap point to see if someone else arrives first;
If either the engaged unit or moving to target location fail out, then EQS around TargetEnemy and create a much wider circle of possible locations around TargetEnemy, move their and enter an AwaitingEngagment sequence which waits and periodically re-runs the "search for enemy" task.
I don't know if that's optimal or helpful, but I don't have clumping anymore which is nice.
that looks like they will sort of move, but on the next check, move somewhere else and so on. since the repeating service time is so short, i dont imagine they actually move much but just sort of wobbly indeterminately. is this correct? I dont recall reading how exactly they are behaving.
so when they are in that branch
in normal Pacman, the Ai return to their "home domain" which is one of the four quadrants of the map, one for each ai
so that's what I've now implemented , everything I have seen it's to centre. but the frightned state EQS is working wierd
working wierd?
SO when the EQS runs they are moving to locations but dosen't seem to be the right and if I email the trace thing I can come into there view but they don't react say rethink there position and turn elsewhere
alright, thanks, was gunna ask to see the eqs setup. So what are you feeding in as the Context? Querier would be the owner of this BT
the querycontext is get player character as well, so would i be correct in saying the points generate around me
ah ok
yes, the eqs will appear around the player in world
im not 100% but im guessing the eqs will look for the furthest point from the player?
it's a bit annoying when using a context object, but if you change it to querier and test the look of the eqs using the eqs pawn, it should show the query
yeah at the moment it tried to do that
hope that's not vague, im seeing how much query gets thrown around
great, alright thanks again, this helps me understand whats working right and whats not
awsome, it seems the distance is working
it favours greater away but the trace of can see seems bit weird
this eqs looks right, assumable when its the player that gets it too, maybe debug while playing to double check, so it does come back to the eqs service being run
hmmm i did try to debug but it didn't really help, let me try again
yeah, its not the smoothest when playing. i notice if you press ' after a few seconds it doesnt really show
i typically work with one ai so i can see the bt and then press ' right away
well it's more so the debug only appears when looking through camera
like camera player will look through
ah yeah, the eqs pawn shows the eqs works
but to test in game is to make sure the player was found
be sure to set that back on the eqs query obviously
i still think... #gameplay-ai message
brb
i just tried it's a bit touch an go if i'm honest
so i think i'm trying to much
just watched someone play the game and when in danger mode they just random move around don't actually try stay away from player and also it seems the danger mode is just so you can eat them nothing more it seems
obvs theres boost of points along with it
gotta run for now, but if i can, i remember a thorough breakdown of pac man that i found years ago which described the enemies in great detail, ill see if i can find it
i have found something tbf which provide a lot of help it's transalting it into UE4 which some bits I'm getting caught on
but yeah still happy to look at it
"Frightened mode is unique because the ghosts do not have a specific target tile while in this mode."
doesn't look like there is a section on Frightened, but searching "fright" shows up all the details
Hello,
I am having this issue where the sequence on the far right runs before the "Compare Blackboard entries" fails which is THEN supposed to run the sequence on the right.
repost
indeed it is. what have you tried to debug since last time?
behavior trees run left to right
this is the order they run in
you cannot change the order
but you can change the nodes
left to right....?
sorry yes
I am not changing the order. I would like the middle branch to loop until 2 entries are equal, then it continues on to the right branch.
it won't if the BB entries aren't correct
and tbh the compare BB entries is so bad of a decorator I had to make my own
So should I just make a composite and compare the 2 entries?
you could make your own decorator class sure. not a composite though
the force success is useless here
The force success is needed so that when the sequence runs, it doesnt restart the whole BT after it finishes.
so how you imagine that works? that it runs once, and the next time forces its way through?
It runs the first branch (InitializeMaxVariable), then it goes to the middle branch where it will loop infinetly allowing the AI to continue moving to different shelves. After each shelf, the index is increased, and once the Index and Max Shelves entries are equal, the decorator will fail. However, by this failing, the entire bt is restarted, so a force success was added so that although it is failing, it will still run the last branch.
This is for selectors.
it's for everything
all the composite nodes work the same
the difference is selector needs 1 child to succeed
sequence needs all children to succeed
and simple parallel succeeds with its main task completion
So what should I do differently to get this to work properly?
remove force success, make your own decorator instead of compare BB entries
no idea what your ai is supposed to do but seems to me like it should be selecting to either find a shelf or find a register, not sequencing them one after the other
The ai goes to the register after it has been to all the shelves.
the ai goes to the register if it has satisfied some criteria that means it should go to the register
keep in mind your root node is a sequence so all 3 nodes have to succeed in order for it to be a success
and the ai goes to the shelves if it should go to the shelves (high priority/checks first)
in fact i would probably have going to the register as a higher priority
going to the shelves is the fallback behavior
but can make either way work
I mean I'm not going to dictate design
maybe it's a bad store AI
designed for a worse customer experience
maybe the onus is on the player to teach the AI the error of its ways
and lead it to the promise land
I am still confused. Sorry, dont work with BTs often.
In theory this should work. After initializing some variables, the ai goes to a shelf and will keep going to a different shelf until the index is = to the max amount of shelves. It then will go on to the register.
So I dont see why its not working.
I would put the initialize values outside of the main sequence you're running
and slap decorator on top only to do that IF the values haven't been initialized
I told you why
I am unable to do a blackboard based condition for the max shelves entry for when it is set as type is an integer, so I can only check it its equal to a value.
you can make your own decorator class
you aren't forced to use the built in ones
I'm telling you this especially for compare BBEntries because it is not great
Just curious if anyone else has encountered this and what their approach is: when I want to use a simple parallel node in a behaviour tree to update a movement location I always run into this situation where I need to get the location before entering the simple parallel (otherwise the MoveTo fails and the parallel aborts). However, in order for the simple parallel to work properly I can't have a "Finish Execute" in the node that finds the location to go to. So I end up needing two identical versions of the task that finds the movement location, one with a "Finish Execute" and one without. Am I just missing something obvious?
I have created new decorators and rearranged some of it, but sometimes the ai will only move to the correct amount of shelves, other times it will do more/less.
right now it will always reinitialize the values because you don't have a decorator stopping it. you still have force success which still doesn't do anything for you. you should probably have you comparison before the loop
guys blackboard can't take multiple values can it ??
what like an array?
yeah
so i want an array of location
the array location would be for when the Ghost go to there corners they do a patrol as it were
could i have the specific AI_child have it's patrol path points and then pull them into a task on BT maybe ??
I'd say keep the points external and load them in, in a task, as needed
I have a more complex setup for this
so the task has the points not the BB
which would probably take a while to explain
and would be completely over engineered for pacman
lol
I can do the task thing I would just have specific task for the 4 corners
just wondered
the task doesn't know about world locations
plus the patrol points would be hardcoded for now so
yeah exactly
i can give it vector for know places
exacly haha
I have shit like an AI director that collects and distributes roles to AI. each role has a set of points
but that would be way overkill to do
yeah I could do simple version of that technicallt
at game run time I tell AI Director to give the spawn AI there patrol points. Only thing I would need is how would I grab the right AI spawned for the points to be given
I could loop through all actors and match up the actor name with the locations it should have possibly
the idea behind the AI director is that the AIs self register to it
I can do that
I would leave empty array and on play the AI calls to Director says am I in the list if yes then woop. If not then I add myself
true true
well I can pass in the actor saying Hi
exactly
then check the actor saying hi within AI dorector are you in my list
how would i distinquish between wierd naming
what do you mean?
so I've found that the Ghost are not named simply so they may not be for example just
AIGhost_BlinkyRed
but might be AIGhost_BlinkyRed_03
or am I overthinking something
??
I would say give the ghosts an enum in this case for each name
doesn't need to be massively complex
it's just pacman
and then have the individual ghost have the defualt set to it's name
not pacman 2077
trust me i just wanna see if I can for once make something to level of playable etc, not releasing
@cobalt palm
get rid of force success
change sequence to selector
AI should consider going to a register to buy things (or whatever it's doing) as a higher priority task than browsing for stuff on shelves
use a decorator on the go to register actions/subtree which only enters if the AI has visited enough shelves, and set it to abort lower priority tasks
it's all good I think you're well on your way
I think your scoping has been reasonable all this time
which is rare
my plan is once tings work etc switch things up so it's not Pacman but something else that won't be so much copy of something else
haha why ?
why what?
the only way to learn anything fast is to make a 1000 player MMO with multiple interlinking servers across the globe (and one server physically located on the moon)
Did about 20 tests and so far this is working.
I heard the best way is create a character creator before you have any gameplay
sure. but consider this for future reference: the further right you go, the lower priority the tasks should be. the furthest right task should be mundane junk that the AI does if it literally can't find anything else to do
The thing about this ai is that everything that it does, going to a shelf/register is required. It is not a patrolling ai so it only goes to a set amount of shelves, then lastly to the register.
and you can set up the BT so that if some condition for any higher priority tasks suddenly are present, they can kick that low priority task out of action and take over
the difference is that you can use "my way" with any AI, including yours. you can't, however, easily set up "your way" for anything except your specific use case. what if you decide you want to add the ability for an AI to just randomly wander the store in between picking shelves to visit, a lower priority task? it'd be easier if you could just add it onto the right and tighten up the conditions a little for going into the higher priority actions.
it's just a mindset you'll pick up for BT's as you use them more tbh
Yea, will be something that will be needed however there are no tutorials on this that include the looped branch that is needed.
so two things
first, when you run the game, it's always wise to have the BT in a separate window so you can debug it easy, and you can see where it's going
second, the BT thread iterates over every node, and subnode in order
which means that if you have a condition before an infinite loop, that condition will have to be true for the loop to start, AND for it to continue
keep an eye on the order of your elements, it's written into the BT
hmmm i have slight issue i have succsefully had the AI Director register the Ghost into an Array
i'm then taking the array and looping through taking the actor in the array grabbing it's GhostType Enum
and then setting the PatroPoints but it never seems like there actually being set
where are you setting the patrol points?
and how are you distributing them?
so the AIDirector knows where all the Patrol Points are as in there vectors these are in Arrays
Like so
then as it loops through it takes the actor matches up its Enum then set the PatrolPoints on that specific actor
with the points from the ones the AI Director feeds to it
you can have a sequence running, with 3 tasks: request point, move to point, wait
request point requests the next point for the AI to move to
yeah
the AI doesn't need to know where that point came from
just where it is assentially
yeah so the Vector essentially
exactly
so it gets the vector. moves there. waits. requests a new vector
loop ad libitum
the requests could be sent to Ai Director which could keep track of the index it is on
now you're getting it
the AI should already have a reference to the AI director as they register themselves to it
I don't know how you built your AI director
could i case to base AI pawn that they all derive from or would it need to be specific to that relevent actor?
yeah
makes sense
if you do dabble in cpp I would recommend a subsystem for this
makes it ever so much easier
hmmm maybe in the future hahaha C++ and me have never met
I assume you have been doing programming before?
but i am aware alot of things are much easier defo loads of BB people start out then move over to C++
never C++ etc prob UE4 is first time i have in visual way got around of programming
maybe not in methods everyone would agree on
and yeah BP
but you've done other programming?
don't believe so
welp, you seem to have a natural aptitude for it
??
I thought you'd been doing this for a while
ohh haha
fair enough
tbf when not working I do spend a lot of time in front of my PC normally with UE4 open or taking in other peoples Devlog on there games. End of day it's all knowldge
is there a simple way in eqs to put weight on a location behind the target?
So it can turn around? Invert the score
either increase score based on distance from the querier or increase score based on dot product result of target's forward direction and direction from the target to the candidate point
My decorator is fail, but the Behaviour Tree won't execute the next node (Right Hand Side)
any idea why is that?
if bb condition failed when moveto is still active, it waits until it returns with success or failure before switching nodes
you wanna abort branch on decorator fail
anyone have any recommendations on the best way to create multiple AI classes? not sure if I need multiple controllers and behavior trees for each or if there is a more efficient way of doing things. I'm working on creating some AI that patrol on path points while others are more melee free roaming, etc.
i already add the abort self
but still it wont abort
you can just use 1 AIController and 1 BT just add parameter inside your BB to control the behavior of your AI
@stuck comet what do you mean by parameters? I'm not sure I see anywhere in the blackboard to modify the blackboard keys
it could be the same AI since, in bp at least, you can set the behavior tree when spawned (there a node for this). The consideration in doing so is to make sure both behaviors can be affected by the code of the AIC. Most logic may best be done in the task/services for this reason. This can work with perception and there will be some back and forth between the AIC and BT. And these BT can use the same BB because you tell each BT which BB to look at.
oh awesome, thank you both!
Hi. any tips on improving the walk-run animation to be in sync with the movement speed. It seems that I am playing by eye what movement speed a certain animation is ok.
generally I'd consider a new AI controller per different type, and different BT per subtype at least
hello, i'm using a smart link to detect when an AI should open a closed door (which has the navlink obstacle), but after that i want to give the control back to the normal path following so i use PathComp->FinishUsingCustomLink(LinkComp); after detecting that the navlink is being use, but he still remains locked in the nav link for a couple of seconds. how can i tell him to ignore the navlink?
another approach of fixing this could be to have a way to tell the current path to be recalculated
anyone know how to use FAIDataProvider for vector
or how to use FAIDataproviderStructValue
Is there an easy way to clear Blackboard keys without knowing the number of keys in the Blackboard?
@storm zephyr i had the same issue
glad i'm not alone 😅 do you happen to find a way to fix it?
i did
gimme sec
C++ or bp?
@storm zephyr void ASolsticeAIControllerBase::InvalidatePathWhilstLinking() { UPathFollowingComponent* const FollowingComponent = Cast<UPathFollowingComponent>(GetPathFollowingComponent()); if (FollowingComponent && FollowingComponent->GetPath().IsValid()) { FollowingComponent->GetPath()->Invalidate(); } }
thanks i'll get it a try 😄
@pine steeple did you call that function after the FinishUsingCustomLink?
yes
i assume that invalidates the path and makes the move to task recalculate it again without using the navlink
yes
Hello, i have a problem with to make not stacking mobs, how i can solve this problem?
I'm using behavior tree and Eqs but dont now how to customize them
Hello collective mind 🙂
I am trying to learn AI for characters in UE4. While I am familiar with VFX in UE4 ai is something foreign to me and I'd like to change that.
I'd like to make a quick prototype where a player plays fetch with an NPC pet. I have no idea even where to start.
I'd appreciate any pointers as to how is the easiest way to achieve this.
AIController derived class on the Pet
add a behaviour tree to the pet
or rather, run the pets behaviour tree in the blueprint
have a blackboard with a actor variable for the player and one for the fetch toy
maybe have a BB value for the distance between the player and the fetch toy
if the distance > some threshold value (also in BB), then run fetch sequence, otherwise run "return to player" and "idle" sequence in turn
might want BB value for the "have toy" status
fetch toy sequence goes to position of toy, runs pickup toy animation, then sets "have toy" in BB
have toy BB entry being true, causes "return toy" behaviour to be highest priority
stuff like that 🙂
TBH though: find and work through a couple tutorials first
Yep 🙂
@ocean wren thank you for the seudo steps. This is exactly what I wanted before going and doing a bunch of tutorials.
@simple crest yes, that is my next step is do tutorials. Any in particular that you have found useful for AI behaviour?
I don't but let me know if you find anything, I've been trying to find some information on how to use GameplayTags with it.
I think I would set this to be more stateful. what if you drop the fetch toy at your feet?
just learn the basics of a behavior tree. it's a bit convoluted to understand at first, but once you get it it's fairly easy to work with. left to right. one success or all succeed
CE: I guess that is part of the behaviour spec you'd want to work out beforehand..
Normally a dog would probably just look at you funny 🙂
@prisma prism the pins probably have some decent starter material? not sure otherwise sorry. note that most implementations for BT's are similar across engines, so any generic learning resource on them would help you get started or help better your understanding of how to work with them in general
Hello i have a system on my ai that chases the player. i want that to trigger only when it overlaps with a certain collision sphere on the enemy. I think i have it set up but its not working. any ideas?
i used to have the enemy follow the player regardless of there they are. They are still doing this and not following the overlap event
are you using behavior trees?
do you have navmesh?
yeah i have a navmesh, they currently chase me by default
Hello, I'm having a weird issue that I'm not sure how to go about fixing
I'm trying to make an AI using a BT that will chase the player, until they get to a certain range and then attack the player, thought it would be simple.
My issue is, the BT runs fine until it gets to the point that it should switch from chasing to attacking. I use a service to check if the player is in range, the service seems to run, the bool changes, the ai stop chasing you, but it seems to go straight through the sequence node and the just sits on the first task in the sequence, no matter which task I put first.
This is my BT right now
This is my isPlayerInAttackRange service
Here is to my sendtolocation task, I've tried all manor of differenct versions of this. The normal moveto, BTAI move to, changing this one, setting up different finish events
Here is my get player location
Here is where my BT gets stuck, after getting in range, the bool changes, showing that the service fired and has worked, and then it goes through the sequence, past the service and just stops there, forever
Okay, it would appear setting observer aborts to none, on everything seems to make it all work, I need to learn what the different observer aborts actually do because it's clearly not what I thought
so... turn them off until you enter that trigger box?
Hey, a couple random thoughts (I might be wrong if you've laid it out this way intentionally):
-
Your isPlayerInAttackRange service never sets the bool back to false, so if it returns true once it will always be true.
-
Your isPlayerInAttackRange is using receive activation, I can't remember if this is accurate, but I feel like receive activation calls the service once when the node is activated (maybe I'm wrong, I just know I've significant trouble with services when not running my events through the tick A.I. event).
Not sure if either of those will address the problem but it might help.
So the issue that stopped it from working was the observer abort was basically stopping everything when that happened, and I think stopping a tree with a move to in it starts getting funky. Also, the IsPlayerInAttackRange was correctly setup, with the output bool being set to the result of the lower than or equal too, but in my messy attempts to test and fix I ended up trying different ways to see if that was the issue and forgot to change it back.
Lastly your point about the isPlayerInAttackRange being fired once, seems to be correct this isn't an issue for my move to tree, which is fired every like 0.2 seconds. But this will be an issue for my strafing braches and others that are only called once... I didn't think of this so thank you for the heads up 😄
Anyone know why after unpossessing my AI does not work on Clientside but works on listen server
probably better to ask in #multiplayer
if you are on multiplayer UnPossess on server only
anyone know how to make movement between 2 actor that "Move to Actor" each other smooth ?
@stuck comet so how would you achieve this?
send RPC to server if you want to trigger it from client
for example if you want to to unpossess some pawn by using Input
@stuck comet i want to unpossess the ai after the death animation plays
Hello. I've got a very strange problem. I have a PlayerShip that I'm making AI for. If the player hasn't selected a location the vector is at 0,0,0. A service reads out the player vector and sets it in TargetLocation. Now when I try to find out if the player set a target the ship just disappears. If I add the first branch in the execution the ship disappears... any ideas?
I don't think this service affects the ship disappearing
Or rather, the combination of the position with whatever else the ship does is what causes it to happen
so it's kinda hard to say just based on this :)
It dispears just by adding that node.
But I understand it can be everything
But thanks for your help anyway
What does the ship do with the position?
It calculates a pth
path
the AI service
the ship doesn't do anything with the position
So nothing moves the ship or does anything else?
It does, there is an AI Task that adds a steering force to the next waypoint
Ill try remove that
and try again
My guess is that the calculation is wrong and the ship gets launched into the direction and that's why it disappears :)
Yeah could be
You can try seeing if the ship is still visible in the world outliner once it disappears, you can then detach from the player pawn and doubleclick the ship to see where it is on the map
Yup you were right
IT's in the add force thing
Thanks I can go further debugging now!
np
@pine steeple i tried your code but it still does the same thing, did i do anything wrong?
void ADoor::OnSmartLinkReached(UNavLinkCustomComponent* LinkComp, UObject* PathingAgent, const FVector& DestPoint)
{
UPathFollowingComponent* PathComp = Cast<UPathFollowingComponent>(PathingAgent);
if (PathComp != nullptr)
{
PathComp->FinishUsingCustomLink(LinkComp);
const FNavPathSharedPtr Path = PathComp->GetPath();
if(Path.IsValid())
{
Path->Invalidate();
}
}
}
i mean it works for me so not sure
not without debugging with breakpoints and visual debugger
no problem, i'll take a look at it, just wanted to see if you could spot something wrong with the code that i missed
no i cant :/
thanks anyway 🙂
One of the things that mildly annoys me about the pathing stuff with smart links is how do you use pathfinding within the smart link without invalidating any movement
I seem to recall if you do another move request, say to pathfind through the smart link, then it effectively aborts/ends any previous ones - so if you had say a BT Task asking the character to move somewhere... that has now failed because you tried to pathfind through a smart link
Hello!
Is there any tutorials/useful articles on writing custom EQS tests? I want to filter out actors based on their attitude (ETeamAttitude)
anyone know why my AI sometimes trip over like that
Look at the code for the existing ones. They shouldn't be too complicated
Yeah, that's what I'm trying to do rn
looks like a feature, not a bug 😉
LOL
any idea whats cause that
not at all
im using RVO,
are you debugging your behavior tree?
in my behaviour tree i use MoveToActor
ah i see
yeah you are correct
the problem is my behaviour tree
because after the target actor is dead, i put it below map
z axis -2000.0f
oh lol
it should be
Started learning and experimenting with AI perception. Anyone knows what exactly AI Team sense does?
It seems to broadcast the event to every AI which belongs to the team indicated in the event
but I'm not really sure what the intended usage is, because the event doesn't seem to carry any useful information.. it just has a field for AActor* Enemy
So basically it just returns actors that belongs to the same team in the map? In the Documentation it says that it notifies when the "same team is close by". But I'm confused because i don't see any parameters related to that
As far as I can tell if you broadcast a AISense_Team event with the team set as TeamA (for example), it just sends the event to all AI's in that team
it carries a bunch of data like the position of who sent it and such, and an actor ref to "Enemy", but that's pretty much it, so I have no idea how it's intended to be used :D
Oh yeah it does check for range between target and you as well
the code for it is pretty simple
ohh ok.. I'll take a look at the code. I want my enemies to stop colliding with each other's path. i am hoping that this will help
It might not.. you'd probably need to look into avoidance
avoidance? can you tell me more about that? also to add more context, I have an EQS generated around the player and the enemies stands on it's respective weighted location. but right now, they are bumping into each other. so wanted to fix that issue
rvo avoidance and crowd avoidance are the options which are built into the engine
but I don't know if they will solve that specific problem, they're more about just avoiding colliding into actors when moving about
ok, i'll look into that as well but i guess i have to write my own ai logic to try to avoid each others path as much as possible.
thanks for the information. saved my time 🙂
RVO will definitely help with that
I'm currently looking into it 😄 if this works i'll be so happy lol
@misty wharf @mossy nexus rvo avoidance worked like a charm! 🙂
how would I proceed to make NPC say something when they see the player, but make them not say it at the same time? How could I make only one say it instead of all if they detect the player at the same time?
AI director or sound channels
sound channels probably the more correct solution in this case
when it comes to dealing with groups of AI, you need a separate manager to determine which AI should do what
thanks! do u have any resources or a brief explanation on how do do that?
i think AI Director/Manager seems like the best way but how exactly?
genuinely in the case of sound it's not
for decision making - absolutely
but sound should have its own sound architecture propagate correctly, regardless of AI
I never used sound channels tho…u mean in the sound cue or somehow via BP?
digital sound has channels
u mean like stereo, 5.1, 7.1 etc?
I don't know much about sounds in engines, but wouldn't a simple sound/dialogue queue system work for his/her case? @mossy nexus
but the idea is that you either have a sound queue and or a sound channel for NPC voicing, and if that channel is in use, the sounds either queue up or get removed based on priority or sound type etc.
so if it's a low priority sound like a bark, only a single sound would be used
but if it's game critical dialogue, there would be a queue
the above is an implementation I've done before
along with a dialogue engine
I guess really it's an audio director at the end of the day
but w/e
Hmm, it looks like a nice thing. I guess not necessary for my project but still it made me curious about the 'sound channels' you mentioned. Maybe I'll look for it in the future
also to be clear, this is for actual audio, which is separate for "physical" sounds, that the AI can react to
So basically there are 4 NPCs seeing the player at the same time and on perception update they all say something. Right now they’re saying it at the same time. Should I instead send the voicelines into a queue in the audio manager and play only one from there?
and then play the audio at the NPCs location from that manager?
IMO the best way to do it is to have a wrapped sound object that contains the sound + auxiliary data like the speaker, location, direction, and physical sound attributes like radius and allegiance etc.
then when the sound plays, the audio director could play the correct audio, as well as notify the AI director of any physical sound
although one could argue that the notify should happen on the sound object itself, but I guess it's up to how you do your architecture
well i’ll try that out but i’m still unsure about how the whole thing would work. so the AI notices the player along other AI agents and then? They won’t play the audio instantly but send sound object to the audio manager?
technically you'd route all sound through the audio manager
and the audio manager decides what to play when
you'd have different channels for different kinds of sounds, based on sound hardware
so NPCs or conversation would be one, ambient sounds would be one, music would be one etc.
basically a way to layer audio
but we're way beyond the scope of this channel. IMO you should ask #audio
oh so ur saying that I use the audio manager for all audios, not only AI speech?
yep
so you don't play two pieces of music at the same time
etc.
two pieces of dialogue
or that one piece of dialogue can override and silence another
stuff like that
alright yeah makes sense…that’s my goal for now…thanks a lot, appreciate it.
makes me think I should expand my perception system a bit. right now I have EyeComponents that are glorified scene components because I can't always guarantee that eyes on an AI will be where you'd expect them to be (especially for non human AI). I should probably make an EarComponent and SpeakingComponent as well
i used sockets
and ensured all ai had the same sockets..
cheaper than scene comps
uhh sorry if this is a stupid question but how do I get the controlled pawn location from an EQS blueprint
can sockets be placed as components? because that's the key feature I'm looking for
sure but that requires everything to be setup at a mesh level
yeah but thats easy
and to be fair the components can be discarded at runtime for their transforms
we use the eye sockets/eye bones for other things also (in the animation)
so it just makes sense to use those
sure
I think generally for something more humanoid it's fine
but I'm dealing exceedingly with composite actors that aren't just a single mesh
so this kind of disjointed approach doesn't lend itself well to a single skeletal mesh, let alone static mesh
the EQS you call should have the context object set to querier, which would be the AI controller, therefore pawn, that calls it
how do I get the context/querier location from the eqs? I want to linetrace from there
the EQS returns the successfully chosen node, as far as accessing it in bp i dont know
the link above may help, but I think most applications of EQS pairs with BT instead of BP
EQS in BP's is easy. You use the Run EQS node, which returns an EQS query. The query has an event dispatcher you bind to
You can then get the result via the event, and get it either as locations or actors
oh I found out how, thanks!
Does anyone if the AI sight/perception stuff takes into account the light level? Is there any way of debugging what the AI controllers "see"?
I don't think light calculations are done for AI generally. you could, but I think it would either require some degree of render code to expose light values in a deferred renderer, using a forward renderer, or using some sort of light collision/trace based system where light values are faked
as for what AIs see: I don't know that there's any better way than "printing" the vision.
Printing like, using debug shapes on-screen to show the radius and cone?
sure. debug cones, values for alertness, targets being sensed. the whole shebang
or I shouldn't get ahead of myself. I use debug cones because they pertain to how I do perception
but I don't know what the perception requirements are for your project
It's a 2D stealth proto with v basic guards patrolling around. We want to have just a binary state "You're visible" / "You're invisible" to the AI, based on light level and whether you're crouching or not
top down? I see no issue with just having viewcones draw debugged and some target info.
I think I'd do a cursory search for light level based AI too if I were you. those approaches were the ones I found, but perhaps we're in a different time now where other approaches have been discovered
Hey guys, so I recently stumbled upon a very subtle bug in the AI sight perception system. On very rare occasions, the sight perception system will trigger that it successfully sensed a stimuli source (in my case the player) even though the source is nowhere near the bounds of the sight cone. This sometimes happens even when the source is blocked by multiple meshes from the AI character's view. This seems to happen rarely and I couldn't spot a pattern to it. It just happened randomly so it was almost impossible to debug. I ended up implementing my own custom sight perception, but I'm wondering if anybody else had experienced this anomaly as well? \
I've always wondered how Thief 1/2 did it. my thinking has always been that I would figure out some way to build a scoring system for every light... light's score goes from 1 to 0 as a sample point moves from bright to dim regions of light's coverage. A system would constantly track which lights are near the player and add up their scores to the player's position (also scoring zero if there is no LOS from the light to some point representing where the player is, e.g. linetrace to the player's location a bit above floor height)
Other way I wonder if Thief did it is by precomputing an entire map and building something that looks like a navmesh, overtop of a normal navmesh (navigable area), with each polygon having an assigned total brightness level. That idea doesn't work well with dynamic lighting though.
The engine Thief runs on, aptly named Dark Engine, was built from its core to pay attention to light calcs. The engine did not age well and could not scale for higher resolutions. Innovative for its time, the lighting calculations are impressive compared to other engines of the same time. It would calculate lighting intensity on the player if the light is marked as "dynamic" essentially a fully mobile light in Unreal. When Thief 4 was developed, using Unreal, it did not implement the same accurate lighting calcs, instead it was zone and triggered based along with some watered-down ray cast checks. The dev process demanded more of the lighting that the engine could not naturally support.
is that a quote from a website or something? it doesn't really have any useful info
(I know the Dark Engine more or less used the light value of the floor you were standing on)
(and yeah thief 3/4 were asstastic
)
yeah, best info i could find since the only way to know the tech is to get the game (its free now!) and crack open the engine.
How I have been doing AI sight with light is my player has a float var (Visibility), and the light sources in my level have their own colliders for detecting overlapping. If player overlaps with the collider, do traces to a specific socket on the Player, if hit then simply do some calculation and increase the var. If there are multiple overlapping colliders, select the highest value. Then in my AI sight code, I simply check if the variable is > certain threshold
Worked pretty well for me so far
The way you'd do the "light" stuff these days, is to render to texture from the lights point of view using the current light shadow map depth texture and render the character from the lights viewpoint doing a depth test, the pixels that aren't blocked by other geometry are the pixels the light can "see" from its point of view, so the proportion of those pixels are the amount of light the character is in (direct lighting at least)
most cheap implementations just raycast from character capsule to the lights
or raycast from points on the character to the light (using different points on the character over time to give some stochastic value to it)
light level would then be "percentage of recent light raycast hits"
The Dark Engine had a software renderer. light values were exposed as per such
see above
hey man, I loved T3. shalebridge cradle was fantastic
also let's never forget the Russian version of Thief, Stalker 🙌
(which had fantastic AI, when not buggy)
Thing is, for current AAA engines at least, you already have depth values from shadow casting lights, because thats how they compute shadowing (using shadow maps), so as long as you can grab the shadow map for each light, you can do the proper per-pixel lighting calc
Dark engine had hardware rendering of course but maybe you're meaning the lighting data was always built on the cpu first so it was available. I think they did just read the light maps or something.
Ok fine Thief 3 has some good parts but not the same 😄 I remember much of the game suffering greatly from "graphics outpacing gameplay" of that era
Was thief lighting entirely dynamic or was it based on lightmaps?
Ah yeah, it was dynamic because they had the water arrows right 🙂
I think nobody would really care for this though, it would suffer from classic "too smart AI is less fun" or similar issues
I don't think thief had any moving lights but stuff could change during gameplay yeah
Well, might as well do a better job than a worse one, it wouldn't change the behaviour, just look more convincingly "right"
Hm, so you could use lightmaps baked for on/off versions and store those.. then sample from the nearby lightmaps for approximate illumination values in space
OR, I guess you could do some light probes and pre-bake those like we do for irradiance caching in UE (pre volumetric lightmaps at least)
In current UE4 builds, you could use sampling of the volumetric lightmap and just increase the voxel density to get approximate lighting values in 3D space
or read the shadow maps 🙂
Modern render pipelines are freakishly powerful 🙂
And sadly devoid of artistry 😉
I think there's a big warning label on the function which lets you read from render targets and such about how it's very slow so makes me wonder how some of these would be done
I mean it's not slow enough to immediately be a problem but still
slow to transfer from GPU to CPU, so you could do a compute shader to actually compute the light value
do it all on GPU
You'd do it by downsampling so you'd just have a low res version of the shadowmap etc.
I've seen one or two articles about compute shaders but it seems like another of these things which is rather poorly documented and at least I would have no clue how to do that lol
Well, its like anything in UE, its hard until you know it 🙂
lol I guess so
We know its possible, so its just a matter of willpower
it had support for hardware acceleration but I'm pretty sure the engine was written with a software renderer in mind: http://nothings.org/gamedev/thief_rendering.html
I quit Looking Glass for a time; during my absence hardware acceleration support was added. (I came back and added support for colored lighting in the lighting generator and maybe the surface cache or something.)
most important quote But I don't know if we shipped with this or using the "check the lightmap value on the floor", which I seem to recall we at least considered using for the player's visiblity to guards (to avoid players being tricked/confused by places that appeared to casual inspection to being in shadow).
😄
that's definitely what they did, I remember hiding in super bright places just with dark floors
and that quote highlights what I was talking about earlier, where in some cases stuff being "made better" or more accurately etc. can result in worse gameplay
Yeah, makes sense for the time, lightmaps were pretty defacto and sampling from them was a simple matter
Hi guys, Found a really good video from a Square Enix AI dev https://www.youtube.com/watch?v=BV2GTGbSjq8&t=2426s
Unfortunately, it's only in Japanese, It will be great if anyone can help me out with translating this into English. Ping me personally we can discuss further on this. If anyone is interested
I saw the original presentation in english if that helps
One of the sqeenix guys did a talk at either the aiGameDev.com conference or Nucl.ai conf (it changed its name)
Really? Can you give me a link?
sadly not, Alex let the site die, so the videos aren't available anymore
damn me 😦
yeah, was an amazing resource, but I think he got a bit bored of doing game AI for so many years 🙂
Currently working on Enemy AI on a hack n slash game. Its so hard to find relevant information on EQS. Everything i find its just so basic
Yeah, the TLDR from the talk was basically "we use EQS a lot" 🙂
@ocean wren Yeah i know, that's what i wanted to know 😦
Let me know if you have any other resources which can help my situation here. That will be so great
have you tried the automated subtitles 🙂
I tried that. its straight garbage
Yeah, it really is 🙂
The thing I remembered most from the presentation, was that they did a lot of layered eqs queries.. so lots of dot products to weight specific points and lots of distance values latered on top.
You can kind of see that in the "DOT" video.. dot product to select an attack quadrant, another test to determine proximity to player, another to bias towards the outer selection etc.
So they got that sort of spiralling quality using changes in the dot product biasing
Yeah i figured that by presentation images. but thanks for your help 😄
the next bit is just running subtrees inside the main behaviour tree
Is there a specific bit you're interested in? or is just the EQS stuff in general?
I forgot about that utility stuff 🙂 hahaha.. I do the same kind of thing 🙂
so how'd they handle torches?
and water arrows?
dual lightmaps?
bake different lightmaps
seems weird
yeah, they weren't like movable lights right? so you could just calculate multiple lightmaps
true I suppose
I mean UE4 has that now right.. with the lighting scenarios
We used it on Ground Branch for day/night versions of the ship level etc.
tbh I was thinking about seeing if one could do a prerender of a navmesh style mesh and use that as a layer for light attenuation
might be cheaper than texture lookups
Well, the textures were likely in main mem anyway, so lookup was likely just a hash value lookup into a lightmap set
I'd have thought with modern UE you could just sample the volumetric lightmap for it
assuming no support for compute shaders
isn't that still texture lookup?
or is it the same case of it being in memory?
No idea on that one.. but they're already sampling from it for dynamic mesh lighting anyway, so I suspect it'd be fast enough for this
I suppose
As with all UE, you'd have to try it out 🙂
Hey guys! Just a quick and potentially very noob question about EQS: Is running a simple EQS "Find safest movement direction for AI" a bad idea for performance? this would be running every .5 seconds and basically just returns 8 items representing a potential move direction (I then score those locations for what is the safest/ is least threatened by enemy factors in the AI blueprint)
No, thats fine
ah fantastic! Thanks for the info 🙂
If you're concerned, just profile it 🙂 i doubt you'll see anything with that kind of workload
Is there a way to force an AI to recalculate its current path? 🤔
why does the eqs return false even if it's traceable to the player?
gunna need more info
well when I try to use this node, regardless if I put it on Filter Only, it still returns places on the grid that are visible by the player. Its not that it's entirely not working, its just really unreliable @crimson galleon
what are the settings?
thank you, is this the only thing in your EQS?
yep, nothing else
i mean there still is the grid
so it creates a grid and looks for points not visible to the player
i think you need a scoring of some kind, no?
and do you see the line trace happening in game with it succeeding?
you may also want to try turning off bool match, though i think that will ignore blockers
it has no debug
i tried that too...i mean its working but its really inaccurate
i mean it should filter all results that are visible to the player, right?
this might be better to perform as a service rather than EQS, is there something that EQS offers that a bp or cpp line trace wont?
its quick to set up
haha, well its not great to debug
true, but what I noticed is that the eqs linetrace is not accurate either
you could do a line trace in the service, set the bb key, send that to the EQS so the AI can navigate to an area nearby or something of that
ive not tried the line trace method with EQS, though i think thats because im using ai perception
well, I'm trying to do a cover system
any ideas
just one
its more of a study to concept though
and i dont recall the time code, but cover AI is discussed
probably around or after half way if i had to guess
aight, thanks a lot. gonna check it out right away
is it safe to assume that a line trace will be cheaper than an EQS query, in a case where both are ran every 0.5 seconds?
Sorry for late response, Mostly I am working on EQS, Group of enemies surrounding player maintaining avoidance radius. Like battles on DMC and god of war
EQS can run line traces.. so not much in it.
If you're having trouble with EQS Queries, look at the EQS Query Pawn, which allows you to debug them
yes, I just checked that myself. A line trace uses around half the cpu time of a query…but both isn’t much at all, literally not noticeable
can u write eqs tests in blueprint?
I think there's a EnvQuery Test BlueprintBase or something like this in the all classes list when creating new BP's
Oh sorry
generators have that bp base class
i actually didn’t find that
tests do not
Don't think so
It's fairly simple to do in C++ though, you can pretty much just copypaste one of the existing ones as a base and just modify it to suit your needs
yeah I wanted to keep my project BP only but there’s no way around C++ i guess
Yeah there's no reason to avoid it :)
should be able to call an eqs query and plug in the eqs function into it, just like in BT
thanks for checking as well, I know zoombapup said that line traces can be done in EQS, so maybe this is a pointless question. Just curious what kind of overhead EQS has. I suppose it depends on what it does, like a grid search and such. Just trying to decide if an EQS would be light enough for 10+ AI to use to check things that a line trace may be able to solve instead at the same interval. I guess the only way is to test it.
So the point of EQS is that it does all of the functions, like line traces and angle checks and proximity checks etc, but it does it a few items at a time and over multiple frames, so its basically timesliced and therefore a bit more tweakable performance wise.
that's very good to know! I read some conflicting points that EQS runs on a separate thread, but then someone else said it was on the same thread. Maybe this is the confusion of the idea.
Yeah, I dont remember it doing any threading, just did a measurement of time cost and exited once the cost reached a certain threshold, with it resuming the next frame etc.
^yeah this is how it works afaik, the costs are configurable
Cpp configurable only?
I think it's in ini files
i still haven’t found any reliable way to create cover points…so what I tried is to make a grid, get only points overlapping with cover at a certain height and checking if visible by player but somehow it still doesn’t work. The Agent either doesn’t go to the point even if it’s set as winner, or the EQS chooses a point which is visible to the player. I tried everything but nothing seems to be working. Any suggestions?
Have you tried debugging the EQS query with the EQS Query pawn?
yeah it doesn’t show the debug if there’s no player though
I don't know if you've had a look at that, but I've seen it mentioned a few times, and I believe there is a github project if you wanted to mess around with it and get some ideas.
Are you sure? I used it a fair bit without a player active.. but its been a while
I did, but I don’t really understand it or it just doesn’t work…u mean the one who generates cover points before play?
might have to run in simulation mode
i mean i’m using the player as context for the trace and if there’s no player it doesn’t show any point
So use another pawn for the context
and just check the logic of the query
basically, give it a different query context which returns a target pawn or something.. and check that you;ve got your scoring and generation right
Thats how I use it
Quick example of what I think zoombapup is saying (I use the same method for testing EQS queries).
Let's me set whatever I want as an EQS target and makes debugging super easy.
Preach 🙂
very helpful, yes, thanks
alright, I just did this. It seems to work showing the debug points but the tracing is still way off…some points without cover are green as if it’s hidden by something but it’s literally not
Are you sure its tracing to/from where you expect?
yes definitely cus I even see it working. It’s just inaccurate and unreliable
also the same goes for custom env queries with linetraces
they are so unreliable
You've probably already checked this, but the fact that some points are appearing hidden despite not being occluded by an object makes it seem like there could be a collision box or something that is blocking the trace? Have you tried setting up a custom line trace channel specifically for cover and seeing if you get them same errors?
yes i did this. even tried to trace complex and show debug but some lines seem to just go trough cubes, meshes and whatever else
iirc, death stranding would line trace from the AI and from cover points that the AI found to determine if they were in cover or to validate cover
Does anyone else encounter an engine freeze when binding the "number of points" in an EQS "On Circle" call? As soon as I go to edit the value in my EQS Pawn the editor locks up (just tested in a fresh project).
are you launching from an IDE?
if no, it's probably an ensure
No I wasn't, I was just running straight from the .uproject, but I just launched via Visual Studio and got the same behaviour.
I've never had any problems in that area, so it could be a bug or something in your scene that is causing it, or the setup just isn't quite right somehow
Have you tried it in an empty test scene and added test colliders to that?
Yeah exactly, and RAM usage goes through the roof.
I'm using UE5 right now so it's possible it's a bug there, I'll try to troubleshoot it some more tomorrow but was just curious if anyone had encountered it.
I'd not use UE5 yet
i'm sure they can grease their way through it
It's bound to be a trainwreck for a while though bugs wise.. I mean UE4 isn't the most stable platform anyway.
but... their name... their name!
I was trying to ignore that 🙂
Wouldn't it be amazing if you could just grease bugs away 😉 lubricated programming 🙂
Lmao, sometimes you’ve just gotta slide into the situation and hope you can grease the wheels enough to make things work.
Also, I appreciate the advice re: the engine, but I’m a loooong way away from any type of actual release and I’ve done a large amount of the legwork so far in UE4.
Blueprint Runtime Error: "Accessed None trying to read property CallFunc_FindPathToLocationSynchronously_ReturnValue". Blueprint: HorseBP Function: Execute Ubergraph Horse BP Graph: EventGraph Node: Set Path Points
Why UE4 always throws out this error everytime I try to pathfind?
i tried the same setup on different maps and even two different projects. it’s either a bug in ue4 or i’m just missing something
Given how many have used EQS and had it work, I suspect the latter. But the main question is how to debug it. Have you tried looking at the EQS code to see what values its using in the C++? If you're having an issue with this, then I'd break out the debugger and step the EQS code to see whats going on.
It doesn't do anything fancy with line traces. If line traces are failing, you've got something weird going on.
Sounds like line traces weren't given a start/end height or weren't set to ignore the player pawn or something
yeah, something weird
is there anything built in unreal which could be used for fish AI movement?
ok, i got a actor component for that which does it, but it's kinda wonky -.-
so guess i'll have to fix it
sounds about right
steering behaviours work well for fish
just make sure to keep them in an octree and only steer against nearest neighbours in the tree, multithread it and you're good to go
yea the problem that script has is that the fish sometimes swim outside of my aquarium 😄
fish will do that you know.. if the aquarium is made out of imaginary glass 🙂
seriously though, this is a pretty simple problem to resolve with optimized steering. I'd even be tempted to do a particle-system-only version these days
given niagara has decently programmable stuff
well, it's weird they escape even tho they are in an enclosed box of collision boxes
xD
fricking fishys
Always better with chips I find
and a little bit of salt and vinegar
Maybe they are ghost fish?
nah, figured out the fish had only blockdynamic collision
Opposing force the closer to the bounds they are
yep, steer away fishies, steer away!
yea that fish movement component does a lot of line traces to predict collision, not sure if theres a better way
the niagra particles kinda drift away when they hit a collision?
Then again 200k fish dont go well with ai
yea, i'm using like 10-20 fishes
you should be able to get a few million going really
The pen is only ~40 odd meter radius
plenty for a few million tadpoles
My gfx maxed at 1.5m :(
Or maybe the particle did.. dunno, started going slow
Luckily i only need a fraction of that for my actual game project. Was thinking GOAP for the AI
goap for fish? that's a touch overkill
I doubt they have very complex plans 🙂
Goap is VERY old now btw.. most people prefer HTN planners these days.
Not doing fish for the game :p
and HTN planners are pretty old school too
If its good flexible and fits my need, age doesnt concern me that much :p
well, me neither, but if there's a better approach I prefer to use it
whatabout utility ai 
I like utility for some things.. but I don't like the idea of using it for everything
lots of redundant computation going on with utility really
Reading about it htn sounds very close to goap tho
Well, Goap is a planner.. there's a lot of replanning if your plan gets out of date
Utility is simpler, in that it basically always replans 🙂
goap is quite a bit more complex IMHO
for often very little benefit (definitely does depend on the specific use case, these are all different tools for sure)
yeah, I mean they're both pretty simple in reality, but GOAP has a lot more problems with dynamic environments if you have any real complexity of decisions
I just prefer HTN approaches for the planner methods.. just feels simpler
I mean GOAP was out of date about 10-15 years ago 🙂
I don't really think I have any redundant computation going on with my utility AI ... I mean, unless two totally separate decisions happen to use the exact same scoring criteria just by chance
but I don't think the frankenstein I came up with exactly matches many common articles on it
well, to be responsive you have to have access to the data to score the decisions, so in order to test the decision utility you have to run the computations, even if they're discarded
Doubt mine will be considered advanced by any stretch of it either , so complexity should be close to 0 i think
Altho as you say, alot of replanning when the plan is old
And for 1500 actors that could in worst case be quite often
most games plans don't last very long in reality
if you're doing 1500 actors, it'd make sense to aggregate some decisions, or use sparse sampling or something..
1500 AI is going to be too many for any common complex solution tbh, that's approaching full custom everything territory in more ways than one
I guess it depends what the 1500 is meant to do
Yeah i think that part is gonna be the most challenging , but yet again, it should be fairly simple decisions, seen isolated atleast
I mean if you can shove it all in a compute shader, 1500 should be relatively trivial computation wise
yeah, you need to optimize for your use case with 1500 of anything in UE 🙂
Im planning for 1500 ,
To give myself some headroom
Actualy use probably limits around 500
The things itll do is simple really. Doing chores, reacting to a few external factors, and a few internal ones
Chop tree, move tree, sleep when tired etc etc
I guess I actually don't really know much about HTN technically, I should learn about it while I'm on the throne sometime. I'm just running my utility scoring on a separate thread right now, which just means the AI takes a frame or two to update their running actions when the world changes. but yeah, I agree if you have 30 decisions then they might all have to run some complex maff and it feels kind of like there should be a smarter way to cull
Well, for that kind of decision, you can just have it take a while to resolve a plan, so you're not tied to "fully realtime reactions" right?
500 is still tough just for character movement even aside from AI lol
I doubt it'd make any difference how you choose to do it, goap, htn, utility, bt would all work
I got that part covered
well, yeah, the CMC is the culprit there right
Not using cmc at all
sod all to do with AI 🙂
Im planning on using vertex animated instanced meshes
good plan
those are fun to play with
there's that Epic livestream where they did like RTS units using it.. fun stuff
mind you, they used niagara for theirs
Yeah was about to say
can you show your behavior tree?
I don't really, but just show me the BT
which part are you testing?
the get actor position
ok I don't think the decorators are set up correctly
your order is also incorrect
highest priority is leftmost
in this case all you really need is the IsActorIt
ok ill take out the other condition tree
the path where the actor is "it" should be the highest priority
well i need the other condition so i can have my actor move around until it sees another
i swapped the two
so whats wrong with the decorators
think about this
you only need decorators if you want more paths to be different from the lowest priority path
the lowest priority path doesn't need decorators
it will happen automatically by virtue of all the other paths failing
that's the fundamental idea behind the behavior tree
in this case, there are probably two paths
either an AI is "it", or they are not "it"