#gameplay-ai
1 messages Β· Page 158 of 1
The other thing to think about, is if you want it pathing to your player, or your AI?
I'd have thought calling in backup would want to path to the AI calling for backup?
can you even access a raw dijkstra from UE4 natively?
that was my thought as well
which is fine, just didnt want to reinvent the wheel if there was already a way
right, so get the navpoly under the AI's current position (assuming its on the navmesh), then do a dykstras from that navpoly, looking through the list of EQS positions you'd generated and stop at the first result
I mean you could copy the UE A* and just throw away the heuristic
I got a query
suppose I have something like a rotating camera that can look for the player. it is static, but positioned in such a way that it has jurisdiction over a large area. the area is big enough that the camera doesn't have the cone size to keep watch over it all at once. I'm looking for a way to keep it relevant to the player as they traverse the area without seeming conspicuous or gamey. my initial thought was to force the pitch rotation to change in relation to how close/far the player is to the camera position. but I'm wondering if there are other, and perhaps, better ways?
cmon AI peeps
Is there a particular reason that AI Focus doesn't seem that widely known? This is concerning me, because it's exactly what I want. It looks fine, it works perfect. But I've been listening to a lot of tutorials, reading through a bunch of AI stuff. Yet I haven't seen a single mention of it. I went to start implementing a small system on my own and ran into the SetFocus call. Yet tutorials and guides and everything else basically just tells you to rotate the AI yourself towards a target using tick and interpolation math. It isn't even a basic BehaviorTree node to set a basic target, nevermind to use the different levels of focus, so what the hell is wrong with this system that everyone avoids it so hard?
I don't know. I think this is the second time I hear anyone mention SetFocus
but I've been doing my own system from the get go
I generally stay away from proprietary functions both to not need extra includes or hookins to things I don't need, and because I have greater control over my own code
Which is fair. I won't need anything more than what this offers. I'm just really confused as to why it's so unknown. It would literally replace dozens of "How do I tell my AI to face a target" tutorials. Single BP call, Done, GG, no tick implement.. Oh right, that also means no videos and Youtube views.
CE: what do you want the camera to do? keep the player in view? lead the players current motion so that you can see the world in thier forward velocity?
stay relevant to the player. so like, no matter where the player moves in that area, the camera has a chance of spotting the player
I've typically done that.. computed a look at position which keeps the player and some future position (based off velocity) in view. Basic trigonometry to calculate FOV and look at really.
Similar to what Mario 64 did π
I don't know what you're referring to
you don't know Mario 64?
I haven't actually played Mario 64
have a look at a video of it being played.. notice how the camera predicts the future position of the character.. that sort of thing
its basically calculating a dynamic look at position that is ahead of the target agent scaled by the agents velocity
well, it doesn't matter, I'd still do it anyway
that way, you never lose track of the character
I don't think it does what I'm looking to do
the point is not to not lose track of the character though
I can handle that once the character is spotted
Well, how about this.. find a video of what you want it to do, and I'll explain how to do it π assuming I know
but this is staying relevant as an obstacle
as in, the camera is an enemy. you are sneaking past it
oh right, so you just want it to sweep an arc?
the arc isn't the issue
the camera is overlooking a large area. at some point the player can get close enough to the camera to hide "beneath" it. I want the camera to adjust in some way so that the player can still get spotted closer to the camera
So tilt the camera down?
yeah that was my first thought
but it's going to seem a bit conspicuous, being that the player hasn't been spotted yet
Why not make a camera thats one of those security ones, they're just basically a dome π
That's gonna look hella weird lol. "It knows I'm here but it doesn't know I'm here"
Have the camera do one sweep at long and one sweep at close pitch?
why even do it? let the character have the benefit of not being spotted?
It's a super high tech camera system with heat and air displacement sensors?
I'm already accounting for that
have overlapping camera arcs?
Or just use a pie slice detection instead of a cone
I guess this could work, but sweeps are fairly time consuming to complete. perhaps I could bob the pitch dynamically to move it in a wave like fashion?
Indeed you could
I've never seen a security camera do that π
I think I need some elaboration here
Why not make it a drone? then you could have quite interesting behaviour
how could that be justified for a single lens potentially?
because it being static is kind of the point of the whole level
Or how about this.. have a mounting with TWO cameras? just different arcs?
Lol well there you just answered your question. Duct tape two cameras together
I've seen multi-camera thingies
got a reference?
google image search is the best reference π
I have no idea what to search for
CCTV cameras
I'm not sure a multi-camera thingie is a technical term
Panoramic cameras. π https://ellipsesecurity.com/wp-content/uploads/2018/02/ds-2cd6986f.jpg
See that one would naturally have views at a shallower angle too
The ones we have in our computer labs look liks this:
and the technicians can rotate/pan the camera remotely
I think they're called PTZ cameras
pan/tilt/zoom cameras
That last one would be a bit more visible about where its pointing, but definitely looks PTZ.
Seems they're popular because you can remote control em π lazy shits π
And not ideal for when someone is trying to stealth rob your bank, too easy to catch them
Good for ML stuff though, having the machine learning model do the camera control and tracking and whatnot
machine learning markup language π
confusing?
not as confusing as lisp
damn, almost 2022
here's to another year in isolation
KAOS. Best AI pathing that avoids getting stuck?
stuck where and how
Like, RVO stuff or crowd pathing thing.
RVO does not care for navmesh, so the agents can end up outside of navmesh bounds
crowd pathing does care for navmesh (slightly), but its a lot more jankier than RVO
i did try using both (turning on/off rvo/crowd following depending on situation) but could never get it working nice
best one for me was Crowd following
especially with big crowds
just reduced how often avoidance was calculated
every frame is ridiculous
Hmm.
I really wish there was a way to affect navmesh, except for self.
i implemented this on engine level
there isnt
and that would be another entire headache
sounds good in theory, bad in practice
Is there a good way to make my character just stay still in BT in an infinite in-progress task so that only a higher priority decorator may abort such idling? At some moments of my gameplay I want my NPCs to do nothing but without reevaluating each decorator every BT-tick, instead I want only blackboard-observed values to abort such behavior in higher priority decorators
I made a custom task for this. It can only be aborted
and what's the logis inside the task? just return EBTNodeResult::InProgress?
yeah
then how is different from default task Finish with result In Progress?
I guess it isn't. I had no idea that existed. but I do like not to use proprietary nodes if I can avoid it anyway
ok got it. thx
Just have a wait node
it'll keep going back to your wait task until something more important aborts it
so have a wait task as your rightmost
I guess the wait task is cheaper?
but in this case after each wait completed BT will evaluate decorators on its way to wait task that I don't want to be evaluated
why not?
but is it cheaper?
Well, it depends on how long you wait for
theoretically its supposed to be event driven.. not sure if the wait is using a timer or ticking though, haven't looked
iirc it just updates a float with deltatime
Time =+ DeltaTime;
if(Time > WaitTime)
{
finish()
}
Anyone may know what it means when your AI has a red circle instead of the normal green circles in the AI view? My guess it's something with not spawning in correctly but its still moving but can't see it
wouldn't FinishWithResult set to in progress be cheaper?
Wompa: usually if there's an error, its written to the log, so check that
CE: Not sure what you mean?
there's a node called FinishWithResult
that can be set to In Progress
Yeah, but what does that have to do with waiting? if you return inprogress it'll just execute the node again right? so yes you could implement a wait by timing it and returning completed instead of inprogress.. but why not just use the wait node?
yeah so it'll execute the node again, but wouldn't that be cheaper than ticking the wait task?
it'd basically do the same thing
its always going to evaluate the node, the node always has to check if some time threshold has elapsed.. same thing, different approach, but personally I'd think the wait node made more sense.
Zoombapup, is there any possibility you know the actual difference between three?
I'm having issue with by path planner component, might be related with I'm using the first element in the enum
Well, the first one is using what it says, a 2D raycast against the navpolies in the navmesh, I suspect the second is using some kind of heirarchical data structure to speed that up (likely the octree as I've seen that in the nav code), the last is probably using the regular A* pathfinder
Whats the issue you're having?
Path points (offsets to actual target location) was sometimes not updating their location but I realised it was related with something else
Been trying to solve it since two weeks, was getting suspicious about everything in the end. Randomly I found the actual issue and it's fixed now π
Good stuff
Out of curiosity, is there any accuracy difference between those?
I guess first one just provides "has path" or "does not have path" info
While others can provide actual info about navmesh
Well, the first one is just a raycast, so its a line test against the navpoly bounds, gives you a hit when the raycast hits an edge of the navpoly that isn't connected to another one
done in 2D, so its basically a line/line intersection test
I've used it a few times to probe the edges of navmeshes for cover generation, but ended up using physics raycasts instead
noted, thanks
I have a scene in space and I want the actor to fly to certain point, only problem is that from certain angles there's one another actor on the way. My simple timeline changing the actors location towards the target fails as it collides with that actor. Is there some pathfinding node that works in 3D space that would easily just allow it to detour around the other actor?
There's a free plugin on the marketplace that might do what you want
but in general, no
Thanks, I know the plugin but it's outdated, not working on the current versions
Ah, you're out of luck then
I made sort of vector swing arm type of solution that has center point on the obstructing mesh, but unfortunately on short distances that also fails since my obstructing mesh is spinning and has some extending parts
well, i guess it is in to watching tutorials and learning how to build flying AIs from scratch
You're basically in need of some collision avoidance, which you could do reasonably with simple steering behaviours, but it depends on your flight physics model
it might work with some capsules to detect collision that then push the actor to other direction, but since my dumb linear, or optional pivot around, system is just on timelines, feels like it gets super messy if try add another layer or manipulation on top of that timeline. Anyways, thanks for the input, I'll go search for some vids on how to make flying AI
Why are you using timelines?
there wasn't suppose to be any AI in the beginning, but then there's this specific case if the player gets lost and needs to be "force" returned to the starting point (without just teleporting)
Timelines seem a very weird solution is all.. I'd have thought a sequencer sequence? or is this just an interpolation value?
so in most cases I can just have timeline lenth based on the distance to fly the player back to beginning, but it doesn't work if the player happens to be exactly behind the goal where he suppose to fly to begin with
it's interpolating yes
since it's empty space, except the station, that's the only object player can collide with. problem is someone might fly so far of the course they have no idea where the station even is and needs to be forced back to beginning point before their time runs out
they are suppose to dock with the station and that can only be done from one side
Why not teleport them?
it's a simulator, you'll be sitting in actual capsule, looking out of window seeing the space
that would be highly non-immersive if it just jumped location
so you need some way to point them towards the station then?
or some kind of auto-docking thing?
there are guides and such, but i just need fail safe automation to fly them back to front. auto docking is already there basically, in case they fail to do it... but it just doesn't work if they close to the station. linear flight works on front, pivot around works from behind the station, except if they are too close to the station
maybe trying to do this with timelines was fool's way to begin with
Yeah, that sounded a bit of a weird approach
i just thought AI is too big topic for me to go into
i'm new to UE and no programming experience, just somehow ended up doing this thing
Hehehe.. thats how things work π
Anyone here have experience with the AI sight rotation instantly snapping towards the target location when using the "MoveTo" AI behavior? I can't seem to fix it in a way that doesn't make matters worse. I would like for the sight perception to follow the actor rotation, which doesn't seem to work when the AI behavior is in charge.
It works fine when I work with character rotations outside of the AI behavior tree though.
I had a problem with that. I had to override the Pawn's C++ FaceRotation and not call Super. I use the following settings in the images there.
void ATarrionCharacterBase::FaceRotation(FRotator NewControlRotation, float DeltaTime)
{
}
Thanks for the tip. How did you override the C++? Can it be done in a blueprint only project?
Enabling use controller rotation yaw makes the pawn also instantly snap directions now.
just make your own BT task where you do a smooth rotation turn before doing a move to
Sadly its not exposed to BPs
Enabling use controller rotation yaw makes the pawn also instantly snap directions now.
Usually people lerp the rotation in FaceRotation and it makes it act like bOrientRotationYaw
It's a backup solution I've considered, yes.
Yeah, that's far out of BP only range. If you don't need the pawn to look at the control rotation for strafing or whatever, you can just orient rotation to movement.
If you need control rotation looking, you'll have to pretty much override anything in BP by disabling it all and doing it yourself.
That's what I feared ^^'
all of this just makes me glad that I made my own system
Looking at the function. I'm not sure if I needed to override that actually..
Oh. Well thanks. You just pointed out I can remove that. π Different settings.
Uncheck that, and use my other CMC settings and it works fine.
Set Focal Point seems to override the the direction snapping, and be compatible with interpolation called upon from the actor blueprint
Nah, you don't need to interpolate. CMC will do it for you.
My character doesn't rotate at all though when I use the focal point blueprint π (While moving)
Should. I'm using the default focus system as well.
Without the FaceRotation override, which I just took out, I'm fairly sure nothing I've done is not BP accessible.
Can the MoveTo C++ code be accessed in a BP project though?
ah
Talking about AIMoveTo, I was just trying this node.. does it only work on flat level where you define the area on which actors can move? Or can it be used in 3D space?
As far as I know AIMoveTo relies on the navmesh.
What about "Find Path to Location"?
anything AI related relies on navmesh. so unless you have some 3d navmesh then no
There were some plugins like a year ago I was glancing at for flying AI. No memory of them though.
I was toying with the concept of having sky banded navmesh, but my world is not high tech enough to require that
One more question, can these AI related nodes be used in other blueprints? For example, keypress spawns something,followed by these nodes to get path... or do these exclusively have to go to the AI blueprint?
they require an AI controller
it doesn't have to be in the AI controller blueprint
but you need an AI controlled pawn to make use of them
So I found AI controller on the create blueprint list before, but I couldn't figure out how to integrate that together with the actor I want to be AI controlled
it needs to be a pawn
And on the blueprint where I spawn this actor, error is that the AI controller doesn't exist when I try to call it... so I figured that much that somehow it needs to be manually created
pawn is the term for anything AI controlled
pawns also have an option to automatically spawn an AI controller of a given type in their default settings
so how do I combine the AIcontroller and Pawn? Because on pawn I can't find the AI controller
As in I was trying to add AIcontroller to the pawn using add component, but I can't find it there
that's not how controllers work
controllers possess their pawns
I'd look up MathewW's videos on AI controller
you're obviously not aware of how the system works yet so no point in me explaining the very basics
Yeah, I also saw that AI Controller Class thingy, but figured since I couldn't get it to work I missed something. Anyways, you already helped me understand few things. I was actually checking his video on AIMoveTo, that's why I asked if it requires that guiding area, NavMesh, like you mentioned to. But I'll look up his video on AI controller too
Thanks
Does anyone happen to know off hand how to stop AI from slowing down when choosing a new moveto target? Like if you tell them to run to a place far in the distance, they start running, you tell them to run to a point just a few units away from the far away point, it's not even a full degree of rotation away from their current target, but they sort of pause for a quarter second and then start running again.
Seems that RequestedMoveUseAcceleration in the AI's CMC was what I was after. Disabling it stops that behavior.
Interesting, I would have thought it could be a result of the pathfinding
but good to know that's a thing
Some people have reportedly also created full BT Tasks that do the entire movement. Not sure what that changes, but I guess it also solves it if you never call finish execute on the task until movement is done.
yeah I consolidate movement behavior in sequences
Hi
This is my first week with the engine.
I have a pack of animations, a pack of characters, and an environment.
I want to walk the characters around the environment giving them some level of autonomous control.
Then I'll film cartoons in the environment.
I figured out how to retarget the animations from the animation pack to the scanned archviz character pack cause they use the UE4 mannequin
then I made a character object and added the skeleton and the static mesh and an idle animation
then I added a blueprint to the character object that I made and used a simple move to relocate it to a position on the map
all of this was sort of done automatically for me by the engine.
I have like...a million animations in this pack.
Is there a guide that someone can point me to that will help me do things like switch to the walking animation, walk the character somewhere, when they stop, change to the idle animation, make them stretch periodically, etc?
I've gotten to the point where I have to actually learn something lol and I'm not sure what to look up
can I just control all that from the character's blueprint?
because I watched a video last night that says I can make an AI component and a behavior tree ... can I buy a pack that does that? Any recommendations?
You'd probably be better off using sequencer and just playing the animations rather than trying to do AI
Theres a video on the Unreal Engine youtube channel from the Epic guys on how to use sequencer
Am I missing a setting somewhere? Is there any way to turn EQS queries into the local space of the querying AI?
Meh. Screw it, will just write my own.
The wut?
Not invented here (NIH) is the tendency to avoid using or buying products, research, standards, or knowledge from external origins. It is usually adopted by social, corporate, or institutional cultures. Research illustrates a strong bias against ideas from the outside.The reasons for not wanting to use the work of others are varied, but can incl...
okay admittedly they don't paint it favorably
but I think it's entirely fair to write your own stuff in lieu of existing elements
Oh. Yay. The custom EQS generator class crashes the engine.
So. I'm curious why this doesn't work? This doesn't create points when used in an EQS testing pawn like other generators do. Hard coded some world points for testing.
Ah. Wasn't enough to change the Generated Item Type in the EQS menu. Had to change it as a class default for the generator.
Just FYI, I dont know what changed but overhead decreased to 0.05ms
I guess it differs from Standalone to Shipping
Now I can do infinite amount of pathfindings π
just serialize them and you can do infinite anyways π
well.. capped by amount per frame and distance to travel before new pathrequest but thats not an issue at 75
what is the "best practice" way of running a behaviour tree?
is it with a BT component or with a Run BT blueprint call?
and how can I get the BT/BB from blueprint?
With sync path finding it was consuming 2ms on my machine for 50 pawns
On a tick with 0.2s interval
Though I didnt understand this, can you elaborate more? What serializing has to do with pathfinding? π€
@mossy nexus after thinking about it I guess I should have a service that loops on a .5 second delay that checks if a new task is available when an AI is idle
it's better than making the manager itself check the BBs of the AI controllers to see if they're not doing anything
and the director could then say "do x"
yeah that's what I will implement I think
yeah this is a no no
sure but you can do that without a service. It's a task to query.
you could also have the director assign roles to your AI and do role based behaviors
it's supposed to be a really dead simple background AI I don't think I need to setup anything complicated
they're basically NPCs that will move around a little bit to play animations in front of locations
a role would be a struct containing an array of positions, which could themselves be actors or structs
okay, it works all the same though
When the other actor gets out of the perception radius, does this then also change the value of the blackboard key back to nothing(or default)?
but yeah I will also have to map the locations to an animation to play somehow (probably through an enum for the location type)
I guess you could call it a "role" actually
That's silly. just use an actor or a struct
my setup is
Point actor that holds information such as animation, duration of stay any potential custom logic
how do you get the actors from the manager?
you assign them at editor time
I'm thinking about having different zones with different managers so I can't simply query all in map
it sounds kinda painful tho no?
I was thinking about what kind of gismos can be seen in the level editor
something like the spline one but with only points would be cool
that sounds like a pain
or at worst having actors that are attached to the manager on the level editor
that's what I am doing?
ah you meant attach them by assign them
I thought you meant selecting them in the property editor
"Never do at run time what could be done at compile time" - some smart guy who I don't remember the name of
but the director doesn't know which tasks are supposed to b active until you tell it
If it's really basic ai then have them all set up in editor and assigned
technically it's kinda compile time
at runtime you would just need to get all the attached actors
this is probably one of the few places I would advocate for level markup
actors in world. put them into an array. activate. director goes brrr
that's what I'm going to do π
do it right
I can't stand the idea of having to add items in the array one by one
it also adds room for error like adding the same actor twice
that's the whole issue
if you tell them "just drag and drop it on the manager in the outliner"
it's much simpler than
that's not how it works
yeah but it's really bad
why?
esoteric thinking
how is it bad?
stick to simple things that work
you can optimize later
You're trying to optimize before even doing anything
because there is no good way of just dropping a manager into a level and expecting it to understand everything
it's a fallacy
you can automate behavior and registration
and tbh I would advocate using a subsystem in CPP instead of a manager actor
that's silly
why is it silly? :0
what happens if those tasks are done?
I meant to put tasklocation
no global overview
attaching also make ordering a pain in the behind
At this point just have a spline to move along if multiple objects are hard
as I said it will pick a random task
it's attached only on the editor so that when the map is loaded I can know which manager has which tasks
you should have only one manager
not a million
It's like you want to make it hard for yourself
I need exactly 2 because NPCs can't move between a certain area and another
This is starting to sound like how darksouls 1 has its ai set up and limited
well it does since when a task is assigned the npc will always do it
and that's why your thinking is esoteric IMO
I think you guys don't realize the dead simplicity of what I'm doing
Just use tags if you want specific areas
i think you're trying to oversimplify how complex AI is
Or a plugin
tags are fine for this. the important thing is having a single robust manager
NIH Be damned
Not actual serialization but basicly just doing a que , and have a central place to process the requests
I think you're trying to project your complex AI system in what I'm trying to do
no
All AI is complex
I'm not
It's the I part
the manager could be replaced with a literal array
you're completely misunderstanding the concept of a manager class
there is no "task" to be done, only locations to be in
Then a sequence would suffice
no because it's a crowd
random AIs will be in random locations and move around
but that's all
Then some fluid dynamics using meshes is in order
except those locations are supposed to have animations as well. you need durations for themz because they can't stay in one place indefinitely
how will the AI know what to do
On beginplay -> register at manager?
exactly what I'm going to do
I'll just get the attached actors and register them to the manager
Bad practice
lol
how is it bad practice wth?
esoteric thinking
Because it can just be set before runtime
having an array where you can place twice the same actor is better?
The compiler can handle that
stop conflating things and start listening instead of trying to have your own opinion all the time lol
what?
what compiler are you even talking about?
excuse me? π
Wait, I'm getting this wrong right? Is it bad practice to let the AI auto register, but good practice to manually pick them? This must for sure be me missing some memos
The engine you're working in, unreal, has a compiler and can at compile time fix stuff like multiple arrays
you obviously don't know architecture very well but you act like you know everything.yet every step you want to take is painting yourself into a corner
Or misunderstanding whats been said, at the very least :p
If it's known at compile time
wow you know me so well
the heck?
do you even know what a compiler is my friend?
Literally just what I see from your behavior here
if I put an array in my manager and put the same task location in it multiple times how can the "compiler" know that?
if you don't want to listen why are you even here?
because I'm trying to have a discussion, and the only person here trying to force their opinion on others is you my friend
ok, good luck then!
I gave you a valid criticism and thought of an "esoteric" better way for me to handle things
yes because you conflate things
but that's wrong because all I say is wrong?
Im a bit confused about the multiple tasks attatched to the manager tho
they're just task locations
I'm not even understanding @mossy nexus's solution because they never explained it fully
maybe because you never took th time to listen?
Wouldnt tasks also be actors in the world?
you immediately went NO I DON'T LIKE THAT
but if I got it right, I should make two BP classes, one for tasks and one for the manager, have only manager even though it handles two distinct areas that are unreachable from one another, put the tasks in the map and then register it through an array manually by putting the tasks on the array
my criticism was, why not attach locations to their manager instead of letting designers add it to the array
because having an array means the same task could be in it twice
which means two AI could be sent to it at the same time
and having one manager instead of two would just mean having two arrays instead of one and switching between them
and again, why not attach them, there is literally no reason to not attach them
what happens once you want to switch over to using something like subsystem instead? every level will have to change its approach because you conflated ownership in level with mapping
why would I ever move to a subsystem?
and how would that literally change anything ?
accessible everywhere without hitches
if my BP classes are in a subsystem or not won't change the fact that they can be attached or not
the fact that you still insist on having a manager as an actor I don't think is helping you
sorry I think I misunderstood what you meant by subsystem
but still
why would I ever move to a subsystem?
it's just driving you down this path of making decisions that will leave you with huge tech debt
yes
At best, manager idles , while all ai do their stuff π
as I said the "manager" is nothing more than an array of locations
Instead of constantly checking what every single one is doing
it wouldn't
you still have the issue of ordering
Ending up with a ton of edge cases and scenarios where the manager must handle it
it would only check what they are doing when it needs to assign something to one of them
ordering what? I told you it's about randomly picking tasks
how can you order a list of location meant to be picked randomly?
what would even be the point?
what if a task requires more than one location?
as I said, idk what you have in mind but if you listened to what I'm saying
it's not even a task
it's just standing
and playing an animation
What is the ai really doing here? Random idle walking?
I said it's dead simple but I guess I'm just thinking "esoterically"
Not sure it counts as ai at all tbh π
because it needs to go to predefined spots
your thinking is esoteric because you conflate things
Random points, wasnt it?
not because of your "simplicity"
I think the only one conflating things here is you my friend
a random location from the list of predefined ones
great way to take criticism
just lol
what criticism π
you're criticizing me instead of criticizing any part of my system
all the while asking me to make it much more complicated
for absolutely no reason
and packing things together when they don't need to
that's the definition of conflating π
I'm criticizing your thinking because you're trying to do 3 things at once
instead of focusing on a layered system
if you truly want a dead simple system. don't have a manager
how would an AI know if a spot is empty or not then?
just assign random points directly to the AI
RVO?
it's more of a locations manager than an AI manager actually
Predefined*
or not even, just collision detection
Youd want to know before that
that sounds completely unnecessary
SimpleParalell :p
π
if the tasks never change you don't need a manager
I would have been done with my system if I was working instead of chatting π
Id be done with my game if i uninstalled discord
if no overview is needed you don't need a manager
there is
how if the spots are random?
I said I think building the array from attached locations is better from a designer UX point of view
I said it picks the spots randomly
Or keep them in sorted array
exactly
when literally not reading what I'm saying
it picks one of the spots randomly
not a literal random location
I said it when you were talking about order
if two AIs aren't even sharing the same spots, how could they collide?
I told you order doesn't matter because it'd pick them randomly
and spoiler, I don't hate arrays
I just don't see why I would make a public array when it could fetch the attached actors and copy that on begin play
I would have literally been done if I wasn't talking
Copy? What? π
ok buddy, good luck
ty
I missed the copy memo :(
Ohhh
I see
Id just let the actors register to the manager directly but i suppose this does the job
Being registered, they could use dispatchers to communicate with the manager
If needed
Like if their state changes
they don't need anything really
initially I was thinking about having literal vectors for the location
I don't even need an actor
I could have a struct with a vector and an enum for the type of animation to play
I think it's pointless to argue here
it's pointless to try to force a certain solution on me*
I take any criticism of my system and when my manager was broken (before I even had had a good thought about it) and you gave me valid criticism I listened and changed the way I see things
Actors are easier to manage, since they can hold info beyond just their location
They could also have custom logic if you wanted expansion down the line
but here it's a tradeoff between making it a pain for designers and a potential source of bugs vs ???
I guess the downside would be if I want to change my BP to a subsystem it would be an issue but why would I ever do that
to quote our dear friend I think that would be conflating the task actors which only really need to hold the location
I really don't
in fact all of this is unnecessary
our game didn't even need any of this
If thats decided, then its all good
Im often ovetthinking how flexible i want my systems to be
I'm only doing it to get used to BTs and BBs only
the NPCs were literally skeletal meshes looping an animation
I thought it would be more fun if some could move around locations
but that's all
better to be future proof in the case of system architecture
For sure, when possible
Its a tradeoff tho
I think having to unwind years of tech debt trumps overthinking easily
but your mileage may vary
I am 100% with you on this one @mossy nexus
in fact I'm rewriting everything in our project (not talking about AI) specifically because they used drag and drop BPs and made spaghetti code
but again here it's dead simple
and the risk of having the array not be correctly filled by the LD is just too big
famous last words
I will always be 100% against selecting items that are in a level on the details panel of a blueprint (be it an actor or a subsystem)
and I would much rather have them attached or be part of the actor itself
Takes some experience and knowledge to properly plan ahead at most times^^
Hhaha.. you guys really just talked over each other π read the thread back..
so... how I'd do this.. I'd have a BP that auto-registers itself with an actor (you can find specific actors in a level onBeginPlay). That means you don't need to have your LD's do anything but drag positions for your AI to go to. The actor they register themselves with would be the one that AI uses to get the location to go to. I take the point that they're just locations, but in my experience they never are "just" locations. You have to reserve them otherwise you have multiple entities going to the same spot etc.
the point I think people were trying to make, was that parenting actors to other actors is kind of lame as a setup. Plus UE editor doesn't make that ideal.
Nice summay ^^
I'd suggest it was a better idea to just have the "place you can go to" register itself as a place to some central system (doesn't matter if its a single actor or a system) mainly because your LD's can have a nice gizmo based position to edit and see and group in the outliner and such
the issue is that there are two areas that won't be reachable from one another
and I don't need to make the actors have a "reserved" tag because they would simply be removed from the array when they're taken
and then put back in it when they're freed
So add a "area ID" to your BP that registers a position so that when an AI queries for positions it gets only those
Also, two weeks from now some gd says "we need the ai to do more"
"Would be cool if the npc would do x"
Then your system is ready for this with smart actors :p
well, ok, having two arrays vs an array with a reserved bool.. whatever π
Or potentially smart* actors
I'm the GD technically (and I already have the AI doing more, it can stare at and follow the player randomly if it's nearby)
not even two, the AI can "put it back" itself
I guess this might be a better idea π€
but what's so wrong about attaching actors?
But then something outside the manager is modifying what the manager is ment to control?
Containment
OOP is a curse
So generally, I'd have whatever data needs to be associated with a position within the position object, and have queries on the manager actor/system to filter them
let's not go down the rabbit hole of OOP
well, the attaching actors thing is just a pain in the arse when you want to move them properly and when you want to version control the level or do multiple editor stuff. But hey, if thats what you like, go for it
I mean if you're the only one working on it, you do what you want.. but my experience has been that the editor doesn't do well with heirarchies of objects for some reason, I guess I might have seen some edge cases but still
Also wouldn't just a nav modifier do the job of separating areas?
I find it harder to have to make people put area tags or fill an array manually from instances in the level
Than to attach even if it's a pain
You don't fill the array manually
Especially since the parent won't move
Like there are nav modifiers made specifically for separating areas like you want, no need for multiple systems
Yeah I meant if I don't put an area tag (referring to the previous solution the other person was trying to force me to use)
I didn't think of that!
Well, if you use individual actors, you can set multiple properties on all selected actors at once, so using a tag or id for each area would work there
just add an id/tag/whatever to your position objects
select the ones you want in each seperate area, give them different values
that'd just be part of the query setup right
"give me points near me in area 1", "give me a point in area 2"
Just gonna throw this here
I think it'd be even simpler to figure areas from what is reachable or not
he's not using navigation in this particular aspect though
no need to have a tag or an ID or anything
so nav isn't the issue
technically it's the root of my issue
I think this might be a perfect solution
so its not JUST selecting a point then
π
it is
its selecting a reachable point
It almost never is
at random
yeah
that isn't already being used
yup
THAT ISN'T "JUST" A POINT π
You see why we've been at this for HOURS now?
and all points will be reachable if they're in the array (either attached or from deducing it with the area)
God I should've remembered nav areas earlier...
I dont think there's a way to contrain a thing within the navmesh though
constrain even
although to be fair, it'd only be a simple construction script change to do that
Wait, howd nav mesh fix this you said?
also sorry if what I said to you earlier sounded rude, I didn't mean to, I simply wasn't understanding what you meant with "compile time" as I'm a software dev (and I studied regular computer science), when you start the editor the "compile time" is already done, I guess you meant on construction @grizzled hazel
Hello. Where can I find an example of this visibility algorithm? I want separate the safe and danger zones.
the points are reachable so they can simply get the navmesh they're in to know which manager manages that area
When you ship for development it compiles it
This is why things like fast paths are important for anims and so on
Worked out some custom crap to handle it instead
ah I don't know about that
yeah I see what you're talking about
from a recovering performance maniac point of view I understand how doing something on begin play is technically at runtime
but I'd argue this would be so cheap it wouldn't even be too insane to do it multiple times per second
or even on tick
god forbids
I use tick on a daily basis for ai π
You better not have any bp casts...
gasps
Tick on ai is fine just not in bp
btw I'm more of a C++ person than a BP person and if it was only up to me I'd have made my own state machine in C++ but I'm trying to be considerate of others
I thought this was a one man thing?
no I'm the only dev but there are 2 others on the team
Do it in cpp
DO IT π
I won't tick anything
I was thinking about making a BT with BTT/BTD/BTS in C++ but it looks like an absolute hellish pain to use those
My tick is mostly for movement , for now
Its how i handle my 2k ai
Other methods go sluggish
you can use BT's and BB's in C++ just fine
or try to be considerate and use BP (but probably make anything that is frequent enough in C++)
Are they reviewing your code?
meh
Peer review?
nah
they could move some stuff around in the BT if I made it simple enough
but they wouldn't understand anything if I make it in C++
speaking of them I have a meeting on discord with them in 5 minutes
Do they need to?
all they see is the BT in the editor, not the C++ code underlying it
they might, I don't know if I'll stay in this company for long but I could get some shares so it's in my best interest to leave them something they could modify easily after me
oh you mean about BTTs in C++
I mean the BT nodes are all in C++ anyway
nah that's just for me
if I go full C++ I'll scrap the BT
BT nodes in C++ look painful to make
oh I get you.. not sure why you'd do that
its just deriving from a base class.. I don't see why you'd think that was painful
I mean the BTT_MoveTo which sounds simple as hell is like 400 lines in the .cpp
Because it isn't simple
navigating a path on a navmesh isn't simple
especially one with string pulling
and potentially collision avoidance
Clean code for your buddies (and others who might see it) would be like 80% cpp and 20% bp exposed if you want the best possible rep :p
Showing clear lines between the two π₯²
yeah that's what I do mostly but well I'm still kinda learning
So ive been working on improving my level a ton and now my level is more advanced that my AI Director can handle, i want to play test to see what changes I need to make. I want to have hordes spawn procedurally along my level, but only spawning in in front of me, the frequency being determined by numerous variables. How can i define whats forward progress in my level and backwards progress using the navmesh
i currently have a system with EQS but the AI are spawning a bit more randomized than id like, Id like to somehow maybe make my grid so that it paths out along the remaining (linear) level that i havent traversed yet
this entire discussion, summed up
I was thinking maybe a spline path if i have to but id like it to be reliant on the navmesh itself
How would one handle npc pickups? Would they register to the npc manager aswell, and any idle npc would be assigned to pick it up and deliver it to its destination?
I'd do this as part of a point
as in
an actor that has animation etc. on it already
Thats an example of a path that id follow
you could put custom logic into that (or a custom component) that handles the pickup. the pickup could then have a tag or a variable stating type, and the AI could then have an overview over all spaces that would access that pickup type
Its a resource in my scenario,
right, same difference
Transporting a resource from a production building to some designated storage area
But yeah its the same
Was planning on tag for the 'item' data, which uses a db to get the mesh and stats for thenitem
if you have an AI director you could query AI director for high level things, such as spaces that accept your resource
anyway more complex than that and you're probably looking at an inventory system of some sort
Is this a good use of casting to avoid them sensing other enemies? Enemy class is quite light and should always be loaded when this is hit
I do indeed. I did start on a second component for the buildings, so i can keep a clear line of responsibility
I know you can filter by using C++ but I dont know C++ hehe
ehhhh... I'd have a set of targets
I prefer tag but at least aip doesnt run on tick
Buildings being any building, including storage areas and whatnot. Also makes it easier for high level player control of them, and collecting/showing stats and whatnot
How can you use tags for this?
check tag against tag
You check if the actor has the tag π
sort of like faction
oh lol I thought there was a setting for filter by tag on the component
this makes more sense hehe
I generally have a set of actors to look out for, and then check faction on those down the line
or well it doesnt there should be a blueprint setting for this >: (
There is? πΆ
Put a tag on your enemybase then see if it has that tag
All actors already have a tag feature
Try breaking the stimulus
But i getcha there. Detection by affiliation sucks though - for bp
Is the get tag then branch more efficient than a cast? why use 2 nodes when 1 do trick
yeah I mean this is what I'd use instead of tag. I'm not sure if the perception component handles targets as well though. like for instance, what if you have an enemy structure?
I just said what i prefer and that cast is fine too π
What does that mean?
Haha fair enough thanks!
Its an output value, below actor
Think of tag this way though: maybe not all enemies of the same class should be sensed.... or maybe different classes need to be sensed.... all they need is the tag to be checked π
True true
If only tag was gameplaytag
for now its fine like this but in a bigger project for sure
You may not need to break the stimulus. I usually do to check if it is a successful result or not because aip fires when they spot and lose sight of anything detectable
good points
I dont remember exactly but iirc what UE was doing is pretty same already. Registers pathfinding reqs into an array, loops them, then dispatch to game thread
I see
My stuff isnt time sensitive so im just doing one request per frame
Gotta add something extra for avoidance soon tho
Just to understand your mindset a little more; I still dont understand why did you use 'serialization' word at the beginning? I didnt study serialization features much so maybe I'm missing something π€
It was a bad word to use, my bad :p
Not a native englisher (obviously), so was the first word that came to me when i wrote it
Calling it a queue was more accurate really
detection by affiliation is broken because you can't have an affiliation for the player, which is just bizarre
good to know
once again seems that I made the right choice in making custom perception π¦Ύ
Its not broken in general, its just that the component is added to the AIController and not on the controller class where it should be
or rather, on the pawn side of things, instead of the controller
not typing well tonight π
so only fixable incpp?
Yeah, this is a case where I'd do it myself in C++
Using an interface
Then you could have a BP version too
its one of the downsides of inheritance trees, if you get it in the wrong part of the tree you get it wrong, which they've done
why does my ai keep getting stuck like this? when i initiate them to chase me if theyre in a crowd they just rotate towards me and not move
is there a collision settings i need to fix?
you got a navmesh built?
yes
they work up until i melee them, they fall down and get back up and are supposed to keep running
I can get some more screen shots when i get back from work
so they move initially but not after some event?
correct, the behavior tree is also showing the correct info, its retriggering the move to after the melee fall event occurs
anbd theyre rotating towards me in what it looks like an attempts to come after me, but they stutter a little and wont move
sounds like the fall event is changing something then....?
could they be ping ponging between two BT states/branches?
ive checked the bt and it appears to the run the same way before and after
I also notice something similar near door ways they start to bunch up with eachother and just stand there ujable to move after no matter my position
like 1 will go thru the door fine then 2 come and they swarm up after 1 gets caight
so will one Ai alone work without problems entirely?
Yes
then maybe multiple are messing each other up by affecting the navmesh area
Possibly, I tried pulling up AI debugger but I couldnβt find anything to show that, is there a way to visualize the navmesh area
console command: show navigation
I also forgot to mention Iβm using Detour Crowd Ai controller does that have any affect on this?
Hello, i made a simple character and on event play i have "ai move to" but its not working, it was working but i did some changes to map now it stopped working, i also deleted navmesh bounds and re added them but still not moving, move to location or actor works so the character can move
Navmesh move it
If you mean navmesh bounds it doesnt work if i move it
Was worth a shot making it rebuild
Been known to work more than a few times before
Does the ai move to respond with failed?
Does it execute at all? Got a screenshot?
Weird, plugging "self" into pawn input worked, but it i tried that before and it didnt work, also i dont remember i had it when it was working the first time
So i enabled the nav mesh while in PIE and i still cant see anythign wrong, but here is a video of whats happenign
And your BT?
i found it i beleive
I was disabling collision on the capsule during the animation so i can walk through the zombies at least until a proper stumble back animation
when i turn back on collision once the anim is over they mustve slightlky clipped into eachother and caused an overlap. Seems to work for now but ill keep an eye on it
thank you
trippy
Anyone knows where exactly previous (or current) velocity get zeroed when a new path requested for AI?
When following player, AI stops for a second before moving to another player and I want to prevent this
Nvm already found it (ApplyRequestedMove() on CMC)
Thanks though π
Couple different things affect that apparently.
AI behaviour trees are the most unintuitive thing I've come across so far π
Avoidance Time is way cheaper than I expected
Interesting
Its literally nothing but 0.02ms on 30 CMC
what does that include
yeah "AvoidanceTime"
does that include all things related to avoidance?
guess i gotta dive into it and see what it does
It's beyond my programming skills π
Pretty sure Epic also got it from somewhere
Does not look like Epic's work
probably beyond mine too, so it'll be interesting to see what i can come up with that's dirt cheap, and works sufficiently
It kinda breaks the movement
Controller Yaw and Avoidance velocity direction does not seem to be matching
Pawn looks at the target goal but moves to right without rotating
Yeah i've seen that , almost as if someone just did linetrace forward and if hit pawn add right vector location offset x)
I'll probably use some combination of some crowdmanagement along with better pathfinding
custom implementation of one i guess
i know there's stuff for predicting existing paths and collision time etc
so that'll probably be the main workload
so the cost will be during pathfinding, which is fine in my case
then some simple movement handling for when roads are too crowded etc
yeah that'd help a ton
Just seems so much more effort and you gotta learn what dexorators and service and blackboard Keys and when I want to communicatie with the BT I need to set up a key, then referenxe that key in another blueprint to then implement it in my BT it seems so much to try and connect to eachother
But yeah should get easier with practise
Hello. Where can I find an example of this visibility algorithm? I want separate the safe and danger zones.
Been messing with this for a while, I just realized even Back 4 Blood using the default avoidance manager. I thought they had a custom flocking system π€
RVO was an academic paper called Reciprocal Velocity Obstacles for Real-Time Multi-Agent navigation by Jur Van Den Berg: https://gamma.cs.unc.edu/RVO/
and the associated library
from back in 2008, so there's likely a ton of better approaches now
There's a chapter from one of the Game AI pro books by Ben Sunshine-Hill about that and ORCA (another approach): http://www.gameaipro.com/GameAIPro3/GameAIPro3_Chapter19_RVO_and_ORCA_How_They_Really_Work.pdf
I'm not a huge fan of RVO's π
just feels wrong to treat paths as geometric constraints to me
I did not like it either
It's too aggressive and dominant over the movement component
Pawns literally slide
And somehow they manage to slide towards back
I wonder what AutoStore β’οΈ uses for their pathing for robots in the warehouse
probably some simplified stuff since its really just a 2d grid
Along with a relatively limited amount of agents
I don't think the sliding is the main problem, its more that there's no giving way to other people are any of that social stuff we tend to do unless there's a huge crowd
humans are surprisingly pliable π
RVO's are just too rigid
british people after a night out drinking, 2022, colorized
lmao π
I think sliding is a big problem π
You can cover sliding by having foot placement take care of it..
its only a problem because the sliding isn't natural
people don't slide left/right, but they could step left or right and it'll look better
But shouldnt it accelerate towards to somewhere instead of sliding at the first place? π€
Sliding towards right-front or left-back for example is okay but it looks like they directly slide to right and left
Which makes it even more un-natural
Well, sliding is just moving away isn't it.. you can cover that in the animation system
but yeah, the main issue is just that people wouldn't do it anyway
they'd avoid any of that in the first place if they could
it looks weird because its got rigid colliders
That's a "maybe" for my project π¦ I have ~100 of pawns running around and most of the optimization comes from reducing anim BP complexity and movement component
I'm sure if you switched the rigid bodies off even that RVO would look better
have you asked GB about his instanced skelmesh thing? maybe you could coax him to give it out to you
Last time I checked GB was not willing to share it, though asking it like that wouldnt be nice π I have a friend in the industry helping me create a new instanced SK currently. Its not working great or nowhere near to finished but I'm hoping we will get to some where in couple months
My only concern is we wont be able to guarantee it's going to work on other platforms so if something goes wrong I wont be able to fix it by myself and my friend helping me doesnt have a UE background at all to fix things
My prayers have been answered, they just added a free AI plugin to the marketplace collection so maybe thats gonna be easier for me
^what that guy said
So I have AIMoveTo and it seems to work sort of but it doesn't quite arrive at the target actor I set to it move to( Which has no collisions). But depending the direction where it aproachs, the movement always stops slightly before getting there. Think of if the target object goal would be a center of the clock, instead of navigating to the absolute middle, the AI stops at the number circle, it just falls shot. Not sure where to control it so that I would go exactly the middle all the time
Join the Discord if you have questions π
Woah
Ahh i feel it, good luck with whatever you're working on!
check collision view if something is blocking it. contrary to popular belief, collision is invisible
"Blueprints" and "advanced" don't go together π
How do I get input info from an AI? I'm trying to get my turn in place animation to run by using Get Turn but it doesnt work on an AI because there is no data coming from the source that Get Turn reads from
75 blueprints though
maybe someone should re-write those blueprints into fast functioning c++
Hello, I have an AI that moves to a spot in line, however if an AI leaves the line it tells all the AI that are either in line/moving to the line to stop their movement and MoveTo an updated spot in line.
However, what I have found is that the AI will move to the spot they are told to move to, then they move to the old spot they were originally going.
I used the Stop Active Movement function but am realizing that it doesnt make the AI forget about the orignal location but rather just stops the AI for a split second. Is there a way to have the ai stop doing the MoveTo function?
Ive also tried the StopMovement function via the AI controller but that did not work.
you need some sort of manager to tell the AI to move to the next spot when one opens up
That's what I have. The problem is when the "manager" tells the AI to move to a new spot while its already going to a spot, it goes to the new spot, then goes back to the original spot it was going to.
sounds like you need to check your logic then
to me this looks like you're not changing the target
I know the stop movement is working as I can see the AI stop for a split second, however I need it to abort moving to that spot and instead move to the new one. Its almost as if the AI MoveTo functions are stacking in their own queue.
I don't know why you're using stop movement
just change the target moveto
you're trying to omit a bug instead of fixing it
or at least that's how it sounds
It seems as though I used the normal MoveTo function. So I instead am using the AIMoveTo and it seems to have worked. Well see. Thanks though.
Hello everyone! I'm working with BT's right now and I've put together a composite decorator, which seems really cool. BUT, Is there not a way to set an observer abort on a composite? you can do it internally but that doesn't work because I'm AND'ing conditions together, I only want to abort if both conditions are true (for example)
the issue is not which function you use but how your architecture is setup
unfortunately not, as far as I've seen
Thanks, there isn't anything else since it is in empty 3D space. The moving actor is just empty, as in there's no mesh or something that's corner could arrive to the end first and then technically register it there. The agent size is still at -1. On BT the move to radius is 5 but it fall sort more like 100-200 units. Maybe it is just some sort of local space world space issue, gonna look into that next
did you check the navmesh?
this area nav mesh has no collision
what do you mean no collision?
maybe i answered wrong question... i have built the data for navigation and this area has no visualized data that would make the AI stop or go around it
Also check visual logger
Anyway to vary up the MoveTo for AI? They're followeing the exact same path and I'd like to add some variety.
Try RVO avoidance and adding offsets to target goal
okay, I'll look into that. Thanks @celest python
I have empty actor as target to fly to, and another empty actor as AI flying there, and still the AI doesn't reach the position of the target actor. Is it possible that the movement stops just because their bounding boxes are toucing? Even though there's nothing inside with bounds preview I still see blue cube and yellow sphere on both actors, and visually it would make about the distance where the stopping happens
Sounds like it. What's the acceptance critiera?
I need my AI to be able to pathfind close to walls. There appears to be a hard cap on navmesh generation at like 35-40 units. My current solution is to scale everything up twice as big but even then, there's still a pretty big gap between the walls and navmesh
I have some smaller entities that I want to pathfind close to walls too, so this is a pretty frustrating limitation in UE4 and 5
Every item in the navmesh generation settings is minimized
problem solved, never seen this in my life but apparently it's automatically added and overwrites some of the settings you can enter in the project settings.
adjust navmesh agent radius
@crimson galleon where?
How do I change this? I can't find any setting in any details panel that sounds like something like this.
To be honest I don't even care about it flying to other actor location, that actor is there just to mark the spot since I don't know how on the blackboard keys I could define a world location. If I make a vector key with 0,0,0 the AI pawn just fly to seemingly random direction and never stops
Also I'm not calling AIMoveTo node manually, it just happens on the BT so it seems I don't have access to what the node would have on regular blueprint
I'm referring to the AIMoveTo - but that doesn't seem to be the core issue you're having.
navmesh agent radius can be found via the CMC.
The radius is at -1.. these are all defaults. I had it on bigger values before and originally thought that would be the culprit but no
hmm sorry not sure
Thanks anyways, I'll keep looking
Aren't you making a space sim? AIMoveTo doesn't work for agents that aren't on a navmesh
I have 3D navmesh now
It works, circles around objects, or flies through (if not built into the data) but for some reason the movement to arrive at target always fails short from any direction
Usually, that's because it has a value on the movement to allow it to stop near something. On the regular AIMoveTo there's a value that is "how close do I need to get to be near it"
can't remember what the value is called in the task, but it should be obvious if you read the docs
So on BT the acceptable radius is 0
You really don't want 0 btw.. have some small value but not 0
It feels and looks like what you say is correct, I just can't find where it actually allows this result to happen. Yeah I have it at 5 now which is the default value, but same happens with 0
seems like it always falls short and visually it feels like it is pretty much the distance between as if bounding boxes of those empty actors were touching, could be coincidence
hmm I had something similar ages ago. I'm trying to remember the situation. Basically the actor would detect how far away it was so it'd move closer It was outside the acceptance radius until it was close enough but it wasn't close enough to trigger the overlapping or whatever needed to return the MoveTo successfully, so it'd get caught in this loop.
It was a few years ago. Drove me nuts. I had to manually do the MoveTo and do a HitTrace on it (or something like that) .