#gameplay-ai
1 messages · Page 155 of 1
no im just testing out the it actor right now
so they will move around randomly if another actor is not in sight
thats why i have the blackboard bool set in the perception update
I don't know what you mean by that
but
for the path where they are "it"
you need the decorator that says IsActorIt
and it should be set to Abort Both
abort both?
im confused. are we still talking about getting the it actor to move to the non-it actor?
yes
first we have to make the tree work
then we can take a look at the tasks
if the tree doesn't work
the tasks won't run
you don't need the blackboard condition
you just need the "it" condition where the blackboard condition is now
ok
so let's quickly review what's happening here
the tree starts, it will check the leftmost path first. if it's not it, it cannot go through the IsActorIt decorator
right
so it reevaluates, and moves to the right
and checks if it can go to that tree
which it can
because there's no decorators
if an actor is "it", they will use the leftmost branch
yes but i need my it actor to use both of those sequences depending if they see an actor or not so why do I not need the blackboard conditions?
that doesn't make sense
as long as an actor is "it", they aren't suddenly going to act like they are not "it"
well my it actor isnt moving anymore
it's too early to test, we haven't had a look at anything yet.
now let's take a look at your nodes
ok
have you checked with breakpoints that your perception event gets triggered?
that will also allow you to see if you indeed have the correct blackboard pulled up
I only have one blackboard
yes but a blackboard could also be a null value
ok so how do i use breakpoints
i know my ai perception is working because i used print string
F8 while selecting a node
then you run the game and let that event happen for instance
and the game will pause once it hits the breakpoint
while paused, you can hover over pin previous to the node you're on and see their values
ok im pressing f8 on a node and i dont think its doing anything
i should be doing it on the on target perception node?
do you get a red dot
no red dot
take a look at that page
there's a section called breakpoints
when something breaks in your BPs, breakpoints are your best friend
ok i just added one through the menu
so on which node exactly should the breakpoint be on
yea it did
cool
so now at the top of your BP graph you have some new controls
step over, step into etc.
so now try and step past the branch and see if that's possible
yep
just using step over
ok it moved to cast to bp_myAi
as long as it moves it's fine, if the game resumes, it means it didn't execute the next node
so that means that condition fails
if you want to be certain you can put a print statement on false
no the true statement is working
ok, so why wouldn't it move past?
um ok well it is now
I mean it may be that this is intended
is the bool only true when it spots another AI?
yes
well
once an ai moves out of sight, the bool will turn false automatically right?
does GetTeamAttitudeTowards() get call everytime ai_sight detect actor or just once ?
ETeamAttitude::Type AMinionAIC::GetTeamAttitudeTowards(const AActor& _Other) const
{
const IYOLOPawnInterface* Other = Cast<IYOLOPawnInterface>(&_Other);
if (Other && MinionC)
{
if (MinionC->Team.MatchesTagExact(Other->GetTeam()))
{
return ETeamAttitude::Friendly;
}
return ETeamAttitude::Hostile;
}
return ETeamAttitude::Neutral;
}
why are you asking me? I don't know your logic
im trying to implement my custom logic to detect affiliation
but look like 'GetTeamAttitudeTowards(const AActor& _Other)' just get called once
never mind. ok so the branch is working but i only needed the branch for the bool so i don't need it anymore then?
again I don't know what it does
i have a blackboard bool key for if an actor was in range, id set to it to true with that branch
and that was my blackboard decorator to tell the it actor to move to the AI
ok I don't know how the perception works with AI because I've used my own component for this
but ideally you want to collect as much info about your target as you need
so not just the range, but also who the target is, if there are more targets as a fallback etc.
the it actor dosen't need that because no one else is it. i just need it to move to whoever they see.
right but what if that target goes out of sight?
like you have to account for failstates
well thats why i had the condition so they would move to random positions
ok so we need a sub branch on the left side
and another decorator
now you want to distinguish between when a target is in sight, and when they are not
yes
ok
so can you take a screenshot of your blackboard currently
ok so you need the target that you are chasing as a bare minimum
and really, instead of having bools for in range and it
you should have decorators that check against a range you define, so it becomes a function of distance
the reason it's better to have a target as a key is because you can then at any time extract information like location
and equally you can use the fact that there is no target to put your AI into looking for new targets
as for IsActorIt
there was a function on the game mode that gave that result
so you can just query the game mode for that result instead of having it as a blackboard value
otherwise you're just repeating information
okay so first, i should put the target into a key
yes
and really
nothing else
all other information can be extracted from the target
or the game mode
or the current AI
you can test range by checking distance between current AI and target
you can check for it on the current AI or the game mode
both of those can be custom decorators
I would avoid as much as possible using the built in decorators, as they are buggy
does this update per frame?
im not sure
i don't know how to test that
r u asking if the key will change objects whenever the it actor sees different actors?
I'm asking because I don't know if you are ever resetting the target
yea i dont know i only know how to use bool
like for instance, when the target is out of the vision cone, it should probably set itself to false
well you just set it to nothing
it seems easier to try to get the actors location inside the behavior tree if thats possible
you actually don't even need the actor's location
MoveTo accepts actor keys as an input
wait is that a way also? If i pass the position to a blackboard key and use a MoveTo? I havent tried that.
gonna try it out really quick
huh well it kinda works
I mean that's kind of the standard MO for MoveTo
I have no idea what you were doing before
anyway no biggie
so you should ideally set up the other branches of the tree as well
what i would recommend for the non-"it" branch would be to put down 3 tasks
in sequence
wait before we do that, my it actor is having an issue. it might be the null thing.
task 1: find new location in radius
task 2: move to new location in radius
task 3: wait x seconds
and put a loop decorator set to infinite on that
sure ok
ok so when the it actor touches another actor, both seem to get stuck on each other
i think its because when they are always moving towards each other if both are in sight
makes sense
both become "it" momentarily, find closest actor, then set that actor to be "it"
yea
there's a few ways to get around this
but you'll have to find whatever suits you the best
a grace period is probably wise
you could combine that with the actor just having been it being untouchable for a grace period as well
and actually
i want a way to see whos it or not
because its hard to keep track of each actor by color
well being that the game mode knows who is it
you can just query the game mode in a widget
to have it displayed always
but that's no longer AI
yea ill hold off on that for now
ugh somethings not right
how do u make something null
just set the value to nothing
Hi everyone, can anyone confirm if the Gameplay Tags Test for EQS query works? doesn't seem to work on mine on both ue4 and ue5.
It should work just fine
Actors you are testing against need to implement the gameplay tag container interface though
Thank you. So what I understand here is that it doesn't work if you're working solely on blueprints, you need to fiddle out on c++ as well.
Correct
There's no way for it to know how to read your gameplay tags unless you implement the interface
thanks
So I'm trying to explore EQS and i was going through a unreal talk where i saw this EQS Generator called "Context: Set of" I tried to find it in my UE but i'm unable to find it. is it a custom Generator?
yes it is custom
ok thanks for the info
That's an interesting generator lol
ya lol, unfortunately the talk was in japanese so i couldn't understand but thanks to youtube auto translate and some of the ppt images, i could understand that he was trying to tell that enemy targeting system can be achieved with EQS . but he didn't explain what the generator does. i'm guessing it just returns the enemies currently in the map
Yeah seems likely based on the description text
Uses the selected context to return a set of actors
which games was this for?
It might only get enemies within the queried space
Not sure if this is the right channel, but I am getting crashes from the navigation system.
The usage is quite simple, there is a navmesh in the world and there are characters which find a random point and move to it and repeat
Another crash that i get, it alternates between these errors
Which do you prefer for your AI? physical animations or just using animations for either hit reactions or death?
I like physical animations but at times the behavior is too random.
So far I played around and also some games that its better for the ai to have no collision on other ai and the player but still react to hits from the linetrace.
Yeah, having hard collisions on AI is generally a bad idea imho.
I usually just use a seperation force to keep them from interpenetrating
still have the capsule colliders on the agents, but set them to not collide with each other
not exactly a game. it's a UE AI talk: https://youtu.be/BV2GTGbSjq8
The fact Unreal Engine JP is great compared to normal Unreal Engine channel makes me sad
And makes me wanna learn Japanese
ya true. Missing out on a lot of things
Try looking for Eric Johnsons version of that same talk. Eric was working at squeenix back at that time and he was the one who gave the english language version.. he might have slides up somewhere?
Ah, Eric's at Kojima now
Dammit 🙂
Well that sucks
Because the movement of AI characters doesn't do well with rigid collisions
imagine you have a group trying to get through a doorway, having rigid collisions can easily block that kind of setup really easily
Often, we see games AI where they disable rigid collisions and switch to soft collision response (where you simply push actors apart) and they just have a bit more wiggle room for edge cases
Some games if they detect protracted collisions between two agents that have opposite path directions, simply swap their positions
ah ok, that's good to know.
this is not the same as the Context generator?
looks legit
I guess japanese studios are increasingly moving away from in-house studios nowadays
since it seems there's an increased amount of content in japanese regarding gamedev
it's actually not a very hard language... except for the writing system lol
Hello,
maybe this is not the correct channel to post this, but it has to do with behaviour trees and ai mostly, so I hope it is fine.
I'm developing a VR game, where you can feed animals. So there is a pickup object, that is the food.
The animal is controlled by aicontroller - when it sees the food it goes there. But I also implemented a sphere collision into the animal character BP, that destroys the food object on overlap. This way the animal "eats" the food.
My problem is that when the animal character is already moving it loses the object on the goto node, and tries to go to the center of the world.
Is there any way to abort movement or jump to another task, when the object defined in the blackboard as a goto target object gets destroyed?
I will try to give enough screenshots so it is obvious what is happening.
Thanks in advance.
the second screenshot is the go to food location task, that after the goto sets freeroam boolean to true
Why are you using a blueprint moveto?
Oh youre not
So you're logic looks a bit wonky
What is the animal supposed to do if it doesn't want food?
usually, I'd have a value "food need" and increase it over time
then have some logic that runs if food need > some threshold
the "go get food" would only run if food is in the blackboard to go and get
so you'd need a BB entry for that
otherwise, you'd do some idle wandering around (because food need would be too low to trigger the "go get food" branch
So basically, think of it as priority, higher priority trumps lower.. so lowest is idle, middle is needing food but not having it, and highest is knowing where food is and going to get it..
that kind of thing
to what zoombapup is saying, whether this solves the immediate problem, this is a finite state machine, the AI must always have a state to go to - there should be a failsafe state as lowest priority for then no other conditions are met (idle in this case) with higher priorities to override as mentioned.
The bit im curious over is how the BBkey for location is being set. I see it for the moveto, but what is given it a value?
Hmm, I've got to think of some AI thing to do when a floating point value goes up and down.. I was thinking of going between peaceful and rioting, but I dunno 🙂
So what it is supposed to do
left side is freeroam, right side if it senses food (with ai sense)
when it senses food - it stores that food in a bbkey - as an actor
then the freeroaming is set to off
then he goes for the food, but since the food can be held by player and thrown at the animal - it can happen that the food object is destroyed before finishing the move to - and that where it begins to break
I suppose that I should be doing everything in the behaviour tree - but I can't figure out how to do the eating (food object destroys - animal plays eat animation ) inside the behaviour tree
thanks @ocean wren for the thresold suggestion, it is a good idea, I will definitely implement something like that later
this is how the vector value for object location was stored, but I changed it to an actor variable - because if the player moves away the animal follows that way
so this is how it is stored now
and this is what happens when the animal character "eats" the food object
and this is what happens in the food object - so it is detached from the VR hands - and then destroyed - as touches the animals head
sorry for the wonky BP screenshots, I'm extremely beginner - but I still feel the main problem is with the behaviour tree - like when the food is eaten - I should change for a different behaviour tree task - so it can play the character animation instead of the character BP playing it.
Yeah, so you're logic is the wrong way round.. the priority goes leftmost = highest to rightmost = lowest
so you should have your lowest level "do something if nothing else is more important" on the right
then as things change the blackboard, you can respond to those changes based on conditions
the leftmost should be the most specific thing, so things like sensing food that is available might set a value in the BB for the food.. that would then cause the higher priority path to move towards it taking over the lower priority idle
and each bit of new information is shoved into the blackboard to allow subtle differences in behaviour
so for instance, that threshold value would mean you don't have ALL animals coming for the food once they'd eaten for instance
or, you might have a "can I get a path to the food" as a condition on some higher priority branch to come and get food, which would fail if you can't reach it etc.
Usually its best to write out what priority you want the behaviour in and what preconditions must be in place to make those work (write it in your normal language first) then encode that into behaviour tree + conditions
is there any tutorial/insight how to handle AI aggro/hit player if the player hit certain character/Ally of the AI
like an AI gets notified when an AI buddy gets hit?
yes
for AI that talk to one another, a middle "man" class is best
like an AI manager
ive not done this, but have something like it, so ill give you my take
i want to create minion like MOBA game
any tutorial/example i can learn from ?
AI manager is probably a good term. might not find a minion moba, but should probably fine the answer to the concept
ok thanks
I use a manager class that organizes the squad, I use a messageendpoint to coordinate between them, when any of them get hit, it sends a message to the squad manager that its been hit, it also does the same for when it spots an enemy or hears a sound etc.
The squad manager class tells the squad members about the information sent from each other
Its basically like a sort of squad radio, but done as message passing
For the specific use case of aggro, the manager class would need to keep a list of enemies and how much of a percieved threat they are (increase every time they do damage for instance) and would assign the squad members to the highest threats with checks for if the squad member can reasonably do damage to them etc (in my case, testing line of sight so they can shoot back and whatnot)
There was actually a nice presentation about this in one of the GameAIPro books if I recall. lemmie see if I can find it
tactics and strategy i think
Dammit, trying to remember where it was
Anyway, posting this here, as its something a bunch of people should know about
Home of the book Game AI Pro
Ah it was Chris Jurney
AIWisdom.com - Game AI Articles & Research
Only, the aiwisdom site is dead.. sheeit
seems to work for me 👍
Try clicking on a link
i did, both
And you don't get a dead link?
i see that
Yeah, I'm talking about clicking one of the articles
the host of the content seems to have gone away
yeah, sad
i can always copy paste these though
Ah well, can't be helped, the internet is fickle 🙂
the fool! if DOIs were used from the start we wouldnt have this!
DOI?
Well, it isn't the web address so much as the hosting going off 🙂
unless you're saying that there's some magical internet thing that automatically keeps internet things online even without a host? cos thems some magical beans 😉
i think the links dont work anymore because they are old (~2003) so the links used probably point to something unfound and it defaults to the web hoster "dunno" page
i think the DOI has to be approved or something, but it is permanent
website explains it all
Yeah, I guess nobody wants to host old stuff 😉
i think the links to the places revamped the site so the links were changed for that revamp. kinda like gamasutra becoming gamedeveloper - honestly harder to finder gamasutra articles with something so generic >.<
Hmm, seems it went away sometime before 2013 🙂
really? i thought they changed the last year or so, because I will go to gamasutra regularly
No, I meant AIWisdom
ah
Apparently Chris Jurney is now head of development for Facebook VR
@ocean wren @stuck comet i think this one from GameAI pro can help http://www.gameaipro.com/GameAIPro/GameAIPro_Chapter29_Hierarchical_AI_for_Multiplayer_Bots_in_Killzone_3.pdf
That's not the one I was thinking about. Chris did a talk about selecting how to attack in Warhammer? Actually, thinking about it, it might be on GDC youtube channel.
yeah, i haven't seen Chris's talk, though i recalled this one had similar to what you mentioned about there being an squad manager/commander
Yeah, its a pretty common setup. I'm sure there's a bunch of similar papers and articles doing it
yeah
thanks for the answer - I will change the layout and think about the priorities
and on the old unreachable sites it is a good tip to try https://web.archive.org/ - here you can enter URL-s and see snapshots of them in earlier times - the site that you tried to open is also there in the 2009 snapshots
Sadly didn't archive the actual book chapters. Which is a bit of a problem.
Question: I have a box component attached to my door that acts like a nav modifier that is set to a custom area with an extremely high cost. This is to prevent my AI characters from trying to walk through the door. However, the box component is very thin, but the area that it covers is very large in comparison. The first image below is the area that it covers and the second image is the actual size of the box. I'm wondering why it's so inaccurate?
Hello, just need some advice. I have some ai that are to wait at a register to "purchase" their items. However, as of right now it is just a go to task. I would like it to be a little more realistic and have it where they go to a point to make it look as if they are waiting in line if the first point is already taken.
What would be my best approach?
Probably best place the spots on the line as maybe there are different store layouts. Then keep track of which is the next available spot in line. Alternatively, you could get the last pawn in the line and set the move to location an offset distance behind them. It may also be better to derive the offset direction from the register and not the pawn as the pawn might have off rotation. It would still use the pawn location just the directional offset from the register.
Hm. When my ai goes to different places ie: registers, and shelves, I have a public vector on the base classes that can be seen ingame.
Would it be plausible to have per say a struct map on the register where the struct contents are a vector and a bool so that when an ai gets to a point, it sets that bool to true? Or maybe have a vector array and a counter that goes up each time a customer moves to the spots, and goes down when one leaves?
I kinda like the counter because that give you the index of which vector location to go to
I wonder if its possible to use eqs from the register to determine location, just wondering though
Hm. I haven't ever used eqs. Ill have to watch some videos on it. Seems interesting.
Ah, mighy too tricky then eqs in general can be a bit much and what im thinking seems even more specific
Oh, is eqs not too good when it comes to accessing specific actors?
It could be. I think youd have to make some logic for it
I see. Well, Ill give the array and index method a shot and see how it goes. Thanks.
Eqs could generate a grid of points, filter out actors occupying certain points (as well as collision) and the tricky bit is having the right position to move to from it
Oh, so I'd have to get the points near each register?
Eqs can generate a grid of points that exist in the navmesh
Its sort of all within eqs
I guess we can not extend C++ BTTask's to BPs right?
I dont think you can extend but you make your own bp version
Anyone have good resources they can point me to on how to setup bots for a dedicated server game? Not from a BT perspective, but from a how to spawn them? i.e. from game mode or not, etc?
game mode is the place for handling spawning of characters as game mode accesses player starts
Yeah, I surmised it should be in game mode, but I was curious about where specifically I should place that logic based on the initialization order within game mode
HandleMatchHasStarted() seems to spawn the players, should I extend that and also spawn my bots at that point? It seems to be tracking bots before this point though internally, which caught me off guard
i think there's a more direct function to override, but i cant recall the names
i wanna say ChoosePlayerStart
honestly not sure if that works for bots, i assume so
Yeah curious if there's any way to spawn a bot such that its able to go through RestartPlayer
And take advantage of the same spawn logic
For stacking up on doors, I created a component that stored positions and just queried for that component on the door object if I wanted to stack on it. Using components to annotate things is generally a good approach. You could create a "queue" component that you'd query on your till to get points to queue at. The reason to use a component, is that you can add editor gizmo's and stuff to it to visualize when you select the object
I had a queue component for ladders, because generally they are one-way traffic queuing systems
The ladder queue had to do some logic for which was the current ladder direction (so agents could go up or down it but not both at the same time)
Its kind of similar to smart objects, in that its something in the world that tells the AI how to use it. Just a bit simpler in reality 🙂
For AI opening doors, I am doing it like this :
when AI reached the smart link on the door BP, the door BP will set the AI's Blackboard key DoorActor to the door BP. AI's BT has a branch which checks if DoorActor is set, if it is, it will execute a bunch of actions to open door and clear the DoorActor once the door is opened.
I am wondering there is an easier/proper way to do this?
Something makes my pawn move but my BT disabled and BrainComponent is resource locked. VisualLogger says pathfollowing comp is active and BT is running. I'm also sleepy so probably I'm missing something but anyone has any idea what could be making my pawn move?
BT is not even connected
Did you save it? 🙂
Xeon: That's a reasonable way of doing things. Just breaks down if you have to manage multiple agents competing for the resource (the door), I like the idea of having the logic of use in the object of use (wow that sounds like a nice meme) so that it can direct its own usage to the agents trying to use it. So for a door, what if two agents try and use it at once?
Interesting, so if the logic is in the object itself and assuming there are multiple agents attempting to use it at the same time. It would handle the situation by making them queue and there will be an additional branch in their BT for telling them what to do when they are put on queue to use an object?
Yeah, essentially, you'd say "you're currently interacting with something" in the BT, the interacted-with object would tell the AI what to do until its finished with the interaction
Its typically called a "Smart Object"
the Smart Object thing started with the sims franchise.. at least that's where I first heard of them. The SO idea is that it also broadcasts its utility for general usage, so good for spatially seperating objects (i.e. AI will do different things depending on where the nearest satisfier of a need is)
Good examples of more recent smart objects.. Bioshock Infinite, there's a great presentation from GDC by John Abercrombie (now at Epic) on it
probably a bunch of chapters on gameaipro.com too, I wrote about some of this myself
I wrote a paper about social objects.. a sort of social version of the smart object, for things like parties and conversations
think of it as a more localised and smaller form of AI director.
typically used as a coordinator in multi-agent systems
One of the greatest challenges of video game AI is that of creating believable companions that inhabit the world. This GDC 2014 talk from Irrational's John Abercrombie explains how these seemingly contradictory design goals of BioShock Infinite's companion character, Elizabeth, were solved by leveraging philosophies from other entertainment medi...
around the 24 minute mark. They called it "smart terrain" apparently
Does the smart object stop the AI's BT so that the AI will do whatever the object specified in it?
That's a bit of a grey area. In general yes, because the smart object wants to give it a list of things to do
But in reality, the BT can still override if a higher priority task tells it to
The reason you want the smart object to control the interaction, is because its likely to have more info and be more recent than the character (these things were intended as add-on packs for DLC usage)
I think you'd have to play with the coordination somewhat, but just a branch that essentially idles whilst in a smart object interaction seems reasonable
So you'd generally keep both
I actually do my "actions" as a task queue anyway, so my smart objects just pushed actions into the task queue, I don't do actions as part of the BT. My BT's just choose which actions to push, and monitors them for completion
That way I can go entirely scripted by simply pushing a list of actions. Or I can mix and match BT and actions and smartobjects
Yes
I was moved the BT's to another folder in the editor. This started to happen after that. Probably something is messed up with blueprints again, yet still it does not make sense 😄
Debugger also confirms the BT is running, even while nothing is connected to root selector
I ended up going to counter and the multiple vector route and it seems to have worked. So once a point has been found, the ai moves to it and the index is increased so that the next customer goes to the point behind them.
Now I am trying to get it so that this purhcaseitems only runs when a bool in the register is true, meaning there is someone at the register. I have tried a loop in the purchaseitems that loops until that bool is true by I keep getitng an infinite loop error.
since you have an index which is specifying which vector location an AI is in, cant you check the vector location of the AI for the one at that location? Alternatively, if you are keeping track of index, maybe that can be cross checked for the AI if that makes sense.
Hm. I might be able to recode it a bit nicer however, the index I have is in the register class that I use to get a new vector for the next ai to go to.
However, I see what your saying is to cross check the vector location I want the ai to be in to do the task. But that now brings up another problem where, as you can see, there is only a task go move the ai to a spot near the register, then purchase. I never figured out how to make a sequence or a task that would make sure that the ai is in the correct spot to purchase and if not, move to the next index for the register if that makes sense?
so you have them move, but there is no double-check on if they actually made it?
Kind of. I pick a register, and get the registers index to which I then find a vector point in the array to go to. Now I only want the ai in the 1 element of the array to our purchase, then, he leaves and the AI's that were in line move up one vector(ie getting their index and going down one) until they are at the 0 index to which they can then execute the purchase task.
what about a little sphere collider in front of the register, on overlap double check its the right AI since they triggered it
Ah that could work. Now how about the AI moving up to the next vector when the AI at the register leaves it?
on end overlap tell the AI in the line?
actually, i bet you could have the AI follow one after another once they get in line
well, that'd probably have you reworking some things
just thinking about how each AI would need to shuffle forward
So I could create an object array in the register bp that holds all the ai in line, each ai can have an index variable that can be used to get the next vector. Then once that ais index = 0, they do the purchase task?
This is what I am stuck on too.
i think the index variable makes sense, you've already got that in action from when they move to queue up
the register could tell each AI to move up with a delay i guess, maybe slight variation in delay so its not too uniform
That's what I am thinking. Create an event in the register that is called by the ai that leaves where the event gets all the ai in the array and moves them to the vector value index - 1?
so, i mean, ive not given this a complete think, from start to end of what you want, its more responding to the next problem as it arises.. but maybe you see where im going here
I need more experience.
well, thats not where i was going
Oh 😂
since its this deep in, just look at everything thats going to be needed, maybe you have that, but plan out every little nuance on paper
i think its good to start working on it to see how it all works and how detailed it gets
i would do the same, and now the inner voice inside me is saying " take a step back from all of this, list out all the things this ai needs to do, check it over again and make sure every little action is addressed, and then figure out a plan to execute it"
Will do. The reason I have been bugging you so much is because I have created a couple games before that I just ended up stopped doing because it was "too much". However, ai is something I haven't really worked with before in school so although I am having issues, I somewhat understand this is just me learning something new. I will definitely plan this out and take a look at it. Now, once I do, I know I will want to keep going, so I will most likely be here in a day or so. 😅
so you made games or stopped before finishing?
*stopped before finishing
ah thats a shame
sounds like there is a bigger hurdle than learning a new concept
That's why I'm not going to stop with this game, and is also why I keep bugging you here is because of certain things I don't know.
great, that's the right attitude, dont quit on it
get use the feeling and idea of cutting your ideas though, not everything can make it in, sometimes we have to look at what is working and make something of that then force all the initial ideas in
no wants to make a bad game or a game they know can be better, but time is the key. keep the notion in mind that this game should've been finished yesterday, that it should have shipped. Maybe the art isn't great, but it feels complete already. Then get it out there, keep working on it and you'll hear plenty of feedback from people who play it; what they want; what they dont like, etc
/ rant over
cool. well, regarding the AI, i have suggestions, but i think the best way to advise to know all the details of whats to be achieved
from an AI book, i read that "the amount of work which goes into AI is not necessarily the work performed by the AI"
Ok. Tomorrow I'll try and get a detailed plan for this AI and I'll send it here. Then we can go from there.
im down
Ah I see, I will toy with it around more and see how it goes. Thanks for the help. Also I just realised that you are one of the devs for Ground Branch 😮
very cool!
AI is always a bit of an art as well as a science 🙂
Has anyone had any issues with AI perception seeing one player but not seeing others in multiplayer? Using 4.27
<@&213101288538374145> just to be clear, these are all over this discord now, every channel
:no_entry_sign: Ahmad9a9PRO#0284 was banned.
Oddly I already striked them so they should have been muted
@rough lotus thanks 🙂
could anyone tell me how do I set a boolean BB key when the player is in line of sight? right now I use AIPerception and thinking about using On Target Perception Updated as a way to do it. Or are there anyway to check the condition easily? I tried to search for the answer but official doc also not helping much about this. I really out of idea on what kind of keywords I should search. In case you wanna know how my BP is, there is only On Target Percetpion Updated(AIPerception). Because I have no idea what to do, sorry for bother.
Yes, just use the perception events
or whatever method you use to do the detection in general
my question is "How" I might lack some fundamental knowledge to comprehend on how to implement it, so it'd help me a lot if you spare some knowledges.
Ah
In the event you can check what the actor that was perceived is
so you can for example Cast to PlayerCharacter
well I do want to only change the boolean on blackboard key so that the condition met
Yeah, so if the cast passes, you can get the blackboard and set the boolean value on it
I cannot cast to playercharacter but can cast to PlayerController, dunno if it'll works but thanks for some help
You should be able to if you try casting the sensed actor
you're probably casting something else if it only offers the controller as an option
(or your player character class is called something else)
well I cast from Actor
but if it works I think it's better to cast to playercontroller because you might have to change pawn right?
Well, the sensed actors are going to be the ones that are actually moving around and being seen
so they'd be your pawns or other such actors typically, and not controllers
you could certainly use other methods besides a cast to check it - such as checking if the actor has a certain tag. In that case you'd just need to make sure you assign the appropriate tag to the player pawn class if you do change it
it not works, the player controller also not work, I even casted to AI BP itself and still not work.
You're getting the blackboard from the player character
well this is how I understand from your explanation,so...
Yeah the basic idea is right, yes :)
But you have to get the correct blackboard - if you were to get a blackboard from the player, you would be setting values on that one, and not the one belonging to the AI which saw the player
well I need to set the bool from AI BB
This logic is in the AI controller for it I'm assuming?
it's in AI character BP, I don't know if it's possible to get that event on AI controller
Ah okay. To get the blackboard for the character, you can do Get AI Controller -> Get Blackboard
cast to AI BP first right?
You don't need to cast or anything
do I need AIPerception on AIController?
No
Here is how I do it, This is in AIController. The perception didn't work part of it is because I didn't set "affiliation" to everything(still not know how to set to one yet). And I didn't tick "Auto Register as Source" at the AIPerceptionStimuliSource on the player character.
Well in conclusion I made it works as I wanted to.
A question about the Observer Aborts
How can I end the task 7 and continue on task 8. Right now, the self abort will prevent from proceeding
why would you use "time limit" ?
for now, I fixed it by overriding receive abort AI and forcing to finish execute
I'm not sure if it's designed to work in that fashion 🤔
So I'd be careful... but if it works I guess it works
Does UCrowdFollowingComponent work with custom nav links?
Yes
I did some custom nav links for ladders and doorways and it worked for me
Hmm, seems like Epic have finally allowed some love to go into Unreal Engine for AI. I didn't know, but Mikko Mononen (person responsible for Recast and Detour libs) has been working on some AI tech for UE5 and its one of the things behind the Matrix thing they just released. I'm kind of sad it was the matrix and not something original, but hey, access to that tech will be fun. Mikko is a top guy in terms of he cares about usability and presentation too.
yeah, it came up earlier today in the lounge, pfist was talking about it. suppose to allow more crowd ai features
Just glad to be finally seeing some movement in that respect and Mikko really is a great person.
Given they've got Mieszko and Mikko and John Abercrombie, they've got some really experienced AI guys around. Apparently Mikko's been working on this for a year.
Still going to be huge room for improvement though 🙂 in terms of the whole AI thing.
AI in general hardly gets love
only these recent years has it been doing other things
Yeah, but hey, limited progress is still progress right?
Seems they've added a traffic system of some kind
right right, its like they have some gta tech coming in
I guess we'll see soon enough
Looking forward to seeing the tech
I was just bitching at Paul, one of the Epic guys about it being the matrix (I'm not a fan of keanu reeves) and how it was just a fucking advertisement
But hey, the tech can't be held responsible for the business decisions
I just wish games companies had a bit more artistic vision I guess
dont get me started, Kena won best indie.. sure it looks great, but its a sony + epic product, nothing indie about it
I think what set me off was the Matrix thing where they had that Uncharted style "shoot the tyres" sequence.. that stuff pisses me off
fucking call of duty and uncharted have a lot to answer for 🙂
pardon my french
It's a tech demo really, still hugely impressive though
Makes all the "GTA Realism Mod" videos look dated
Yeah, I was just wishing it was something original? I understand its a business decision and all.. apparently some of the team worked on the original film too. But it feels like UE is being subverted by lots of shitty advertising/crypto/nft bullshit lately, so I'm a bit sensitive.
Just don't like cool tech only being used for goddam advertising
With any luck we'll get some new original IP's from Epic post-UE5 launch.
This Kena is kind of Pikmin meets what? 🙂 some other game
Yeah, maybe. I wouldn't count on it. But maybe.
I'm just going to riff with it and see what comes out.
its pikmin meets market analysis
Planet of Lana looks cool
ok, I'm here with a weird problem - I send a MoveToLocation action to my AIController, and it doesn't do anything, because apparently i get NULL here. What is this?
here, when building pathfinding query
(this is ofc Epic's code, not mine)
is there any other way?
like, yes, I'm streaming in level, but that level has navigation built, wtf
@empty fossilDo you want WorldComposition + static nav data?
@alpine path yeah. i would assume sestting navmesh to dynamic is a performance hit i dont need
@empty fossilIt depends on many things. But here is setup for you: https://lifeartstudios.net/tips-and-tricks/ue4-streaming-navigation-data-from-instanced-level/
thanks, i will check it out!
I think with UE5 dynamic setup will be the preferred, since it is object streaming
Has anyone ever experienced this when using dynamic modifiers for obstacles?
A box collider with the area set to NavArea_Obstacle is spawned and the navmesh disappears. The area should all be green
Ah i fixed it, I must have changed something in the level and I had to build paths
So I have an eqs context that stores all of my enemy characters, and I'm trying to add a filter to their movement and cover EQS systems that ignores points that are within x units of any actor with said tag. Unfortunately none of the methods I have tried have worked, and I was wondering if someone could help me out/point me in the right direction (Im new to EQS)
My first thought was to use the distance test (mainly by setting something up that allows me to filter out points within x units of tagged actors), but even when double checking what I think are the correct settings it doesn't seem to work
Hey all, I am wondering: if I can implement something as a function inside the AIController OR as a node for the Behavior Tree - is there some general rule of thumb on how to decide? Any general good practices there?
For example, a function that goes through an existing array of actors, and return the 'best' one. Where would this go, AIController function, or a BT node? 🤷♂️
I usually try BT first since those are bite-sized tasks/services or else BP if its too dependant
perception for example, merits bp because of the set up
how do you make the BT to keep looping in a sequence while a bool key has some specific value?
also I don't understand what's the point of decorators checking if the key is set rather than their values.
Loop task
Keys range from bool to vectors and such
A bool key can be true or false - these are both considered set
There is no such task at least for me
Maybe its a decorator
yes, and I don't get the point, they allow to check if it's set but not their value
The bbc checks condition if set or not and updates on value or result change
the loop decorator only allows to define the number of iterations
it doesn't seems to check any key
You can have more than on dec or if you prefer make your own dec
I don't care how many, I just don't see any of them that can do the job
Will youtube it a bit, this is probably the most unnatural thing I ever had to deal with.
What methods can be used to stop AI from clumping up?
I'll admit I don't know what that means. I'm still learning AI scripting
Fixed it 😇
Thanks! I'll look into both of these methods
Hello everyone.
I am facing problems in AI Move to node.
It works perfectly and my ai is able to follow my player in unreal editor, dedicated server.
But when i package the project and run from client build, the ai does not follow my player.
What can be the issue? I have been with this blocker since long. Any help would be very much appreciated.. 🙏
You can make your own decorators too
Hey all, remember that discussion about thief and the shadows and whatnot? Well watch this presentation: https://youtu.be/Z6oZnDIgio4?t=238
In this 2018 GDC talk, Daniel Brewer and Rez Graham explain best practices for helping video game AI make decisions that will feel impactful to the player.
Join the GDC mailing list: http://www.gdconf.com/subscribe
Follow GDC on Twitter: https://twitter.com/Official_GDC
GDC talks cover a range of developmental topics including game design, ...
Basically, Daniel suggested intersecting the light frustum with the navmesh to alter the nav properties. Which sounds like a very neat idea.
It might be that the navmesh isn't built? Do you get anything in the log files to help debug?
perfect timing
Interesting, thanks.
Any idea how can I check if the behavior tree is executing some specific type of node?
I mean, from outside the tree itself.
i need a guide on how to make the enemy strafe around the player using eqs. I did a couple of tests but still it isn't working like how i want. if someone has done it before, it'll help a lot. been working on this for days now
the test i've configured cannot differentiate the Left and right direction so when it reaches an obstacle, it doesn't strafe the other way. it keeps on going in one particular direction instead
my tests
what are the applications of UPawnActionsComponent in AAIController? I couldn't find anything about it. How do people use it?
I can't get EQS scores to be anything other than zero when using GetActorsOfType, anyone know if that is just broken or if there is something non-obvious?
Trying to just do simple distance scoring
how do I check what sense my character was detected by when detected by perception?
you can make a custom task which outputs a string or draws a string at location
the way ive done it, though i did not end up pursuing further, combines two processes: one is to look at the target while strafing (usually a tick/looping timer) and the second is to move to a location offset from the targets right vector (this could be +/-)
did you set the context from the default querier?
i have a quustion: so i have this giant worm thing and i wanna make an AI for it. heres what i want the AI to do: when its idle to stay underground and randomly jump in and out of the ground, when its alerted to rush to the player- still underground and randomly jumping out of the ground
I don't remember doing that specifically. I made a new EQS query which is just this, it's set for search center to be the querier. My understanding was that ActorsOfClass in this case was the context, is that not the case? Could you point me towards setting the context if so?
i could be wrong, it sounds like by using GetActorsOfClass, you want to perform the query at their locations
Querier would refer to this controller which is executing the BT
maybe you've changed this
Where are those fields?
Interesting, mine looks like this currently
the dropdown should have your getclass
the pic i have is for pathgrid node, but you have it there: Search Center
Ah gotcha
that should have an entry for your query context
Yeah in this case I wanted it to be the querier, I think, because the intention was that the AI is the querier, so it should be looking for BP_Ships around itself (which would be possible targets)
ah, i think i understand
The hope was for a simple "get me all of X around the AI" and then I can filter down X via scoring to get the best one, and then the AI can engage that. Though they're all scoring zero when I put tests on. 🤔
not sure, could be any of the tests not set right. You have tests for both filter and score right? i see 3, looks like 2 for filtering and 1 for scoring. Also, when query happens, the other ships are valid in the navmesh (they're on it/using it)?
Intent was just to score higher the further they are, so this is the full set of the tests at the moment
There is a navmesh, though I don't necessarily think my ships are on it perse, they're just spawned into the world and querying it for locations, I haven't done any manual attaching or anything, though for this test I wouldn't necessarily expect to need to
ive never used this node, so i dont know its specifics
if its this much trouble, maybe a bp version using GetActorsInSphere SphereOverlapActors
I'm brand new to using EQS, so I assume there's just something dumb I am doing wrong
yeah, EQS and BT are very particular
part is hows its being used while the other is the specific checkboxes and settings
the feedback of what doesn't work is not that great
I created a post on UE Forums of the issue I described as well as a flow chart to kind of show the AI's full behavior that I would like.
Link: https://forums.unrealengine.com/t/need-some-ai-ideas/265484
Hello, I am making a customer AI for a store management game that I am creating. I have been able to complete a full circle for the AI, from when it spawn, to getting items, to purchasing, then to leaving. However the part I am trying to make better is when it goes to the register. The below image is a flow chart that I created sort of expla...
heh
you have such similar issues in yours as my project because I'm working on a video rental store simulator :P
the way I'm handling queueing in mine is the register holds a queue
and whenever the queue updates, the npcs update their physical positions in it
the queue update event includes their current position in the queue, so they can use that to determine when they're the first in queue and should perform actions based on it
@cobalt palm 👆
So in mine I just use vectors as points that the AI grabs to get a spot "in line". So when an NPC leaves, do you just call an event in the register that moves any ai in line?
yeah basically when the npc enters the queue, it tells the register its entering the queue, and it also starts listening to the queue's update event
and whenever they leave the queue they tell the register they're leaving the queue, which then triggers the events
Oh, did you watch/read some documentation on this so I can adapt it?
nah wrote it from scratch
Ah. Hm. So the events that are triggered, is it events that the register triggers based off who is in line and it is an event in the AI's bp or is it a variable that the BT is waiting for?
yeah the register manages the queue so it triggers it based on when npc's call the LeaveQueue function on it
the npc's have logic in them which handles being in a queue, and for my BT I have a Queue task which handles entering it into a queue, and waits until it reaches first in queue before it finishes
Hm. Ok so that queue task runs, then waits until it reaches first, then does another task for handling the leaving, and then you just do whatevere after that? Pretty neat. I just thought that using the move to function outside of the BT would cause problems but I guess if you are just waiting for something, it would have an issue.
Nah moving has no effect on BT stuff
It would only be affected if your BT is trying to move at the same time as your other logic is trying to move
Gotcha. Well thanks for the idea, I probably will have some troubles with it tomorrow so I will probably be back. Thanks.
Got a question for someone
Using a Sub Behavior tree to run some behaviors. It's using a Blackboard that derives from the parent blackboard but has extra keys... It's not running, does anyone have experience with that?
Would a generic ue4 AI character work good with time dilation? Do I need to do anything special?
the BT_SpawnDrones derives from the BB_Boss tree
Just has the one additional "shield" key
... If I make the tree no longer a child tree, it does continue into the sub tree, odd.
Anyone know how to make a sub-tree that has a different BB run? I don't want to have the root tree use an excessive amount of variables.
i played around with the tasks and generator parameters a bit more and it seems to be working fine. still not perfect but good enough to move on to work on different things
https://youtu.be/rYQQRIY_zcM?t=1372
Do we have a "game debug history" like this in UE?
i have a quustion: so i have this giant worm thing and i wanna make an AI for it. heres what i want the AI to do: when its idle to stay underground and randomly jump in and out of the ground, when its alerted to rush to the player- still underground and randomly jumping out of the ground
That's mostly just playing animations while idle and different ones while attacking
Anyone checked out the new stuff in UE5 for the Matrix thing? Just wondering what it looks like
Apparently the code is in there under experimental
Did they release the demo as project?
I thought it's for gameplay only on consoles
No, but apparently the code is in there
They're releasing some demos next year sometime
But according to the stuff on the internet, the new crowd stuff supports like 100,000 agents etc. Which seems worth a look at
Yeah, thats what got my interested first
Someone on twitter mentioned it was in there already under experimental
so.. I guess its in the UE5 codebase?
Yeah, it's the MassGameplay framework I've sent you earlier
ECS system with visualization thing, you have your agents in the ECS and bind them a visual mesh in the world
is there any info on it?
That's what they're doing from what I can see from Digital Foundry's video
Sadly no, but people at #ue5-engine-source has some knowledge about it
Digital Foundry's video?
Ah, hadn't watched that, thanks
ok
for a creature like that, you're basically going to have to animate it mostly
not really an AI thing
You could, but it would be a bad idea
Yeah, blender, max, maya etc.
What you COULD do in unreal, is add a control rig to it and add some secondary animations procedurally
ok
Hey guys, I am getting this weird navmesh thing. No matter what parameters I choose, some parts of the navmesh are floating above the terrain. And my AI agents somehow get stuck "under" it
Any ideas why? I have just a basic AI random move behaviour, and the agents are able to find a path on the navmesh and move to it, no problem. But once they find a path to this spot, they get stuck and can't move out of it. But they are still choosing random points on the navmesh, just can't find a path to them it seems
I guess it must be because they are somehow stuck "under" the navmesh?
Hey there, does anybody know a way to make an AI sight on navmesh instead of just something in front? Like your player requires to be on the same navmesh path before the AI can see you? I'm rather still new to the AI functions, I've only studied it a little to know about blackboard and trees though how to add it into my favor is something I don't know about.
I repeat, does anybody know a way to make an AI see player by through navmesh path? Try to think of it this way though I know this is not very realistic but it's how it worked, if a table is in front of the AI and the player is behind it the AI won't see you even though the table is not high enough to not block sight if you can get me.
Literally what colliders do for ai perception
I'm not quite sure what you mean by that. I haven't had a lot of experience with it. I'm at the moment trying to make a structure of the blackboard and behavior tree of the AI patrol. If you've played Persona 5, you should understand how to AI patrols in that game function. I've noticed highly that they patrol on the path of the navmesh so if anything is in the way of the navmesh, they won't notice you unless you are on the path open. If you'd like a full explanation of the AI's from Persona 5, I'll have to give a lot of screenshots so I'd like to put that all in a personal chat. I know this is a lot of explanation so I'm just asking if there's a way to connect the navmesh bounds volume to the AI patrol in a way though I'm actually trying to see in that is possible if I just cut the navmeshes with low objects so if you know this won't work then is there a way to do it?
Ai perception is implemented in BP (i guess cpp too?) and if there is a clear line of sight to its target, it will register so you can perform AI reactions (run at player, call for help - whatever based on BT state).
Blocking volumes can do the same as in the picture, but they are invisible in appearance. With your table example, the collider for the table can be created from sm editor, set to block all, and will perform the same. SM can also be marked as a dynamic obstacle which can move and if navmesh is dynamic it will update on movement.
In BP you can specify the Navigation Area Class for a similar reason.
Patrolling is usually handled by defining waypoints where the AI can then use the navmesh to travel with. Not sure how your are "detecting" the player and it sounds unreliable.
the navmesh generated looks low res, you could play with the Tile Size UU and Cell Size in Project Settings > Navigation Mesh to have it more precise, if that matters (i believe it will be a slight more expensive).
Alternatively, you can adjust the Agent's Default Query Extent, specifically Z, so that it projects itself onto the navmesh even if it is far away from it (specifically Z). Thats in Project Settings > Navigation System > Agents. The way I have my AI setup, they platform, so this solved it for me, I set the z to 2000 (Should be plenty right?)
I'll look into this and analyze if this can give the results I'm after. Once again, thank you so much!
sure thing, and I also dont know any of the Persona's so I'm going of the description
Personal thoughts, I can't seem to cross paths with many who do.
not surprising how specific game preferences are among other, especially game devs
the more games you can reference the better though
There's a raycast function on the navmesh that you could use to detect things along a line, if that helps
Or just tell the objects to block the navmesh and your agents will path around them
Where can I find the raycast on the navmesh if I can quickly ask?
Can't remember which class exactly. Sorry. Likely something like NavSystem. I just came across it when I was doing some cover generation.
Search for raycast navigation unreal engine on google? might hit something
Although maybe not. Not sure it was available to blueprint
It's fine then, if it exists than I'll look for it. I don't have a lot of experience with AI so my understanding is a little tough at the moment. If you played Persona 5, you may know a bit about the AI patrol I want.
yeah, thats what it's called
Never played it.. if you can find a quick video clip of what you want we might be able to help a bit
Oh...OK. Thanks!
never used it either, also not sure how it will help you
It's fine. Maybe I can share my end results if I ever get there with all that I can recall helping me.
it does a 2D only raycast along the navmesh only.. basically its a horizontal ray to find the edges of the navmesh etc.
it is just for edges? kinda figured, seems like something to check if the AI is on the nav or not
I'll look into this, I just needed to hints how to even start.
Well, I am pretty sure you can detect stuff like navmodifiers with it, so you could have a navmodifier on objects you want to look out for and use the raycast to detect those modifiers
Would have to check the source code again though
i guess thats cheaper than getting ~~nav ~~path cost?
Path cost is just the cost of enter/exit locations along the path for each navpoly crossed by the path
don't really give you anything for avoidance or knowing something is in the way
oh, thats what it sounded like it does
But that's probably where I'd start.. read the code from the raycast and understand what its doing etc.
doing in in navmesh is good because navmesh is really low poly
i pretty much EQS exclusively now, so i dont recall how these work any more
yeah, EQS would work too
Hey there, I have a problem with Unreal Engine's behaviour trees, so yesterday I have been following Unreal Engine's official introduction on behaviour trees, making that stealth AI that roamed around and chased the player if it saw it, or investigated a sound, the AI worked mostly, it could see the player and chase it, but the sound thing didn't work for some reason and since it was late I just saved, closed and went to sleep, when I opened up the engine today I was greeted by the AI perception not working at all: The AI could not see the player anymore, or if it can see the player, it did not chase it, I have found a guy who had the exact problem I have but the fix that worked for him didn't work for me, what can I do to fix this?
Here's a screenshot of the behaviour tree
And the screenshot from the AI controller
NOTE: On Target Perception Updated is never fired for some reason, so the problem must be there, but I have no idea what causes it
have you tried a print string directly after the event, ignoring all other logic? nothing fires? did you double check that the senses config are still there, that affiliations are checked? And that the player has not lost their settup for perception either?
I'll try making a print string now, as for the other questions, everything should be exactly how it was yesterday, but I'll double check
should be... yes, please check again
So... The player character AI Perception Stimuli Source is set to be source for sight, as it should be, but Auto Register As Source is off, I'll try turning it on
Oh it was that
I feel dumb now... Thanks I guess
gunna blame Ue5 unstable
Yeah, probably, I likely have to expect something similar for the hearing function that does not work, but that probably was an error of mine since in the tutorial the sound was triggered by the rock actor hitting a surface, while I triggered it when shooting with the gun
Thanks
Is there a good rule of them when something should be a service versus a task?
Services run on a modified tick time
So I want to branch based off my AI being dead or not, is the way to do that with a service that constantly updates its health state to the BB, and then do it via a blackboard based condition? or continuous loop?
Not quite sure the right way to combine the various BT bits
Something like this?
On the decorator you can do Observer Aborts when the death value changes to cancel lower priority (alive behavior).
I dont think its necessary to have a constant check of whether it is alive or not by checking health, rather, it would be told that it is dead when health reaches 0. So instead of checking something over and over, it waits for death as an event.
So on your selector, instead of the service, it would be a bb dec that could go one of two ways: check a bool result (isDead) or check the boat health (float comparison). So if you dont have an isDead bool on your ship bp, go with the latter.
Wouldn't I need a service to constantly be checking and setting the BB variable that corrosponds to the ship's isDead in that case?
I'd love to know how to make it more event driven, it feels heavily based around polling right now
This works, but I don't know if that's the best paradigm, not sure how to have the blackboard accessible ship state update based on an event rather than a poll via service
I'm guessing that in your boat bp, you have health right?
Yeah
and is there ~~anything ~~ any logic in the bp when health reaches 0?
Yeah, I can have an event be fired in the BP when that happens, is the idea to set the BB value then as well?
im first asking what exists
Yup, the ship has a health state, when its health reaches 0 it changes its state from alive to dead
And an event is broadcasted within the ship bp when that happens (whenever state changes)
My service currently just checks that on a 0.5s loop
hang on, before we start considering the BT, im just seeing whats in the bp
Yeah, all the health state stuff is on the ship bp
and on AnyDamage is what would determine it to be dead since you would do the damage calc to health right?
Yeah, there's a damage function which checks if it goes below 0 and changes its state, yup
okay
well when it changes to 0, you could have a SetBlackboardKeyAsBool if you want
your BT can update when it happens that way, so using a bb decorator would know this
as i mentioned above, an alternative is to simply have BT watch health
Hmm, I wonder if there's a middle options now that I think about your suggestion
So I like what you're saying because its event based as opposed to polling, what I'm nervous about organizationally is having things external to the BT set BB values, as then it's sorta arcane knowledge to know where in the project they're potentially being influenced by
Would it be possible to use a service, but instead of having the service poll in a tick, its activate binds to the ship's health state changed event, and updates the BB value there via the state change?
yes, less is better, so im asking what exists, as that determines the direction
you can use a bb decorator to "listen" to health
it would be better and work how you are thinking the service would work
I'd need to be manually setting the BB value from the ship though in that situation, right?
bb decorators can work with bool or values
no i dont think so
your BT would need to know of health though
Hmm, if not from the ship, when does the BB value get changed in this example?
we might be hearing different things... when i say bb decorator, im talking about the blue box that can be added
not the bb key
Yeah, one of these right?
alright cool, just making sure, we are on the same page
👍
so the bb decorator would watch a bb key (health) and in its settings, it can compare if the value is "greater than" or whatever
Yeah that part makes sense, question in this case I have is when does the BB health value get updated, since it's not actually the ship's health right, it's an intermediary equivalent value I need to keep in sync somehow?
i think so, but maybe not, though this is why a bb bool key seems easier
no yeah, you'd have to have a key
but you can pipe in the ship health to be setting it
and again, a bool key would do the same, which makes more sense given the boolean nature of life (or death)
Yeah, that would work I think, but that set BB value would come from the ship in this case, but I think maybe the event driven way inside a service would work equivalently and be the best of both worlds
Lemme test real quick
i think a way to avoid having the key (which is really not that bad) would be making a custom decorator - though its more about achieving preference
Yeah the event from a service works, and keeps it all internal to the BT, nice!
This is my service now, no polling necessary
well, its not what i was picturing, but hey, if its working for your needs!
Yeah this is just nice since it avoids the ship having to pipe in its health
And/or something in the BT doing that on a tick
it is doing it on a tick?
Not now, my previous version was, the service there UpdateShipState in the above screenshot was previously setting the BB value for state/health in its tick, so that the BB decorators would be checking against the up to date value
well keep testing it, make sure it handles respawning multiple times and whatnot
Thanks for all the help! ❤️
sure thing
Maybe someone here knows about that #cpp message
I think I understood it now.
Hey guys, I there a way to draw path on the navmesh? Like a draw debug path in Unity.
I have a basic behaviour tree with MoveTo point, but I can't figure out how to enable the path drawing
Visual Logger can show some of that info iirc
yeah I don't have that in UE5 it seems
can't turn it on via "VisLog" command either
got it, it was in Tools -> Debug 😅
OH!! finally fixed it. The Z extent did the trick! Now it's so obvious 😄 My AI kept getting stuck under the navmesh, in terrain holes, so ofc I needed to look further on the Z axis than 50 units I had before (which is like what, 50 cm? :D)
thanks dude
50 is 50 uu so yeah i think thats cm
does anyone know why would ISM/HISM instances not affect navmesh? pawns simply keep trying walk over it and getting blocked.
it is not carved out like static meshes in P/navmesh view mode
jesus this is a mess.. how can you possibly make remote control so bloody weird 🙂
Was the tutorial for behavior trees rewritten at some point?
I last tried looking at anything to do with AI in 2018 and the impression I had back then was that the documentation was a very obtuse step-by-step instruction manual.
Written for people who already had a background in AI that just needed to get up to speed with UE4 quirks.
It seems a lot more comprehensible now.
Or did nothing change and I just simply got gud?
Is there a way to have a in infinite wait node until a value is true?
I tried adding a while loop that waits till a variable is try to do a finish execute but I keep getting an infinite loop error for obvious reasons.
A little bit of both. The newer one does not go so heavy into making a bunch of custom tasks and such.
Waiting is a state 😉
I know 😆 I just need it to wait until a value is true. Rather than an infinite loop or a set time.
Its a hint
Now I'm confused 😂
The only thing I see is a wait delay
Waiting is a state
correct.
Acting like the annoying teacher that just wont say the correct answer
I am trying to get it, it just isnt getting to my head. 😂
Want a hint?
ok. . .
There's a node built in for it
Are you referring to a decorator?
Task
i thought this would be clearer
I understand there is a wait task.
alright, well, since BT are conditioned based, you need a state (such as buying an item, moving to register) that is literally waiting and enters this state if certain conditions are met or not met, depending on your approach
So you run a conditional loop while what you are waiting for is false
yall need to read up on how finite state machines operate, it's not this intricate
Depends on the setup I guess, I have AI parts where I basically wait with a conditional loop
Ok, so if I have the conditional loop set to "is not set", have it read a key, once the key is set to true, will it break from the loop?
Yes
you can have this from a bb decorator, they literally update on a value change
Ok. Thanks for the help, I will continue this tomorrow and see how this goes.
Hello. I'm trying to get the behavior tree asset from a behavior tree component in c++, but it's protected. And there's no getter for it either. Can anyone help?
GetCurrentTree() seems to be public? Have you tried using that?
GetRootTree() as well
Yup I tried both of those too 😞
So what's the problem with those? Do they not return the tree?
Not at all. Mind you I also made sure to assign to the behavior tree asset to the behavior tree component, and start the tree too.
I swear I do everything and ue4 does this too me lol
How did you verify it's not returning it?
with a UE_Log and prints out the returned type. Ima keep trying stuff and see.
so it printed out nullptr?
Well then it seems like it did return the BT
You're right. But for some reason when I run the game, the behavior tree doesn't show signs of running(that yellow surge of energy as I call it)
By the yellow surge of energy I assume you're referring to the way it gets displayed in the BT editor when it runs?
Yeah
Check in the dropdown in the BT editor's toolbar that you have an active pawn with the BT selected
Sometimes it won't autoselect anything
Good idea I'll try that now.thanks
Yo it worked!! I appreciate it immensely
Nice :)
Anyone mind answering a really dumb question that came up today and for the life of me I can't remember?
I had to get the name of an object in blueprint
I did getowner->get name and it returned empty string?
Just trying to print string the actor name
I guess the owner could be null?
that seems like it should work, but are you sure it has an owner? I think not all BP's have one
possibly not.. but whats the default way of getting an actor's name in BP? man its so long since I did BP stuff its embarassing 🙂
it feels like its the most trivial question, but it stumped me while I was streaming 🙂
just Get Name
you don't need to Get Owner it because that'll give you a different actor if it has an owner
weird.. so you can pipe self into get display name.. sheeit 🙂
Why doesn't it default to self? goddam it
Seems I'm out of practice BP wise
Thanks, that clears that up 🙂
it's just the same as calling this->GetName()
yeah, but it doesn't use self as a default param
Oh does it not? That might mean the function is not on the actor but rather in a library
Or it's a static function
Yeah, it requires an actor ref passed in
that's what threw me 🙂
that it was missing self 🙂
Ah
turns out just getting self and passing it works
Yeah it might be a static func, I know there's at least AActor::GetDebugName which is static
but not sure which one the BP Get Name node calls
Yeah, there's a few get... type name functions
ah well, I'll clear that issue up in the next stream 🙂
2 goddam hours and all we managed to do, was get twitch chat sentiment piped into Unreal Engine via python and the new web remote control thingy and get some basic AI director hooked up with the sentiment values
next stream, we'll have to make them do something more fun 🙂
That web remote control is both cool and idiotic at the same time 🙂
:D
I would probably have tried to hack all of that directly into UE
Your approach sounds like it probably requires significantly less work lol
Well, I could have used the vaRest plugin and it'd have been a lot easier 🙂 but still
the web remote requires you to interrogate the API for usable named objects. using json packets for every request.. its just nuts for what should be a route->function or parameter routing
which is what vaRest does
It would be an interesting experiment to just build a web api into UE where you can just directly poke at things
...I don't quite know what that would be useful for though lol
How does you queue work? It vector points that the ai grabs? The idea I had was a vector/object variable map that associated a customer with the vector point.
it's just an array where the customer actors are placed
the position they need to stand in is calculated based on the array index and desired queue spacing
This is my current setup. However I keep getting a Set Value as bool error.
This is the part of the BT that deals with this. The ai gets to the spot and called the Enter Queue event. It then does a waiting loop until the value is set to true to where it then does the purchase task.
Its saying accessed none with the get blackboard function.
the AI Controller has the blackboard I think
so you need to do a Get AI Controller first before you can do Get Blackboard
That seems to have somewhat worked. They are not moving up in line though.
Well at least the BP you posted doesn't seem to have any logic relating to moving in line except when they're leaving the queue
My hope with this was so that when an AI entered, it would set the AI that is first in line to purchase so that after they purchase they call the leave queue event which would then move each customer in line.
Thats what the web remote is.. its an API to allow you to poke at things in UE, its just a little.. unusable in its current form usability wise
ah
How else could I do this?
well when the actor goes into the queue it needs to move into the appropriate position
and whenever the queue updates (eg. another actor leaves) they all need to move as their positions would now be one further ahead
This happens in a previous task where the ai grabs the next available spot and then this Enter Queue event fires.
The Leave Queue event is then fired when an actor leaves which has a for loop for each customer in the Customers In Line array.
okay so if that's how it should work then hard to say.. you need to debug it to find out why they're not moving
Do Engineering Beyond Uuga Guuga
Does Every Bit Underperform Goodly?
hmm, nope
then it has been debugged
For the register bp where is manages the queue and tells them to move when they need to, is it an event set on a timer to check every like half second? I cant seem to get this to work in my head with only having and enter queue and leave queue events.
No, it just broadcasts an event when the queue updates
since the manager knows exactly when the queue needs updating (eg. when an actor is added or leaves the queue)
Ok, so I most likely need to recode it all as I am still having accessed none errors for getting the blackboard but it may actually be due to be getting the first index of the array in the Leave Queue event which would cause problems when the last ai leaves as the array is now empty.
Is there a straight forward way to put an AI into a State while they are performing a part of a Tree? I have a part that is made for Attacking. Some bigger Sequence that performs some actions. I had a PreAttack and a PostAttack which started and ended the State part, but if anything kills that part of the Tree (e.g. the AI gets hit, which will put them into the Interrupted State, which will, a lot further up the tree, abort stuff), it won't call the PostAttack and the AI won't leave the State
I tried a SimpleParallel, with the MainTask being something that manages the State, but Tasks only have Execute->Finish and Abort->FinishAbort, so there is no "everything completed and the sub tree is exited".
I also tried a Decorator that returns true and uses Activate and Deactivate, but then I noticed that the tree is never entered cause some other Decorators up the chain instantly fail their condition if the State Decorator changes something they rely on, so this also won't work.
Not sure if a Service would help.
Also, fwiw, I have huge trouble getting my head around Behavior Trees. They look so nice at the start but feel damn limiting by enforcing too many made up rules
I use OnNodeActivation and OnNodeDeactivation on UBTDecorator, aren't you just setting a state in the decorator? How other decorators are failing?
Yeah I think the same way with you on this, I also mix* HFSM and BT altoger. Recommended watch: https://youtu.be/Qq_xX1JCreI?t=1681
i thought a parallel node would help me for what sounds similar. I have an AI that checks if it needs to jump and doing a jump boots it out of other states (so it just looks dumb) i ended up not having that logic part of the BT so it essentially runs "in parallel" with the BT - basically does not influence state changes
Alien Isolation is a combination of some-kind-of Utility and BT, it's AI based on states and if you need examples of how they are handling states, you can check a mod that exposes their BT system to a custom C# editor: https://github.com/MattFiler/OpenCAGE -- though you need Alien Isolation to run the editor. It was free once on Epic Games Store, if you got that it's just ~15gb
The State is a Gameplay Ability from GAS. It comes with owned GameplayTags. There are other Decorators up the chain that seems to fail, because the Ability performs some actions.
Not sure why, but I can try fixing around that.
Thanks, will check
I never worked with GAS & BT together, only have a small knowledge of GAS, but Deadalic made a great presentation exactly about this. Not sure if it exactly covers your issue, but you might wanna check maybe: https://youtu.be/1Dm1G6fUuFs
It's more like that I want to combine it with a GA based StateMachine. AI has GameplayAbilities that can perform specific things when they get Activated. They are, based on UE4, activated when a Tag is added and deactivated when the Tag is removed.
Now there are two ways I can look at this:
- Tree Enters and Exists a Part of it that Adds and Removes the State.
- Tree only Enters a Part (and exists it again) if the State is available, and I add and remove the State from somewhere else.
But while 2 sounds good, I would still need to know when the Tree is done with that part to remove the State again, so it basically becomes option 1 again
I will first try to see if I can figure out why a Decorator doesn't work for me
Because it calls Activate and Deactivate exactly in the scenarios that I want, so this would be perfect in theory
Suddenly the Decorator works...
It really doesn't help that looking at a BT while it's active tells you the truth only 50% of the time
@pallid mica your PreAttack and PostAttack are parts of the BT?
They were originally, they aren't anymore
PreAttack was doing things like: Play Taunt
i'd keep it clean, have a TransitionToState that calls Post on OldState and Pre on NewState
If I would have the time, I would yeet that BT out of the window and code it myself
that way you should be able to abort part of the BT related to state just by setting the state BB key
Yeah it kinda works now. So I won't doctor around on it much more. I need to change the EncounterManager now to have a more organized attack order. Need to finish most of it this week. BT will have to work in the way it does now.
But I of course appreciate everyones answers and time
Co-workers in the office can tell you stories of me flipping tables over the BT.
I will probably come up with a custom solution to the BT in the future. Plugin 4tw
engine annoys me more then any weird thing other people do 😄
The BT just seems to enforce rules upon me that I don't see necessary.
It always feels like you need to know the exact combination of 5 nodes to accomplish something that in pure code would be 2 lines
Or use parts of it like Decorators to convey a state. It just doesn't feel right
we use BTs to run ingame mission logic
for that, they work great
managed to train a pair of junior designers into creating their own missions in just a couple of weeks, none of which had any significant programming or unreal experience
Don't get me wrong. The BT probably has its uses and people who use them for AI for the past years know how they need to do stuff. But I often waste time on stuff where I know that the logic is correct, but the BT doesn't support it without 4 additional nodes
(plenty of c++ running backend for that, but they don't need to concern themselves with that)
Yeah but it's not like one couldn't have made that mission logic stuff with a more generic state machine or?
There are plenty of StateMachines with visual editors on the market
Or even writing it yourself fwiw, cause making a node editor like the BT is not actually that hard. There are open source examples for this
Of course it takes time so using the BT if it works is totally fine
also prefer not to confuse those designers that can handle blueprints with another editor
nod i designed the mission system to work with unreal BTs out of the box
and didn't need to go out of my way to do it
so, they were perfectly fine
got c++ BlueprintAsyncActionBase derived classes that handle tasks like DestroyActor, ReachLocation, DeliverItem, FindItem, DeployItem, InteractWithActor... etc
then blueprint tasks wrapping those
Hi! I'm sorry for a late reply. Can you please say What is right method to create "cover triggers" for AI?
How are the problems you wrote about usually resolved?
It's been a huge 3 weeks lol 😂
I didn't see Cranz around for at least one or two weeks
ehh, really? ☹️ Maybe Does anyone know what he meant by that message? How triggers can help me detect a multiple enemies?
I don't even remember those days, it was the first steps of the current layout of the project and a lot of things changed
I still move my pawns from AIController without using BT though, I have a subsystem that manages path goals and uses a AITask to move them
Enemies won't overlap this trigger. Trigger is a place used by AI for a covering.
He meant that enemies position can disable trigger. For example
all sides of trigger are visible for enemies. AI can't use it for covering
Make an actor, create N amount of sphere components, place them to the cover points, when AI occupies that cover position set a boolean for that sphere component and let AI only occupy the non-occupied points
Or just use the Glass' cover system 🤷♂️
ty. it's a simple base. I'm doing same.
can you please send me a link to this system?
.
Why could it happen that my "Run behavior dynamic" doesn't actually run the BT I specified in AI controller`s begin play for a specific gameplay tag? In AI debug console I can see that correct BT is supposed to be running but that text is blinking with every frame as if it starts and stops immediately. Also it is run in sequence and it looks like the "Run dynamic behavior" task is failing because next task in sequence is never run
What is blackboard compatibility? I've created a separate BB for dynamic BT but I've set its parent the BB of the main BT, should it be enough?
I don't remember for sure. It might have to be the same BB
hmmmm
Easy enough to try and check if that's the issue at least
damn
it is the BB. they have to be the same
But was is the purpose of dynamic BTs then if I still have to keep all the possible conditions in the main and common BB? Unless... among with common BB variables I could only store a state object for each dynamic behavior and then just read it in dynamic BT`s tasks and decorators...
Yeah the BB inheritance thing seems a bit weird :P
I have a lot of custom tasks and decorators which just read stuff directly off my pawns and such because storing all of it in the BB would just be a bazillion variables and so much glue code
so instead you have bazillion of decorators that check different values?
lol pretty much
noice
Ok another theoretical question. Does anyone know state of this thing here? Is it some legacy thing that is going to be removed in UE5 completely or is there a chance there will be alternative to BTs sooner or later?
Im doing some implementation of HTN plugin at moment, as far I know is a early version very bare-bones and I didn't saw any updates in the git, its kinda working for me so far, Im using as guide to prototype a HTNP for my needs
some tweet from 2020
Hello, I am having a small issue where if call the Move To Location functions on an AI that is already moving to another location, it will set priority to the new Move To functions but once it arrives, it then moves to the first location it was told to go to.
Is there a way so that if the AI is moving to a location and is told to go somewhere else while doing so, it updates the current Move To location to the new one?
This is a finicky are but you can try abort move or stop movement maybe. Sort of depends on how the move to calls happen
The good thing is that the move to calls happen by grabbing all the AI that are in an array so that might work. Ill give that try.
@zealous ginkgo thinking more on it, a selector based on failure to find a loc via eqs might allow for a failsafe
I was thinking of that at first, but there is no blackboard condition fouling on failure
initially I was going to implement the failsafe within the move to cover function, but the EQS locks everything up before it gets to that point
this kinda of layout doesnt work then?
I just realized I just need to clear movement location beforehand and then just check if set afterwards
That works, I just forgot to clear target location first so it was still technically set to something and therefore true
oh
its always the small things that slip under the cracks
thank you!
Actually wait lemme double check real quick
debugging is a little lengthy
unfortunately it doesn't seem to work. Even with the setup above it seems to get caught since if the eqs fouls it does not overwrite targetlocation with a null, it just tries again
Ive also tried forcing a success to then foul on the next task, but that doesnt seem to work either