#gameplay-ai
1 messages · Page 148 of 1
If I recall, Mieszko did a livestream on the UE youtube channel showing how to use the EQS Testing pawn if you're interested.
@ocean wren Hey, thanks again for the response! That first part was quite helpful (i.e., using different contexts with different filters and the way they’re evaluated). I think I’ve got a better understanding of what you were saying in your first response now as well.
I believe I watched the Mieszko video on testing pawns a while ago and it was definitely helpful, but I’ll have another look at some of the AI videos.
I’m heading to bed now but I think I’ve got an idea for how to approach the tests tomorrow. Thanks again.
anyone ever did some procedural cover placement
does anyone knows what this error means? BB_Defenders parent is BB_Base. BT_Defender is a subtree injected and BB_Defenders is its blackboard
Behavior tree question.
Does anyone know how I can use this Key Query funtionality in a custom Condition or Service?
Of course I can use Branch nodes as usual, but those are static. As where I'd like to be able to choose great than or less than per instance of the Service node.
@frigid cipher iirc this is implemented in the blackboard condition decorator, you would need to build this logic yourself, eg. have an enum which has the comparison options, and one of the variables you set for your BT node would be of that type etc.
Ah okay. Using an enum and building it out from there makes sense. Thank you.
Yeah, I've done it.. https://www.youtube.com/watch?v=-17EYeQbJlY
Cover reservation demo (pink = reserved, green = unreserved)
Video showing some work on the cover probe actor for Ground Branch.
Stuff like that. Although I'd do things differently now I've done it a few more times
Oh hey you've worked on Ground Branch? That's awesome 🙂 I've been majorly focusing on FPS AI these last few years, so I'll certainly be checking out your videos.
They're a bit older now, I just looked at some of it was years ago now
But yeah, I did some AI to get them to the point where they could release the game and start getting some funding coming in
Glad they got published by Microprose recently, good on them 🙂
Oh yeah I just now saw that video is from 2017. Very cool you were involved with that project so early.
My current project is an FPS on Quest, and trying to get AI which are seemingly intelligent and feel dynamic on such a tiny performance budget has been an interesting challenge.
Yep and It's broken. Best way it's use version from marketplace
Mieszko Zielinski also confirmed its not working ^
@ocean wren What would you do differently for dynamic cover generation aside from the navmesh raycast?
Hey guys! I just tried to make the AI behavior by this video so my enemy attacks the player
https://www.youtube.com/watch?v=HuH3MTWGDNk
We have now got animations in place for the melee attack and now we are going into the behaviour tree to add the behaviour to the NPC to attack us when we are near them.
Link to Attack animation: https://1drv.ms/u/s!AvfMAVHw1KCio4EleOT4cnppOaPSUw
Support me on Patreon and get access to videos early, join our developer community on Discord, get...
It worked the previous time but now it gives me an error for some reason!
As I understand, my MeleeRange service can't get the Controlled Pawn from Event Receive Activation AI
So it checks the distance of... nothing with player and constantly setting BB key as TRUE bool
That's the service
All of the variables are instance editable, they are set in a Behaviour Tree
I don't get it really... AI possesses the enemy but it just can't do anything with it!
Help me pleeease
1 - Is there a finish execute at the end of the task?
2 - have you tried not using get player character?
Hi, i'm trying to make a parkour AI. how do I make the AI find the way to climb the wall using NavMeshBounds?
how does she recognize that the wall is the best way?
Is it needed in services?
It's not needed for services no. I wouldn't keep it like this, but just for troubleshooting, try switching your event from "Receive Activation AI" to "Receive Tick AI".
Alternatively, you could add a print string into the end of the current event and hook "get player character" into it and see if it's printing anything.
Hello, I'm having trouble with this AI node in blueprint. Is returning OnSuccess even if the AI has not reached the acceptance radius and there is no path on the NavMesh towards the player. Shouldn't it return OnFail?
I have allow partial paths on false on the project settings.
Is it possible to use "Rotate to face BB entry" for an actor that doesn't actually rotate?
I have a turret that has stationary base and head with weapon component is rotating. I'm rotating the weapon towards focal point so it moves
but how to know that it is already facing the right way
hello i have a door that uses a UNavLinkCustomComponent and i set the SetMoveReachedLink callback and everything was working fine. Today i created a new actor that also uses a UNavLinkCustomComponent and SetMoveReachedLink to open something different than doors and for some reason when an AI is trying to open a door he's calling the callback for the nav link of the new actor instead of the door and the instance of the door and the new actor are not even close to each other (they are separated by 10000 uu or more). Is there a reason why the AI would use the nav link of something very far away and from something that is on a different class entirely?
Anyone know if there's a way to use a decorator or a service to keep a node active (until some point in time) even if it has finished executing whatever it was doing? 🤔
I'm working on updating my AI to allow my NPC's to speak while they're doing other actions so trying to think of a nice way of doing this so that I can easily gate it so that it can start speaking at a certain point, and it would execute certain actions while it's speaking, and if the speech takes longer than executing those actions it would wait for it to end before continuing
Figured having it as a decorator or service which I plonk onto an appropriate node would work quite nicely but not sure if they can actually hold the node active until the speaking finishes...
tbh it looks like "no" and simple parallel might be the actual answer here
the problem with that is that I might want to have more than one task as the "main task" while speaking is happening, and if I was to put those as the "other tasks", then if they fail I don't think it will affect the result of the simple parallel node 🤔
I guess I could just have a separate task "wait for speak end", that would work, but it would require me to litter the BT with those everywhere where the npc might still be speaking and that's just mildly annoying lol
Okay I'm going crazy, how is this BT task not ending immediately?
It's just in sequence like this and... somehow... it waits until the speak ends before it advances? But... there's absolutely nothing in the task that does that :X
Speak Voice Line is just a regular BP custom event so there's no magic there... and I checked with breakpoints that it is definitely calling finish execute
This makes absolutely no sense >_>
Verified via prints and breakpoints that everything is happening as it should, the execution finishes... and yet here we are, the next BT task simply will not run unless the NPC finishes speaking
I even tried removing the speak node and then it behaves entirely as expected... but put it back and ????
I would like to have a very stupid guess
Maybe if its not instanced UE waiting to finish the audio?
Anyway to be more productive, is any breakpoints hits this code block?
line 140
Hey everyone, I might just be blind and/or dumb, but is there a way of linking the number of loops that the loop decorator performs to a blackboard value?
ABOUT BEHAVIOR TREES, DYNAMIC SUBTREES AND BB INHERITANCE:
does anyone knows what this error means? BB_Defenders parent is BB_Base. BT_Defender is a subtree injected and BB_Defenders is its blackboard
I vaguely remember reading somewhere that bb inheritance is unsupported with subtrees
Our support for “Run Behavior” nodes (which effectively run a subtree) does NOT allow you to use multiple blackboards. Each subtree is conceptually part of any tree that calls it, so they share the same blackboard. That means the blackboards must be compatible (anything you reference in a subtree must exist in the parent tree’s blackboard).
Unreal Engine Forums
Reposting a bit from my separate response to zoombapup’s question: We don’t support multiple blackboards directly. However, there are ways you can use multiple blackboards. First, we support blackboard inheritance. See my post here about “Parent” tab in the Details view. (I’ve also just made a note to add a specific section about blackboard a...
does anyone know why my AI's are all walking in sync with eachother? https://youtu.be/GLMu8mRDF7o
If they all begin their movement at the same time then this would happen
Eg. on BeginPlay or whatever triggers their actions
if you're using BT's you could add a Wait with some amount of deviation before it, or add a random Delay node in BP's, etc.
So I'm wondering currently how to not kill performance and yet have a way of evaluating the best location for an AI around the player. The idea is to have a variable amount of AIs around the player, with the rest sitting in a backline (sort of Middle Earth/Batman Arkham like).
EQS would allow me to generate points around the target (player) and evaluate them based on multiple tests, which in theory is nice. But since the player can move around, it would need to constantly re-evaluate the best point, means once an EQS query finished it can basically run again. And that for 10+ AIs, which sounds like I can say goodbye to performance.
I could do it outside of EQS, with calculating the points by hand and checking them myself on tick, but I'm pretty sure that's as bad of an idea.
I don't want the points to be static around the player (so not just 8 directions calculated with forward and right vector).
Is there any other approach for having points dynamically generated and updated as often as possible?
I will probably start with just running the EQS over and over again, crossing fingers that the tests are lightweight enough that UE4 spreads them out nicely over multiple frames for performance reasons
But EQS doesn't really sound like a system that should be used for constant evaluation
So, take everything I say with a grain of salt, because I've only been teaching myself the engine since March and I don't work in the field at all, but I have a very similar mechanism set-up using EQS and I've found it to be super performant.
From my understanding, EQS is basically just generating some vector locations using math, so it's relatively cheap to perform. You can also reduce the frequency that your checking those locations with EQS if you're really concerned about performance (i.e., maybe re-evaluate every 0.1 seconds instead of every tick). Finally, I use the system I set up with way more than 10 AI.
I know that Epic clamps the time spend on tests so it moves them to the next frame
But that only works per tests
It doesn't stop a test in the middle
So I need to make sure that at least each test is performant, which I guess is easy enough...
I would just set up a simple parallel node and test it out, I don't think you'll have performance issues but it will only take a few minutes to set up and test.
Yeah that was also something I was wondering about
If I should make this a Service or Task that runs parallel and "never" ends
thanks!
So the bottom most sequence is what runs your eqs?
And that runs once per execute and then over and over until the tree is aborted?
Yeah that's fine
That's the "Is in range decorator" and I monitor range using a service higher up
That's what I meant with "never" stop
Okay, thanks for the insight. I will try something similar. My tree in that regard is actually flipped. The main task is the EQS and the subtree is handling either running towards the target or attacking. so my distance check is down there and the abort happens if it loses the target
:no_entry_sign: SollertisKhan#2082 was banned.
Curious is there anything similar to web walking thats been created? I figure the easiest way to do this would be a nav mesh but im trying to come up with ways to handle large areas and have ai still be able to interact with the environment.
Exi: I've seen exactly this kind of thing setup in a presentation from an AI programmer at Squeenix. Basically an EQS query system setup with some interesting filter conditions. You can basically rely on the EQS timeslicing to have reasonable values for how many query items are done per frame. Sadly the video isn't on YouTube, but from what I remember of their system, they had a bunch of generators with different fallbacks for different attacking agents. So they would filter them by query context and have them basically move to a holding attack pattern around the player. They had a part of the query maintain visibility to the player etc. So the short answer is EQS it 🙂
There was a similar sort of thing in the game Sunset Overdrive now I think about it. Which I believe was on YouTube as a GDC talk? might be worth looking.
I also recommend reading Game AI Pro 360 Guide to Tactics and Strategy by Steve Rabin chapter 3 for this type of setup @ Exi
http://www.gameaipro.com/ it is free actually
Section 4 - 28th element
There's also the AI wisdom series available too
Hi.
I need help.
How can I correctly recognize a player by ai (on behavior)? Example - he looks at player 1s and is interested, after 2s he is aggressive. Anyone have any tutorial?
I did not find anything concrete
You could probably do this via timers
Eg. you first use the perception system to detect when the player is visible, so that when the player becomes visible, you trigger a timer, which then triggers whatever behavior you want
(and make sure you clear the timer if sight to player is lost)
@ocean wren @celest python thanks a lot!
@jovial kelp There's a GDC talk on YouTube by the guys who did the AI for Dishonored 2 that you might want to review. I think they covered some of this in that talk. But the main approach is to use perception counters. Basic idea is pretty simple, you add to the count while you percieve something, using different amounts for different types of perception events, you decrement the count for when no perception is present. You then have a threshold for the various states where the count being > threshold activates different behaviour. So as a concrete example, you might add 50 to the count every second that the enemy is in direct line of sight. You might add 20 if you hear a footstep close. Then you might have "interested" threshold set at say 200 and agressive at 400. You might then subtract say 10 from the count for every second there is no perception.
Here's a video of me showing the Ground Branch community my debugger for perception counters: https://www.youtube.com/watch?v=Qo-6AEyda98
This time showing the debugger for the perception system, showing the history logger that visually shows the perception values for each enemy perceived by the AI. This means that balancing perceptions and debugging them should be a lot faster and has already shown a number of errors in the AI setup. A great and much needed addition to the AI imp...
I also did a video explaining to them how it works: https://www.youtube.com/watch?v=Hm2uckBcDBM
Another update. This time about the perception system upgrades we're doing for the Tactical AI toolset.
I ended up using a bit of a mixed approach, using response curves and counter based thresholds (as you'll see in the first video)
@ocean wren ur cover stuff looks nice, however i meant to place the cover objects into the level
What Speed Variable are AIs using when using NavMeshWalking? o.o
Asking cause their MaxWalkSpeed is lower than mine, yet they run the same speed. Kinda weird.
(not using RootMotion)
I've seen versions where you simply place them at specific distances apart, so basically a regular grid or other similar sample. Have a look at the cover generation for Killzone for example. For games like Crysis, they sample the navmesh around objects and have actors the level designers can place to get their cover generator to produce what are essentially cover rails/polygons.
I went for the latter myself. After messing with just generating anywhere there's a navmesh edge boundary
So basic idea is that you look at the navpoly's and anywhere there's an edge that doesn't attach to another poly, you know its a boundary edge, so you generate cover samples for that edge.
But if you want a sort of rail (like say a wall has cover all the way along it), then you can have an actor that has a line segment that probes along its length and establishes a cover rail. Again, the CryEngine versions of this are documented if you want to see how it works.
nvm my question, I'm an idiot. I forgot that my GAS Attribute defines this stuff
Hi all! I make bots. There can be about 50 of them on the map. I need each bot to attack the closest one to it. As soon as some other enemy gets closer, the bot hovers over it.
Which algorithm is more optimal? I was thinking of creating a separate actor with a distance graph between each bot. And so that each bot in this graph somehow looks for itself and gets the nearest enemy.
If you do the logic in the behavior tree for each bot, it turns out to be too loaded for the system
Behaviour trees can definitely handle 50 agents no problem. If you're seeing performance problems, it isn't the BT
<@&213101288538374145>
:no_entry_sign: mvirtb#5768 was banned.
thanks!
❤️
Hi guys! I'm wondering is there a way to generate navlinks as the navmesh being generated? Currently I'm looking for a way to generate navlinks between two nav mesh poly if it's jumpable. I was doing it in OnNavMeshTilesUpdated function but after generating the navlink, it will retrigger the navmesh generation thus creating a loop :P
check Unreal Tournament 4 it makes jumps at runtime.
Can you show me where to look, that sounds really interesting, they can include jump in their path finding!?
Hi all, is there any documentation out there on writing a custom MoveTo task? I need my AI to move in a robotic way, so at each waypoint it stops, rotates to face the next point at a fixed turn rate and then moves in a straight line again. With the default MoveTo task, it will start moving before it's finished turning which it not what I want
You could fix that by adding a condition "is facing towards next path point" and not do the next move unless it passes
@ocean wren Thanks, I'll give it a try. The simplest way to move an AI is just through add movement input isn't it? If I want the AI to just move straight forward without pathfinding?
I can't seem to find a C++ equivalent to "move directly towards"
If its in blueprint, then its in C++ too. But yeah, you can move directly without pathfinding.
How to setup BT for pawn that has two independent sets of weapons?
The logic for one is Find Target -> Custom Rotate to face BBEntry (rotates only specified weapon set) -> Shoot (weapon set )
but how that would be with two?
also note: i can't split them to be independent pawns to have two bts running
I guess you could just build the rotation logic into the pawn and call that from the BT?
i could build more complex rotation node that does start rotation and waits until first weapon found target then triggers appropriate fire
what if i made some like "find suitable weapon" and do
Find Target -> Find suitable weapon -> Custom Rotate to face BBEntry (rotates only specified weapon set) -> Shoot (weapon set )
but i need to have each weapon be able to track their own target
Seems reasonable
Or you could just have "rotate suitable weapon"
whichever level of abstraction makes sense for your BT logic
does it have aicontroller (since it has to have path following component)?
debug moveto order
I can't figure out what you're asking or trying to solve. to me it sounds like you're just describing what the perception component does already @verbal knoll. it might just be a language issue, if you want to try explaining differently. are you trying to code your AI to switch from focusing on the first target to focusing on the second new closer target?
Morilec: You'd do the perception stuff as normal, but then filter out the results of the currently percieved actors with your own criteria before passing them on to the rest of your logic for perception handling.
@lyric flint Have you checked that the AIController is parented to the pawn? that can cause some weirdness if not. There's a checkbox on the AIController I think? Otherwise if you use logic relative to the controller things are weird because its position isn't the same as the controlled pawn
Nice idea, but honestly, state machines? what is it, 30 years back in time? 🙂
There's already a state machine editor on the marketplace
Although this one looks like they've put effort into it at least 🙂
😆
That navmesh looks decidedly hand edited too.. ugh 🙂
Ain't noone got no time for that s...
at least there doing something
Yeah, have to admit, I'm dissapointed at Epic
I know the AI guys at Epic and feel their pain 🙂
Hi everyone. I have an issue with AI that moves very slowly. I'm using a simple AIMoveToLocation node at the moment to test how my AI moves, and I have overridden the movement component of the AI and the GetMaxSpeed() function. I've noticed that if I have the AI move very slowly (say, max speed of 5.0f), then the AI gets stuck at the first path point, it just stops moving completely. If I speed it up a bit to more like 50.0f units then it navigates correctly
Is this a known issue with AI that it can get stuck on a path if its movement speed is too slow?
set a breakpoint on a completion and check what triggered it. may be there somewhere hardocded "minimal distance to travel" constant
@shadow pythonThanks, I found it. It's in the PathFollowingComponent. It runs a check to see if the actor has moved a certain distance within the last few frames and if it hasn't then it considers the character blocked and ends the move as "successful"
For those curious, it's at the bottom of the UPathFollowingComponent::UpdatePathSegment() function which is called every tick in TickComponent
State machines are still widely used
Modern approach is mixing them though
I wouldn't say widely and if you're talking about modern state machines then you'd be looking at HFSM like say Valve used. But its still goddam old tech that we binned for a reason 🙂
I mean sure, widely if you're new to AI. Or maybe widely if we're talking Unity or something. But for AAA we moved on a fair bit now.
How AI works with player being in unreachable area? There are partial pathes, but sometimes AI just gets stuck, usually stopping somewhat before getting as close to player as possible.
Its not about AAA, though sometimes AAA also uses State Machines. You wouldn't use BT or Utility pattern when you want to do a melee attack queue system or something like a boss character does melee attacks based on combos
Every pattern has its own usage area, so best is mixing them if possible
DOOM was using some kind of state machines, Final Fantasy also using them, then combining BT with it
the correct statement would be more like, nobody uses traditional/90's-like state machines anymore... other than that, you could argue by the simple words themselves everything is some kind of a "machine with states", i.e. a state machine. lol
(whether Skylonxe's work is more like an old fashioned state machine or a modern type I can't say, didn't really look at it)
Hi guys! I am having an issue with multiple navmesh agent types which they aren't supported when using detour crowd AI Controller. Agents with the default type work fine, but agents with any other type don't move. Any ideas?
I've seen BT's being used for melee attack patterns. Although that was alongside EQS, which is in effect a utility architecture. I'm sure HFSM and FSM would have worked equally well here. But the contention here isn't that FSM isn't usable, its that its not a very good system to use because fundamentally its hard to encode behaviour of any reasonable complexity in that kind of boolean logic approach. See the paper "Its Unwieldy and it takes a lot of time" from Microsoft Research for arguments why. Personally I'm looking at various ML graph based approaches to address the issue. Hoping to draw off recent work in robotics literature (robots tend to need to work well with humans and so them learning from "few shot" examples of demonstrated acceptable behaviours is one approach). Point being, FSM and all that are certainly usable. Just not what I'd call a good approach. BT's are slightly better, but have the same underlying issues. Utility and hybrid BT/Utility has been my go-to for commercial work, but I see that ultimately as a dead end.
EatMoreMore: If I recall, there's a list in the editor settings for supported agent types? Did you add yours into it?
I see, I totally agree with you. Thanks for the paper recommendation, I'll read it today. Unlike you, I dont like BT compared to other patterns but its just a personal preference, maybe with other engine I could like it more 😄 For example I wouldn't use it that much if there was proper (out-of-box) solutions for latent tasks and low-level memory optimization in other patterns (from marketplace or such, doesnt matter). Also thanks for the conversation and sharing your insights
There's a number of BT implementations out there. I'd argue that UE's is pretty flawed, mostly because of usability issues, but the event-driven nature of the implementation is pretty restrictive. Usually with BT's you would have more parallelism in there, but the BT's parallel nodes are not really that 🙂
Unity has some better attempts.
I was a big advocate of BT's about a decade ago, because I'd seen the hell of state machines and BT's were a step up. But they both deal with the same issue, that of encoding non-linear behaviour in boolean conditional logic, which is a bit wrongheaded 🙂
Right, off for the day doing interview panels.. back tomorrow.
Hey. Quick beginner question. In the Ai perception component I can toggle the sense for neutral, enemy, friend. How do I set this properties for my different characters/pawns? Im trying to create minions owned by a player, they should attack enemies, but not the other minions.
This needs to be done in C++ by using IGenericTeamAgentInterface
HI everyone. I've got a really frustrating problem with generating navmeshes. I've defined 4 agents, but some are very large (radius of 6000 units). I've noticed that the biggest (the 6000 unit radius one) doesn't generate properly: the navmesh is high in the air and it is almost exactly the same as the second-largest navmesh (3500 unit radius). Screenshots below:
https://gyazo.com/f9626149187c9a041727ff31d51f919b
https://gyazo.com/187b1a24d9d851d4ac58c0b5a16d1ed1
The pink is actually the "company" navmesh, it's just mixing with the red "section" mesh underneath xD
I've tried regenerating the navmesh several times, but it always ends up the same. Anyone know what the problem is?
Just to confirm: 3 of the 4 nav meshes generate correctly, it is ONLY the biggest agent which fails to generate a proper mesh
I made a simple Health variable in an actor blueprint, How can I access this data in a behavior tree I made ?
custom decorators or such
or use your ai controller to assign it to a blackboard variable
custom decorators ? Im gonna check that out
👍
how would I access my Health data in the custom decorator ?
Well it depends on what you're trying to do specifically, but you'd override the PerformConditionCheckAI function, and then cast the pawn that's passed as a parameter to your actor class (assuming the pawn is the one with the health value you want to get)
alright im gonna decipher what you just said when my mind is clearer
These few images are all made entirely with AI
More proof AI can be useful for much more than just controlling a pawn 
could make great concept art for devs to use as reference, each one took roughly 5-10 minutes for the ai to create after being fed the instructions and told to compile
if anyone is interested in things like that just say so and I can link some references of online tools and resources to use. I don't think it could replace a person yet, but it can definitely be used to assist or generate quick references to build from
I found a video of a guy using exactly the principle I want to use....the video is 2 minutes long, there is no sound. He just sets his custom decorator on a task...without showing what the custom decorator is or how he did it....and the video name is Custom Decorator....At least I know its possible
yeah those are kinda interesting... my game generates video tape box art, it would be pretty cool if it could generate crazy stuff like that, but having it takes 5 minutes per box is kinda prohibitive lol
just give them a load screen minigame to play while it generates 😆
lol jk, but yea, i am not sure how it would run inside a game actively
ok I think what you said is what I need...bbut I still cant find how too access my data...
What do you mean?
Like where in memory the data structure stores the data? Or finding the data structure itself?
I'm running into a strange problem where I can Run Behavior Dynamic, but not if its inside a Run Behavior
is this a new-ish bug?
or should that be working
For example, here is my root tree. This is working fine, as I'd expect.
Here is what happens when I run it from a sub tree. The Run Behavior Dynamic keeps failing instantly over and over.
This FEELS like a bug...
Does it contain all the necessary variables and values? Some nodes may not have the same inherent values so it can't pull the information from them that it may need
^
I'm trying to run the same dynamic behavior in both cases, plus its just a normal Wait inside it anyway, so it shouldn't be failing in any normal way that I understand
AFAIK this was working fine a few months ago
@plush pike Sorry Im still digging through ue4, kinda new to it. Now I know what I need, in short it was : Get owner > Cast to actor in particular > then Get X variable . This way I have access to variables I made in any actor (character, ennemies, etc) for my AI behavior tree's tasks. It's very useful and powerful !
I would love some!
Yea I would like to learn the source of that AI too
Have a look for google colab clip+stylegan and you should find a colab notebook that does it..
That particular model I was using on those, was VQGAN+CLIP
if you type that into your search bar it should return various things related to it. It's a text to image converter that builds on the CLIP algorithm published by OpenAi
There's also several websites which allow you to use it for free or for very low cost without the need to train one yourself, but training them is where you'll really learn how they work
My little logo on my account was made with a CLIP+STYLEGAN that zoombapup mentioned.
It takes a base image and a modifier image and applies the style and colors of the modifier to the base image
It can do tons of things on its own, but combine those two ai and you can create some truly unique images, 2 of the images above were technically created with both those models
If you wanted to take a personal lab a step further. You could even link a voice recognition or music recognition ai to the VQGAN+CLIP model and create images simply by speaking or playing music, this could even allow people who don't have use of their arms to create artwork to their liking
sorry yeah, meant vqgan 🙂 I've been messing with some stylegan things too
Whats fun about these things, is that you can basically just enter text prompts and explore what the generator creates
I've found it useful to add certain keywords to the text prompts though, like "unreal engine" and "artstation HD" for instance 🙂 to bias the generator towards images that have that sort of sci-fi look
For those interested, CLIP is being used to guide the latent space of the generator towards a certain value associated with the text. You can do some fun things like interpolate the latent values for different strings and whatnot too.
Latent spaces are a very interesting thing to play with if you're into generative ML
Ahh I thought you meant you had Ue4 parameters feeding your gan to randomize
I don't think either of those could run very well directly in ue4
But they make very helpful ai tools to use for developers
Could help in generating concept art
Could help in giving design inspiration
Could help in creating quick rough mock ups
Could be very useful for checking how something might look with a different texture or visual effect shader before creating and applying one
And stuff like that
You can also use something like stylegan to do animation technically
It would just be using ai to convert a person into some other style, likely whatever the models in your game look like.
Then you could just use a free ai program to crop the background out and have an animated video or Sprite or whatever
Although if you go that route I'd recommend existing tools, setting something like that up can be pretty intensive
Yea, you can definitely run ml in the engine
I was just referring to those particular algorithms. They usually require a full gpu cluster to operate
sure u need just a autodifferntial framework, from there u can implement anything
torch works also from c++
Where do you get the processing power from?
Most of the halfway decent algorithms require data centers of gpu clusters with the approximation of hundreds of terabytes worth of gpu ram all running calculations for the algorithms and sometimes taking several minutes
Something like that would take even the most advanced $7000 gaming cpu rig many hours or even days just to run a single iteration of the algorithm
Don't forget most those companies that offer the decent ai tools to use, like night cafe, have invested hundreds of thousands and sometimes millions of dollars into gpu memory for running the calculations in their data centers
what do you mean by halfway decent algorithms ?
In terms of the ones that do image processing and stuff to create tools usable for developing content
Not the basic ones for controlling characters, but the bigger more sophisticated ones that can help someone solo dev a game very comparable to a low end AAA title in under a year
i am more interested in the smaller ones 🙂 yeah but we are far far away,its not like we have all those descent algorithms and its just a matter of cost
We're basically there already when it comes to the tools available that are provided by the large companies with the data centers
You can take your smart phone outside and scan anything you want with an ai app that converts it directly into a 4k 3d textured model ready to plug into something like blender or zbrush
You've got great automated tools that have minor ai elements in them that drastically speed up modification to models to prepare them for use in game engines where the user barely needs to know what it's doing and instead just need to know what settings and button to click
Then you've got tools in the engine that can take those models and convert them into something usable and even tools designed to make them modular for fast level design and construction, as well as ai that can fairly closely fill almost every role of a concept artist with the exception of model sheets and animation sheets, then you've got ai that can create animations from video and transfer them directly to 3d models and rig everything up perfectly again with the user only needing to know how to adjust the settings
Then you've got ai code skimmers that read code and identify its purpose and can suggest modifications or outright replace it with more efficient and stable solutions, as well as great automation tools for many other areas of the process
Many of those are in early stages but are still usable and often yield better results faster than the manual alternative already
It's just most people don't bother because they don't want to trouble shoot what problems do arise
well. these algorithms arent really generalized, and do only work for a certain dataset
I guess all I'm getting at, is you asked what I meant by bigger algorithms that can't be ran in the engine client side.
Those are the types I'm referring to, that's all I'm getting at
yeah sure its need it, i am not saying ur wrong,
The more lightweight ones can easily be put into the engine, and they're pretty cool as well, just not the ones I was immediately thinking of 😅
There was a somewhat recent game a guy made mostly using modem automation and ai tools and put a basic ml program into the seat of the ai to challenge the player, it was pretty cool and very good quality
wich one?
When i get home in a few hours I can search for it
yeah would be cool,its smells like its about deepRL
You can always just use a REST api in the client side and move your ML to the cloud. Its what we're doing for some research work
But yeah, its possible to run smaller models in GPU mem on the client end. If you look at some of the models from Google's mediapipe, they even run on browsers etc.
Its just memory. Although sadly we still need more GPU mem 🙂
My work involves processing video, which eats memory like a thing posessed, so yeah, have to do that via a cluster to train with at least
The reality is that you can get pretty far if you're prepared to use async REST calls and use commercially trained services like Azure Cognitive services and the like
So a bit of cloud, a bit of games, a bit of ML etc.
I think some of the efforts to make smaller phone-friendly models of some of the main ML models is a good idea. Certainly having an "almost as good" model that fits easily in to phone based GPU's is no bad thing
The one I'm thinking of is called echo
Looks like the guys got a small team together now, been a few years since I've seen it, still a small indie studio
Yea, a lot of the ones I'm working with also use image processing, so I definitely feel your pain lol
I'm trying to do what very little I can to contribute to the progress of an algorithm that can create custom 3d models at high quality based off concept sketches and stuff 😅 first step is reliably getting it to interpret the sketches
Although scanning things in with a camera app pretty much bypasses that, but it's not very useful for stylized stuff or things that don't exist in reality
My AI is glitching when he tries to move with path finding (He is rotating to every direction and going in a crazy way). Is there a way to fix that?
I am coding my AI with cpp and without behavior tree
@plush pike u dont need to use ml for it,this isnt really ml area more differential geometry/geometry processing,however there are some applications out, but its a pretty new field,deep learning + geometry
Yea, I know
But ML is more fun to work with than calculating tons of geometrical formulas 🤣
Besides, depending on how you set up the ml algorithm, the ai basically does that automatically as it solves the problem and identifies the patterns
not really, there wouldn be just a ml algorithm.
I'm not sure I'm following
Are you meaning that the ai to solve that problem wouldn't be only ml
Or are you meaning that ai used to solve that problem wouldn't be considered ml?
Because if you're meaning that it wouldn't just be ml
I agree
However if you mean it wouldn't be considered ml, I disagree
Most of the systems I set up and test involve many ai algorithms working together, there will be one or two analyzing the data set to crunch a good fit to the data, there will be one determining how to best arrange the formula of the problem at hand to change the approach
There will be one designed to hinder them and try to throw a wrench in the plans by occasionally changing things about the data set or things about the problem it's trying to solve
There will be one analyzing the software in use to determine how 3d models are made by human artists in it and the best practices
There will be one observing the system as a whole to analyze the patterns in the system itself
And there will be one that is analyzing the progress and determining against a completely separate data set whether or not the output of the ai system is within acceptable tolerances or not
In other words, 2 ai I usually set to interpret the data, 1 I set to use the software, 1 I set to act like the unhappy and difficult customer, 1 I set to act like the manager overseeing the project and 1 I set to act like qa
there always some fancy terms, i am assuming u mean with ai algorithms mostly deeplearning
if thats the case,deeplearning is good in solving nonconvex problems,but doing that stuff on a mesh isnt really straight forward,
I'm trying to avoid the fancy terms to keep the concepts understandable to onlookers not familiar with the terms
But I don't just use one form of algorithm either
Each type is good at certain things, and the reason for multiples analyzing the data set is because their purpose is restructuring the data in a way that's easily usable for the one designed to create the model. And some of the data that needs extracted is better understood by one model while other data that's needed is better understood by the other model, so each model focuses in on what it's particularly good at and relies on the other models to make up for its weakness
For example the ones studying and reformatting the data are basically deep learning where the one that makes the model is more similar to something like alpha go
The reason for the one making the model being something like alpha go
Is because software use and model creation are very similar to board games
The data it gets fed is the end goal, the tools in the software are the moves it can make, the canvas is the current board state, and going through the process start to finish is effectively just a set of instructions to follow, the other 2 ai already did the creative heavy lifting, it just needs to do the assembly, and studying the moves it can make (the software it's using) is just teaching it how it can move its body to follow the assembly instructions the best
And the one overseeing the whole process acts as a reward/ punishment mechanism, it rewards successful quality results, but also keeps track of previous results and constantly pushes the system to improve and streamline the process while the one throwing wrenches into the system intentionally forces it to adapt and innovate to complex problems
the deeplearning stuff u see in image processing isnt really applyable to a mesh, because non of these works take the curvature of the surface into account, however its on going research to make cnns/gans work on a mesh, so u will find probably mlstuff about mesh segmentation but no one is using ml stuff for mesh segmentation in practice,
part of the reason why i have 2 different ai's analyzing the data sets to extract what information i need. it is not a matter of there not being one currently, it is a matter of how to structure one for what it needs.
i'm not of the type who just waits for things to be done by others, i am actively trying to find ways to accomplish it myself. people have extracted 3d geometry from 2d images for decades
when you look at an image you are able to identify depth in it despite it being on a 2dimensional plane.
an AI has a much harder time at this, however through the proper design of the needed data it is trained to analyze, it can accomplish this goal somewhat, the trouble is getting all the weights set right. AI is very good at noticing patterns, the only hard part is singling out what patterns you want it to notice the most and being able to have the foresight as a human to know which patterns actually contain the data you need to accomplish the task you are trying to accomplish
by identifying objects inside images first, then working in tangent with an ai designed to understand those objects the 2 ai can identify what shape an object should have, and be able to compare that to the image in order to determine what differences there are in the patterns and be able to figure out how the represented object might be deformed. due to lack of labeled data sets on many things however, getting a good fit to the data is time consuming and resource intensive, and i only have a single GPU cluster to use myself
and doing all that, with the way the ai reads pixels, is very difficult lol
to help you think about what is going on, i am basically forcing 2 or sometimes 3 ai have a discussion that pretty much goes like this
these pixels form a pattern
what pattern is that
it seems to be a ball
how close to a ball is it
i am 75% sure it is a ball, can you pull up references
here are some references of what a ball is, is it close to these
yes it is close to those
what is different
it has marks here, this is what the color values are, this is how they change
do those color value changes represent a pattern in the picture to indicate lighting?
yes they do
that is how lighting should appear on the surface, what ball references have a similar effect?
these ones are 90% similar in lighting effect
how does this compare to a similar ball with full metallic properties and one with none
and you get the idea by now
and that conversation goes back and forth to pull out every bit of relative information while comparing to related references of those types of information
There's a whole bunch of work in differentiable rendering and 3d mesh generation from images, I recommend Prof Matteas Neissner's channel on Youtube. He has had over the last year, the top researchers in the field doing presentations to his research group and has put those on YouTube.
Matteas Neissner even dammit 🙂
YouTube
Welcome to our YouTube channel -- I'm excited to share our newest, cutting-edge research with you!
My name is Matthias Niessner and I am a Professor at the Technical University of Munich where I am heading the Visual Computing Lab!
I am also a co-founder of synthesia, a brand-new startup working on cutting-edge AI tech for visual effects and mo...
Andreas Geiger's work is pretty interesting..
I also like work by Or Litany in this area. About 3D mesh representations and transforms that work in any space and orientation. I suspect that some of the representations they're using in this area will end up solving a lot of game mesh problems eventually.
QUESTION: scene - camera pans down on a city, people are walking about, walking in the park, having light conversation. camera pulls back and player now has control, as he starts walking the AI all stop and stare at him... after 90 seconds they start saying something. This is done with trigger boxes or AI blackboards?
could be done either way
trigger box would probably be easy, as soon as the player bumps into it you trigger the AI to stare, and then just run a timer for 90 seconds
Play it in sequencer, then at the end of the sequence, start the look timer
Hey, does anyone knows anything about the AIHotSpotManager class? Couldn't find any documentation on this.
the c++ starts with a U prefix so my guess is it should be a component, but I can't add this to any Character or AIController. so does anybody knows what it is?
As far as I know it's nothing
It literally has no code associated with it, beyond just an empty class
and the config props and the code that spawns a hotspot manager... but there's just absolutely nothing anywhere else for it
Here in this Live Training (https://www.youtube.com/watch?v=SjrLLXBY3C4) around 54:20, Daniel says that the HotSpot is used in Fortnite, I checked the source code (4.26) and yes the UAIHotSpotManager class is completely empty, so I guess it is no longer supported.
Senior Gameplay Programmer Daniel Broder gives us some insight into Behavior Trees and how they function in UE4 and answers questions from the community.
Here's the initial posting of the event - https://forums.unrealengine.com/showthread.php?59449-Twitch-Support-Stream-–-Behavior-Trees-–-March-10th-2015
Classic UE documentation, only documentation exists in a random mention in a one hour stream from 6 years ago
frankly it sounds vaguely like EQS solves some of the problems they talk about
so perhaps they just dropped it entirely before it got anywhere in favor of EQS
I wonder how many of the mystery AI features are mentioned randomly in one of these videos... like pawn actions
or whatever they were called
Pawn actions were a thing, before the abilities system. I used them a bit.
Basically a queue of actions
is anyone here knowlegeable to help me on something
Like
Im legit trying my fucking best
and so far i only managed to make one ai
AND THATS THE MANNIQUIN
In some RTS games players are able to build walls to enclose their structures, how would an AI know which object is blocking it's path if i right click 'attack' on a building that's inside the walls?
That way it could then attack/destroy the wall
There is a function for that but I dont remember on top of my head rn
Please help a noob out
Bro please
like
all this and t=]yet i yielded nothing
Even followed a youtube tutorial
Follow it again
yeah, or find another tutorial with the same subject
has anyone experienced a bug where the behavior tree sequence node does not actually advance when a bt task completes
like I legit have a task like this, does absolutely nothing
and then the behavior tree is stuck on it
results are printing of course, behavior tree just isn't moving forward to the next node
I guess I can get a source engine build to see what's actually wrong, but if anybody has experienced anything like this first, would be good to know
I have also tested sequences actions in the same blueprint task, so there's no last second interrupts occurring
If I recall, there's a couple of versions of finish execute, might want to check you're calling the correct return?
this same entire process was working before, so it still should be
Just something I remember seeing, I guess you're going to need to bust out the debugger
hello! need some help
how can i make a behaviour tree run from left to right if the DEC on the left fails?
since failing restarts the tree
Use force success or a selector
@misty wharf replace the sequence with a selector like this?
the selector will still read the decorator fail though and restart the tree surely?
you need to set it up so that you have a selector -> optional node 1, optional node 2
this way if you have a decorator on optional 1 which fails, then it will try optional 2
like im trying to set it up with another skeletal mesh beyond the mannquin
I did that XD
i tried putting up the ai controller
and then nothin
like the thing didnt move at all
so I just started experimenting with eqs and I have a doubt. I was making an AI which uses eqs to place itself properly relative to the player. But then if the player is continously moving, how would the ai consistenly react? Like the ai is still moving towards the eqs result but the player moved do the last query should be invalid.
do another query
how do I determine if I should do another query? I have one which tells the AI the player is out of sight.
My current conditions for eqs are have a line of sight to the player and be in range. The points are on the nav grid.
you could store the position where the player was when you did the query, and check it on tick or on a timer to see how far the player is from the point to decide if you need a new query
or any other method that would be suitable for your usecase
isnt doing stuff on tick expensive? Also for context enemy ai with doom 2016/ quake like pacing. But then the problem would be that since the player is always moving this eqs and movment would never succeed
it depends on what you do on tick
if the player always moves and you need to get position relative to player, and the position would immediately be invalid, then your position finding logic is clearly not suitable for your specific problem and you need to think of another way of doing it
awww
so I was looking at Doom 2016s AI breakdown of how they were placing demons by reversing the cover detection to keep them in sight
you could for example just use the position you got, and then once you reach the position or after a specific interval check if the AI should still be going to the position, or perhaps do something else
hmmm
it's worth just trying it with something simple first
even if the logic seems flawed, it might be fine in terms of gameplay
thats why I was thinking of starting with a zombieman like ai (2016/eternal)
so how viable would this approach be for a basic moving and shooting ai?
use eqs- move to resulting position - shoot.
It sounded doable in theory to me but only felt logical if the player was static
it seems reasonable to me
as said, it's worth just trying something that's not overly complicated
you could do all kinds of things like running new queries while moving to determine if there's somewhere better to go, but it might just look weird or otherwise not be so good for gameplay
so you could just try a basic system where it doesn't try to act too clever
then if that doesn't feel right for gameplay, keep adjusting it
oh wait your timer thing gave me an idea.
So I could add a timer in a behavior task which runs the eqs and waits for reaching the destination. If the distance of the player from the location given to eqs is too much the task fails forcing the sequence to rerun.
This task would fail on 2 conditions - player too far from the point given and if eqs could not give any valid points.
yeah something like that could be an option
@hearty niche https://youtu.be/G8W7EQKBgcg A good watch
Hmm, mildly annoyingly it appears that EQS cannot generate a list of actors by interface
time to copypaste and slightly modify another EQS generator I guess lol

im trying to make a ai attack system, but when the AI comes in to attack it stops. i have a video here showing it. There is a check next to sop on collision but i can seem to uncheck it. any ideas?
AI NavMesh question
So I have a relatively large map ( about 2km x 2km ). Would it be a good idea to
- Generate the entire navmesh for the map once and load it when the level starts?
- Create multiple navmesh volumes ( like 20 volumes ) and dynamically generate the navmesh whenever an NPC enters that particular navmesh volume?
I'm assuming solution 1) is better for performance but requires more memory... as it needs to store the entire gigantic navmesh.
Make a new animebp with the mesh you want
@autumn ibex The navmesh has to be in the persistent map and you may need to look into NavigationInvoker components for your agents to dynamically generate the navmesh around themselves
cheers, thanks mate
2kx2k isn't really that large. I'd not worry about it too much unless you're going for really small cell size in your navmesh generation. There are properties on the navmesh generator you can tweak for performance if you absolutely need to.
About the AIPerceptionComponent with a Sight config.
My AI randomly doesn't trigger the event where he lost sight with the Player. In the screenshot you can see my setup. It seems to be unreliable and I don't want to check every frame or so if the Player has been perceived or not.
Did someone encountered that problem before?
are there any other senses that are enabled?
yes, hearing and Damage
I disabled both of them and it's still occurring
Does anyone knows about PawnAction ? couldn't find any documentation. worked with it a little, but can't understand some of its functions, for example the pause function. how it's called? am I supposed to call it somewhere (like AIController)? or how can I use it in Behavior Trees? There is a node called Push Pawn Action, but when the node is executed, only the start function is called, and if I finish the action WithResult In Progress, the next time it is called, it doesn't resume.
Pawn actions were kind of replaced by the Gameplay Abilities system
Pawn actions were just a queue of actions to execute really.. nothing much more than that
I used it for RTS style commands alright.. but ended up rolling a different system
Is the sight sense timing out? Did you vizualize the situation with the AI Debugger?
timing out? I test by showing myself and hiding myself quickly back and forth till the bug arrives. Sometimes it happens sooner, sometimes it takes more attempts.
there is a stimulus age limit that is what he means. the perception remembers it for this duration
Could it be that the age limit timer is not triggering the perception update event then? I can't look atm. if I use it, if I remember it correctly I don't use the age limit parameter.
I can't remember exactly as it was a while ago, but I think I just removed any items from the senses if there was no event in the update. So basically keep a list of all sensed senses, if you come to the end of an update and any of them haven't been updated, then remove those.
It'd have been better if you got a "sense timed out" event, but I don't think that happened.
cheers, thanks !
I actually had age limit set to 0,1 and removing it seems to fix that problem. Thanks for the help VEGITO BLUE and zoombapup! ❤️
Hello, I have a question regarding navmesh generation:
One of the sublevels in my level is placed quite high (around 850k units) and the volume encapsulating it never generates navmesh.
Are there some spatial limitations when it comes to navmesh generation?
any idea why when I save value as blackboard key and immediately load it, I get different value?
lower line is original value, and top line is wrong really high values
Hi, is there a way in which I can define execution order of multiple behaviors tree .. meaning AIC_A running BT_A will always execute before AIC_B running BT_B?
no worries buddy happy to help
I wonder why perception system doesn't utilize gameplay tags for stimulus tags? I've just implemented that in our custom source, and it improved the way perception system works drastically.
Now we 're able to do more detailed queries within active stimulus in world with gameplay tags.
any idea why move to doesnt track moving goal? I make sure to update goal location vector
hello guys, i have inherited from AIPerception, but senses seems to not work even tho i havent touched the core functionality of the component, any thought?
GameplayTags is already a dependency in AIModule https://github.com/EpicGames/UnrealEngine/blob/ue5-main/Engine/Source/Runtime/AIModule/AIModule.Build.cs#L28 @lyric flint
Maybe gameplaytags only came later? Who knows
anybody? 😦
i havent overrided anything just the begin play and its calling his super
i just exposed more event to handle stimulis in bp
yeah i didnt know theres a limit
seems like sense are initialized when changing properties in the details panel
it works if i remove a sense and add him within the editor 🤷♂️
I vaguely recall people having issues listening to perception events from C++
even using the regular perception component without any changes, they couldn't get it working
I'm sure there's some way of setting it up correctly but I never tried it myself, just from BP's
seems like senses are register on UActorComponent::OnRegister, i suppose its when the component is registered
im confused, anyway its working
Hey guys, I'm having some trouble with my behaviour tree. I have a selector node, but it won't go to the node with the correct condition. The conditions on my nodes are based off an enum, and I can see that the enum is set to the value I want, but my node isn't reached anyway
could it have anything to do with what is in the sequence? maybe it is firing a success immediately?
hi guys, I'm really confused about BT, I guess decorator aborts self, when it fails. but when I set it to lower priority, does it abort lower priority nodes when decorator fails, or when decorator succeeds?
Look at the numbering next to the nodes, it looks like the Wait node is 61 with the Sequence being 62. They generally follow left->right ordering so it might be choosing the wait node first as a result
it aborts lower priority nodes when the value of the decorator changes even if it's not the currently active node branch
what do you mean by value of decorator changes? like output true/false changes?
yes
this should have a chapter on aborts lower priority https://www.youtube.com/watch?v=kEI4Ez-WnJQ
What are the Decorator Nodes in the Behavior Tree in Unreal Engine 4
Source Files: https://github.com/MWadstein/wtf-hdi-files
I think I saw that too
Im having so much trouble with this behavior tree, nothing at all works as I would expect it to, to a point I think it would be just easier to make my own custom behavior tree
it's not really a hugely complex thing but you just need to understand the basic concepts of how it works, if you don't then it can be hard to make sense of why it does what it does
@lyric flint
cpp
UHumanoidAIPerceptionComponent::UHumanoidAIPerceptionComponent(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
// Sight
SightConfig = CreateDefaultSubobject<UAISenseConfig_Sight>(TEXT("Sight Config"));
SightConfig->PeripheralVisionAngleDegrees = 60.f;
SightConfig->AutoSuccessRangeFromLastSeenLocation = 1500.f;
ConfigureSense(*SightConfig);
// Hearing
HearingConfig = CreateDefaultSubobject<UAISenseConfig_Hearing>(TEXT("Hearing Config"));
ConfigureSense(*HearingConfig);
// Touch
TouchConfig = CreateDefaultSubobject<UAISenseConfig_Touch>(TEXT("Touch Config"));
ConfigureSense(*TouchConfig);
// Damage
DamageConfig = CreateDefaultSubobject<UAISenseConfig_Damage>(TEXT("Damage Config"));
ConfigureSense(*DamageConfig);
SetDominantSense(DamageConfig->GetSenseImplementation());
}
void UHumanoidAIPerceptionComponent::BeginPlay()
{
Super::BeginPlay();
SensesUpdateDelegates.Add(EAISenses::Sight, OnActorUpdatedSightSense);
SensesUpdateDelegates.Add(EAISenses::Hearing, OnActorUpdatedHearingSense);
SensesUpdateDelegates.Add(EAISenses::Touch, OnActorUpdatedTouchSense);
SensesUpdateDelegates.Add(EAISenses::Damage, OnActorUpdatedDamageSense);
OnPerceptionUpdated.AddUniqueDynamic(this, &UHumanoidAIPerceptionComponent::OnPerceptionUpdatedInternal);
}
void UHumanoidAIPerceptionComponent::OnComponentDestroyed(bool bDestroyingHierarchy)
{
OnPerceptionUpdated.RemoveDynamic(this, &UHumanoidAIPerceptionComponent::OnPerceptionUpdatedInternal);
Super::OnComponentDestroyed(bDestroyingHierarchy);
}
EAISenses UHumanoidAIPerceptionComponent::GetSenseFromId(const int32& Id)
{
return static_cast<EAISenses>(Id + 1);
}
void UHumanoidAIPerceptionComponent::OnPerceptionUpdatedInternal(const TArray<AActor*>& UpdatedActors)
{
for(AActor* Actor : UpdatedActors)
{
FActorPerceptionBlueprintInfo PerceivedInfo;
GetActorsPerception(Actor, PerceivedInfo);
for(int i = 0; i < PerceivedInfo.LastSensedStimuli.Num(); i++)
{
const EAISenses Sense = GetSenseFromId(i);
AActor* SourceActor = GetOwner();
AActor* PerceivedActor = PerceivedInfo.Target;
const FAIStimulus Stimulus = PerceivedInfo.LastSensedStimuli[i];
if(OnActorUpdatedPerception.IsBound())
OnActorUpdatedPerception.Broadcast(SourceActor, Sense, PerceivedActor, Stimulus);
if(SensesUpdateDelegates.Num() && SensesUpdateDelegates.Contains(Sense))
{
FOnActorUpdatedSensePerception& DelegateForSense = SensesUpdateDelegates[Sense];
if(DelegateForSense.IsBound())
DelegateForSense.Broadcast(SourceActor, PerceivedActor, Stimulus);
}
}
}
}
"```cpp"
?
well, problem is that I sort of understand it, but for example now I disconnected and reconnected same node and it worked differently
that doesn't really make any sense yeah lol
I guess if it somehow goes out of sync, or if the node is close enough to another node that it recalculated the ordering
also while we are talking, can behavior tree once decorator fails, wait until task is finished and then abort self?
yeah afaik a task which gets aborted can still finish whatever it's doing before "finishing" the abort
not sure if there's some timeout on it or not, but at least based on how the abort implementation works it should be possible
I have two wait tasks, and they get aborted instantly
well that's probably just how it's implemented in the wait node
if you create a custom node you can choose what to do when you get the abort event
oh
ok I will try to create custom wait task where it waits until finished
so it keeps it going, but also lets other part of tree run
That's interesting
I tried to stop it, so when it gets aborted by decorator is should finish executed as not succeed
yet it still hangs there yellow
and now I changed literally nothing, and it works differently
did you try adding a delay into the abort event? so that it would wait before finishing?
also you need to call finish abort, not finish execute from the abort event
hmm is really strange, it didnt work with finish execute, then it suddenly worked even with finish execute. then I changed it to finish abort, and it didnt work, and then without changing anything it works with finish abort....
:D
I wonder if it's an UE5 "feature" that it's a bit fucky
unless you're just using some custom color scheme?
I use ue4
ah nevermind then
still I work like 10 years in film/game industry and I never seen software do such randomly generated weirdness
I will try to figure out pattern behind it
calling finish execute from abort though... no idea what that would do, most likely nothing good, so it behaving erraticly with that is kinda expected
but finish abort should work correctly - but what I'm not sure about is how it behaves if you don't call finish abort right away
assuming it allows you to call finish abort later, that's what I'm guessing should allow you to finish the task even if it gets aborted
but not sure if it does, I just assumed it would since it has a separate finish abort func you have to call
ok I figured out what causes those issues
if I disconnect that finish abort, and reconnect it and then run game, it wont work
it never aborts the task or?
yes, then I stop game, play it again and it suddenly works without changing anything
That's peculiar, I wonder if it's some weird bug with PIE
literally after working 1.5 days with BT, found like 3 of these issues that effectively made all my testing behave wrong
that pushed me to tons of false assumptions about how BT works
now I tried to set abort, and abort it once delay is done, however it keeps going forever, yet it doesn't do anything when delay is done
it puts task in somewhat limbo state where it still runs, but cant do anything
Interesting
Maybe it doesn't support asynchronous aborting then despite looking like that 🤔
hmm
actually
BlueprintNodeHelpers::AbortLatentActions(OwnerComp, *this);
it runs this as the first thing when aborting, before ReceiveAbortAI is called
so it kills your Delay right away
based on looking at the C++ code, I think it should work - you just need to set a new delay from the abort event
Any navmesh expert here?. i need help regarding dynamic obstacles
what exact mean by dynamic obstacle?
the area class is set to "navArea_Obstacle"
as you can see the the brown color area
what mean by this area?
does my AI character can't be able to walk in this area?
It depends on the nav area filter used
I don't know how the default one is set up, maybe it disallows navigating on NavArea_Obstacle
but if you create a custom filter and use it for your pathfinding queries you can choose how the different areas are treated (movement cost and whether it's allowed at all etc.)
can i also create custom navarea class?
i have a AI robot which pick some objects from floor, and then he drop the object at some other location, i want to update that object dynamically
Yes you can have custom area classes as well
if you create a new blueprint, choose NavQueryFilter or NavArea as the base and you should be able to make them
i created a custom navarea class, but there are only few options
how i can change settings inside NavQueryFilter and NavArea class?
Yes those are the only settings for a nav area
navqueryfilters also have a few settings like this
they don't have any other functionality besides those settings
what exactly mean by dynamic obstacle
@misty wharf i have a situation, where i have 3 chairs in a row.
the character is standing beside first chair, when the character want to move to third chair, but he can't able to move to 3rd chair, because there are two chairs already in front of character
is there a way to make a dynamic pathfinding system?
for example if there is not any space to move to ai location and player have to find a path dynamically, for example AI will move from another path @misty wharf
at least if you enable runtime navmesh generation it can automatically regenerate
dynamic obstacle has something to do with it I think but I'm not a 100% sure
if my character pick an object ( which have dynamic obstacle enabled ). Then it will create issues
Because the character navmesh path blocked due to dynamic obstacle. Imagine if i attach a cube mesh to character hand
like this
is there anyway to enable and disable dynamic obstacle bool at runtime?
so when my character pick that object, i will disable the dynamic obstacle
when my character release that object and then i again enable back dynamic obstacle
How was everyone in the beginning when they tried working on the ai
Like were you bad or good
I mean if you've never ever worked on AI systems you probably won't be good at it :D
@high summit probably, maybe just see if there's a node called set dynamic obstacle or something? Could be a C++ only feature too, some of those flags aren't settable from BP's for some reason
thanks
Hey i am in massive need of help! How do i make an ai prefer to use one nav mesh over the other? I have a building i want my ai to walk into but he insists on walking all around it. I have even created a custom nav mesh area but have no idea what to do
Have you tried using the AI debugger to visualize if there's even a path? I usually hook up an EQS debug pawn, with a simple actor as target. Then display the path of that to make sure there's a navigable path to be used.
Based: I was fine yes. But then I'm ok with reading and debugging C++ engine code, which for the more advanced AI you'll probably need that.
As you've probably noticed, there's hardly any documentation, never mind decent documentation 🙂
Hi, can anyone explain what mean by "Grid pathfinding" system?
Its a pathfinder, on a regular grid. I think Mieskzo created it for Paragon and they added it into the engine
Why when a decorator failed BT stops executing?
Huh?
That question is kinda unclear. Decorator failing will cause the node it's on to evaluate as failed, which will in turn affect how the current selector/sequence node finishes
Selector stops looping when both decorators failed
Selectors don't loop
Tick/Execute.. 😄
You mean the service on it?
Alright one sec
If both of those decorators fail, it would mean the top selector also fails
So I have 4 pawns, only 3 of them can obtain token, when one of them dies, other one should obtain the token. But when first 3 obtain the token, 4th one cant get the token and its TryToObtainTokenFromCategory fails and root node never ticks/checks (probably because all nodes failed?) conditions again so 4th one never can get the freed token
It's a bit hard to say but based on your screenshot what probably happens is the nodes immediately fail, which makes it fail so quickly the tick interval for the services is never reached
I think there was a setting on the service if you click on it which can be used to have it tick on activation or something, or you can use the function on services which runs when the service gets activated
that might solve the issue
Alright, to verify if I understand correctly let me ask another quick question, do root node updates the nodes even if literally everything fails?
What do you mean?
Nevermind, I found the issue. Looks like it was unrelevant with BT's. Thanks for your patience 😄
heh :)
hello guys, its my first try on a melee ai, i used to do this a lot when i was using unity but behaviour trees are different
i have animation notifies on attacks that trigger ai evaluation(should i block? dodge? whatever) the only way i can think to communicate the "response" to the bt is by setting a BB value
there is a cleaner way to do this?
i should really take a look into gas 😕
4.27 didn't really bring any changes to any of the AI systems afaik
you should be good even with older 4.2x tutorials, maybe even for versions older than that
Epic's last 2 AI videos are great
The one for EQS and the one with fancy explanation includes BTs, EQS and such
I did all this and the thing isnt moving still
Watch this and try again, if you stuck after that, ask questions
Probably that video will help you to understand the BT framework
For example rarely you need AI Move To for AI
You should usually handle those things in BT
Video explains about all of those properly
Im trying to get it to move on its own and attack
Like
I did an easier version of it
But shit its hard trying to make a blueprint of it and it still wont do shit
How do I generate a eqs with the origin being the result from another eqs?
take the first EQS's result you want to use as the origin, and use that as the querier I guess
How do I send the value as an origin?
hm, so the first EQS's result is just a vector and not an actor?
Yes
I made the first query to make sure it is in line of sight of the player
Now I want to choose a point around that point while still being in sight
One way to do it would be to store the vector somewhere, and create a custom EQS context which returns that location, and use that as the context for the generator
Not sure if there's a less roundabout way to do it but I think at least that should work
I am storing it in the task but I am not able to get the value in
Just use a generator with a generate points around, then filter those, then generate points from the filter output
using different contexts
How do I generate around the filter output that is my question
the EQS stack basically passes things through as it filters.. so if you generate points, the next entry in the stack gets those..
wait you can have multiple generators in a single EQS query?
yeah
finally after all this time a person who knows how that feature works!
I've randomly mentioned it a few times here I think and nobody ever knew about it and was basically "yeah you can have more than one but it doesn't do anything" :D
You can also have fallbacks if one generator stack fails
so basically, you can go "if this one returns nothing, then fall back to this other one"
Probably helps to code yourself a generator or something.. you learn its not a very complex system 🙂
hmm
I've never seen any configuration options for how to deal with if this fails then that in the EQS editor
Basically just drag another node off the root, the fallback will go left->right from the root.. so if left fails to generate anything, then it'll go to the right.. bit like BT selector
so if you had something like this, would it generate circles around the results of the first generator?
I only ever did two, but I assume it'll just keep going left to right
No, it'd do the first stack on the left, if that failed to return anything, it'd go to the right one
Ohh I see, that's interesting
how would this help for VEGITO's question though? since he wanted to generate around the results of the first one
I think the use case if like a default "nothing works, so just go somewhere close" kind of deal
You just add more generators in the first stack.. but change the contexts for the query
How do you add more generators into the stack :D
so generate points.. then filter those, then generate again, using those points as the context
lemmie see if I've got an example somewhere.. been a while
There is a Composite generator which allows you to use multiple generators, but I think it only allows you to filter the results of all the generators in the composite but not in sequence as you described 🤔
Looking at it, that must be why I wrote my own I don't think the default does that other than as you say the composite generates points from different contexts.. you can filter those though, so you could generate in a composite using the two different contexts and the filter out where it meets both line of sight and other checks
Mine read from the existing generator output and used a context to generate from those
Yeah makes sense
Its a pretty simple C++ class to override a few methods from
Its the kind of thing I'd fix for good if Epic cared to hire me to finally make decent usable toolsets for AI, but... they don't 🙂
Unity on the other hand.. are hiring like crazy

just DM Tim on twitter
as joking as I say that, I'm sure they have positions if you know the right person
Honestly I'd have thought some of the staff they already have would have convinced them by now.. I mean they've got like half a dozen top AI guys there by now
But almost none of them seem to have any sway.. its very strange
Almost Apple-esque in its disregard 🙂
Fortnite doesn't need AI I guess :P
Yeah, that's part of it.
I mean it DID have AI back when it wasn't a battle royale and was more a tower defence style thing
Yeah true
Unity has AI tooling, just not written by Unity
But they've got like half a dozen senior AI dev jobs right now in the UK
lots of ML and whatnot too
its tempting to be honest. But then they make the job less attractive in the job specs 🙂
Working with "customers" and the like 🙂
sadly pretty much all interesting jobs tend to be "move to location X that is not where I'm living currently" which immediately removes my interest
Yeah, Unity has like 5 studios in the UK now, so you could pretty much pick your home base
as far as I can tell, they have the same job specs for all 5 locations 🙂
apparently they're at like 1500 staff or something
I wonder what are all those people doing considering Unity seems to still be a bit all over the place
A lot of them are doing consulting and dev for "customers"
Think about how Epic are targetting say architecture firms.. well Unity are doing the same
But Unity are doing a lot of the dev work on contract
Who knows. Unreal is definitely getting more of the indie mindshare in particular lately which used to be basically 100% Unity
AI wise, I suspect Unity will have the better product, because its clearly actively developing its toolset
AND they at least care to experiment with UI
They're doing some ML based stuff, but they've got jobs for specific AI tech on the jobs sites
Tbh so far nothing I've seen from Unity holds a candle to what's builtin to Unreal... and pretty much everything that's builtin to Unreal is already years and years old :P
but who knows what they're working on, perhaps they'll surprise us
Have a look at the jobs they have.. clearly putting a big dev push in this area
I mean, I'd only be interested in taking ownership of the whole AI toolset, which isn't likely, so not for me.. but I think they'll be on top AI wise because they're at least trying 🙂
Yeah, can't argue with you there.. They've had some top AI staff working for them too
I guess they've got management issues trying to figure out what to focus on, given game engines have exploded in popularity across different industries
I suspect Unity sort of expects plugin makers to take up some of the slack
That's been the typical way Unity does things
I think the users just want what is already in these engines to be reliable and usable 🙂 both engines could do with a good push on Usability and testing
Doesn't sell though right?
I wonder if they'll ever fix the issues in the EQS editor where it doesn't refresh the description texts on the nodes until you close and reopen it :D
What do you think? 🙂
they'll do it just after they add better docs
You're a real funny guy 🙂
lol
i would call you a real optimistic guy myself
How they are working on it.
im trying to spawn a character BP instead of a pawn BP and apparently theres no way to do it?
id prefer avoiding re-parenting if possible as the C++ is edited on my character parent class
I didn't think it'd be an issue since characters inherit from pawns.. I dont get why it gives issues here
Is there a way to have an unconditional blackboard decorator node? I want to be able to trigger an abort in my code on a specific subtree of the behavior tree. However, I don't want this subtree to have a condition.
Hover over the thing that says Error, it should tell you what the problem is
Why Epic so strict about its encapsulation, damn 😄
how do I make the AI move to a point while not ramming into the player? Currently, if it chooses a point behind the player it tends to ram into the player
you need to add some avoidance mechanism to it
you can for example use the crowd avoidance system and register the player pawn as a crowd agent, which would allow the AI to automatically avoid it
I think rvo or custom system are also options
What is the advantage of HierarchicalQueryand RegularPathFinding over NavmeshRaycast?
RVO does not seem to work for some reason. How do I register the player as a crowd agent?
you need to implement ICrowdAgentInterface on the player pawn and register it into the UCrowdManager
any samples on this one?
it's fairly simple if you look at the interface class, you just need the couple functions on it which should be reasonably self-explanatory
also is this system a good idea for fps shooters?
to register it you do UCrowdManager::GetCurrent() and then CrowdManager->RegisterAgent(whatever)
I dunno, try it and see I guess :D
it's easy enough to turn off if you don't like it
ok so I take a pawn class and call this in begin play?
Yeah
ok so crowdmanager is the variable that caches UCrowdManger?
yeah you just put it into a local variable so you can use it in the function
the date type is UCrowdManager* here correct? Pardon me I have not explored AI that much in cpp
Yeah that should be it. You can look at the return type of the GetCurrent function to see what it should be
ok lets try this out! 🙂
use a service?
i swear somebody should write bp callable wrapper functions for these cpp only ai goodies
the problem is that you'd need to modify engine source for some of these, for example the crowd agent interface is not implementable in BP's
Wont a plugin do the trick?
No because it's an engine level interface, you would need to modify the interface class to allow it
I made those kinda stuff for ai perception custom targets (detections and the root)
oh hope epic makes this stuff more accesible in the future
I guess there might be performance considerations
since some of these interfaces could get a lot of calls
hmm I mean at least initialization stuff like setting teams and comparing them for example
UCrowndManager::GetCurrent needs an argument of type UWorld?
Oh yeah it might
nvm did a GetWorld()
@hearty niche you need to implement the interface on your class - as in, inherit from the interface using public APawn, public ICrowdAgentInterface
ok
Also you shouldn't store the crowd manager for no reason in the class
Instead of creating the crowd manager variable in the header, create it as a local variable in BeginPlay
UCrowdManager* CurrentCrowdManager = UCrowdManager::GetCurrent(GetWorld());
since you don't need to use it after you've registered with it
you also need to add overrides for the functions the crowd agent interface provides, so check in the interface's class which ones you need
what would go into the register function as argument?
this
what errors?
Header?
oh wait I had an object declared as ICrowdnInterface
now it built
so just adding this registering should affect avoidance right?
If you implement the functions from the interface
ok time to check out the api
also you do need to enable crowd avoidance on the ai characters but yeah after that they should avoid you
(and each other)
where would that be? I used detour crowd as my parent class for the AI controller
is that it?
Yeah might be
ok lets try this after fixing my stupidity of inheriting from pawn instead of character XD
can I get an example of how I can implement one of these functions? @misty wharf
FVector APlayerCharacter::GetCrowdAgentLocation() const
{
return GetActorLocation();
}
FVector APlayerCharacter::GetCrowdAgentVelocity() const
{
return GetCharacterMovement()->GetVelocityForRVOConsideration();
}
void APlayerCharacter::GetCrowdAgentCollisions(float& CylinderRadius, float& CylinderHalfHeight) const
{
CylinderRadius = GetCapsuleComponent()->GetScaledCapsuleRadius();
CylinderHalfHeight = GetCapsuleComponent()->GetScaledCapsuleHalfHeight();
}
float APlayerCharacter::GetCrowdAgentMaxSpeed() const
{
return GetCharacterMovement()->GetMaxSpeed();
}
You can do something like that
they are declared like this in the header
virtual FVector GetCrowdAgentLocation() const override;
virtual FVector GetCrowdAgentVelocity() const override;
virtual void GetCrowdAgentCollisions(float& CylinderRadius, float& CylinderHalfHeight) const override;
virtual float GetCrowdAgentMaxSpeed() const override;
why would one set the velocity through this crowd agent when the character movement has its own values?
None of them are setting anything, they're just returning values
I'm guessing the reason it's implemented in this way is that you can implement the crowd agent on AI controllers too if you wanted, or other things
hmm so getcrowdagent location and agent collision should be enough to set up basic avoidance right?
I implemented all four since it's quite simple to do, and it works. Dunno if it's enough to implement less
ok trying it out this way then
hmm, it does seem to turn a bit after hitting the player
so I can increase the range this by changing the collision right?
I think there should be settings you can tweak for crowd avoidance somewhere
in the navitagion system settings I see an option to add agents
the setup does seem less chaotic with enemies not jamming a small area now
If it isn't a character then you don't have a GetCharacterMovement
Oh is that even the error wait
okay I think you need to #include the CharacterMovementComponent.h file
the other errors are a bit weird but see if including the .h file fixes it, it might be interfering with the compilation
I think rvo is separate from crowd avoidance
Yeah not 100% sure tbh... I set it up in my project once and it works, I can't remember what were all the settings I turned on lol
and sadly there is no documentation either
ok I read I have to replace the Upathfollowingcomponent with Ucrowdfollowingcomponent
ooh yeah you might be right
actually that's what Detour crowd AI Controller does
That's the only thing it does :P
so I have to override something in cpp then?
the controller cpp files came up blank for me when I created the class
No you don't need to do anything, as long as your AI controller inherits from the detour controller you're good
If you inherited from the regular AI controller you would need to manually set it up so the proper comp is used
then why is it not working :(?
hard to say 🤔
I don't know for sure but maybe crowd avoidance logs into visual logger
visual logger?
"in the end we're going to switch over to Gameplay Tasks anyway, that's the goal."
What does that mean? Epic will use gameplaytasks when possible in the future or when shipped engine uses gameplaytasks automatically like in the BTTask_MoveTo?
😄
is it possible to send parameters to an eqs query? Like I have the distance range an ai maintians and I could reuse the query on another AI but witha different distance value?
Hey!
I want to create an animal AI, but I need some help with the basic structure. There will be different animals(deer, wolf, bear, etc.) and some of them will move in groups.
So about Behaviour Trees, would it be better to create one for every animal? Or just one for animals, which will have the tasks, like roam, attack, flee, etc.
I want some features(like attack) to have different logic for each animal. How would be the best to achieve this? Maybe different Behaviour tree for attacks? Or override an 'Attack' function in the animal's Blueprint?
I just ended up using the blackboard decorator node and made the condition always be true.
It depends on where the common behaviours are. If you have animals that do the same behaviours in general with minor tweaks, then make a BT for those and parameterize it via the blackboard. Otherwise, create more unique BT's.
Okay, thanks! 😄
If you are able to afford, Animal Behaviour Kit in marketplace has some exact examples for that. Though its totally not necessary but if you wanna see some examples and can afford it, it'll be a nice boost for your prototype phase
Yeah, thanks for the idea, that is a really great kit, but unfortunately I can't afford it.
how would I adjust a nav mesh bound to a sculpted terrain?
edit: i just scaled it, looks fine
Hmm, I'm searching the internet about this all day, and I can't figure it out. So when e.g. two animal is chasing the player, when the two animal gets too close to each other, the AI starts shaking (like it can't decide how to avoid that other animal or something). I'm using the DetourCrowdAiController, and I saw the Crowd Manager settings, but I couldn't make a better result(If anyone can help me setting that up, that would be awesome). How can I achieve some sort of better avoidance between the animals?
Or let me know if anyone knows games where e.g. a pack of wolf can attack the player.
sometimes my AI get's stuck and doesn't even execute the main selector anymore, any idea what could cause that? (it was also like that without the time limit)
ok, apparently that also happens when it can't find a subtask to execute?
How can I customize the description of my C++ BTDecorator class? Just like the Blackboard Decorator says: "Blackboard: HeardStimulusTag Is Not Equal To [None]
It might be something you can only do in C++, not sure if BP-based decorators have the function you can override for it
My BTDecorator class is written in C++. I wanna know how to do it in C++.
Why BTTasks use 'memory' structs? like in the BTTask_MoveTo
Whats the benefit if I don't declare my related variables in the class and declare them in a FMyTaskMemory?
I guess engine does some hacky optimizations behind the scene?
I'm assuming there's a performance benefit from not having multiple instances of the task class
and instead just running the same one with different memory blocks
Interesting, but looks like way too low-level for me to completely understand
There was a boolean something like "bCreateInstance" or similar, probably related with it
Yeah the create instance basically makes it so that it creates separate instances for each node of that particular task
This allows you to just use regular variables and some other things
(All BP-based BT nodes are instanced)
i actually did a breakdown
I get a lot of question on Unreal Slackers Discord about custom BTTasks in C++, how to create and someContinue readingAll about BTTasks in C++
explains the Memory block a bit aswell
@celest python
when your rocking 200 AI
you want to save memory where possible
so mostly all my nodes are non instanced
Thanks @pine steeple @misty wharf 😊
this whole thing has been a really nice resource since there's hardly any c++ tutorials, wanted to thank you for it for a while now
@real arrow i will expand it, once i get a bit more free time.
to go over decorators and services, etc. Probably dabble into perception system and using EQS for finding targets with perception system.
eqs like this
Oh sweet
the Game AI Pro books are free on their website, that would probably be something
what website
I don't remember the url, just google it and I'm sure you'll find it
Hey! I have an AI, that uses root motion to move. The problem is that when the AI try to avoid an other AI, the Crowd Ai controller decreases both AI's speed. Is there a way to fix this and avoid each other on normal speed? Can anyone give me a starting point about how to create my own code for this if there are no other fixes? Maybe a public github repo that has an example for this?
(this speed reduction is there even if I'm not using root motion. So let me know if there is a fix for this if I'm not using it, because then I will write my own movement for AI instead of using root motion movement.)
Hey everyone, so I asked about this a couple days ago in the CPP section and was told it's not something EQS supports, but I'm still a little stuck on the idea and was wanting some additional input as I'm not sure why it wouldn't be possible (even if the input is just explaining why it wouldn't work, just as a side note, it's not that I don't believe the person's information, I just don't fully understand it).
There is an EQS test titled "Gameplay Tag", this test filters queries based on the Gameplay Tags that are entered into it in the Environment Query graph. I would like to be able to choose the Gameplay Tags that are entered into it when I call it (i.e., in my behaviour tree and/or in my blueprint graph). My thought process was that this would allow me to have a single EQS Query of "Search for Actors of Class with X Gameplay Tag" rather than needing to create a new query for each and every Gameplay Tag I wanted to look for. I assumed this would be done by editing the Gameplay Tag container used by the test in C++ to be an exposed variable defined by the user elsewhere (similar to how you can bind the radius of an EQS search to a float variable).
Can anyone give any thoughts and/or input into why this isn't possible?
@winged grail I haven't looked at whether you can parametrize EQS tests by gameplay tags, but you can at least bind some types of values into parameters. I have no idea why they're limited though. You would need to create a custom version of the gameplay tag test that supports the parameter. If you can't use the gameplay tag as a parameter, you would probably need to pull the value from somewhere else in your EQS test
Hey, thanks for the reply! Do you know if EQS tests are simply sorting all members of the query using a for each loop and disregarding the ones that don't meet the criteria. For instance, if I search for all actors of class X and with Gameplay Tag Y, is it just grabbing all actors of class X in range and then sorting each one and adding any with Gameplay Tag Y to a new array or is it doing something more performant?
I'm just wondering because if it's just sorting them through a for each loop (rather than doing something more performant), then there's probably not much point in pursuing the idea any further (as I could just EQS to get all actors of class in a specified radius and then sort them myself).
I'm not sure but EQS is timesliced so it might be doing something slightly more elaborate
but most likely the basic method is a loop of some variety
you can just look at the source code for it to find out if you know enough C++
I definitely don't know enough C++ yet (I'm looking through tutorials but it's a slow learning curve 😆 ), I'm just trying to understand it logically, it being timesliced makes sense in terms of a performance gain though. Thanks again for the input I appreciate it!
hey guys
can anyone help me with a bug
i want on attack button pressed
my ai to move
what object do i put in the cast
You need a way to get a reference to your pawn into your HUD. From my understanding casting is just saying "treat as". Someone gave a great breakdown in a forum but I can't recall the link. My general understanding of casting is probably best illustrated by this example:
I create a variable of type actor and name the variable "MyVariable".
I set MyVariable to contain a custom actor I've made (let's name the actor MyCharacter").
I want to get specific functionality from my character, but pulling off the MyVariable pin doesn't let me access variables, functions, or events from MyCharacter, because it's type is just a generic actor.
So, I plug MyVariable into a case to MyCharacter node, and I am then able to access functionality from MyCharacter because the case is basically saying "if MyVariable is of type My Character then grant access to it's functionality".
I'm not sure if that's a complete picture, but hopefully it's helpful, essentially (from my understanding, which could be wrong), you'll need to find a way to get whatever actor that implements the AI functionality into a variable inside your HUD.
I'm struggling to get the Gameplay Tag Condition decorator working. I have my character populate the TargetActor Blackboard Object and it has a Gameplay Tag variable with some tags set.
When the behavior tree runs this Selector the check to see if the actor has the tag Player fails.
I've tested the actor in the blueprint logic and if I cast it to its blueprint type and then get MyTags I can check a Has Tag test to confirm that the actor does have the Player tag.
Is there something I'm missing on the behavior tree side here? I've tried setting the object type to be an Actor and also the actual blueprint child type the character is.
Hey, I'm assuming this isn't the problem but just on the off chance, is MyTags a variable that you made on the character blueprint or did you expose Gameplay Tags to the character blueprint through C++?
It's a variable added on the character blueprint
How do you expect that to work?
you need to implement the GameplayTagAssetInterface
and override GetOwnedGameplayTags function (in c++
to return the FGameplayTagContainer on that actor
is GameplayTagCondition your own custom decorator?
its an engine decorator, so yes you need to do what i mentioned above to use it @simple sigil
relevant C++ code on that decorator
Thanks. I was unsure how it was supposed to work given that there was no casting done to the object, thus it wasn't clear how the behavior tree was going to find the tags, but with it being a default decorator I wondered if it had a way of resolving it.
you can make your own interface or just cast to your pawn/character
and make a BP decorator that does the same job
Hi anyone know what the Action Component inside AIController is? I cant seem to find much documentation about it, but from the appearance it looks like UtilityAI
it's for pawn actions which apparently was some kind of system for just queuing actions and I think someone mentioned it might have been abandoned in favor of gameplay abilities but there's pretty much no docs anywhere for it so ¯_(ツ)_/¯
so its basically mysterious
Hey, I saw you already got the answer, just to add, the same goes for EQS if you decide to use gameplay tags with that (i.e., it needs to be exposed through C++). If you're already familiar with C++ then do your thing. If you're not (like me), it actually ended up being pretty easy to implement and I can link what I did to expose them.
Hi everyone quick question, should I be using detour crowd controller for my zombie ai or rvo avoidance? Only thing about Detour is that it’s a bit buggy with collisions and stuff
use whichever works better for you
personally I found rvo felt a bit floaty in how it pushed characters away from each other, but if you don't have those kinds of issues with it and it works better for you than crowd, then go for it
you can always change it later if you feel like it since it's not a complicated thing to do
Yeah, pawn actions were superceded by Gameplay Abilities system. The pawn actions are simply a queue of actions to run one after another. I actually used them to implement some simple RTS examples because you can get away with just giving an RTS unit a lit of actions to complete. But I'd probably avoid it for anything with complex behaviour (and the intention was that GameplayAbilities basically does all that and more)
I'd use detour, but actually tune it. Don't take the default setup because I think it doesn't represent what detour itself is capable of. Take a look at the raw recast+detour code (its on github now I believe) and you'll see what Detour is capable of. So you really should explore how to set it up to your particular use case.
Detour is a library Mikko Mononen wrote while at CryTek (he's at Unity now I believe), you can find some videos on his "digesting duck" blog.
There isn't any tick interval in BTTasks, right?
We configure them in FPrimaryActorTick normally but I couldn't find any equivalent in tasks
Oh actually it might only be on BTTask_BlueprintBase
Hmm, maybe I can steal some code from it
Lemme try, thanks
they literally don't interval the tick, they just not executing the code block if enough time not passed lol 😄
TickInterval.Tick() returns true if x time has passed
heh
I see thank you I’ll check it out
for EQS, is there a way to specify direction for cones or other query shapes?
or even location
or take it as a parameter
I seem to recall it was possible to specify direction for the cone generator... maybe it uses the actor forward vector if the given context returns actors
It is definitely possible to do if you create a custom generator which parametrizes those things though
unfortunately none of the builtins are very good in that way, you pretty much just end up copypasting them and tweaking them to allow the parameters
in this case I need a cone per "eye", and each eye may be situated in different locations, with different directions
I didn't see any options for custom generators in blueprint
I assume this is cpp strictly then?
Yeah C++ only for custom generators and tests
is there a decorator like compare BBEntries but for numeric values? e.g. access to greater than/less than
There a way to allow my AI units to jump off a ledge when following the player
@lyric flint Thanks I will check it out
I'm struggling a bit with AI actions. what's the best way to let AI perform actions generically? I was thinking about letting the behavior tree call an AIActionInterface or some such in a task, but perhaps there are better ways?
alternatively, if I could somehow let the BT carry all the information to perform the task, that'd be great. but that would require access to arrays and structs
Not sure if it's the "best way" but I communicate with AIController mostly, and encapsulate the behavior itself in the BTTask or BTDecorator depending on the action. But I might have misunderstood you, if you explain what kind of 'action'(s) you're talking about I might think again
I think the intended approach, is to use Gameplay Abilities
I'm kind of struggling with the concept of an action as well. for me an action is an animation x, happening at location y for time z. but animations don't leave way for logic, and if I have a situation where an AI is in combat, they should be able to respond with combat, not just animations.
Well, you need some code to handle the logic of "when can I activate" and "I'm currently doing something", which GA's handle
I've used PawnActions for same thing too, but those are kind of outdated and undocumented
I don't use GAS
Well, start 🙂
I don't intend to
Well, don't bother then 🙂
that's some terrible advice
Why?
GA's were the replacement for PawnActions.. I'm telling you what Epic intended.. not what you should do
saying "don't bother" with creating an AI system because you feel they should use another system is an extremely narrowminded way of looking at things
@ocean wren Isn't gameplaytasks replacement for them? Not GA itself afaik
GA is also gameplaytask
well, ok, I meant the gameplay abilities framework
There is also a concept like AITasks
I'm not using PawnActions
I'm trying to understand how to get AI to perform (the concept of) actions
but perhaps the BT tasks are what I need to be using for that, and make them less generic?
Daedelic did a nice talk about their RTS unit actions stuff (which is on YouTube I believe) and they repleased the code on github
BT and AI tasks are what you're looking for in my opinion. GameplayTasks (not abilities if you want to avoid, 'tasks') are also can be used
Intax: I didn't use them, but they were originally pushed as the "gameplay abilities system", hence my use of the term
and yeah, tasks and resource locking and the like
I do recommend watching that Daedelic presentation.. has some useful insights, for an RTS style setup at least
I understand, I just wanted to remove the confusion
I'm not doing RTS. I wouldn't have my first venture into AI be something where everything is dependent on AI
Daedelic's presentation could be a teaching example, it's worth looking at. I think it should give you ideas to start
It was not RTS-specific iirc
I guess it depends on your experience level.. but most of these concepts are pretty useful across genres
I mean its made for RTS but same concept also can be used in any game that has generic actions
yeah, there's plenty of stuff in there I've used in other genres
or seen people use in their games when we're discussing architecture etc.
I'm just very wary about hitting genre specific logic or patterns that may be beyond what I need
but I'm looking at it now
There's actually quite a few talks from the AI summit at GDC available these days too
Including a bunch of animation oriented ones if I recall
I thnk the closest notion I have for AI is something like a shooter AI
gets within range, finds cover, starts shooting
For more specific actions you end up "trying to find a way to communicate between other frameworks", like when you take damage or your health is less than X you want to disable some behaviors etc. and there are plenty ways to do this based on your setup, like state machines (the pattern one, not the Finite State Machines), GA's activation handling system (activating and disabling actions based on tag) can be some examples
Hehe.. "finds cover" 🙂
cover optional really
it's the shooting part that concerns me
doing some search for specific actors in radius and using them isn't a concern for me
Why are you concerned about the shooting part?
because that's the "action"
You might want to understand EQS too then, for example you can get a nice point with line of sight, distance etc. and you can rate the possibilities and get the best one based on your conditions
perhaps it just doesn't gel with the way I would like actions to be data objects. they will have to contain some degree of logic somewhere
I tried with EQS and while I appreciate it there just seems too much custom work to get it working compared to just a few dot product/line traces that I need
I have some specific requirements for my AI in that they aren't humanoid
or rather, they aren't just necessarily a single entity
I have an 'Apply GameplayTag while active' decorator, when doing some action I add tags like "AIState.Shooting" "AIState.CanFollowPlayer" etc. and I do my whole logic based on that tags, since both BT and both Actors can access it, it makes things very easy
Hi every one
Is the Detect By Affiliation problem fixed in ue5 ?
EQS as a concept is a pretty well tried and tested approach (i.e. scoring a bunch of options), basically a spatial utility selection system
Used across a bunch of shooters at least..
Probably he is not able to query the environment due to 3d space, if AI is not humanoid
Not sure though
sajjad: what problem be that then?
oh hey that's interesting
And my guess is.. no, its not fixed 🙂
so almost using gameplay tags as states
Cranz, to summarize, I use gameplaytags to handle "conditions", my 'behaviors' are generic but tasks are not. Tasks and decorators communicate with pawns, components a lot and they are mostly latent actions but not all of them are latent. I have some tasks to add speed, some tasks are just moving to player while adding a 'AIState.CanShoot' or such, this way while pawn handling shooting logic BTTask handling movement etc
But I'm only going on past experience here.. given I've no idea what you're on about 🙂
Yeah I was about to mention that
the main issue is that an AI may have deferred senses
Thats just my way, zoombapup probably has more experience and knowledge
I've seen people using sort of states in BT's and honestly I'm not a fan. Feels like mixed metaphors to me.. but hey, if it works for you, why not?
and the ordinary EQS is built only to accommodate very simple AI. I would have to extend the EQS with what I need instead
at which point it's simpler to just write my own few checks
Well, yeah.. EQS is there to be extended for sure
And if its just simple stuff you're doing, then probably overkill. But if you want timesliced spatial queries run at a decent pace, they're good enough
To be honest I'm not ultimately familiar with "Game AI" world itself, when I first started UE4's BT, I found Alien Isolation's source code and I mocked it, then things started to develop 😂
I think it's semantics. you don't have to call them states, but they act as states (or very similar)
AI is a rabbit hole 🙂
Yeah, but the reason we moved to BT's in the first place was to get away from using state machines (for very good reasons)
Then lots of people built states into the BT's and around we went again 🙂
Calling State machines inside BTTask FTW haha 😄
Can't remember the guys name, but a very popular tutorial on BT's early in UE4 had state machines built in the BT
I'd love to see a non state based BT. I really don't think there's a difference. I'm not using explicit states in mine, but what is a sequence but a series of steps that could just as well correspond to a state?
Its the way you transition though.. explicit state transitions was what we were trying to get away from.. its easy to fall back into that
Of course there's state in that you have a blackboard.. but not "states" whereas some people explicitly architect their BT's to look like a state machine 🙂
Damn I can't type tonight
Only reason I'm using gameplaytags they are hierarchical and can be accessed from anywhere, if I was using enums or bools etc. I wouldn't even bother it
I simply mock GA's activation handling, "can do this have any of these tags, can't do this if have all of these tags"
sounds like a funky utility system
without the dual axis stuff
Hmm, I wonder how many messages per second Twitch chat can emit
hmm, 10 billion messages a day according to them
??
Detect by affiliation works perfectly fine in UE4. Where does it need fixing?
in blueprint it didn't work fine for detecting enemies and friends there was a little bug
we had to write a few lines of cpp to seperate that detections
in blueprint we should check all 3 checkboxes to sense work
Right, yeah it's probably not going to happen because of performance constraints in BP's
so it retians in ue5 too?
I haven't tried it there but I would imagine so
Ok Thank you 🙏
looked through the daedalic talk, sadly doesn't answer my questions. it's so heavily involved with GAS that I don't see the point of trying to use anything they do without having GAS. they also didn't answer the question of how to perform actions generically
From their github repo of that talk
I just follow the same pattern for my 'actions', just with gameplay tags and BTTasks instead of GAS elements.
There isn't much any other way anyway. Alien Isolation source code was almost same too. Each sequence has a condition (decorator), each sequence calls BTTasks very similar to this and it goes on
I mean that's just explaining how a general BT looks. I'm asking what's inside of Use Ability
my BT looks like that too, for what it's worth. but it was never a question on how to make a BT work
But I answered that too, at least I explained how I do it.
For example for your 'action' definition here would be like this, you would sequence your actions in a single BTTask, play an animation, bind a delegate to animation's end (or just use BP play montage node, it will notify you via an exec node output), then move to a specific location then when everything is done, end the task
To achieve this, you would want to use AITasks which are latent as BTTasks, "PlayMontage" and "AI Move To" are AITasks, can be usable in BTTasks (and being used)
in that case I could use the Play Animation task
in my case I need logic with the animation
that's the issue
but maybe what you're doing with gameplay tags is just the same as using any delegate or what have you to create logic past that. if I supply an action as a data object, then perhaps I can just have that inside of something like an interface to let actors do what they need to do with the action data. I don't really see other ways of doing it. I'd love to bind delegates dynamically like this and tie it in with AnimNotify events, but I don't think I can do some of that in BP sadly
I remember something like that was made already, one sec