#gameplay-ai
1 messages · Page 16 of 1
Its a bit of a weird time for graphics.. we're on the edge of ML based graphics, but its still too compute intensive and slow..
That would actually make my life insanely easy😂
Im actually having to turn the generated nerf into a polygon mesh
Yeahh when nerf editing comes into play and ue unity and blender support nerfs by default it will be insane
We're working on methods of improving the nerf to mesh thing
Oh yupp we're working on that too
Any idea whats sota currently?
The current implementation is pretty neat but not that good
And working on faster workflows too.. spending ages in colmap is not a good plan 🙂
I'm just finishing marking for last semester then will do a lit review of the current mesh implementations so not entirely sure what SOTA is for the mesh aspect particularly, I saw some papers on SDF usage and I'm generally of the opinion that SDF's will play a role, but haven't had time to dig in
got a masters student looking at it, so will have to review what he turns up anyway
there's a bunch of literature on voxelization and some sdf work, which are the two main methods right now
Haha yup
But nvdia omniverse had done some pretty good work for animations
We're looking at more "in the wild" style nerfs though, i.e. take an iphone and go and scan stuff and have it be useable
I saw a presentation by Alex Evan's and co (nvidia) using an azure kinect to locate the cameras and then realtime nerf people.. siggraph asia I think? pretty recent.. was on YouTube probably
Thats the kind of thing I can get on board with
Intresting Thanks
Ive found this
https://github.com/qway/nerfmeshes
They use marching cubes and its pretty neat
Oh wow yupp thats pretty cool I also saw something using wifi signals for realtime object tracking
Combined with nerfs such approaches are going to be wild since everything is em waves
Yupp its basiaclly an extention which turns the nerf to a mesh but will have to see what approach they are using
Imagine creating a nerf without rgb values just via wifi signals
I don't know if you'd call it radiance then 🙂
Haha yup
I suppose one of the advantages of nerf to mesh, is that there's already a ton of visual content you can then extract into a mesh (i.e. just select frames of video and then nerf those)
Thats a really nice idea will have to take it up with the folks at laion to use nerfs to semantically generate a massive object dataset from youtube
Better than shapenet at least 🙂
Thats the presentation I was thinking of
Hold on.. this is THAT Thomas Muller? 🙂 hahaha.. no wonder i recognized the name.. anyway off topic.. apologies
We're doing to be doing this NeRF stuff in realtime for characters someday soonish too btw
That is really amazing!
Aah had to do a double take and search it up yup so thats nvdiffrec /nvdiffrecmc's paper
XD mans a legend
Ok where do i sign up
Was planning on trying exactly that after solving text to 3d:)
Dynamic radiance feilds is also a pretty good idea if you want to capture motion too
Kind of want one of Paul Debevec's lightstages before we try doing proper motion NeRF's though
Thats really nice
guess it helps to be a well respected professor in terms of getting loads of funding 😦
Have a look at Michael Black's lab.. I want one of those 🙂
Haha Yupp
@harsh storm any idea how to load debug symbols for AIModule?
I'd imagine it'd do it automatically as long as you have the debug symbols for the engine installed
Which you do so in the epic launcher
Maybe sometimes you just need to get creative😉
Im quite sure motion nerfs can be done with fewer cameras than a lightstage
I have them installed however I can’t step into the function
I’ll give more info here in a moment
Turns out it being null is normal so i just have to come up with a different solution
It basically doesn't get set until MoveTo is called. and only if the location is reachable
I didn't say I need one, I want one 🙂
Any tips on coding a flanking paths(?
Use the EQS
From what I can see it lets you access parameters in the ST with the help of linker but I'm ultimately confused because same method was also used for getting "node parameters"
I might return to ST after some more fixes. I just wasn't making progress with my AI due to some bugs. But the way that I did it did work. Just not sure if it is the "correct" way 😅
Does anyone have any tips on setting default configurable for AI to use (e.g., follow distance)? I'd like to do it in custom Blackboards, but they don't seem to support any sort of default value that can be set before runtime.
Gotcha
Don't go behind the player.. at most look for paths to the side. But remember your players won't know whats going on, so you might have to do something to feed it back to them. We had an FPS out on the amiga and the second release of it had AI that would run away and get their buddies and flank behind you, players hated it because they basically shot at someone, who then ran away, then 5 minutes later they got shot in the back of the head and died.. without knowing why.
Does pathfinding in navmesh care about the Z?what happens if search a path from a point with z 200 (floor is at 0) towards a point in the floor?it would seem it finds a path but i'm not sure why
What does that mean in practice?
It allows you to reach a point in the air if lower than 200 from the floor?
can that be disabled? My setup could cause the z coordinate to not be correct
I could linetrace to get the correct floor height at x, y but seems a bit excessive
Can you show how you do this on blueprints its been almost week and I am still hitting my head on a wall trying to make my character move
Really starting to lose motivation as I just cant get the thing started at all like this
At this point I dont even care making the main character to be a pawn and AI controlled, but then I dont know how to use the camera when you start the game
you have a navmesh at 0
you path point from 201
it wont find
it does a box trace to navmesh
to find path
Hello,
I use a spline mesh to create a decoration.
I would like to make this spline a smart object, and generate slots in some locations.
Is it possible ? or are we limited to create slots in a DataAsset?
hey guys, how do i disable the gameplay debugger ? i want to make a keybind with apostrophe but every time i press it, this screen shows up ...
You are limited to creating slots in the data asset.
All right, thanks, I'll do it another way.
I will wait until the SmartObjects are more advanced to use them. 🧐
has ever happened to someone that some actor's controller sets values on an other actor's blackboard?
I see they added documentation for 5.1 navigation streaming. Does this not work for you? https://docs.unrealengine.com/5.1/en-US/world-partitioned-navigation-mesh/
Hello, I have issue with AI. Npc detects me when i'm nearby but it's not facing me. Does anyone know how to make the npc look at my character?
still experimental sadly
Depends on the behavior that you want. Set focus is one option. Rotate to BB key is another option (BT task).
How to avoid the "Minecraft zombie" moveTo effect?i mean that the enemy just seems to proceed in one straight line towards you and it's kinda ugly
use pathfinding
I remember Mikko told there is a "Run StateTree" task exist in BT
Is it just me or there isnt?
Yeah moveTo uses pathfinding doesn't it?
I'm not sure but if I recall correctly there were two, one that's dumb and one that does pathfinding
the smart one might have been AIMoveTo or something like that
it might have changed, not sure
Anything except Simple Move To Location uses pathfinding
Mhhh i'll check it out
Hi! I'm trying to add Detour Crowd Avoidance using a custom AIController (really really basic) and custom MovementComponent (again, really basic). I'm using a BehaviorTree to tell my NPCs to move towards the player. When not using detour, everything works as expected, but when trying to use detour, the Status seems to always be Idle. Has anyone encountered this problem or knows anything about it?
I've been beating my head against a wall over this for a couple weeks. Trying to set a location for my AI to MoveTo. It works if I pick a random point off of the NPC, but if I set a specific vector, the NPC just freezes. Hoping it is something stupid that I am doing and easy to fix. Here is my BP.
use VisLog. It will show you where the location you're trying to send your AI to is, and will also probably tell you that it failed to project that location to navmesh, or find a path.
Anyone knows why StateTree has to update and call SetContextRequirements on tick?
I'm guessing your vector isn't where you think it is.. have to tried using a debug sphere to visualize it?
how do i change what part of the body an AI looks at? by default he always looks at the pelvis bone, how can i change it so that he looks at the head bone instead?
i can't use setfocalpoint
You need to implement CanBeSeenFrom which is part of the IAISightInterface (only possible in C++)
yeah, it is not public. I had to create just a few days ago.
5.0 or 5.1?
I was just creating my own too, thats how I saw SetContextRequirements thing 😄
yes, I was copying that for my BT ST node. I understood it that the contexts exists on the stack only for the given execution. So every tick we create a new context, set it up and then execute the state tree with that context.
So basically after each update context is being cleared so it has to re-set them.. but why it sets same values for each UActorComponent/AActor/...etc?
Do you mean this branching?
if (ItemDesc.Struct->IsChildOf(UWorldSubsystem::StaticClass()))
{
...
}
else if (ItemDesc.Struct->IsChildOf(UActorComponent::StaticClass()))
{
.
}
else if (ItemDesc.Struct->IsChildOf(AActor::StaticClass()))
{
....
yes
yeah, for example if its a world subsystem that we are currently evaluating and if context has more than one world subsystem external data in it, it's setting same values for each subsystem data
and from my understanding ST parameters are "external data"s
so its actually setting a value that I dont intend to if parameter's type matches with any of the thing on that branching before ST tick?
I believe External data's of context are Context params defined by Schema
If you see UStateTreeComponentSchema you will there a single external data defined
FStateTreeExternalDataDesc ContextActorDataDesc;
but I am not 100% if external datas are Params + Context or just Context
There is a .SetParameters() function in FStateTreeExecutionContext - I interpreted it's usage as setting ST params (it sets external datas) since UStateTreeComponent sets parameters with that function on StartLogic
I'm %99 positive its both params + context without being completely sure
https://github.com/EpicGames/UnrealEngine/blob/b0bd2840335e86e9d77bbb091d34337d3ad640c0/Engine/Plugins/Runtime/GameplayStateTree/Source/GameplayStateTreeModule/Private/Components/StateTreeComponent.cpp#L108
and it seems like setting the schema params manually
so that branching really confused me, maybe i have to debug and see
If that is the case then I am afraid they are being too smart with it and expecting there be only a single property of that type and that it will always referring to what they think it should be referring :D In the case of Actor it probably always gives you your owner 😬
In StartLogic() they override it with Context.SetParameters(), so the tree will start with you actual params, weird.

I have been assigned a new role with my job to do advanced ai with cpp and couldn't find many good tutorials or courses online. I checked some of the pinned videos in this channel but does anyone recommend a good course or something on it? thank you!
Need a hand with state tree. Have a task performing a trace and outputting enum of trace hit or not and then completing. If I transition on succedded it goes to desired state, but as soon as I add a condition to check if hit was blocking or not on succeed it will not continue. I have tried a custom condition as well as prebuilt enum compare.
"Hmm so I need an AI task which is like AITask_MoveTo, but a little bit different - I know I'll extend AITask_MoveTo, that'll make it very easy"
Famous last words. Turns out nothing about it is extensible in the slightest lol
Guess it's the same as with Slate, time for copypaste
Thanks! I’ll look into that.
I hadn’t. I’ll definitely give that a shot. Thanks!
Had to derive AITask_MoveTo last week but I was super happy that my smaller changes could have been surgically applied to in its child class. I wanted to change it to use meta path with "via" waypoints inputs. I know the struggle tho. 😅
lol yeah
For anybody interested, Smart Objects started receiving changes again. https://github.com/EpicGames/UnrealEngine/commits/ue5-main/Engine/Plugins/Runtime/SmartObjects
It was tied with the new world conditions plugin recently to allow modular smart object filtering.
I am patiently waiting for the support of moving smart objects. That is currently number one on my wish list :P
thanks
i managed to get it to work
You aren't going to find "advanced AI with C++" tutorials. I would start with the AI with Blueprints course on Epic's learning library to learn the systems. Then start very simple. Most people get into problems when they start off with making complex AI.
Right now I'm trying to work out having an enemy that runs at the player, slices them while moving and then retreats to the shadows 😅
It's been...fun
It's what got me started into EQS
Can a gameplay tag query be constructed at runtime. I am trying to implement Smart objects and feed the activity requirements search query dynamically with a has any tag from a container of ai "need" from a survival system
for future reference there is an eye level variable in character defaults
Yeah I'm already familiar with AI blueprints, I've done a few projects with them. But I just need a course purely for CPP cause that's what the company wants
How can i add multiple sight configs in perception component?
Is there any way to get NodeMemory in BTTask in a function that doesnt provide uint8*
Yeah, but you need access to the relevant BTComponent (since by default BTNodes are used as skeletons, i.e. the same BTNode instance is being used for all given BT asset's users)
// where `this` is the BTNode
const int32 BTInstanceIdx = BTComp->FindInstanceContainingNode(this);
uint* Memory = BTComp->GetNodeMemory(this, BTInstanceIdx);
thanks!
@cosmic gulch that doesn't change what the AI focusses on
are you check the top down unreal template?
Nope I use paper characters aka sprites
Why isn't there a infinite extent unbound option for navmesh volume? or there is?
I'm trying to make an fps enemy ai which makes use of machine learning and/or deep learning in ue5. Does anyone have any pointers?
how do you plan on training the AI?
I want it to learn while the player plays against it. The ai is yo put it simply suppose to learn by playing against the player and hopefully it should start playing to counter the players strategies and such
How do you make a box collision component modify the navmesh in its area?is there a way without navmodifiers?
I see an Area Class Override option in the box collision component but it's greyed out, can't change it🥲
Is there anything I should be aware of before learning behavior trees? Is it quite literally just: "do this when this value" And I implement everything? Or is it something different entirely
I'd recommend watching Epic's overview on the AI tools. It's about 30 minutes long and is probably the best tutorial covering things on the interwebs.
Very concise and hits all the stuff you need to understand it and get an overview.
The rest comes from practicing
Thanks, I'll take a look at it today
I am using Behaviour tree for AI in my 2D games. And I use the GetRandomLocation, and the Y axis that is returned is not always the same value as my AI character Y axis (because... you know... random). Is there a way I can make either custom 2DGetRandomLocation or lock the Z(?) axis rotation of my AI character?
you could just change the y value of your randomlocation to the y value of your character?
you may need to code the neural network from scratch because i don't think UE4 supports external libraries like tensorflow or pytorch
I did try that but sometimes the character still 'face' to the side
clamp the rotation of your character before it moves?
how can i do that? sorry if it sounds dumb to ask
and also do u know what kind of parameters you would want to train your enemy with?
UE should support pretty much any external library that is in C or C++, after all, it is just C++ at the end of the day. You just have to manually do the work in these cases. https://docs.unrealengine.com/5.1/en-US/integrating-third-party-libraries-into-unreal-engine/
should be clamp function i forgot from where or if its built in
it does. focus is controlled by target actor location + eye height
ah wait you mean the other way around
The location on the look target is controlled by GetFocalPointOnActor
while the location on the looking actor is GetPawnViewLocation()
personally I would change your controller so it does respect eye height in Getfocalpointonactor
so it's all nice and consistent
There are already pytorch plugins for UE4-5 on github, but that isn't going to help you that much, I mean its just using libtorch to load your python model (or you could use Intel's ONNX libs for same thing). Personally I'm following the "keep the ML outside of the game env" approach and training models linked to UE so that the GPU resources are easier to manage (not fighting with the graphics env for memory for instance). Same approach that Embark uses apparently
how do i change the strength of the sight?
is that a C++ only thing? if so, how can i change it, what is the documentation for it?
Pretty sure you'd need to use C++ to mess with it.. I don't remember it being too blueprint friendly, but they might have changed it..
What do you mean by "strength" though?
I mean you don't need to change the strength, so much as the perception value right?
Just go to the sight config in your perception
I built a system on top of the basic perception that had thresholding and built up perception over time
sight doesn't really work like that though
it does a raycast to some point on your character
and if that raycast hits, then its seen
oke
its not an "event"
Hmmm - I haven't looked under the hood, but do you know how it only does the raycast in the degree radius?
you can ask it anything and it will either know what to do or give you a completely bogus answer
So typically you'd do an update loop where if the sight sense returns true, you would increment some perception value and if the sense returns false decrement it
@ocean wren This was for you - just a hypothetical
I don't remember it doing that to be honest.. I built my own system for it
built a custom raycaster because I wanted to test different parts of the body in the update
Yeah, my systems were always just some trigger box in on the AI and then doing a raycast to w/e enters it
and did different perception values based on the angles and cover rating etc
It was quite a fun system to work on, I added a perception debugger value into the visual logger and stuff too
So I just need to dig in and see how they are doing it without a trigger box really. I always felt like that was how I mine wasn't as efficient. Just quicker to set up 😅
graphs of perception over time are generally useful
Basically, they raycast to points on the skeleton
Oh yeah - I know that much.
It's really just that degree radius that I'm curious about
I forget 🙂
So you can have it where it is only scanning in like a 40 degree area
Yeah, probably just to cap the min/max angles
in fact, doesn't it draw that in the debugger now I come to think of it
the pink semi-circle thingy?
Yeah, its just a dot product
And that's the part that I need to look at - 'cause I always just slapped a trigger box on the AI and then when player triggers it, shoot out that raycast. That was how my LOS systems have been built in the past.
There was a really nice perception lecture by the stalker guys on aigamedev.com but its gone now sadly
The pink is the lose sight area or something like that.
one of the colours is for the angle
Lost to the ancients 😅
yeah, kind of sad, but hey, was probably like 10 years old at this point
It's still green by default, you just see the lines shooting out from the Actor
not that we've improved even slightly in 10 years on this stuff 🙂
But what about us young pups with 🤩 in our eyes 😅
I mean its still useful knowledge
i.e. its still pretty much the state of the art.. sad though that is
it was all paywalled most likely.. but I don't know.. we were doing a lot of different things so maybe it was public
Oh well - fare thee well knowledge bank.
I wish Alex had just put everything on YouTube 🙂 but hey, its his baby..
Email him 😅
I'm sure he doesn't want to talk about all that these days 🙂
Sheesh, the AI jobs market is kind of weird right now
I swear I felt like I used aigamedev.com not too long ago 😭
you dreamt it 🙂
shows nothing for me
Ah man, those confs were fun
My uni at the time was messing me around and wouldn't pay travel, so I somehow managed to find someone else to fund it..
vienna was cool as hell really..
but I have a soft spot for paris still 😉
Hey, is there a reason my Blackboard condition doesnt give me the ability to abort lower priority?
nvm, needs to be a selector node not sequence
what's the way to go to run an BT with higher priority than another?
like pause BT1, run BT2, and resume BT1 when BT2 is done
Are you trying to do a subtree?
Yeah
then i'm not looking for that
At least - from what I've seen.
As far as I know, the Brain Component can only have one BT at a time. So switching it the way you're saying, I don't think is supported out of the box.
At least, with what I know.
yea i feared that
guess i'll give several behavior tree components a try
and adding/removing them as necessary
There is a way to get the current active task I believe.
So you might be able to save it, switch, then when switching back to BT1 - tell it to start playing at that task.
¯_(ツ)_/¯
Just curious if someone around is making an AI based game and decided to not use epic's behaviour trees. Recently I stumbled across an article that promoted utility ai over behavior trees (Tom Looman's blog). Now I'm curious if utility AI would really be that much more maintainable 🤔
it's just a different way of thinking about structuring AI logic, and depending on your game BT might be better, or utility-based might be better. Up to the dev and the project really.
I see, I guess I'll build a little prototype and see how it goes. Much appreciated.
I experimented tons of ways to structure my AI so far, unless you have some badass slate skills and time to write that slate code its rarely worth it
Why slate in particular? I presume to add tooling and debugging support around the new AI system correct?
yeah because otherwise at least for a project-wide AI solution you lose a lot of flexibility
Wouldn't it be possible to make some of the tooling in blutility or whatever are tools for ue made in UMG called?
for example utility AI heavily involves curves to scoring, EQS has some pre-defined functions but if I would want to use utility for complete decision making tool I'd want to edit curves dynamically in editor
UMG or blutility helps you until a point
I’m getting “Navigation System: registration queue full!” error when cooking or building project and I can’t figure out why it’s started to happen… Anybody knows how to fix it, or where should I look?
UATHelper: Cooking (Windows): LogCook: Display: Cook Diagnostics: OpenFileHandles=20580, VirtualMemory=8489MiB
UATHelper: Cooking (Windows): LogCook: Display: Splitting Package /Game/LL_O/Maps/World_Map with class World acting on object World /Game/LL_O/Maps/World_Map.World_Map.
UATHelper: Cooking (Windows): LogWorldPartition: Display: WorldPartition initialize started…
UATHelper: Cooking (Windows): LogWorldPartition: Display: WorldPartition initialize took 3.05 sec
UATHelper: Cooking (Windows): LogWorldPartition: Display: GenerateStreaming started…
UATHelper: Cooking (Windows): LogWorldPartition: Display: GetPartitionedActors started…
UATHelper: Cooking (Windows): LogWorldPartition: Display: GetPartitionedActors took 28 ms
UATHelper: Cooking (Windows): LogWorldPartition: Display: GetPartitionedActors started…
UATHelper: Cooking (Windows): LogWorldPartition: Display: GetPartitionedActors took 299 us (total: 29 ms)
UATHelper: Cooking (Windows): LogWorldPartition: Display: GenerateStreaming took 144 ms
UATHelper: Cooking (Windows): LogNavigation: Error: Navigation System: registration queue full!
PackagingResults: Error: Navigation System: registration queue full!
how can i make the AI turn smoother?
so that it doesn't snap to where it wants to look?
Hello,
I'm trying to use dynamic behavior trees with RunBehaviorDynamic + SetDynamicSubtree, however I bumped into a problem: as far as I saw, SetDynamicSubtree only works for the currently active BT and won't work if you have nested dynamic BT.
My idea was to predefine all the mappings (GameplayTag -> BT asset) in my character and then register them with SetDynamicSubtree upon possession, but this fails to register all non-top-level BTs.
Then I had the idea of re-registering all dynamic BTs every time the BT changes, but I cannot find a proper place to do that: RunBehaviorTree is virtual but it's not called when the top-level BT enters into a dynamic subtree, so I'm out of luck there.
Is there a way to do this? It looks strange to me that dynamic subtrees are not designed to be nested, so I guess I'm missing something?
RInterp, rotationrate etc
@misty gale i am using ALS v4
I am no utility AI guru but I think at this point I would lean towards using it for a specific part of the AI, not as a core decision thing. At least until you are exactly sure it is going to be a benefit. Some people use this within BT to pick from behaviors based on score. https://unrealcommunity.wiki/behavior-tree-utility-plugin-qenq8l86
I have my own full utility reasoner plugin based on the popular GDC talks and it kind of works, I just did not have a use case yet which would make it more readable than BT + ST combination. Might be just a wrong pick for that specific AI I wanted to do. This is how it looks with no custom UI, just data asset configuration.
This plugin extends the UE4 behavior tree with a new node.
How to run EQS query in blueprint event graph(and get its results)?
So in moving from Behavior Tree to StateTee, I had my BehaviorTree on my AIController, no problems -- now that I've moved to StateTree -- inside where you wire up the "Context Actor" I can't access the Controller? What should my Context Actor be here, and how would I access my GameplayAbilitySystem attribute set in order to do the evaluation logic basic on that?
In my game the AI also has playerstate and GAS ability system so also its stats are on its AttributeSet
How to test a EQS that uses a context with a testing pawn in editor?
Good question. To this day I don't test them with testing pawn and use gameplay debugger during runtime instead. If anybody knows, I would like to know too.
I guess wild EQSs ran from a regular actor in event graph cannot be visualized with gameplay debugger?
Btw i'm creating a test version of that EQS which uses test contexts(that returns actors i already know are in the editor before play) to test it in editor
How can I add multiple sight configs to one perception component in c++? Whenever I add a second sight config, it just replaces the first one. How can I add more than one?
add it to a different socket?
hello everyone, i'm trying to use the node Simple Move to Location on a Vehicle Movement Component but it does not seem to work, is there an alternative or am I doing something wrong? it's working with a Character Movement Component
Context actor can be promoted to any type, its automatically set to owner of the ST component
how?
I was just actually trying to see how you might for you, but it appears you need to hook into GetActorEyesViewPoint and that only returns singular location and rotation, so I"m not sure honestly you might need 2.
True, but I cant use any of my getter methods for these Binds or... is that possible? I was changing things up based on me not being able to figure that out
no functions are not exposed unlike anim graph's property accessor
you have to poll variables
yeah i was also disappointed but better than nothing
its also quite difficult tbh
anim graph and ST are very different realms
anim graph is a complete blueprint while ST is a fancy data asset so there might be technical problems
yeah its pissing me off, I had to go back to my playerstate and GAS system and switch things up pretty major for this, few times been tempted to ditch the effort and keep my BTs
oh thats also an option eh
you can create a new schema UBehaviorTreeSchema
copy paste what STComp does into a BTTask
slightly modify it so it'll compile
then it'll work
alrighty I'll give it a go
Probably stupid question: do EQS contexts get just called once and after that the EQS query that use them will always use that first value?it does seem like that because i created a context that reuturns my player's location, but it seems queries after the first one don't use the player location at the time they are called but always the one when the first query and context function were executed
??? Why parallel not work?
I saw above you're using test actors for contexts, we do that too but we add on BeginPlay to destroy the test actor so they never interfere with intended objects during runtime. Maybe your query is grabbing the test actor while playing?
No, i delete them before playing
This is so cursed. If you want BT - use BT. Come back to the light Eren!
That's a very bad idea. Running multiple BTs is going to cause you A LOT of problems.
Every architecture has it's pros and cons. I would recommend doing more research to see if utility is actually needed for your project.
They will be in the visual logger.
Why do you want multiple sight configs?
thx!how to access this visual logger?also, do you know if EQS contexts are supposed to get the location/actor only at the first EQS executed and then always return that first context output?i tried running the same EQS every 5 secs using the player as context(getPlayerCharacter and return basically) but the EQS after the first one always seem to use the player location when the first EQS was ran and not update it
The visual logger is located in Tools/Debugging.
The context is called anytime it is used.
what a facepalm, i was using GetPlayerController(stays always in the same position) instead of GetPlayerCharacter lmao. Thank you so much!
To make many fields of views for bot
At the same time? You'd need to make your own sight sense.
hey. I'm using the Behavior tree for the first time. I was used to doing everything in BP.
How do I alter the target location of the MoveTo command in the Behavior tree?
Since it is a set command, and looks for a character, actor, etc, I can not find where to modify that target.
The enemies who ram the player fly past them (behind), because they are not taking into account the movement of the player. So I want to adjust that, to make them predict. I know the math, I just cant find where to put it.
Should I still be using the Animation Blueprint with StateTree, or should StateTree Tasks now be responsible for all the animations, or is it a combo of both with Montages played via STT's overriding AnimBP? I'm confused here... I had all this working with Behavior Trees, but having just weird growing pains moving into StateTree
At least to me it seems that animations should work on your character regardless of what "drives" it. It seems like an unnecessary dependency to require an AI component of some sort for it to animate correctly, so having the anim bp drive the regular locomotion + using some method to trigger appropriate montages (bt or st, or some other method) seems like the way to go
fwiw, the method I'm using has functions on my character for each of the actions it can perform, such as picking up stuff, which triggers the montage and runs some other related logic. This function is then called from the AI side when appropriate, so the AI doesn't know anything about animation or what else is involved in the character picking something up. The AI part simply tells it to pick something up, and listens to the character's OnPickedUp delegate to know when that happens
how am i supposed to make the AI NOT deal damage if the player is out of range?
there was a method using blueprints that involved sphere collision but i'm using a behavior tree with anim notify
don't damage
}
else {
do damage
}
lol
i'm not using C++
in other words, before you apply damage, just check the distance
uh
how do i do that in blueprint terms
Check the distance between player position and the AI position, there is a distance function on vectors
The specifics depend a little bit on how you've set it up, but the simplest possible way would be to do get player pawn -> get actor location which gives you the position for the player, and then you can do something similar for the AI character
well uh
i can't do any of that
i said i'm using anim notify
my deal damage code would be running inside the AP
of the AI ofc
so like, starting from the AnimNotify event
how would i check the distance?
Which actor is the notify inside of? Your AI character or?
Right, so you should be able to just do exactly what I said then, with get player pawn -> get actor location
and just use get actor location by itself to get location of your AI actor itself
then just drag one of the position pins, and look for "distance" and that should give you the appropriate node
It's a pure node, so it doesn't have a white exec pin so it won't show up if you drag from there
oh
but then what do i connect to the event?
well since you would want to check if the distance is too far you would probably want to use a Branch node to do that
this is what i got so far
you said get player pawn and get actor location for hte player
and get actor location by itself for the AI
now wtf do i do with this
drag from one of the vector pins for position, and look for distance
this should give you a node that returns the distance between two vectors
then you can use a greater than or less than node to compare the distance to some value
this?
What do you think? lol
i do this right?
i'm reading this as "if the distance between AI and player is greater than 100, don't deal damage"
i could've used less than 100 so it would be true leading to attack but same thing
ah fucvk
oh yeah
we forgot the target lol
Well then it's not inside your AI character if it says that
What is this graph inside of
i said AP
Animation Blueprint
the Animation Blueprint for the AI
Ah I see
I think there should be something like.. get pawn ? or something like that to get the pawn the animation bp is controlling
this?
if i'm not mistaken this is supposed to mean "get the owner of this anim bp"
Yeah that should be it, so just connect the return value from that into the other get actor location
Nice :)
now i got a working zombie : )
I don't know if it's the best architecture to have your anim bp involved so directly in logic related to dealing damage though but that's probably secondary when you're still learning the basics :)
well i'm using anim notify
and this is what i'm meant to do if i'm using anim notify
so
but hey if it works it works
the behavior tree's handling the rest
if i wasn't gonna do animnotify i could've done this inside the attack task afaik
Yeah I mostly meant it in the sense that if you had say two different kinds of zombies with different rules for how far they can attack, then you couldn't share the anim bp between them if the logic for the attack distance is in there
i don't intend to make another zombie with teh same animations
i do intend to have other melee enemies but they're gonna use different anims : )
so should be fine
now i just gotta do a health system so he can die
ok he can die now
just that he also continues to move and attack IN THE MIDDLE of dying
how do i make it so he doesn't do that?
like completely halt the behavior tree when he's dying?
did it
unpossessed him
How do I prevent a huge troll (bigger than a regular doorway) from entering through the doorway, just because his collision capsule isn't as big as the actual mesh?
You could potentially use a separate collider which blocks too big things from passing through, or set the door to use a navigation area which is then filtered out by a nav query filter for big enemies
Perhaps some other methods as well
ive an issue where nav modifier volumes work in the binary 4.27.2 but not in a 4.27 source build running debug or development editor/non-editor (though it does seem to work in shipping).. any ideas?
yeah
Hi, do you guys initialize blackboard variables before running its behavior tree?
how?
By changing the blackboard value.
By making a separate agent settings for the large character.
You set them after. As in the same function. The BT doesn't actually run until the next frame.
@uneven cloud first loop of my task reads the BB variable and it reads trash, how to avoid this then?
It entirely depends on how you set things up. It also doesn't "read trash," BB values are initialized to default values.
@uneven cloud ideas here?
Where are you finding a wander location?
its my wander code, the issue is only with the first read of the vector i havein the blackboard
What do you expect it to be if you aren't finding a wander location?
im finding a wander location based on my previous wander location
How are you handling getting a wander location if you don't have a previous wander location?
because i expect somehow to be (0,0,0) the first location, but can i initialize blackboard variable before the task starts looping?
thats what i only need, to make the vector 0,0,0
Also why is it based on the previous wander location instead of the AI's current location? That is going to cause a lot of unexpected behavior.
The BB is initialized to FAISystem:: InvalidLocation. Which is a lot better than zero vector. Zero vector is a valid location.
You can test if it's a valid location by using FAISystem::IsValidLocation
ok, thanks
What’s the correct way of doing AI for space/air combat?
Mainly the navigation in a 3d space
Hey guys. If I jump ontop of a fence, the AI doesnt know what to do, and wanders around aimlessly. Should I store the player's last seen location, and have it traverse there? Would be weird aswell, incase I move along the fence, and the AI just stands at the end of it 🤔
ig one way you can do it is setup like a line along fence and have ai move on the line where it is closest to player on fence...
i just watched a yt vid of an indie dev who did this with camera follow.... https://www.youtube.com/watch?v=zvD8KCBYFho.... check this out maybe it'll help
My first devlog about a multiplayer racing game set on the slopes of a snowy mountain. Subscribe for more ✌️
Using Unreal Engine 5.1, Blender 3.1
CHAPTERS:
0:00 Intro
0:22 Concept and inspirations
1:22 Character model & basic ski controls
3:51 Slope foot placement
5:54 Creating a camera system
7:05 Physics based movement
7:40 Props and texture...
i am not a pro at game dev, i am quite a noob so ignore if this is a stupid answer
Does anyone know why my AI perception isn't detecting the player? I have auto register for their stimuli source enabled, and the sensing attached to their AI controller, but nothing gets displayed.
try checking the alliance flags nuetral / fiendly / enemy or whatever they are
@final loom
That's what it was last time! D'Oh!
I'm never correct, so.. might be might not be, lol.
No. It is. I remember this issue before but not how I fixed, yet that I did. XD
I hope without help I would have recalled inevitably, but sooner is better than later.
Yeah. That was it. Whoops!
But glad I got it now. Do you recommend a specific way of getting AI to look at someone? Just yaw-wise. They're a person, not a plane or something.
Right. I was thinking that, but wasn't sure it was what you were thinking too
Whats the best way to ensure that an AI completes firing a projectile towards me, before running to melee me? Im driving this logic per tick with a distance check between AI & player, deciding the attack to choose depending on distance.
You really shouldn't be doing that on tick, because you need to wait for things to complete.
The blackboard uses a default moveto. The MoveTo is a command inside of Unreal. It looks for a pawn when used inside the blakcboard as far as I can see. When used in BP, I can just give it a transform.
When I'm looking for, is where in the Blackboards or Behaviour tree, can I modify the target?
The balckboard does not even allow a transform as a Key. Only a vector, but since its just location, not translation, that fine.
I think I jusst found the answer...
I use that vector instead of the actor.
You appear to be confused about the Behavior Tree vs Blackboard. The Behavior Tree has a move to task that you send the target actor or location via a blackboard key. You modify the target by modifying the blackboard value, like I told you.
You do not need a transform. You only need a location.
Like i said. I was very used to doing everything in BP, but Black board and Behaviour tree is the way I'm told is cleaner, and more cpu friendly, so I'm trying to understand it more. yeah... I'm a bit confused, but I am learning... slower than I'd like, though. 😛
So in the Behaviour tree, I select MoveTo as a Task, inside that task, it only allows for a Key from the blackboard (enum), set as a target. I don't see anywhere I can select the enum Player, and then modify that. I can however, in the AIModule tell it to get the loaction of the player, modify it how I like, then save that as a Location (vector) that is also a key in the Blackboard. Then select that Vector as the target to MoveTo.
Is there another way that is more simple? Im sure I'm missing something.
Is it 'good enough' that your statetree succeeded or should you try and StopLogic like behavior tree?
On Activation with a looping delay, or condition-based, like «CheckDistance»? 🤔
Heya. What would be a good way to implement penalty when entering water volume when pathfinding? I want NPC's to be able to swim, but want them to generally avoid pathing through water. I was hoping to achieve this with NavModifierVolume with the top at z=0 but it seems they are more of an "all or nothing" deal (eg. whole volume or none).
Actually seems like it does achieve what I want, but only above z=0 🤔
It seems that should do it, if you place it where the navmesh for water gets generated so that it affects that particular area of the mesh
A trustworthy source told me the AI controller is the common place to do such initialization. Thanks anyway guys
Hello,
When I use an EQS query from a blueprint, I can't see the result of it with the debugging tool.
I know that sometimes you have to refresh the debugging tool to get it.
I tried but it doesn't change anything.
Do you have any idea?
Not sure how to fix that particular one, but EQS queries should also show up in the visual logger which might help :)
Hey. I wonder, are there any resources on this? It interested me when I read it some time ago but I can not very well imagine it. Like what is preventing the BT to queue insane amount of actions if it is not waiting for the finish of these tasks.
Hmm, no, this is just something I'd used for a long time with my previous HFSM implementation and liked the seperation between action selection (logic) and execution (actually doing it)
So I wrote myself an action queue system based on the same patterns (layers of pre-emptable actions)
think of it as a queue of queues, where there's a top down priority order and multiple executions at once
so to execute the actions, you pop the first one off each queue and execute it
and queues can manage each other and such
I used it quite a lot when doing a tank combat game, where the commander added actions for the gunner and loader and they executed in parallel
So the commander was the brain and the others were simply following orders
I've also used it for testing AI, because I can use a script to insert actions for unit tests
i.e. "go here, pick that up, go there" kinds of actions
I mean, technically its the execution stack of a non-UE style BT 🙂
also now I think about it, it seems a bit like a cooperative task system too (i.e. not a threaded one)
cooperative multitasking that is
has anyone successfully merged the two concepts of Animation Blueprint State Machine with "StateTree" states without holding an external reference to yet another "State Variable" for example on your character? I'd like for my AI's animations to be driven by the state of the AI's StateTree directly without this middle man method
Not sure but maybe there's a way for you to query the state tree from the anim bp, and determine what state is currently active to select the appropriate animations
It seems like it's going to couple the two together quite heavily though, so if you ever change the way the states are organized, it'll require updating how the animations are organized
Would you stick with the way I have it then @misty wharf ( the States are an enum on the Actor ) and I just use this as the 'source of truth' at the moment
I was trying to get away from that, if it made sense..
Yeah I'd probably do something like that so that it wouldn't depend on AI how the character ends up animating
Eg. maybe you wanted to script the character doing something without using AI
It's not necessarily a big deal if you have that coupling, because as long as it works it works... it's just something to keep in mind about what kind of effects doing that might have
Can Timers using function names trigger Overridden interface functions on the same actor?
I'd assume they're going to cache the function called by the function name when bound?
thanks a lot for the extensive answer! That definitely shines the light on some questions I had about it
no idea, it doesn't seem to work in my instance - however an event timer worked with the event triggering the same function 🤷♀️
hello,
anyone knows if there is a way to set the NavmeshBoundsVolumes to have only a certain subset of Agents enabled by default, rather than all of them?
I can't understand why FindPathToActorSynchronously result never be partial, but in game i have partial path.. Could anyone help me?
Is it a good idea to switch behavior trees in rumtime per state? I have idle, panic in separate trees for example.
why not use dynamic subtrees
there should be a setting for that iirc?
I do not have to worry about enum switches and all. Plus, I could separate behaviors on the pawn itself?
Are there any drawbacks of using run behavior tree?
hmmm
What do you mean?
there must be a boolean to set if its going to be partial or not
This?
yes
that also might construct the instanced tasks though
but i guess based on design it can help you to reduce the overhead
AI use move to with partial path, and i see partial path in play mode, but when i use this FindPathToActorSynchronously method for new task, i got a valid path with false value for bIsPartial. It is incorrect but, i dont understand why it happens
SetIsPartial not executed
Omg, I think I got it 😅
can anyone suggest a good way to position the AI during combat in a shooter game?
for now i am using EQS and finding the points based on distance and visibility to player, but if my player is hiding, then AI is not getting any valid point and it just standing dumb. So can anyone suggest me a good way to do this?
How about saving the last seen location and go there?
will i am using that too 😅 ,
the problem right now is that i a using eqs for the AI movement, and in the eqs i am doing trace to player, but when the player hides, the AI is not getting any valid point to move.
Does anyone know how to make an AI character jump at the player when they get close using C++?
Do a range check - when <= range, jump
Be it with an ability or montage or w/e. That part is game dependent
Hey ! I'm working on a ship based project. I've set up my basic Behavior Tree for ennemy ships, with a basic behavior which is to go to a certain point in the map, and an "abort decorator", based on perception (sight), which make the AI ship follow my pawn if i'm too close.
In this game, the ships can only attack with their cannons on each side (left and right). So in order to attack someone, you need to be at an angle of 90°.
I think i know how to implement the "range" parameter in the Behavior Tree. But how exactly can I proceed to make the AI ship try to turn, and be at that 90° angle ?
Bonus point if it can choose the closest angle, fastest angle to be able to shoot asap (left or right choice)
My guess is, it would have to choose a path depending on the Target forward vector ? In order to anticipate the 90° setup ?
No, it is the jump itself that is important to me, how to do it without using the nav link. The jump function does not help, it jumps all up and that's it, but it is necessary that he moves during the jump.
The jump is game specific
You can code it to play a root motion montage
You can code it to use an ability
You can code it to just move manually
That part is all on you
Thx
You should use point scoring rather than filter and score.. so that you always have points to move to, just make the score of visibility to the player higher so it goes there as preference than going somewhere without vis.
My preference is to just teleport them with a nice particle system 🙂 hahaha..
Teleport them just up a bit from the ground and in front of the player 🙂
You can't beat a good old teleport
you can use suggest projectile velocity, and then feed that velocity to launch character
If you use C++ there are ways to override the focus functionality. That would be focusing right or left instead of forward.
I dont ^^ But i'm starting by trying to use "Get Actor right Vector" and then "Dot Product"
To know if my AI is in the right rotation
=3
You should be able to do it by comparing the movement direction to the direction where the target is
Dot or just plain trigonometry/angle comparison would probably work
Eg. if target is on the left, if you compare direction from forward to it, it'll be 90 to 180, otherwise -90 to -180 or something along those lines
(those numbers I quoted are probably wrong but you get the idea)
Someone using the voice sdk? Because i'm trying to dicover how unreal or the voiceSDK find my mic... I'm need help with this
Yeah, I've used it
believe it or not, you have to add the online subsystem and enable the microphone in the config before the voice SDK works
I think they added a line in the docs about it
something like voiceenabled=true or some such in the config
I found that I had to fix up a few minor things to make it work, but forget what.. it wasn't anything hard to figure out, perhaps a blueprint node wasn't connected or something
I'm messing around with the Behavior Tree and I set up patrol and chase. For some reason the behavior tree keeps getting stuck on MoveTo after it finds random patrol location. I used visual logger and it says the MoveTo destination is not valid. I deleted my NavMeshBoundsVolume thinking maybe it bugged out but after adding a new one it still seems to get stuck. Any suggestions why this may be?
Heya guys what would be the best way to have an AI that can move on walls and ceilings ? I was thinking some sort of spline solution but what do you guys think
Really depends on the complexity required for navigation
If you don't have many obstacles you could get away by just having it move directly towards whatever when it's on non-floor surfaces
instead of discarding locations where ai has no line of sight, do eqs test which scores harshly against those locations being selected, at least then where theres no other option they can go there anyway and reassess themselves
Do recast nav meshes not support rotated nav modifiers?
As an example, limiting the modification to this section of the navmesh:
but the problem is that when using trace test , it will give either 0 or 1 when scoring. or am i missing something here ? I tried to make the centre of the eqs at player, but that was messing up, as if the player is far from the AI, then AI has to travel a lot of distance, but this things will surely give a valid point.
I am currently making a 2D side scroller game, with AI using behaviour tree. But I don't have any idea how to make my AI move until ledge of a platform, then do other thing (could just stop before falling or run back the other direction). How does AI in platformer game usually check for ledge on a platform?
Linetrace downward a little bit in front of them. Once that line trace stops hitting the ground, most likely pretty close to a ledge.
It definitely supports them, I mean we have navmeshes going up stairs and whatnot. Do you rotate at runtime?
hello! Does anyone have an idea on how to manage a task state for a StateTree task? The most common example would be how to return failure in a task that performs an AI MoveToLocation.
I only see this possible by polling the navigation system on tick. Or to have the move happen outside of the state tree itself in the controller...but then it defeats the purpose of having the MoveTo task altogether
Have you tried using AITask_MoveTo instead which I think should offer delegates?
Whats best way to find closest UFoliageInstancedStaticMeshComponent?
State tree tasks are basically functions and, as far as I can see, they don't allow async tasks like that where you can bind to a result (success, fail)
maybe start by getting all actors of a class that is likely to have a foliage component, filter them out so you are left with an array of actors that definitely have the component and then use "Find Nearest Actor" node
@silent hamlet I mean that sounds simple when you say it, but what 'actor' exactly am I looking for on Foliage that i've painted into the world?
thats just an instance of which I have 24,000+ in the game atm in just this one cluster
Ah of course since we're talking of foliage there's a gazillion of them. getting all actors in this case is probably not the best route. What are you trying to do? Like why do you need the closest grass instance?
don't use landscape foliage for things like grass
do you absolutely need to? 🤔
I mean, that's pretty much what landscape grass is for
Well I dont know what I dont know, I just knew this was performant and easy to make dynamic.. wanted to make my sheep eat this stuff
Ah I see.... I wonder if it could be something that's more easily done in C++ since there you can do whatever 🤔 Haven't yet used state trees so not really sure about this one
You can route to evet graph in BP
And in cpp you can do polling
Not much different than BT tasks other than ST tasks cant be instanced
I am on mobile and didnt read the further context though
Imo proper way would be having a path following comp as evaluator
But thats a troublesome process
I still dream about moving AIController functionality ST evaluators but I dont have energy for it
But then, you'd still be polling the path following component in the evaluator tick, no?
no
what I mean is completely having a custom logic that does whatever path following comp does but that means writing an API from scratch
Ugh, yea I see. That is beyond anything I'm willing to invest in at the moment 😃
btw regarding delegates in BP's - you can assign them even in functions :)
Looking at the pictures on the docs it seems that the Mass Ai system has some Moveto node for ST. Maybe looking in there will give some inspiration
you just have to use the node for it which allows you to pick another function as the event listener, instead of creating an event node directly in the function's graph
Mass ST nodes are the documentation for me so far 😄
they serve as a good practical example of how to use ST
Ah nice good to know, I've never looked into that. Thanks!
Wut. Ok I need to have a second look at it then!
Yeah I forget what the node was called, but if you drag from the square red delegate pin, it should come up as an option
Binding to events inside of function? I am fairly sure this is not possible, seems like a hack
Or I'm missing something, I'll check
it should be "Create Event"
It just emulates the way it works in C++ really
Eg. instead of creating a new event node within the function graph, you're just telling it "there's this other function which has the correct signature, so just use that one"
which is how you do it in C++ - in C++ you just assign a pointer to some other function to the delegate
no but i know the system you are talking about
ah wait. so i'd create the event in the ST EventGraph and bind to that one
I would assume that should work since that's how it works elsewhere as well
ha, didnt try that for sure
Either an event or a function, as long as it has the appropriate signature
Did anybody successfully run multiple behavior trees for a single character before? Now when I can embed stadalone state tree into anything I started to really miss it also for BT :D I think of creating multiple behavior tree components but there are bunch of places in the engine where they look for the component by class -.-
Cant think of any good reason why you' want to do that..?
Split personality ai if that means what I think it means but idk
Would be kinda neat to experiment with actually
I've done it with my own BT implementation yeah, not the UE one though
There's quite a few situations where having multiple "brains" can help, basically multi-agent systems approach which is my preference
so things like having coordinated agents do different functions in a tank sim
commander, gunner, driver etc.
I typically tie my systems together using a non UE blackboard and some kind of message passing system (highly recommend FMessageEndpoint)
Basically, I treat a tank crew as a coordinated MAS and have the commander pass commands down the chain and the gunner/driver/loader etc.. basically process commands
That said, I've done that kind of thing for years, so probably a bit easier to me since I've architected the same thing in loads of engines by now
Have the same thing for squads..
I was using ST for a bit and figured out a nice kind of work flow honestly. But I hit too many snags with the module itself so I ended up going back to BT because I wasn't actually making progress with my AI. The final nail in the coffin for me was when, just randomly, the editor stopped allowing me to bind data between tasks.
Similar reason as why state trees have schemas. I don't want two brains. There will be only a single brain. I want to encapsulate behaviors into smaller trees and execute these within anything. For example a certain state tree task or gameplay behavior which runs its own behavior tree as part of the task.
As for what you're asking - currently, it does not support that. I recall siliex somewhat griping about it.
You can only link to a subtree really. Which already exists within the given StateTree.
Yeah, I also went away from ST as the brain but I have a new experimental AI plugin obsession now: Gameplay Behaviors :D
I'm unfamiliar 🤔
As in - I haven't dug into it and don't really know what it is for.
Gameplay Behavior is really just an empty object which you can trigger with some custom parameters and listen for end of behavior. Smart objects use it to abstract away the interaction logic but you can do anything with it. Think of it as of ultra lightweight gameplay ability or AI Task. I encapsulate everything the AI can do (actions) into gameplay behaviors. So when the game starts, AI runs gameplay behavior "Follow Path". The behavior has waypoints array configured in properties. Each waypoint actor has its own list of gameplay behaviors which should run when the waypoint is reached. I even have a gameplay behavior which runs a state tree within it. So I can program individualAI behavior as mini state trees. I also have BT Task which runs a Gameplay Behavior, with this abstraction I can even run sub state trees within behavior tree.
no manager
it is up to you
you can run as many as you want in parallel
There some debug UI for it?
No, it is really more or less just an UObject which you can create, activate and wait for its end.
Brain BT has idle section which just runs a default gameplay behavior of pawn. This can be anything like Follow Path behavior, Wait, Behavior Tree (this one is provided by the engine), State Tree. I also added stuff like Parallel, Sequence and similar base stuff. So when a waypoint is reached I can do something like: Wait 5 sec -> Run a state tree which does wandering | In parallel to that run a gameplay behavior which holsters the weapon.
As the behaviors are nested, it gives me unlimited possibilities for combination.
I did the debug rendering interface myself. So every gameplay behavior can optionally draw something into the world. This goes down to the state tree behavior schema. So even state trees themselves can draw something into the world. In this case:
The waypoint is rendering debug for these three behaviors. Radius for wander, arrow for rotation, line for move to (ignore the pink one)
What I like about Gameplay Behaviors is that it is done with BP focus, so you can create them in BP, including the debug drawing I did
In general nothing new, very simple thing which is easy to recreate. But a neat thing for encapsulation and modularity.
And that is exactly where my question about multiple BTs originates from
I would like to also allow using mini BTs for individual behaviors
I can use what Epic provides but that one is changing BT asset of Brain Component. I look more in the direction of starting another BT instance within the gameplay behavior object.
It keeps me dragging into creating my own BT plugin but nooo.. I want to do the game but it is so tempting :D
How does the AI handle the data?
All that just sitting on the agent?
So what would conventionally be the Blackboard in UE BT case.
Brain BT still has a blackboard. But these gameplay behaviors are more like functions. which take parameters. It is up to you from where the parameters are sourced. I sometimes configure them on the waypoint actor, on the pawn instance / spawner, in the BT Run Gameplay Behavior, in the ST Run Gameplay Behavior task.
Might try this out on a small sandbox playground project.
yeah i just switched from BT to ST now you got me asking questions as well
Questsions I hope are answered in a more upstream branch heh
ST is really nice usage for individual behaviors because of its configurable parameters. As an example, I can reuse same Wander behavior for multiple waypoints and at each waypoint configure a different radius of wandering.
Its really not that hard to code a BT implementation up. I wouldn't get hung up on having to use Epic's one.
I think once you provide tools, people get a bit fixated on using them, without considering if their own implementation might be better you know? I used to do that a lot back when we were using TGE
Sure, but its reasonable to create your own UI too..
the slate toolset is good enough that I'd definitely have no issues implementing a BT editor, given the ST could guide you etc..
Just trying to make the point to not be scared of stepping out 🙂
I can't resist the idea to use ST as a backend for the new BT. Basically just creating a new BT editor which would store the data in a ST asset. So a sequence would be converted to a sequence of nested states, a selector would be converted to same level states with enter conditions and so on. Might be then even blackboard-less and based purely on the ST property binding.
Personally, my main pet peeve is the blackboard 🙂 hahahaha
and the whole execution would be done by the defualt UE ST code. So you get support of Mass out of box and every ST Task and node will be also usable within this new BT.
Sounds reasonable
I'd still have a BB, but just not one as dysfunctional as the stock one
BB's are kind of funky
They make sense to me. I don't know what the conventional purpose for them are though.
mostly shared data in multi-agent systems
haha, yeah, definitely. I also considered custom BB which would solve all the issues of the default one but did not have time to look into it. ST parameters could be probably a nice inspiration for the the new BB. It could use the instanced property bag as the storage.
With the bag it can be actually quite easy to create as you probably don't need to handle all the type mess.
so if you have a squad kind of thing, store each agents targets and the like.. I mean this was kind of standard back in the original rainbow six kind of era 🙂
Old R6 😭
Rogue Spear was my favorite one 😅
Yeah, great game..
Solved this with just an UObject. I was like... hmm.. isn't the UE BB just type unsafe property list? So I used UObject instead as a type safe property list :D
Yeah, me too
Its really weird how it basically implements only parts of the features that a regular UObject does 🙂
I think it was written early enough to be just too wonky and never got fixed
yes, and you get all the stuff like renaming, errors when deleting stuff, missing references errors for free
I recall that the reason it wasn't a UObject initially was something to do with performance of accessing BP variables? but that seems like a poor justification
ST can already use it with no additional work because in ST you can bind to properties of components. So if you use a component as a type safe BB alternative, you can use it right away.
They do seem to do some weirdness to pack things flat in memory, but I mean for a few dozen agents that seems overkill
Does the agent just get given the UObject?
Yeah, if I weren't using all my own stuff, I'd do the same
have a data only UObject that is shared amongst the agents
Sounds like a subsystem/singleton to me.
not if it is shared only within a certain group of agents and other group has its own shared BB
like squad shared BB
Yeah - but how do you go about issuing it to just those agents?
Well, as a concept, its just a big bag of data.. some shared 🙂
In the simplest way, these actor will have UPROPERTY() UCustomBlackoard* SquadBlackboard which refers to the BB.
And when the squad is created you assign all of them the same BB
Yeah - doesn't that create a whole new object though?
Or are you using data assets for this?
Can you even write to DA at runtime? 🤔
Oh wait 🤔
UCLASS()
class SOMETHING_API UCustomBlackboard : public UObject
{
int Speed = 100;
}
// agent.h
UCLASS()
class SOMETHING_API ACustomPawn : public APawn
{
UPROPERTY()
UCustomBlackboard* SquadBlackboard;
}
Okay - so how do you actually go about instancing only one version of the CustomBlackboard and share it thoughout the squad? Assuming you don't just spawn them in a loop. Or you join/leave the squad. Do you just pick a random agent from the squad to grab the blackboard from?
Then - doesn't this also affect designing tasks with the CustomBlackboard in mind? So you'd have to tie tasks directly with ACustomPawn, no?
For squads I would do something like (ignore the ugly code, wanted to type it quick)
class USquad : public UObject
{
static void CreateNewSquad(TArray<APawn> Members)
{
USquad* Sq = NewObject<USquad>();
Sq->SharedBB = NewObject<UCustomBlackboard>();
for(APawn* P : Members) { P->SetSquad(Sq); }
}
UCustomBlackboard* SharedBB;
}
pawn
Squad->SharedBB->Speed
Yeah - doing that is straightforward (which is why I tried to exclude the loop part 😛)
So, if you want a new pawn to join a squad, you just give them the Squad object?
And handling tasks in a task now needs to incorporate this as well. I wonder if it makes it a bit more difficult to handle editor links. Like, how you can use a BB key selector as a variable type for a task.
I would give USquad functions like AddMember(), RemoveMember()
Right right
alternatively there could be a world subsystem which holds the array of all squads and can do this stuff
yeah, the problem is that it is not very compatible with the default BT based on default BB.
probably no easy unless you do something like automatic mirroring of vars to the BB based on names 😬
This is when zoomba comes and says make your own editor 😅
I think there is merit in both a shared and instanced BB
Yeah, true.. I mean you'd want both private and shared data.. but easy enough (you'd want your UI to show both)
you can always use the type safe UCustomBlackboard* for both. Just not for BT :D
There are pretty significant differences between an AI task and a gameplay behavior. One is not a replacement for another.
That is still the question for which I am actively seeking answers
Can you elaborate?
The line between the two is blurred if you don't need the priotities/stacking of tasks and you expect some behaviors to be usable by AI only.
The docs for GB is non existing
and I think there is also no docs explaining AI Tasks after all these years. I don't mean the usage but more like examples of the architecutre
I favor GB because these can be created in BP easily
shocking 🙂
-
Gameplay Behaviors need a behavior config to run. The data is set at editor time. AI tasks the data is set at runtime.
-
AI tasks are automatically listened for in the BT and the node doesn't need to be instanced. There is a good reason why using the smart object BT task runs the behavior via an AI task and not directly.
Reading the source code for both is not hard. There are more differences, but I have a block of meetings.
-
I know, I create and configure the config in runtime. Not nice (read: horrible for perf) but works well. So I create new config, set expose on spawn params and trigger the behavior from that.
-
That is exactly the example I went over multiple times but it did not give me enough of answers why to choose one instead of the other. I feel like I recreated AI Tasks but with gameplay behaviors as I manage the lifetime, allow running them from BT and other systems. I am still open to switching these to a different backend as the API is minimal, just nothing convinced me of using AI Tasks instead. Especially the missing BP support. Was also thinking of creating a BP support for creating AITask but decided to go the way which 'just works' and revisit the decision later when there are more examples in future versions.
Thanks a lot for the insight, I finally found somebody who knows this new stuff
This is how I create GB config of ST type, set the ST asset and set ST params. Params are not nice but I don't have anything better at the moment. Future plan is to make K2 Node which creates type safe pins from ST assets automatically.
Not instancing BT tasks is not my main concern atm 😅 I think the original BTTask_MoveTo still instances AITask but uses BT Comp as the outer. Something similar should be possible also with GB, if necessary. At least I think so :D
Wait - is AITask something different too?
yeah, it is almost exactly like my GBs but it is an older UE4 thing. MoveTo is using it under the hood.
UAITask is the BP's MoveTo node
derives from UGameplayTask - which lets you have latent nodes exposed to BPs with multiple outputs
and BTTask_MoveTo just a wrapper for it
PawnActions
GameplayBehaviors
SmartObjects
BT
ST
AITasks
🥲
Its amazing PawnActions are still in the source code 😅
I love em
Ah, I have some many questions about all this. Especially the design decision and concepts behind it. Like why does not the AITask allow binding to its MoveTo finished C++ delegates just the way you can do BP.
they're so old school
There was a commit week ago which deprecated all PawnActions
zoomba's days are numbered I guess
zoom can I ask you a ML question at #lounge 😄
I'll ping you one sec
I think is a good thing, I want more :P
There is also WorldConditions in 5.2
but I think it is not specifically AI related but iirc it is developed by the AI team
Because delegates are meant for reflection stuff
UGameplayTasks take the dynamic multicast delegates and convert them to exec pins
and you manage the state of the task with functions in c++
its probably developed with the mindset of being BT/STtask wrapper rather than being a generic moveto task
WorldConditions?? wtf is that?
wrapper around generic modular IsTrue() objects
Whats it used by? I assume some other system?
SmartObjects were modified to enable disable slots based on results of some World Conditions
that. I think you could use it also by objectives system or anything else where you can about checking some generic conditions
Dynamic delegates specifically
https://twitter.com/Skylonxe/status/1592821930088108037
Also this might or might not be related: https://twitter.com/MikkoMononen/status/1599130227158155265
But it would be super convenient to allow also usage from C++. I mean you can bind to them, it just is not perfect perf-wise. Even if it would mean having separate non-dynamic delegates.
It is quite annoying if you want to run multiple AITask and listen for their end. You need to listen in the owner's deactivation interface function and compare the AITask instance :/ Doable but ugly.
You're right
-
Gameplay tasks, AI tasks and Ability tasks are meant to write latent functionality in C++ and easily usable in BP. Gameplay Behaviors can be written in BP, which is meant to be one off things that don't happen all the time.
-
AI tasks allow you to lock AI logic.
-
AI tasks take a single node to execute and wait for completion. Instead of gameplay behaviors needed sequence.
I miss something what can do both. Why this stuff is most of the time just either BP or C++ 🥲
AI Tasks are often used in C++ too.
Smart object AITasks is an example
I said easily usable in BP, not only used in BP.
Am I the only person here who writes slate editors for my own AI stuff? or are there other deviants too?
I realize its probably a niche, but given I hate UI somehow I do end up working on it a lot 🙂
I was intrigued to write a utility graph if I had time
I have tools engineers to write it for me
wait theres people that like ui?
Thats cheating 🙂
I have to write a toolset that shows you how the NLP model is scoring your tokens.. because using wit.ai was driving me crazy
I wish I was you 
I think AI Tasks is best fit for the behavior system I showed but:
- C++ usage is not nice
- can not be created from BP
- overlap & priority handling is not well documented and examples are minimal. I am not confident that something won't just step in and do something weird with the AITask I started myself.
These are mostly the reasons I used gameplay behaviors instead. But I might definitely switch them to something else or custom if in 5.2 or 5.3 engine goes completely different way with gameplay behaviors.
gameplay behavior can run within single node too, can't it?
C++ usage is important for moderate to large projects. I was correcting you that they aren't the same thing. Use whatever you want.
The triggering and finished event binding can be hidden behind async task or K2Node
I really like the input, I have been looking for this kind of info for so long
I hope we get more clear examples soon
could happen with Epic's wip interaction system, not sure
You might be able to write the node functionality, but then you'd probably be limited to only writing delegates in C++.
How do you know all the GB stuff? :D Did I miss some public source?
I read the source code and looked at the examples. We use them for my interaction system.
Yup, I just sometimes want know also the bigger picture and “why” rather than “what”. 🥲
oh don't ask silly questions like that 🙂
its like asking the moon why its in the night sky
I'm interested honestly - just...not much time unfortunately
guys has anyone expanded on the ai focus stuff thet got in the ai controller?
Yeah, I hear you there. I seem to get inexorably drawn to making tools for AI stuff. Mostly because its so goddam rediculous how we do it 🙂
To be fair, its not just Unreal Engine either.. trying to get this NLP stuff going has demonstrated a complete lack of good tools for things like intent matching.. its weird
I mean, its probably a niche of a niche and all, but I really REALLY want to make a nice looking NLP matching interface in UE, because it'd be fun to make one and web based tools annoy me because they're always so damn slow
BTW: Will be making a start on a BT generator soon.. which was the focus of my research the months before xmas
So stuff like demonstration learning being used to generate BT's
that kind of stuff.. trying to fix the stuff microsoft research found in "its unweildy and it takes a lot of time" paper
Has anyone else noticed that the questions we get in here tend to go in waves? like "how do I make flying AI" one week and "how do I make AI pathfind on walls" the next?
lol - kinda
I'm sure if someone could make a reliable plugin for 3D navigation, it'd be some decent coin on the marketplace to be honest
I see people ask for it enough times. Not just in this discord.
Naah, poor indies aren't going to lay out the big $$ 🙂
I mean there ARE plugins for that kind of thing, but they're pricy
Yeah - very pricey 😅
Thankfully - I don't need any kind of 3d navigation for the foreseeable future lol
yeah, me neither
Is there anything you miss in UE BT compared to non-UE BT? Or is there anything you think is not well done in UE BT (expect for the BB)? Asking for a friend...
Mainly just a proper parallel
and I usually make my editors lay out the same was as statetrees compared to the topdown graphs of UE's BT
same way
Usually easy because every GUI toolkit has a treeview control of some kind
or listview
That plus I learnt my BT's from Damien Isla's work on Halo, so it just felt natural the first time I worked on an editor
Its mostly just preference stuff really. But I find the event driven nature of the UE BT a bit of a pain sometimes
Nice info, thanks for sharing!
If you want to have a scare, check out the BT for division 2 🙂 that was... a thing to behold, there should be a video on YouTube
Think it was Phil Dunstan that did the presentation
Saw it :D I think they had a later talk where they had to correct it and said the huge spider is actually a debug view which shows the whole thing without splitting it to subtrees. But I might get it wrong.
Yeah, I'm sure it was there for dramatic effect, but my god
I was at a conf in Paris back when we were running the AIGameDev confs still.. we had a panel where 4-5 devs talked about their BT implementations.. and there was quite a lot of difference. Some had like 5 blackbox nodes, others had 100's of tiny ones
There was an old UDN post where Epic expected the community to do the documentation. However professionals are often limited in doing that, so the wiki was mostly filled out by hobbyists and a lot of bad information started to spread. I think Epic has seen that error (they admit that not documenting GAS was a big mistake), so a lot more systems are being documented now.
🕺
I remember working with a guy who spent ages making his code comments look pretty 🙂 macro's and stuff to beautify the comment structure etc.. he didn't stay in the games industry for long
He was our tools programmer at the time, so maybe that was his thing
What would be a "proper" parallel? I find the simple parallel to work parallel enough for my use cases 🤔
Basically, one without limitations on what can be run in parallel, there are some things that seem to not function correctly in the UE implementation of parallels
Are AI Controllers commonly used to control more "swarm" like agents such as enemies in an RPG?
Looking at Lyra, there is a lot of reference to "Player Bots" that are AI agents posing as humans, but I haven't seen much reference to non-player AI. Is there a distinction for this commonly made in UE, or are all agents considered players?
AIControllers are just Controllers for AI - IE, not the player.
Isn't specific to any one type of AI.
Thanks for the clarification!
I imagine a Director system of sorts would be desired if the number of agents was particularly large
Each AI agent is going to have their own AIController
Ok, I'll build around that and switch to a director if my performance starts showing problems
In regards to UE's AI is there anything particularly special about ETeamAttitude::Type found on the team interface?
I haven't done anything with blackboards on UE specifically, but have worked with them in other places
That stuff is mostly just used for the perception system
I want to make my character show an exclamation mark if it sees the player, and then chase the player.
Is there a way to 'do once' in behavior tree task?
I'd just show that in the event for the perception system. I wouldn't tie it in with the behavior tree personally
New to EQS but any idea why I would have results in my Context, but after running the EQS via the STT I see nothing?
Having items in a context does not guarantee that you have valid items in the EQS query.
gotcha, i'm trying here...
The visual logger should give you more debugging information.
Is there a way to check if the eqs is failing or not?
I am trying to do something like if my eqs is not able to give a valid point, than i want to run another eqs, but in behavior tree, if eqs is failing then it just restart the tree and not moving to next node
One fun trick with the EQS is to add another one to the right in your EQS query asset. If the first one fails, it will run the 2nd one.
yeah i did something like this, but this was not working in the behaviour tree so I created a bttask to do this , and now its working perfectly
@serene grove The AI character has a class default settings where you can auto possess using the AI controller you want. Then if you setup a simple blackboard with a behavior tree you can make it chase the player around and are ready to start adding more functionality such as different attacks or hiding behind cover etc.
yeah, but how about with the network behaviour should i do that ?
Which part from your screenshots was the network behaviour?
i mean, is if it is auopossesed, is that done only in server side ?
I believe it happens on both because it’s an AI you don’t have to worry about it cheating like a player would
yeah but only the server should mouv the ai
My understanding is that AI doesn’t need to replicate anything since there’s no human input controlling it in the first place.
it lives on the server.
Otherwise think about it, people's shit would be moving all different..
Okay yes that makes sense and since you’re already spawning them using the game mode which is server side anyways the AI is showing up but the move to with a looping delay is probably causing the lag because it keeps endlessly restarting it instead of just calling it once. I think you’ll find that a BB and BT might work better for you.
doing that is supposed to work ?
what is Player?
does the AI have that Behavior Tree assigned?
Is it set to auto start logic?
you'll figure it out, read and try things
You’re on the right track now.
provided you just want the first player and no specific player yeah
and of course there is a player when it spawns**
If you want the condition to be the player your AI has line of sight then add a perception component.
or if you want it to be the player within a certain distance there’s another way to do that also
I’m not sure how the AI should choose which player to chase
i do that on the spawning part of player
i mean just after
right now is it just to debug purpose so i do not care about wich player it follow
Okay so the object value should be the Get Player Character then if it’s just for debugging
Because it’s trying to chase a player controller which seems wrong to me
Do you have an Ai controller? It needs to inherit from that default class
i spawn in the game mode so is it always on server
Use the Ai controller because thats what it is for
The game mode is for rules of the game, CTF or TDM etc
and the ai controller come from where ?
I don’t understand the question….Epic wrote it with c++
Go to your monster character and search for pawn on the details panel, then you can select the Ai controller as a default
so when does it spawn ?
Ohhh wait I’m sorry yes you can spawn with the game mode but the blackboard value for player character can be set using the Ai controller
Or as a behaviour task
so that is what i do right now
So your tree becomes root > sequence > bt_find_and_chase_player
root require a selector
But the problem was getting the charter instead of controller for the BB Player value. And since that value was trying to be set using the game mode there’s no character to get right? But if it’s set using a task then you can use something else like Get All Actors of Class
I’m on my phone here without UE in front of me so I’m just going off of memory. Sorry if it hasn’t been helpful maybe someone else can help out?
Btw if anyone interested Metro Exodus SDK is released and seems like you can access the existing AI frameworks https://www.4a-games.com.mt/4a-dna/studio-update-exodus-sdk
It's always a good study to check out other engine's frameworks
it seems like their AI is encapsulated into nodes instead of a modular system - or at least thats how they exposed to SDK
Anyone have an example of Get Query Results As Locations working? been trying this for few hours unfortunately
The AI are server owned actors. They are driven by the server, but they do need to replicate.
Yes, I understand it now thanks for the clarification
I mean I can use it like this, but ultimately I was looking for UInstanceMeshInstances not Actors, which I found in cpp just wondering why I cant return it a TArray<FVector> with matching EQS criteria ( by distance ) and have it show up in this array..
tried to debug it, but it ultimately get to this function with nodda
weirdest part I put a few actors in and use the actors results, and works no problems.. seems weird
I know @uneven cloud said that having one doesnt guarantee they pass your EQS rules but this one I have is pretty basic, distance and the coords this is returning mathmatically falls within the limits
i think first you have to bind the onfinished event and from that event you can take the result as loc
alright I also was approaching it from that angle earlier, thinking perhaps that was the case -- thank you
Can you do this from a state tree tho? its crying about not an event capable blueprint?
ST Task*
I'll see if I can't just inherit from UStateTreeTaskBlueprintBase and do it all in code.
In ST - you'd have a task that does the EQS entirely, then another task that binds to the output of that task.
Ok ok I can buy that
@harsh storm Dude its working, dope. Thank you. Was just slight mindset change, was doing too much.
There is actually still something weird going on, I'm at least getting values now, but its not as espected -- I hard coded a value just for testing purposes and will show what I mean here: At this point bout to take small break lol wtheck
Somehow that value has mutated from 1000,1000,1000 to 1730, -460, 48.295928??
I've never been happier boys
It works! lol no idea exactly what I did differently, but whatever.
If your AI has a playerstate, how should I be cleaning that up after I dispose of the Actor?
just call destroy on it?
Hmm, now I want to play with statetrees too 🙂 hahaha
Ugh, that just reeks of "not invented here" UI stuff. I mean UE is bad in some UX areas, but I've seen loads of arrogant companies making really shitty tools just because they think they can do better than Unity or Unreal and honestly, they can't 🙂
Somehow that game has some badass realistic AI though
Good afternoon 🙂
Quick question:
I am experimenting with Mass Crowd functionality. I followed some tutorials and created a simple map with different agents traversing zone shapes according to the rules I set via tags. (To avoid issues with human meshes, animations etc. - I'm using my own characters - with MassAgent component added - and with cubes as meshes).
Now I want to make them work with Smart Objects - but I encountered some problems.
Is any of you, by chance, familiar with a Visual Logger message like this: LogMassBehavior (Error) Entity [i: 3 sn: 3][MassZoneGraphPathFollowTask] Target is not on current lane, target lane is [0/-1] expected [0/1]. ?
I made smart objects according to some tutorials (SmartObject Definition, actor with SmartObject component attached etc.) - but I can't find more detailed information on how to place them. Judging by City Sample I thought they just should be placed next to the zone shape - but I must be missing something.
Thank you 🙂
Odd issue i have with my character pawn
when i test the moving caps
when they move from A to B, the moment they should stop
they stop but then slide forward a bit
there is like a problem with the friction
i cant figure it out O.o
i want them to stop instantly instead of sliding of
Use Acceleration for Paths
this settings (or something similar to its name) will make your AI slide less
Man I wish the path finding algorithm had some customizability
Would really love to have something like weight randomization idk, would be nice if I could make the ai not path in a perfectly straight line
I think I can try to use a dynamic navigation mesh and place random obstacles that it can walk through but will increase costs randomly
Is it possible to run a behavior tree on, for example, a gamemode instead of an actor?
Not sure - I thought I saw that it tries to use AIController. But you can use a StateTree
I mean, you could just add a BT component to the gamemode and see what happens
¯_(ツ)_/¯
It's been awhile since I've actually looked at the BT setup code.
(Also GameMode is an actor 😛)
Oh, hah.. maybe I'll try it
you can
Sweet
how to make 2 different navmeshbounds work in level?
one is not working after placing it and pressing p also not green.
the first one will disappear when i enter the second
🤔
Pretty sure that used to "just work", as in, combining bounds just combined the navmesh as you might expect
it doesn't even start the "isplayerdead is set" sequence, what am i doing wrong?
???
If the first one succeeds then the second one won't run because their parent node is a selector
The second one should start however if the first one doesn't succeed, in that situation if the second does not start, then your condition is probably false
ok hold on so
if i tell it to fail once the attack's done, it should trigger the 2nd one?
Probably yes, but that seems like a kind of wonky design if it must fail to succeed
but isn't that what i did?
well then what do i do?
Instead of using a selector, use a sequence
Sequences execute nodes until one of them fails
Selectors execute nodes until one of them succeeds
it's not working even with it set up like this
You need to use the debugger to see what's going on then
use the what now?
If you pause the game, you can use the BT debugger options to step through and see what happens
how do i use the BT debugger options?
You can also see it during gameplay but they may move so quickly you might not be able to see accurately
When you pause the game you should get these options if you have your BT open
wdym by pause the game?
how do i pause the game
you need to first make sure the dropdown on the right shows the correct actor as selected, then you can use the back and forward buttons to see what the behavior tree is doing step by step
When you play in editor you can pause it from here
oh
nothing's showing up
the second from left should pause it in UE5 I think