#gameplay-ai
1 messages ยท Page 159 of 1
And like I said before I don't even care about the other actor, I would much rather just give it location to fly to but I also don't know how to achieve that
because the vector you can put as target doesn't seem to work as destination
I've used the BT one forever and never had an issue with it, so I suggest its a misconfiguration
Oh, one thing to remember, if you're using a navmesh, is that your target location needs to be at the same level as the actor, otherwise you'll never achieve the target location (because of the differences in height values)
I've seen a few people have issues with achieving movement to locations because they didn't have actors of the same height above the floor
so it is exension from market place to give me 3D navmesh, and it does work to fly from different heights... but all coordinates XYZ fall short
so there's always a distance between them and the AI could never reach
Can't help you there, you'd have to speak to the author
Thanks anyways for input. Why I'm asking here is because I think it is more likely to be my ignorance of basic of AI, BT and such rather than the extension problem
I'll keep looking, I'll ask the author next if this keeps dragging, but already learned new things from you guys
Hi, I want to remember the name of a topic I watched a video about long ago, it was about running AI simulation in editor and then if it hit an obstacle he would pause/stop the simulation and then add some code so the ai learns to bypass the obstacles, Im pretty sure it was built in UE but cant, remember the name of topic, thanks.
Thanks @viscid oasis I was being passive aggressive since I'd just typed where to find it lol
nah all good.
well you failed to mention this the first time around. might be very limited as 3d navmesh is difficult to work
I do want to make my own 3d navmesh at some point but I have no use for it yet
Thanks, I'm waiting the developer to answer, but apart from the mesh it seems to use the UE's own core functionality so I'm assuming the problem is me, stupid user, being new to all this. I can't even figure how to make AIMoveTo execute from blueprint vs from the BT as it is now. I just keep getting "failed" from it, so can't even try to send it to specific coordinates directly
if you're not using cpp it's going to be difficult to debug from the perspective of what you can change IMO. I have no idea of the implementation for 3d navmesh. if it's band based, it may be that the AI in question doesn't have a movement mode that allows for full use of 3d for instance
if it's between bands, perhaps there isn't a good way to move between them as there is no navmesh
and nav modifiers would have to created on the fly
I'm trying to use this one https://www.unrealengine.com/marketplace/en-US/product/flying-navigation-system
yeah like I said I'm not familiar with the code
I'm giving up, gonna delete all my ai blueprints and start again
Its too confusing ๐
Does anybody know of any advanced examples of INavRelevantInterface
I want to inject a bit of custom navigation data into the world, and try to connect them together. Imagine a box with only one opening on the side - I want the AI to automatically pathfind somewhere outside of this box if they find themselves in it.
Maybe check out vis ai since your starting over. Just be sure to test often regardless ๐
is it possible to see all generated nav meshes?
Press P in the editor
Anyone know if they switched to large coordinates in UE5? or stuck with origin rebasing?
I saw people talk about doubles on #cpp so maybe?
probably best to ask on one of the ue5 channels
Hi guys! If the nav mesh generated slopes that will actually block the AI, is it because something is wrong with my mesh's collision settings?
sounds like a mismatch between ai setting and navmesh setting
Thought I'd heard that somewhere
They switched to LWC
We also have a new world composition alternative
iirc it was called world partitioning or something
@ocean wren
Did it replace the world composition? ๐ค
I've heard this is the case
but I'm not sure if it's just hearsay or what the status is
I can't be bothered checking out UE5 to find out
Yeah reasonable
:no_entry_sign: NeXi108#0584 was banned.
Yeah, theres a new grid based world thingy in UE5 (which I can't remember the name of but it has World <something> in it ๐
Will be interesting how they execute the LWC thing, does that mean all legacy code breaks? or is it automatically typecast or something? Probably some horrible compiler hackiness ๐
Well its all i know is its broken as hell
My ex colleagues having difficult times with Ue5 because of it
I think it will be something like a duct tape all over the system
ex colleagues? ๐ค
did you go solo with your prototype?
I think you are thinking of World Partition ๐
I was actually always been solo, I just have a couple non game developer friends helping me for a short period of time. Back one year ago I was working for a small indie studio, I was referring to them
ohh okay
@celest python sorry I meant the additional layers. I can see my green default layer but I have a special layer generated just for vehicles.
Do you mean navigation areas by layers?
yes
Their color is set from the BP class directly
When you press P you should be able to see it too
If you cant, restart the editor
The Nav Area BP? Its set to red. Restarted a few times. Only seeing green.
Hmm
I had this issue a almost one year ago
Maybe removing intermediate folder might help, I remember I did something similar but cant remember how it solved
We were using Perforce and something went broke then we resetted some settings, removed intermeadiate folder etc. and in the end nav area visibility issue was also fixed
You might have to refresh (replace, move, delete and create again) nav mesh bounds again
ill give it a go - thank you
I checked it multiple times but it seems to be matching :P
I played around with Cell Height values and changing that some times remove the unwalkable slope
so maybe it's just an accuracy issue!?
its a combiniation of the navmesh generation and the walkable z slope for the ai
your navmesh agent dictates how it generates
but if your ai pawn is not setup to adhere to agent settings, it can get stuck
can you tell me which of the settings should I check, CharacterMovementComponent's Max step height and walkable floor angle!?
its your pawns CMC, but also in your project, the Navmesh System and Navmesh Agent
I see, there's one value that I am not sure what is it about
Nav Walking Search Height Scale under Agents
They seem to all align :P
The max step height is pretty weird, I have the setting at default value (45), and it will create unwalkable connection between places
I was wrong to say slope/angle, it the max step height
Somehow the navmesh height also affects it. Im not really sure why, guess i dont fully grasp it๐
hey everyone ๐
can someone gimme a tip whats the problem with the AI when its attacking me its kinda hanging on an "elastic band" on my player ? even with AI StopMovement its doin it. Cant find anything helpful in the forum ๐คทโโ๏ธ๐คทโโ๏ธ
stop movement is momentary
it'll stop for its duration, which is likely 1 frame
Hello. Red man needs shoot to light-blue man. Red man has a triggers with points for shooting (p1, p2). How explain to red man that he needs prefer green p2 point instead red p2? I can test it with EQS (line trace to blue-man) but maybe It has another solution.
priority?
priority of ..?
hi guys! hope everyone's day is going great ๐ I have a weird situation and wanted to know your opinion.. I'm trying to make my agents vault over an object in some situations but to not loose my mind adding the same amount of NavLinkProxies, I'm trying to add the NavLinkComponent to the object's BP.. the thing is, this component doesn't notifies the owner or itself whenever the agent reaches the Link.. Also tried using the NavLinkCustomComponent but the agent just stands there trying to navigate the link.. was thinking into overriding the object parent to be a child of NavLinkProxy but seemed like an overkill hahahah.. any thoughts? ๐
well that is for you to figure out
priority would be a function of the AI's current situation
EQS is exactly the right thing to use, so yes.. use that
McDrak: You can add a trigger around the navlink component end points to do the notification for you
I did that for doors, added a trigger around the navlinkcomponent points and fired on overlap with the trigger
๐ฎ you mean like couple spheres/cubes/etc?
triggers, basically collision boxes
spheres would work fine
I just used a box that was on both sides of the door and just checked the direction to the character to decide what to do
๐ฎ and is there a function to tell the NavSystem that the NavLinkComponent is disabled?
thanks for the info btw ๐
Don't remember to be honest, mine were ladders so not really on/off
doors and ladders
oki doki, will try that out and update if anything comes up.. thanks!!
Anyone know if there's something else that affects the pawn deceleration when using acceleration for paths? While I'm using custom AI solution it seems to work when I'm not using acceleration for paths, but when I use them, the deceleration exponentially slows down, as if Speed is continuosly multiplied by 0.9 or something, meaning it gets slower and slower but stopping takes forever... when tracking the pawn position I can see numbers such as 2500.000 being repeated on every tick meaning that it is slowing it down the pawn in fractions smaller than 0.0001 in the end. Whatever I enter at the deceleration value doesn't really seem to affect it that much. Is there some other setting that affect this, or perhaps some blueprint node that could be used to affect the precision, as if any thing for example smaller than 1, would be 0?
What I mean is I'm using this custom 3d Navmesh... and if I add that acceleration for paths then the result is this super long easing that doesn't seem to care much about the actual speed/acceleration/deceleration values
sounds like you need to dive into the code to see whats going on
I finally am starting to grasp AI !!! Took me like a week ugh.. did anyone else struggle so much with the behaviour tree system?
vis ai seemed interesting but theres more resources for the built in system
but I will definitely check it out after this project
generally if normal solutions are affected deeply by custom plugin, you'll have to look into the custom plugin to figure out how to do things. I'd ask them for support
Yeah, I have but there are so many general level things that I also don't understand. I can get over the problem by adding my own precision check to the tick that just stops the AI... I don't know if these "easing" issues are from plugin or would regular 2D AI have the same issues, since I've never worked with that. That's why I asked here.. just incase there is some universal solution and the problem isn't in the plugin (though it probably is)
You'd have to look in the code
I tried to scan through it but I don't really understand C++ and I think that functionality is actually from base UE and the problem probably has to be between how them two communicate assuming this pawn speed problem doesn't exist in built in functions
I have temporary fix now and just have to wait and see if the developer can solve it
This might be universal though, is there a way to access navigation path on blueprints if that path exist via BT's AIMoveTo?
if you have all these problems, why wouldn't you start with a simple normal navmesh system so that you could test out these issues?
yeah that might be wise thing to do to eliminate variables from this problem's reason
I have been using the air detour controller for an RTS project I am working on and I am finding that the agents don't exactly avoid each other is there another step I could take ?
RVO?
uh so i have a landscape here and i built a navmesh volume which covers it. The navmesh built successfully but no green grids are showing when pressing p. On other surfaces the green grids show.
i built lighting'
nothing changed
just normal landscape
@mossy nexus thanks I'll check it out
so uh
anyone use the Set Finish on Message node in BTT
or the Send AIMessage node
I feel like in theory this should work but for some reason the task never completes
ok
im really dumb
the message was being sent before the task was set to set finish...
should navmesh go in persistent or streamed levels
i have a working navmesh on a landscape
however
on a non landscape
this works
move to
but
on landscape the AI doesnt move
help
bro?
how do i get path from point A?
or the closest location to point A on the navmesh?
Ai like to stay on navmesh and are clueless once off of it
its going to fail the request because you're telling it to move "off" the grid
EQS can generate a series of valid locations to pick from, but specifying a location needs some form of leeway
alternatively, you can adjust the agent radius to reduce the gaps between navmesh islands, but its more of a sweeping effect
There's a function to get closest point on the navmesh to a location off of it
does the input location has to be on the navmesh or it can be off of it?
also
what the hell is cell size and tile size UU ?
i cant understand that, i put cellsize and tile size to the max
:/
but it still takes long to generate navmesh and its detailed
is it world space size or local to the tile?
TileSize is the size of a single tile, a single tile is made of multiple cells.
toggle on navmesh in editor view and play with those settings, you'll see what they do
a decent size map will take around 30-60 seconds on a really good pc
are cell size and tile size tied to each other in any way?
yes, please try seeing what they do by adjusting and comparing
i am seeing and im not understanding
why do i put both to the max and its still super detailed
there is options to show cells in the editor
oh ok
there is a cap to stop bad settings also
it wont allow you put data which is plain wrong
TilePoolSize=1024
TileSizeUU=1600.000000
CellSize=20.000000
CellHeight=18.000000``` these are some good values that should get the ball rolling
i still dont understand the relation between tile and cell, is cell size relative to the tile size? where can i find parameter to visualize cells?
cell size is the size of each cell inside the tile..
not sure what you don't understand?
A Tile is made of multiple cells of Cell Size up to the size of the Tile.
i think i understood
but what is the point of having tiles and not just cells?
thank you for explanation
Cells are like voxels inside the tile
the more "Voxels" you have the more precise the navmesh
cant i just have one gigantic tile?
So the smaller the cell, the more it will take to generate
no cause that will lead to other artifacts
(like edges of the map, etc)
you want to take advantage of the quad/octotree
thats makes it fast to access and generate
i see
if your generating and never regenerating, go with smaller cells than one large one
you'll get more resolution per cell, though in come cases you may not want that
and there should be a setting to reduce the accuracy
our map is fully dynamic so we have to compromise with the tile size
im actually doing big map and vehicles so i need less dense navmesh
but finding that value depends on the game
you may not want to use navmesh if you using vehicles
same, im also doing dynamic, but am using relatively small sizes for both
we did astar calculation
should i use dynamic?
only if it changes
no
dynamic is only good if the map changes
i see
then ya dont ๐
or doors can open etc (if you don't use navlinks..)
are you talking about a custom navigation solution completely?
for our vehicles, yes
and as Kaos mentioned, it depends on your level design, may not matter if most of your map is gridlike vs a lumpy landscape
what is the way to go for vehicle navigation?
that depends what you need..
if you want traffic simulation, etc then that is complex
our vehicles are simple move from a to b
you can do old school waypoints, or adaptive spline networks, or use navmesh, or have vehicles with awareness
there are others im sure
Splines is the common way
depends as stated
was there not a vehicle pathing plugin on the MP?
probably
not interested in plugins
most of what you use in the engine is plugins :p
i was recently looking at this
man goal is for vehicles to find target around obstacles
thanks
๐
easy solution
ye thats tuppence if its good
BlueMan had one
Was pretty nice, judging by description and example video
its less, thats for 500k+
if its not 15$ its out of my broke-ass budget
there are some out there for that much
sometimes its worth spending 50 on seomthing that may take you 4 months
that is right
Otherwise you get burnout ๐คฏ
Which is a thing programmer should avoid at all costs ๐ฌ
there is a learning variable too
yeah, might not be able to grasp AI or something
im pretty happy with where im at i just need a good navmesh
i started generating with suggested settings, will see how it goes
takes long tho
navmesh and navmesh agent, those are two places to be playing in
what do i need from navmesh agent except for radius?
do smaller areas to test if its taking too long
i guess nothing else if you dont need it, just mentioning it in case, some ppl forget about that part
?
in generation settings
you can change it but it doesnt work
you need to add an agent and set it there
not sure, but there are agent specific settings in Navmesh System
does holes like this impact navigation?
I dont think so. Navmesh queries are projected in z.
I want to get eached sensed stimuli and perform an action depending on whether its hearing or seeing. The following setup will return True False for some reason it can perceive the player, but it wont succesfully sense it. Any reason why? (Testing the hearing, seeing works fine)
...
I just saw it
ok weird when I collapse the nested loop to a function it doesnt work correctly, but when the nodes are expanded it does
Unreal Engine baby! ๐
@tardy talon it kinda depends on how the loop is set up. If it doesn't work as a function, my guess is that the variables are behaving differently perhaps as a result of being made function-local
Is BT decorator conditional loop supposed to be working? this return true confuses me๐ค
I would not assume any of the default decorators are working well. AI module seems half baked at best. it's worth making your own versions IMO
Hello, I ve some nav mesh volumes at a level. But they dont work. Everything is looking ok when i press p but when i run the game i see only there is only one active nav mesh
๐
๐ฉ
^
I'm trying to get a very simple EQS query for finding spawn points, but the result always returns false & locations are origin.
the EQS tester looks good
the spawn point is the same EQS tester
The docs seem to suggest that Querier must be a pawn that is currently possessed by an AI controller. Is this the issue?
uh
how do u do delete this
everytime i delete it
it comes back
i want to keep navmesh
but not recast navmesh default
that gets made when you build navigation
you need it to keep navigation
yes
but i dont want them in streamed levels
i only want them in the persistent level
but i cant delete them from streamed level
help
any1 know what this
menas
"does not have any geometry"
@pseudo brookYour issue is that the Query likely wasn't done if I'm not mistaken.
You're looking to do something like this instead.
Hey guys, I'm making a zombie game and have human (soon) and zombie AI, right now they will both only attack the player but I want a test to determine for each ai if the other ai type or player is closer to it, as such; it will follow and attack that pawn instead. Any ideas?
Hi guys, do you have to enable client side navigation in order to use navmesh walking for multiplayer? It seems like the client side is having a lot of trouble predicting the movement and is shaking a lot while moving :P
Hey guys, how can I enable EQS?
I don't see the option in the Editor Preferences
you call it, dont need to enable it
In the behaviour tree?
sure, bt or bp. BT its RunEQSQuery. You need to make an EQS asset.
Alright, thanks
When I use the NavModifier in UE5 seemingly every cell that touches that actor gets its nav data reset to default values rather than what I've entered in the project and recast settings. This is debilitating since it removes navigation from certain areas of my map
is EQS not an experimental feature which you need to explicitly enable anymore? (Conrad/OverG0d)
no i guess not
you have me second-guessing myself about it now...
It's no longer that in 4.27 at least. I never enabled it and I'm using it.
huh... i dont think i did in 4.26
or else i did looooong ago
sorry if that caused confusion
no that's cool i'm surprised and never realized they finally FINALLY changed that ๐
right? eventually things come out of experimental - sounds sarcastic, but really is it?
given the state of the AI module I'd say everything is experimental, labels or not ๐
Hi guys! I don't know if I am imaging this but when the server is using navmesh walking, The client-side AI will constantly adjust its Location Z, so it looks like it's going up and down real fast :P
Is their a way to use event dispatchers in BTs? I have a event dispatcher that throws out a int when the time of day changes. Now i need to get that information in my BT
Not really, you would need to query the value when the BT is running
Okey, so should i run the dispatcher in the AIC and then cast to get the value in BT?
It depends on how you want to use it
Does a specific BT task need that information? Or is it used to update your BB and the BT reacts to it? And so forth
^
I many need to get it in here, im checking if its after the NPC start working hours and before the NPC stop working hours, i need to check this to the time of day
So i need to update a BB value
This is the original event graph
Converting it to BT now
Updating the blackboard would probably be easiest done in the AI controller
so you'd bind to the event there and update the BB, and the BT can just react to the BB changes without having to know where the data comes from
Something like this? This is in the AIC
Yep
You can simplify it a bit though - instead of using a branch, set the value from the AND directly as the value for your bool
this way you don't need the branch and you can just use a single set value as bool node as well
This looks so confusing ๐ (found this message while searching for examples in discord)
:/
basically you just want to counter rotate the root bone till the angle hits X degrees
then interpolate that yaw offset back to 0
so your capsule keeps rotating, but the mesh does not (only your aim offset rotates the mesh)
Hmm, when you explained like this it looks easier now
Are legs playing montages?
no
Normal animation then?
correct
Alright, thanks much Kaos ๐
So to put simply, when actor starts to rotate you detect it and start incrementing the offset, then counter rotating to negative offset value and if it hits X value you interp it back to zero
yep in a nutshell
Hi UKaosSpectrum! Sorry to bother you but can you tell you how did you set up navmesh walking!?
just enabled it on the CMC
then i have a check in the CMC to make sure if it gets flipped to Walking (which can happen), it reverts back to NavWalking
I see
I'm also having some issue when playing as a client, have you noticed anything odd when the server is navmesh walking? I disabled Client Side Navigation because it will cause my AI to float :P
My Client-side AI will shake a lot during movement, especially when jumping . Maybe it's a down side of navmesh walking!?
shaking, could it be from server correction?
or crowd avoidance, without a video hard to know
I think so, but I haven't look through which function is doing it :P
AI will only float when client side navigation is enabled, both Server and client will be in navmesh walking mode
It's pretty weird, seems like Client-side AI cannot find a place to land so it's constantly floating, the FindFloor function can't find a floor.
I'll try to capture some on a video :)
How does it walk on the server?
I have the AI set to navmesh walking on the server, but the client will still use standard move because there is no navmesh
I ment is it shaking on the server aswell? ๐
It's really awkward they way it adjust itself when jumping
oh no no it's completely find on server
standard navmesh walking tho, weirdly smooth :D
it's very prominent when walking up stairs but that might be the capsule component adjusting itself?!
Sounds like server correction, but video might shed more light on it. Glad i'm not touching multiplayer for a while ๐
That does to me look like server correction
Hmm, maybe it's the capsule on the client that made it go off trace so the server had to correct it
Exactly my thoughts
I've been trying to test visAI and see what all this "time saving battle ready systems" are so I opened their FPS template
I've never seen worse FPS AI in my life not even placeholder
That only happens in stairs??
You can debug server corrections
There was a console variable to visualise them
@haughty edge its only happening on stairs right?
cause we had the same issue with heights
this is normally caused by turning on Project to navmesh
Server corrections happen in a distance threshold, with that lower difference in server - client position I dont think its related with networking
or some kind of collision
(we have seen them jumping if they are inside a blocker for example)
What do you means๏ผ Is visAI bad๏ผ
as a conceptual system it's not technically bad
is that the full BP one?
but it's sooooooo bloated and it's not something you can literally slap on anything as they say it's meant to
yeah
if so, wonder what the performance costs are..
Stairs are very obvious
But I swear to God it's happening on flat ground
that's what I was wondering too, but I'm not going to have a lot of AI so I was like if it's really that easy to just jump in and get going I'll use it
except it's not
we rock around 100-150 ai (max cap of 200)
Thanks! I'll give it a go and see if I can find anything
@haughty edge you have project to navmesh on?
Yes
in fact their "super duper useful" starter content is basically useless
Vis ai using utility like method. We are currently adapting our design to utility style.
it has an AI that shoots when it doesn't have LOS, runs away weirdly when it has targets and takes super weird decisions
and it would take me longer to learn this bloat to fix this
than to make my own from scratch
so I'm reverting my workspace to before installing this plugin
๐
Isn't this.. Division 2? ๐
You got the Division 2 AI and you're complaining /s
Roger Roger
I stg
Division 2 AI was weird, sometimes it was like, damn that was smart, but that was once in a blue moon
most gun fights felt easy against the AI, not sure i struggled at all
They just run the whole combat system based on a ticket (token) system
yeah but we do that also in RS2
maybe not the entire system
but least for attacking, etc
I use it too for spawning ranged enemies and making them select targets, but with a TPS it gets too repetitive and schematic over time
After some time you already know which target you should shoot first before triggering a combat
is there any way of making an AI react differently to different sounds? Like gunfire vs a teammate calling out?
send a noise event with a specific noise tag?
oh wait thats what the tag is for?
also any way of sending a tag with the other stimulus?
no
then why does it have a tag?
Damage and Noise
ok
but the stimulus class itself seems to have a tag paramater
gotcha on that one ty
so basically any stimulus apart from sound and damage will make no use of the tag?
correct
oof
I was about to say friendlies but there is different logic for that
Noise and Damage make sense, cause you may want to know what caused the damage (ie type, etc), or what the sound actually was (Explosion/Gun shot/Water)
http://thegames.dev/snaps/UE4Editor-Win64-DebugGame_jFTfL6rwBN.png i made a custom version which uses GameplayTag
cause we use gameplay tags extensively
That's a good idea. Does it convert it into an FName since the event normally doesn't carry a gameplay tag?
oh yeah if I rememeber correctly Stranger was doing it.
you could make the function and convert it, etc
Tag -> Fname and use the standard sense
what are the benifits of using gameplay tags?
No luck :P
we use GameplayTags everywhere, from Game Logic, to UI, to audio, etc
Missions, Achievements, Events, etc all GameplayTags
I see. Epic should make this change then I guess. Remember seeing many absurd things stick around before (widget interaction component had pointer index as a float data tye in 4.25 for example)
they were going to make GameplayTags default at some point
I'll try to find the issue tomorrow, kinda late here, and I'll let you know if I figured something out!!
ie actors have a GameplayTag container on them, etc
That would be awesome
but yeah, quicker they get off of the FName stuff for tagging, etc, the better ๐
get more people using GT's
Out of context but am I weird to be imagining whatever you say in a scooby doo voice ?๐
heh, probably not lol
always had that thought for a year since I joined slackers ๐คฃ
Kaos had a black background and an axe profile picture once, and a text ๐ค
in before mod times ๐
If I was to make a custom EQS generator that queries all actors of some base class "X" and a custom RunEQSQuery BT task descendant, how could I parametrize the query from BB key with a specific class which is an X descendant?
Is there a way to edit navigation paths after the move request went through? Or would I have to do it before that?
Sounds like before would work better as you seem to want a custom path?
pretty much. Then I will do it like that. Would have done it that way anyway, just wanted to test it before, but then I'll do it right away.
Thanks
I am just guessing would still suggest having it seconded by someone who knows this stuff
I mean in the end I want to have it like that I was just prototyping and got the FNavPathSharedPtr or however it's called and thought for prototyping I could maybe just alter the Path points in there to see if my other stuff is working. But it didn't seem to work, probably because the points itself do not get used anymore and are only as reference to use outside.
Again, better if someone more qualified answers
IM SO HAPPY, made so much progress on my AI today. Got proper basic pathfinding working for now (EQS is next!) and they go into all the states
Only thing to fix now is that its set up now so that if the enemy is attacking and hears something it will investigate the sound before continueing its attack
Hey guys, apparently EQS is in a experimental state and the unreal engine 4 website says it shouldn't be used on a shipped product, is this true?
as long as you're using any recent engine version it's totally fine, go ahead and use it
Ok, ty
Is code for AI usually becoming convoluted nearing the end? I remade my AI like 3-4 times now and even tho I always think hard to make the code as easy as possible, there is just too many little issues that I can't solve without making a specific code just for this one exception so there is a lot of "duct tape" code all over.
I wonder if I'm still doing things in a wrong way and AI can be relatively easy or if AI is one of those things that no matter what if it's suppossed to be good it's gonna be a pain to work with.
Is there any possibility you are trying to handle everything in the BT?
They have gigantic amount of nodes and a huge (really huge) codebase in Division 2, so having sphagetti codes around or having complex trees are completely fine
But you shouldnt abuse the BT by overdoing some stuff on BP or as you said 'duct tapes'
AI is mostly complex when you dive into low level stuff
https://youtu.be/Qq_xX1JCreI try watching this, might give you an idea where are you doing wrong with
@celest python I will, haven't seen this before, thank you
@pine steeple When using Navmesh Walking on Server, The Z location is a bit different compared to standard walking, so the server will constantly correct the client's Z location and create the constantly bouncing effect.
i don't have that issue though
server tells the client the correct Z
clients should not be doing anything (like tracing the floor, etc)
The client will always have a different Z because it's still trying to use standard walking :P
I hard lock the z location in the function SmoothCorrection to remove the bouncing, it's not very ideal :P
client does not care for the movement modes tho
(simulated proxies)
unless your talking about autonmous proxy
but simulated proxies (the AI on other clients)
runs through SimulatedTick and then SimulateMovement
no
it always moves the capsule
to where the server says, but then lerps the mesh
you dont have the AI skeletal mesh set as replicated?
I don't think so, let me check
ive seen that causing this issue
I don't have it set as replicated, should I set it to true?
no it should be false
let me try always check floors!
no luck :P
Is there a difference in Listen server vs Dedicated?
Are you on 4.26? but I think the odds of it begin a version issue is quite small.
These 2 are the comparison between Server Navmesh walking vs Server standard walking
If anyone has some knowledge on navmesh generation pls dm me! I really need some help with dynamic generation. Thanks so much! ๐
You're going to have to be much more specific about what the problem is if you want help with it. Nobody is going to be able to guess how to help you
Microsoft research wrote a paper called "Its unweildy and it takes a lot of time" on this subject. TLDR is that yes, its hard ๐
They interviewed a bunch of AI designer/programmers from the games industry and identified key problems
I'm of course working on fixing some of the issues using machine learning ๐ because why not!
Looks like Microsoft writing a lot papers about AI
I heard multiple times from you about Microsoft's papers
they've been doing that for a while now I think
Microsoft Research is basically doing nothing but lol
Well, they've got some people doing games tech research
As do all the tech sector companies
games are obviously important entertainment tech for microsoft, google etc.
Most large organizations have something to do with games tech. I've been to Disney research in Zurich a few years back. Lots of their stuff was games-adjacent
And obviously metaverse and the like.. have sparked a lot of work
Yeah many computer science related things coming out of video game industry I guess
From Carmack to Tim Sweeney, 3d graphics tech etc
But seems like Microsoft paying a special attention to AI
Not surprised though. AI is useful in a lot of scenarios for many non gaming things as well. But AI also has been a little stagnant for a while in comparison to many other tech related fields.
Well, MS research have been going for a long time at this. MSR did stuff early XBox etc.
I don't know why you think AI has been stagnant ๐ I guess if you discount ML and whatnot then maybe? but there's loads of work around planners and whatnot too
But yeah, ML has taken a lot of the heat away from pure game AI I suppose
Look at recent GDC's and there's a ton of ML based talks.. clearly it is in our domain area ๐
Yeah actually, now I realized when you say.. Old game AI papers > new ones
There a lot of useful ones before ~2015
After that time it's way lesser
I guess it depends what you're looking for
Innovation
Because I have waaaaay more papers on ML than anyone can reasonably read
innovation in what way?
Like how Valve and other older studios invented new things, or somehow created a new one on top of other systems
I mean, there's been a few years of things being a bit messy ๐
Valve invented what? you mean like GDC talks and such?
Haha no ๐ They just researched nice things, shared them publicly, made the industry move a little bit forward. All the things they've done in the industry was helpful for creating a new systems on top of the current systems. Not just Valve though, I just had a feeling like game AI researchers and the industry was more serious before
Give me an example?
I was a kid back then, didn't see with my eyes like you ๐ But development of previous game AI methods, talks.. just feels more professional and innovative
The AI driven dialogue system you shared with me
I mean, I take the point that game AI specifically hasn't particularly advanced.. evidence all the people struggling in this channel ๐
But that doesn't mean that AI as a subject hasn't advanced (it has, but in strange directions)
So a lot of the latest academic research in games is about a thing called MAP-Elites, which is a form of evolutionary algorithm being used in games PCG for lots of things
the reason for that being interesting, is because Ken Stanley and Joel Lehman showed that objective functions (used commonly in ML) are actually bad for really large leaps in advancement, so they proposed a more quality/diversity approach
diversity being one way of trying to find new ways of solving a problem
So people are using MAP-Elites for things like PCG level design applications
For example, MAP-Elites could search in the space of all possible robot designs (a very high dimensional space) to find the fastest robot (a performance criterion) for each combination of height and weight.
Interesting
Now admittedly, not really valve etc.. but thats mainly because these methods aren't complete yet
the games AI scene is pretty conservative
and lets face it, unless players vote with their wallets, the powers that be who fund stuff couldn't give a crap about game AI, hence the lack of dev in UE4/5
Game AI could be easily enhanced commercially by just fixing usability of current tools ๐
But yeah, I think you'll find stuff slowly creeping in from the ML/RL sphere
like that Ark Raiders robot ML movement balance controller thingy
Where was that introduced by the way?
Nexon conference.. let me find it
Thought it'd be on Embark Studios youtube, but apparently not: https://www.youtube.com/watch?v=yED9t2tImog
Embark Studios procedural artist Anastasia Opara shares a sneak-peek into Embark's experimental project Kittiwake, where our team set out to explore a feeling of co-creation with a procedural system in a dialogue-like interaction.
Interested in how the visualizations were made? check out Anastasia's Houdini files on GitHub: https://github.com/a...
Oh it is!
โ ์ค๋ฌธ์กฐ์ฌ:ย https://forms.gle/kCBbY3VeXY664E7JA
โ ์๋๋ฅผ ํผ์ณ,ย ์ธ์ ์์ธ์ ๋ณด๋ฅผ ํ์ธํ์ธ์!
โ ๋ฐํ๋ถ์ผ:ย ๊ฒ์๊ธฐํ
โ ๋ฐํ์:ย ์ ๋ฐํฌ์คํ๋์ค Tom Solberg
โ ๊ถ์ฅ ๋์:ย Game Designers, Animators, Technical Animators, Animation Programmers
โ ํค์๋: #Physics #Emergent Gameplay #Robotics #Reinforcement Learning #Animation
๋ณธ NDC ๋ฐํ ๋์์(์ดํ โ์ ์๋ฌผโ์ด๋ผ ํฉ๋๋ค)์ ๋ํ ์ ์๊ถ (2์ฐจ์ ์ ์๋ฌผ์์ฑ๊ถ ๋ฐ ํธ์ง์ ์๋ฌผ์์ฑ๊ถ ํฌํจ)์ ํด๋น ์ ์๋ฌผ์ ์ ์...
about 4:30 into that last video
Awesome, thank you ๐
ML is definitely a good thing to at least understand the basics of if you're into game AI, becuase it will impact you job wise if you don't understand it ๐
So they made the robot learn to move by training it for 2 days, finally robot learned to move.. Just one question comes to my mind, why prefer ML over just scripted movement?
It's not like something people can interact it in daily life, or even if it's ultimately huge dynamic landscape that robot is moving on, they could cover it up with something else, IK on bones etc
Why waste 1.5 years to teach robot a move? Just for research or to implement to project
Because the learned movement is robust to changes in the level architecture
and has a more natural appearance
and yes, people can interact with it in the game, so you shoot off its legs etc
Check out the world premiere reveal trailer for Arc Raiders a new game brought to you by Embark Studios unveiled during the 2021 Game Awards livestream.
How they move the learned 'movement' data to animation pipeline?
yeah, exactly
its basically what robots do
think of it as procedural animation
where the procedural bit is a learnt motor controller
So they train it with a physics engine running millions of simulations, with an objective function to retain balance etc
and it learns from maximizing an objective function
pretty straightforward until you try doing it ๐
Another naive question, what about the performance? Without ML (or RL) data, you just process the steps defined before in the code, trace towards the ground, adjust the bones etc.
But with ML way, it has to process the training data, it literally has a brain to think about what it's trained for
Which means additional step(s)
Well, the training is all done offline.. you learn the matrix weights for the model, the runtime is called inference and is basically a bunch of relatively simple maths inside the matrix
so its pretty quick, because the expensive stuff is done outside of the game (you can do it at runtime too, but that would take time to train)
Its a bit like how IK works, you know
yeah, its basically just a bunch of simple maths in parallel
Is there a way to mark a nav area under a car as obstructed? I need the navigation to still generate under vehicles but canโt have ai constantly trying to walk through the vehicles.
primitive components should have a setting for changing the nav area type, if you set it to NavArea Null or whatever it was that might do it
Obstacle* i think
Yeah that might be it :)
null = never path here, obstacle = only path here is there is no other possibility
IIRC though you also need runtime navmesh modifiers enabled at the project level to support it on a moving primitive
Thank you!
Hi im trying some basic stuff with ai. I tried aiMoveTo on a pre-placed actor and it worked perfectly fine, the actor moved.
When I'm trying to spawn an actor and then aiMoveTo the actor won't budge.
you might need to set your pawn to auto posses on spawned (the setting allows possession on spawned or when placed in world which sounds like why it only works with your former setup)
thank you, I used this node (instead of spawn actor from class) and it seems to work
hey all hope everyone's well - ive got a AI/C++ Q. so i'm doing some experimenting and i wanted to make my enemy character move to its original location after the user leaves the agro sphere and i'm running setGoalLocation, which takes in a vector, but it doesn't seem to move back, is there something else that needs to be added for it to move or do I have to use a different method? thx in advance!!
So you know, with VisAI you can get around 250 pretty easily; more with optimization. There's a ready-to-go example map that'll test 250 AI. (woodcutter) Simple steps taken for optimization.
For BP it's incredibly performant; mainly due to the utility-influenced decision making. In C++ it'll be multitudes faster (coming in v 2.0)
BT isn't the problem for high counts of AI, the CharacterMovementComponent is. With a decent computer and multiplayer you barely will be able to handle 100 of them
Is VisAI easy to customise? Grabbed it for this month but not sure if it's a good general purpose solution to melee enemies (think Dark Souls, Shadow of War, etc)
seems like it based on what I saw. I was trying to get it to work on ue5 but the pawn class keeps crashing on me. It is a really good reference to make GOAP AI tho (they are doing GOAP right?).
It is just auto generating bts, enums, etc so you could look at how it works and make your own.
BP is what I was takling about actually ๐ Also i definitely can run more than 100, like I said i've run 250 with no issue; there's an example map for it if you'd like to test it on your system!
it def is, join the discord if you have questions on how to create AI, we have mods & community members ready to help!
Also not sure why the class was crashing for you, feel free to join the server for support. You're also not bound to any specific pawn/character so feel free to use any.
It's not actually GOAP, it's something i created; heavy influences of GOAP and Utility. lots more info on the video & in the docs
Morning
GOAP is like 20 years old now? sheesh
You'd think we'd be talking about more recent planning algorithms ๐
I blame Jeff ๐
we were actually ๐
Well, you were talking about GOAP, so ๐
There's a huge volume of planning literature since goap
Dammit, I want to do some novelty search now!! ๐
I eneded up making stuff from scratch but taking heavy references from how decisions work in yours. I am on server. Will have it checked today
Lehman and Stanley definitely have some answering to do ๐
sort of yeah, was talking about how it wasn't GOAP; just wanna make sure the distinction is known ๐ Still wild to think how old GOAP is though as well as most of the other popular ones; though most of the web is similar currently
Awesome; example ai are a great place to start honestly
I have an issue with aimoveto node
It always returns success, even when I clearly block off my agents path. To be precise it fires the on success pin and then the movement result is also success, always despite agent not reaching its destination, because the path of clearly off limits.
Agent comes as close as he can, towards its destination, then stops
Yeah, for that kind of thing, a utility based decision is pretty common. There's loads of presentation from GDC on Utility based AI decision making on YouTube
The basic idea is that you score the options using some numerical value
and then choose from the top N percent of scored options
so for your case, distance to target might be part of the scoring function, or number of targets, or amount of ammo etc
In this 2016 GDC panel, programmers Kevin Dill, Christopher Dragert & Troy Humphreys provide a comprehensive exploration of modular AI, from the theoretical underpinnings up to code examples from shipped titles.
Register for GDC: http://ubm.io/2gk5KTU
Join the GDC mailing list: http://www.gdconf.com/subscribe
Follow GDC on Twitter: https://t...
Kevin Dill did some work on this for the US military while he was at Lockheed Martin
and has a few papers on it
Also see the book by Dave Mark on this kind of thing
The idea of Utility is pretty understandable.. scoring functions etc. But there are caveats etc.
Have a watch of Kevin's thing for execution
Also, Tom Looman did a utility AI thing for Unreal Engine
@ocean wrenwhat's your take on Tom Looman rejecting BTs over utility AI?
I've got some sympathy, I think both are kind of wrongheaded in different ways ๐
A mixture of both is useful
but yeah, I kind of moved away from both, because both have fundamental flaws
BT's have the issue of boolean logic being too hard a condition selection mechanism, utility has the problem of redundant calculations and maintaining momentum in a decision
I mean you CAN use either and both and they work.. I just think they're not ideal for my own thinking, they're hard to design because humans are bad at specifying behaviour
I am bad at specifying clearly what I want an AI to do. Because my mind can't comprehend all of the really fine detail edge cases that commonly trip us up.
I'm moving towards using learning behaviour by example being the way to address it. So stuff like reinforcement learning and the like, but using fewer examples and generally learning from video-based examples
The challenge being to have explainability in those kinds of systems
The whole "why is it doing X, how do I make it not do X"
I wonder if people should start looking at AI design problems modeled on real life human behavior. like for instance, could you make an AI have ADHD?
You'd need to define what it is first ๐ or at least how it is exhibited
I'm sure there's an ADHD definition described by professionals somewhere
But how to portray it usefully?
Does ADHD portray itself in any useful way in real life either? ๐ค
useful is secondary to authentic
as a human behavior (tm)
honestly this would be pretty hard to "sell" in any way
I can't really tell my friend has ADHD when I talk or play games with him :P
the idea is that rather than looking at AI from a perspective of purpose it would look at them from the perspective of a model
Well, anyway, believability is more than just having boolean conditions for excluding things
it's having several of them ๐
You can tell he is ADHD if you play a boring game ๐
Or talk about history (if he is not interested in) instead of his favourite band
I think you can make a sim (from Sims game) ADHD very easily
When you have a perfectionist character in there, you cant make it watch movies
Same structure should allow getting bored of actions too ๐ค Wonder how they do it.. I remember there was a thing called smart-objects for their design
Yeah, smart objects was from Will Wrights original sims game
later they used rule based systems written by Richard Evans as the basis for stuff in Sims 3 along with the smart objects
Hi guys, looking for a suggestion of how to implement the finding target logic for a group of actors to fight against another group of actors. I tried to let each actor find the nearest enemy, but that will look really wired when the fight begins. Is there any other approach for this?
I timed the video
Set a prior focus and proper 'positioning' for your AIs and then let them select the other focuses based on other factors
Might help the gameplay
Not a bad read about Killzone's approach from the second? game
TLDR, its all about the space ๐
Thank you guys, I will take a look!
hey, one question? Is there any reason to make AI behaviour in BPs instead of BT?
So if I want to generate a series of spots around the player, would I attach the EQS to the player character?
for the AI to teleport to
attach it to event tick, run eqs query and reference to self
wish arc direction could be from -360 to 360
Currently im trying to make some AI Concepts/Designs, but I couldnt really find any cool examples that sparks new Ideas - all Im finding is people talking about that enemy has to be predictable/cohesive/feel fair etc. but I cant find a single page showcasing different mechanics the AI can do and what pros/cons can evolve from this - If anyone has some references for that - would much appreciate it - right now im mostly looking trough game footage to get ideas, but I dont have that much exp with the design of it, so I would love to hear a bit more insight on how specific enemy abilites have different effects.
Can I set a blackboard key value in the AI controller?
Yeah, just get the blackboard component and do whatever you want
figured it out, thanks!
@mossy nexus thx Dude sorry for the late Response was pretty busy the last Days ^^
well i did it now via animnotify instead within C++
think you tagged the wrong guy tho
I have some custom functions that handles movement and animation in a top down game. The required AI only responsible for move on screen and shoot. The only way for AI to play animation is use this custom functions. They normally takes axis input from player. Should i use behaviour tree, blackboard, AI controller, etc or just write code in enemy pawn?
hey guys, a pathfinding question. on the image I have the following setup: all red ships are ai agents, and the blue ship is the player pawn. now, the one in the blue frame is supposed to follow the player, but instead of creating a proper path (illustrated with the green arrow) it tries to move directly to the player (red arrow) and of course fails, since there's an agent blocking its path. if I remove the agent blocking the path, then it can properly move to the player. I'm wondering if my setup is wrong somehow - e.g. agent parameters for avoidance or something like that, or this is just not possible with the built in nav system? I'm using crowd detour ai controller btw, with RVO avoidance disabled, and avoidance weight set to 1.0 on all agents. other settings are default. any advice?
Avoidance doesn't really deal with pathfinding, it deals with collision avoidance. So you'll never get a path like you want in that image unless you have your agents on a grid and represent the grid being blocked by agents at positions (there's a grid pathfinder in UE). Avoidance is really to push agents apart and avoid local collisions when agents are moving around near each other. My advice would be to turn off rigid collisions for your ships and then tweak the collision avoidance to make it interesting
thanks! yeah, I figured it out eventually. looking into modifying navmesh dynamically using UNavModifierComponent for characters when they don't move
you'd be retriggering it from the BT side, not within the bp
You mean the BB @crimson galleon
no i mean the BT. this is a task
BB just holds keys
i mixed the two sorry lol
If you're "retriggering" a task, I'd say you're thinking about it wrong
the BT will basically retrigger itself when it comes to evaluate the branch if nothing else has priority
Well the task has priority, but it seems slugging at the move to points, like it needs a second to calculate
might be how im using the execute finished
You mean it stops and then moves on? because that's a different issue really
Hello, I have group AI into one group.
Instead of every AI find it own path, I tried to make only the leader find the path and then offset the FNavPathPoint to makes lanes and move in formation.
However I think that because Leader pathfinding is in Async? Therefore other AI need to wait for path to be calculated, is there any event that I can register for that?
can someone help me out with interface communication between the AI and the player? I have an AI that can throw a grenade at the player, and I want to use an interface event inside the player to tell the player blueprint to create a widget that will warn them of the incoming grenade.
unfortunately I cant seem to get the event inside the player running
I'm not sure I would bother with communication between the AI and Player so much. AI doesn't have to care about the grenade after throwing it. Grenade doesn't have to care about anything except existing and calling damage functions. The player itself should have a system that can detect dangerous things around it and notify it's controller's AHUD to create a widget with a passed in actor reference that can add to screen. The Widget can just exist in screen space and do it's own ticking to update screen location/visibility based on the actor passed in. Grenade explodes, does damage to stuff, marks itself for destruction, widget should be validating it's pointer often when updating screen space. If pointer invalid, remove widget from parent and let it die as well. This keeps your classes encapsulated and very clean without having to worry about which classes know about what.
Thanks for the reply, ill look into this solution durin my next work day
Hi, I've only just started with AI in Unreal Engine and Iโm trying to create a custom MoveTo task in c++. Basically, my enemies are tanks and I want them to patrol the specific area but at the same time they will move turrets left and right trying to look for the target. What is the correct way to approach this? Should I create a custom task and add the functionality there, or should I code it inside Tank class and call the functions from the behaviour tree(Iโm not sure if this is possible). I have the patrol part working, where AITank moves from one point to another using the base MoveTo and I tried to create a custom MoveTo task but I got lost in the documentation.
btw: enemy Tanks are derived from Pawn class, not Character
Here's how I've done it in the past...
I had a system like the pawn actions, where you could add multiple "actions" for the system to execute simultaneously, so think about making independant layers for turret and main tank, so I'd treat them as seperate channels that have an enter->update->exit style loop (look at pawn actions)
So my AI itself, would simply add appropriate actions to the queue of actions for each layer of the tank, I had a "commander" layer, a "gunner" layer etc.
The parts were coordinated using message passing between the agents that made up the tank, each having a custom behaviour tree for their own activity (this wasn't an UE implementation btw)
For the most part, the simpler parts of the tank crew, like loader, gunner etc were simply state-machine like
But the more complex ones like target selection (commander) and navigation (driver) were more typical behaviour trees
The main thing was that there was the layering of behaviour functionality, you could add a move order to the driver and the movement action would be pushed onto the drivers queue, commander would evaluate threats and push commands to the gunner, who would move the turrent orientation towards the target via another action in the gunners queue
I've used similar queue-layered event based AI for stuff like chain of command stuff in a squad based AI using custom code in Unreal Engine and it worked out pretty well
I'd recommend looking at Pawn Actions and MessageEnpoint classes as a starting point
Might be overkill if its a simple tank game of couse
and these days, you'd maybe rely more on the gameplay abilities system
But I liked that seperation of decision from action, plus the message passing stuff was a nice architectural design I think
Then again, I'm from a distributed systems background anyway, so biased ๐
think of it as a message based multi-agent system if you prefer ๐
This might be a naive question since I didn't use EQS enough to completely understand about it, is it possible to find the obstacles with almost half-height of the querier with EQS only? or do I have to write a custom system? (simply they should find a position like the image 1 and avoid the 2nd)
This is for ranged AIs that prefer to be behind of a small cover
If we could do multiple traces with EQS tests I could provide a Z and check their blocking hits, and that would be hella easy but I guess we dont have that option
Though in that case I would need to find a way to provide the geometry (meshes) location to EQS ๐ค
Find one for what reason? Like to take cover?
Yes
Get points between ai and target, filter by tracing to target if can reach, discard. Use remaining to trace from higher point to target. You can offset the trace z
Actuaaallly... We can just place two trace test right ๐คฆ
You're right
Thanks for reminding me ๐
I was overthinking with trying to do multiple traces with single test, didn't think of adding multiple tests instead
EQS on the brain lately. Fun note, BP point generator crashes in 4.27.2.
I think the entire query is async.
Nice
Yeah, this might be a small overkill but I love that idea ๐
Why AI module takes UObject parameters as references on functions?
Is it some kind of blackboard thing or servers anohter purpose?
Hi guys! AIPerception Wait is not updating? How Can I access the updating value shown in the video in UE5?
As you can see in the Blackboard list (middle top of the screen) the "Perception Age" is not updating. I've connected it in blueprint as the image below.
But the age is updating in the sphere in debug mode. So what am I missing? Is it a bug? How can I access the updating value?
Have you checked the values coming into the blueprint to see if they're changing? try doing a printstring on the incoming values
yeah they're not
or the age isn't
The Successfully Sensed is changing as you can see in the top middle of the video (the blackboard that reads the values)
Suggests you're not getting the updated senses quite right
Have you set a max age for the sense?
Also, you can check the get known percieved actors array to see if the data updates there.
Feels like you're just reading cached results
Event lastly triggers when player leaves vision
Pretty sure you need to fetch from the array..
Thanks guys! How do I get access to the array?
Is there any documentation or do you have any tip?
Have people used some extra ways to get AI Perception Sight to work at a bit higher granularity? I have a guard bot and it can only see the player if the root location of the player is within the line of sight. This isn't great when the player is clearly visible to the bot just above the waist line. I think I could just put a big overlap sphere on the player and do custom linetraces to all the bots it can overlap with, but... I'd rather use the in-built system if possible.
Alright, overriding a function from IAISightTargetInterface worked, there was actually someone who pretty much had a working solution on a blog page
You'd think you could just add sockets directly as AI detection points tbh
Anyone who is interested I am making a zombie game with human and zombie AI
ive added both of them but now I might think of scenarios such as both AI fighting each other along with the player if anyone has any concepts or hints I would really appreciate it ๐
its hard to think on how to implement this final feature but if I can it would make my game so much better!
any ai experts out there i would appreciate any ideas
artificial intelligence
You can do that yourself by getting bones from the skeleton, that's what I did.
Hey Authaer, apologies for disturbing. Just found time to try your method but couldn't find where we add Z offset to trace. Do we provide a location from context?
Yeah that seems to be working, probably we're adding the offset by contexts
https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/ArtificialIntelligence/AIPerception/ seem to be a function call avaliable in bp
Is there any way to visualize EQS on gameplay debugger when not used with BT?
use EQS pawn
how do I check if the enemy is in front of player? I want the enemy to recalculate its position if it is not in front of player to stand in front of player when attacking (first person)
static bool IsLookingTowards(const FVector& BaseLocation, const FRotator& BaseRotation, const FVector& OtherLocation,
float CosTolerance)
{
const FVector ViewDirection = BaseRotation.Vector();
const FVector OtherDirection = (OtherLocation - BaseLocation).GetSafeNormal();
return (ViewDirection | OtherDirection) >= CosTolerance;
}
Use Player's values for BaseLocation and BaseRotation, provide your AI's location for OtherLocation
CosTolerance would be 0.7f
It will return true if it's looking to your player
You also need to trace first to see if it's blocking hit (AI might be behind a wall, in another room etc.)
actually I wanna place the AI in players LOS if in combat cuz it is an fps and for balancing purposes. I wanted to detect if the enemy is still in LOS once it reached its location and if the player turned recalculate.
Why could I need trace here (AI only attacks when it sees our player and the eqs placing the AI has a trace check for visibility )
If EQS already traces for you you dont have to trace
The function I sent you will do a dot check, if the value is higher than 0.5 it's in front of the player, if its higher than 0.7 its more closer to the cone
1.0 directly in front of the player
That just provides you info about direction rate
ah so thats how dot produxt is supposed to be used. I knew that it was needed but not how
dot product lets you know if you are facing towards or away, cross product lets you know if you are facing to the left or right
Omg its a function.... I totally missed this. Need to override the function not the events. Thank you so much!! You made my whole day
How can you avoid the game being stuck at trying to spawn at a location where it cant?
Check after spawning if the actor is valid or not
If it doesn't get spawned, then the returned actor is null
Already doing this, but the spawning node itself gets stuck at trying to spawn it and doesnt execute if it gets stuck
and just freezes everything
guess a linetrace is the solution then
There is a collision checking option
For BPs its on the K2 node
For C++ iirc you need to set it somewhere on the constructor
๐ค
I'm fairly sure it will not get stuck in a loop like this unless your own nodes cause it to do so
Even with the attempt to adjust location setting it has a limit of how far it tries so it won't just go forever
It could fail
Im already doing this aswell
What its set to?
Set it to ignore collisions?
Wont that cause issues if they spawn on eachother?
It might. Other option is you can randomize the spawning location in a radius and keep the current setting
Or have multiple spawning points
Im already randomizing within nav radius and kept the current setting, which causes the engine to freeze 1/3 times when spawning
That's odd
yeah thought of a grid
Randomizing the spawn location shouldnt be an issue
Its not an expensive function
At least not that expensive
Something else is wrong
Probably logging
Spawning itself is also an expensive thing by the way
how would you decrease that cost?
i.e. spawn them on beginplay, store them in an array and set their active/deactive states via an interface, and try to get them from that array
on deactivated, hide them in the game, disable tick, movement etc
wouldnt a massive active call also be expensive?
It's easy to do, I have some example repos for C++ but I don't have one for BPs sadly
No
It's not that expensive unless you're spawning a lot of them
Yeah
soo an average spawning above delta tick would be less expensive?
It again depends on how many you're spawning
(and how complex the actor you're spawning is)
Spawning one actor per ~0.2s is also expensive, regardless of the count
so say spawning one actor per 0.5 would be much better?
If you're spawning 10 actors it costs next to nothing to spawn them with that interval
but if you're spawning 100 then yeah
hmm
Profile your spawning cost by the way ๐คทโโ๏ธ
Spawning cost depends on many factors
For example BP spawn node uses deferred spawn
~%30 expensive than usual one
Your freezing issue might be related with something else
It's almost guaranteed to not be spawning unless he's spawning several hundred
Maybe its just logging
hmm okay ill do a profiling and make spawning happend slower, and also make a grid
I sometimes spawn large numbers of actors in one tick and while it causes a noticeable hitch, it doesn't freeze the game
im spawning around 30 to 50 depending, its a small pigeon
no complex code running without minigame running
If it's mostly for visual fx you may want to consider using particle systems, I think niagara handles skeletal meshes
@misty wharf
Hmm thats interesting, make the ones that are not interactable VFX hmm
Hey, what's the difference between AISense_Sight_VR and AISense_Sight? Does the Sight_VR look for the HMD?
Why is my EQS not recognizing actors that have been spawned at runtime?
Working fine if I place in editor
Quite likely the item generator you're using to find those actors.
If it's using a system that caches actors, and doesn't update that, it won't know about anything spawned later.
Makes sense. How would I go about fixing it?
Dunno. What item generator are you using?
I'm just generating all actors in a radius inside the eqs query
Are you using multiple levels?
No
Just looked at the code for that. All it's doing is using the QueryOwner to get World. And using that to iterate over all actors in that world of the class type, and doing a simple distance check. So if it's not finding your spawned actors, either they're the wrong class type or they belong to a different world for some reason.
My actors were spawning above ground level so the pathfinding test was failing. I checked by manually setting the Z of the spawn location and it worked. Although the static mesh of my actor was going through the actor previously so idk how it wasn't able to pathfind.
I have this task in my behaviour tree
But in the enemy blueprint the values come back as 0 and -1
Any idea why?
ok now its just -1
So the message is called in the BTT -> then the event fires off but the variables dont come through correctly
I'm currently using MoveToLocation to move an actor to a location. However, I have a need to be able to get the status of this movement to query if it's still executing. In digging into the AIController.cpp I see there's a handful of functions for AI movement but nothing seems to fit what I'm looking for and Google has been less than helpful. Can anyone suggest a function that might be more suitable for this?
Oh, looks like I can override OnMoveCompleted and that should solve most of my problems
ok nvm I was printing the wrong thing it is just 0
Is there any way to get the path an AI is using for a moveto? I know I can use FindPathToLocationSynchronously to find the path ahead of time but I figured it must be saved somewhere during a request
Sounds like internally in the pathfollowing component
if (Controller)
{
AAIController* AIController = Cast<AAIController>(Controller);
UPathFollowingComponent* PFComp = nullptr;
if (AIController)
{
PFComp = AIController->GetPathFollowingComponent();
}
else
{
// player controller, most probably using SimpleMove
PFComp = Controller->FindComponentByClass<UPathFollowingComponent>();
}
if (PFComp != nullptr)
{
const FNavPathSharedPtr Path = PFComp->GetPath();
if (Path.IsValid())
{
// we don't care if Path->IsValid(), we're going to retrieve whatever's there
ResultPath = NewObject<UNavigationPath>();
ResultPath->SetPath(Path);
}
}
}
return ResultPath;```
Found that in UAIBlueprintHelperLibrary
I'm trying to wrap my head around solving this problem. I have an AI moving on a path, the AI can be interrupted at any point in that movement. When interrupted, I need to figure out how many units they moved.. and since the path can bend I can't just get the delta from the starting point to the end point. I need to somehow figure out where the actor is on the path they used.
There should be a distance variable
You could track distance moved since started moving by delta capture of the location
I would need to capture it at every path point though and I don't think there's any hook into an AI reaching a path point
Hmm. I can use UAIBlueprintHelperLibrary::GetCurrentPathIndex though to get the last path point they reached when the movement was interrupted.. add the deltas for all the previous path points then add it to the delta for the last path point to the actor.
They don't necessarily move in a straight line
From path point to path point?
Crude MSPaint of what I'm talking about. From start to end is 300 total units. But if the movement is canceled at the red X, I need to be able to calculate that the AI moved about 290 units. I can't get the distance from start to the interrupted point because it will be far less than what they actually moved.
I do think I can use GetCurrentPathIndex to get that the last path index was "1" (or maybe it gives me "2", not sure) and then manually add up all the distances. But it sure would be handy if it tracked it somewhere
Right,
But if you start capturing the delta at start, you'd get an accurate measure
Not just start loc and stop loc
But .. how/where would you capture it?
But (current frames location - last frames location ) length
Atleast i think this would be accurate
On tick?
Thats what im thinking ..
Unless you wanna check between current pathpoints location and lastmpath points location..
But then you need the points..
I just put this together (currently untested)
{
TArray<FVector> PathPoints;
const UPathFollowingComponent* PFComp = GetPathFollowingComponent();
if (PFComp && PFComp->GetPath().IsValid())
{
PathPoints.Reserve(PFComp->GetPath()->GetPathPoints().Num());
for (const FNavPathPoint& NavPathPoint : PFComp->GetPath()->GetPathPoints())
{
PathPoints.Add(NavPathPoint.Location);
}
}
return PathPoints;
}
float ABoardGameAIController::GetTotalDistanceTraveledInCurrentPath()
{
float TotalDistance = 0.0f;
const UPathFollowingComponent* PFComp = GetPathFollowingComponent();
uint32 CurrentPathIndex = PFComp->GetCurrentPathIndex();
TArray<FVector> CurrentPathPoints = GetCurrentPathPoints();
// Add up the distance from the start to the current path point
for(uint32 i = 0; i <= CurrentPathIndex; i++)
{
TotalDistance += (CurrentPathPoints[i] - CurrentPathPoints[i+1]).Size();
}
TotalDistance += (CurrentPathPoints[CurrentPathIndex] - GetPawn()->GetActorLocation()).Size();
return TotalDistance;
}```
Which I think should work ๐๐ฒ
Hmm, doesn't work quite right. I think CurrentPathIndex is giving me the current path point the AI is trying to get to, not the last one it reached
Yeah sounds about right
oops, crashed it. hmm something is a little faulty in my logic
Idk it does sound like my vector delta should be easy enough to capture but ๐ untested, unverified. Only tried in my head :p
I try not to do stuff on tick when I can avoid it. And while I don't need 100% accuracy, it does seem like adding up the distance between points will be slightly more accurate as it's possible for the movement to end between frames
True, with your method you'd only have to calculate it once, even if its a tad extra
Wha, it can?
I doubt it would be very likely but why not?
hm
actually, no that really doesn't make sense
May i ask what this is for anyways ? ^^
Movement in a turn based combat game. I am limiting how far the player can move and they can interrupt their own movement mid-move
Right
Running this a check on tick during movement doesnt sound like the worst thing imo^^
It would probably be fine
But your apprach is surely reasonable. Getting the last and current path locations + adding any previous points distances should give you an accurate result afaik
For now Ive fixed it in a very roundabout way lol but if anyone knows a better way Im here for advice
In regards to path length it may even be more accurate than my suggestion due to height differences if such were to occure
Think I got it working now, just had to tweak the for loop to i < CurrentPathIndex . Turns out the current path index IS the previously hit path point
Anyone able to help, Have an issue that if I tell the AI to go to an actor etc works like a charm. If I however change it so it goes to another actor then on success then to the actor that it used to go direct to it don't seem to work
gets to the Go Via we will call it turns in steps to direction of next actor it will go to and just sits dosen't move and I can't work out why direct it works but go to another actor first don't
not make any sense
can you uhh show a video
Is there a setting to disable navigation on top of a mesh? I have chairs that are by default being labeled as navigable rather than just blocking navigation
this doesnt work? details of the specific mesh
make sure your chairs also have collision
no
It generates navigation on top of the chair, that setting disables it beneath it
or if it's supposed to disable it above it doesn't do that
They don't seem to have collision though, let me fix that rq
Okay that all fixed it. That's so weird I thought for sure it had collision.
sounds weird that it had navmesh on top without collision
there is also this setting in the static mesh editor fwiw
yeah that's crazy. It the navmesh was being built on top of it
I use dynamic for my doors atm. In UE5 the other common solution resets the navmesh settings
eww
can't you use nav link proxy's for doors? (i actually don't know, don't do much ai level design)
i think so, only familiar with using nav link for jumping
