#gameplay-ai

1 messages ยท Page 147 of 1

jaunty peak
#

Ryans tutorials are decent. That's where I started my AI stuff. ๐Ÿ™‚

desert moat
#

I assumed the AI would continue to move to the player if it didn't have anything in there. As I haven't yet added the attack animation as I thought I'd need to resolve this first

jaunty peak
#

That's the trouble with that kind of set up, you'd need to continually check while in the collision volume. Once it's reached the player then that line of code is complete and stops.

#

the location of the zombie isn't being told to change.

desert moat
jaunty peak
#

Doing loops like that will likely need to more issues.

desert moat
jaunty peak
#

Yup, I can't remember if I ran into any particular issues with his method. Sometimes there are bugs that he doesn't notice but deals with them in the next episode etc.

#

So I'd stick with try BT's, once you get the hang of them you'll see the potential of them.

desert moat
jaunty peak
#

If you get really stuck with them, pop into this channel - someone should be able to point you in the right direction

desert moat
#

Anyone know how I can update my animation here. Usually I'd connect this up with a get animation instance then connect it to the mesh on the AI BP. But not sure how to get this for my BT task?

misty wharf
#

I guess you could probably cast the pawn to your pawn class, then grab the mesh from it, and then get the animation

jaunty peak
#

If your animation BP is set up, you shouldn't need to tell it how to move manually. You can also change the max walk speed of the AI if you want to control how fast it actually moves.

desert moat
jaunty peak
#

have a boolean that controls the anim to go into moving state. So it won't move if it hasn't screamed. Let's it also reset it so it has to scream again after a period of time for example.

#

You can also have distance checks and all that fun stuff inside the BTs for that too.

desert moat
stiff gale
#

So I'm using ReportNoiseEvent to make noise, but my AIPerception is not picking the noise.

ocean wren
#

Is it in range?

#

If I recall, there's a distance check done in the sound sense implementation to stop them sensing all sounds

stiff gale
#

I'm reporting noise for 5000 radius

#

in perception i have 5000 as well

uncut rune
uncut rune
# stiff gale No what is that?

Its a component that registers the actor as a stimuli source in the perception system. This is what I did for my player character and all the senses work fine on my end:

stiff gale
#
    {
        AIPerceptionComponent->ConfigureSense(*SensorConfig_Hearing);
        AIPerceptionComponent->OnTargetPerceptionUpdated.AddDynamic(this, &ANPC_AIController::TargetPerceptionUpdated);
    }```
uncut rune
#

I dont call the configure sense function

stiff gale
#

Ii got it thanks

desert moat
#

Anyone know how to check for damage in a behavior tree?

misty wharf
#

Kinda depends on what you mean specifically

#

In one project I have the ai controller listen to damage events on its pawn and set a bool on the BB when damage is taken, which the BT can then react to

#

it seems to work ok at least for purposes of that one

pine steeple
#

i use damage perception event

#

bt decorators/eqs can read this information quite easilty

desert moat
misty wharf
#

Yeah you just need to choose how you want to handle it

#

You can for example set it to a dead state which you communicate somehow through setting a value on blackboard, or using a decorator which aborts the main logic in the BT

#

@stiff gale I guess you just figured that delegate bind issue? :) Was just about to say the signature for it uses a const ref TArray

desert moat
misty wharf
#

Yeah something like that. You can set the Is Not Dead? one to abort self if it changes

#

This would allow it to exit the main processing if the IsDead value becomes true

stiff gale
misty wharf
#

๐Ÿค”

#

Are the senses configured correctly?

#

iirc the team settings need changing or it won't perceive anything whatsoever by default

stiff gale
#

Yea via blueprint it works

#

But in c++ the log won't show or breakpoint won't hit

misty wharf
#

No idea tbh, that's the same event which is used from BP's, so if it compiles it seems like it should work

desert moat
stiff gale
#

Yea got it fixed. I had to include UFUNCTION()

#

lol silly thing

misty wharf
#

Oh, lacking that usually causes it to crash immediately on call :D

misty wharf
#

if you need to communicate the info from the pawn to the controller, the easiest way would probably be to use an event dispatcher which you bind an event to in the controller

desert moat
desert moat
#

I'm sure this is where my issue is, but I just don't know why

pine steeple
#

your player character does not have blackboard tho

#

and that is really weird. i would go follow some more UE4 AI tutorials.

#

use GetController -> Cast AIController -> Get Blackboard

queen escarp
#

This work presents a decentralized multi-agent navigation approach that allows agents to coordinate their motion through local communication. Our approach allows agents to develop their own emergent language of communication through an optimization process that simultaneously determines what agents say in response to their spatial observations a...

โ–ถ Play video
bright rune
#

my AI sometimes just walks out of navmesh and gets stuck. is there something to restrict character's movement, so it can't get out of navmesh? or some setting to make it more 'accurate'?

cosmic stag
#

How exactly does ProjectPointToNavigation work? i had thought that QueryExtent meant: this is how far around the point it looks for a navigable point. But even with a 0,0,0 extent, it tends to succeed even for an object up in the air, not on navmesh

glossy spire
#

Hey folks, hopefully there's a BT GrandMaster that can explain something to me. I have a sub BT that looks at first glance like it's running, and is labeled simulating, but is actually somewhat locked up, unable to actually run tasks or evaluate decorators anymore.

#

B) Isn't actually running the sub tree. It's stuck and not doing anything until Combo Range or Seen Player decorators become true.

#

The bottom decorator is going from true to false, and then the selector is going from the wait task to my test sub tree

#

and it is locked there until the first decorator goes to true again

#

Seen Player Recently

#

When I put both decorators (In Combo Range + Seen Player) together, at either level, it works fine as expected

#

This works fine

#

This only appears to break Run Behavior sub trees, tasks seem to be fine

#

Is this some kind of bug, or am I using this incorrectly?

#

BTW my test tree is just waiting and printing, nothing unusual.

glossy spire
#

It seems like Observer aborts: Lower Priority causes issues with Run Behavior

stone walrus
#

hey guys i am making an ai for ghost character and using ai perception and i set up ai stimuli perception in my character and for object that i over lap with and they can fall and can produce sound . i set ai stimuli source for it also but first it works fine i go to the place where object falls and after then that it start getting location even he dont see me he reaches up to my place . my question how can i differ between my location and object after on target perception updated ... please anyone can tell whats the problem ??

turbid timber
#

Excited to announce my startup WildMeta's new library and Unity/UE integrations to help speed up the adoption of machine learning bots in video games! Thought it might interest some folks here (more techy post from my co-founder also on our blog) https://www.linkedin.com/posts/amandineflachs_wildmeta-unveils-its-new-library-compatible-activity-6840979426063216640-GKro

slim owl
#

Small question about AI, once a BT Servrice calculate a position and the MoveTo say to the AI to move to it's position... Does it wait for the AI to reach the position, or it Tick each 0.4s and update the position each time?

stiff gale
#

I think it stays on MoveTo until it reached its location.

celest python
#

Anyone knows what are pawn actions?

misty wharf
#

A mystery of undocumented code

#

I've tried to figure them out on a couple of occasions but I can't really tell if they exist or are half-finished or what

celest python
#

lol

balmy silo
#

I want this guy to walk towards me when he sees me. I have some code setup and when he sees me currently he plays the walking animation but doesnt actually move towards me

celest python
balmy silo
#

this is my code

misty wharf
#

@balmy silo add some print nodes to the success and fail pins and see whether it is failing

#

I don't know if you've got a navmesh, but the ai moveto stuff needs one

misty wharf
#

yes but does it fail the move is the question

#

which is why adding prints from the success and fail pins would help

balmy silo
#

its failing

misty wharf
#

okay, try printing the result value

balmy silo
#

How do I do that?

#

the movement result

misty wharf
#

just drag from the pin to the print node, it should automatically be able to convert it I think

balmy silo
#

to fail?

misty wharf
#

yeah the print from the fail pin, since it would go into that one

balmy silo
#

its saying aborted

misty wharf
#

hmm, is the player position actually reachable via the navmesh?

balmy silo
#

it covers the whole map

#

so i guess

#

wait

#

wtf

#

i just did something

misty wharf
#

oh?

balmy silo
#

hmm

#

i moved the background back

#

and it started working

#

but it says failed

#

but he moved kinda close to me

#

this is so weird man

misty wharf
#

Have you looked at what the navmesh looks like with the visualization for it?

balmy silo
#

yes

misty wharf
#

Okay, just a bit hard to tell from the screenshot what the terrain is like :)

balmy silo
#

its not the navmesh i think

misty wharf
#

if they don't move to where they should it's usually some issue with the navmesh

#

or they collide with something which gets in the way

balmy silo
#

i think i fixed it

#

but hes floating

#

when he sees me

misty wharf
#

Collider too large?

balmy silo
#

sending video

misty wharf
#

if the circle that's visible at the very end of the video is a collider then it seems that would do it

#

since it's just about big enough to lift it up the amount that's visible in the video

balmy silo
#

ohhh

#

that did it

#

thanks

misty wharf
#

np

celest python
#

lmao why there isnt any line warping for decorators ๐Ÿ˜‚

#

w i d e

misty wharf
#

lol yeah I've noticed this as well

#

iirc there's a way to hide those details from them but don't remember exactly what it was

celest python
#

Can you let me know if you ever come up to it? shyfingers

#

All of my actions rely on tags and.. thats just too w i d e to work with ๐Ÿ˜‚

misty wharf
#

untick show property details

#

that hides them

celest python
#

Where should I search for it?

misty wharf
#

click the node, it should be in the details panel for it

celest python
#

There isnt one on me

misty wharf
#

Hum maybe it's not available on decorators ๐Ÿค” It shows up on task nodes

#

I guess you would have to create a custom decorator in C++ because iirc it's possible to override how it's displayed there

celest python
#

Alright, thanks for the help ๐Ÿ™‚

obsidian lily
#

How would I go about checking if an AI actor is next to the Player character so it will trigger a sequence?

#

I'm still super new to using the behaviour tree and this is what I have so far when it comes to having the players dog companion follow them when they are visible my only main issue is if the player is too close to them or even slightly leaves sight range it will just start roaming.

orchid echo
#

Is there a way to set blackboard keys outside tasks?
I would need to set an blackboard key enum indicating what state the actor is in.
For example, using the default MoveTo -node would set the enum key depending what kind of task the actor is doing

#

Then again it wouldn't be much of a trouble creating a task for that purpose

misty wharf
#

Sure, you just need to get the blackboard and then call one of the functions that set values

orchid echo
#

It would have been nifty to be able to set it directly in the behaviour tree without extra function calls or tasks

#

But thanks

misty wharf
#

Ah

#

Yeah they don't have any builtins for doing it in the BT

orchid echo
#

That would be pretty cool addition to behavior trees

misty wharf
#

I have a custom SetBool task to do that for bools at least :)

orchid echo
#

Instead of a task I used a decorator and it seems to work just fine for this purpose. Neat stuff ๐Ÿ™‚

ocean wren
#

Please don't start adding states to behaviour trees. The whole point of BT's was to get away from the limitations of state machines in the first place ๐Ÿ™‚

orchid echo
#

I'm using it for debugging to see is the actor doing what it's suppose to do. Not for anything else ๐Ÿ˜„

#

And this seemed to be the easiest way to do it

obsidian lily
#

is this a bad way to go about this?

#

im just trying to figure out how to stop the ai from sticking near the player even when they are not within sight

#

but also i want it so that the player can be within a certain distance and also out of sight with the dog just sticking near them

glossy spire
#

Anyone know a way to get some kind of ID for a task or decorator? I'm working on serialization and need to know which particular task I'm on so that I can load it correctly.

ocean wren
#

Maccap: You're getting the distance between the AI Controller and the Player? Why not set a key on the blackboard for the player and use that instead of relying on the GetPlayerCharacter, you've hardcoded the player. What if you want the AI to fight other AI?

glossy spire
#

Thanks! I was looking at GUID, but wasn't really sure what its all about

ocean wren
#

GUID = globally unique identifier, pretty common system to generate unique ID's for things

glossy spire
#

Are those generally safe for serialization or do they reset every time you run the program?

ocean wren
#

Used in windows stuff too, although I doubt they use the same algorithms

#

Reading that doc, suggests they're only unique for the life of an object and get reused.. so you'd probably generate a unique one at serialization time

#

Basically what you'd need to do, is store a map of GUID's to serialized entries and fixup the GUIDs on serialize/deserialize

glossy spire
#

Hmm interesting

#

okay, that seems like just what I was looking for

#

thanks!

ocean wren
#

If I remember, I used FGUID's for my nodes..

#

It has serialization save/restore and whatnot

#

And turns to a string, or saves to JSON, which was my use case.

glacial sapphire
#

I don't know if this fits in animation, but I'm doing an AI where it needs to turn towards me to run. The flip animation goes to 180 degrees, but I want it no matter where I'm at the animation always flips to me and not 180 degrees. Can someone help me?

lapis sigil
#

are you all using the ue4 behavior trees?

#

i mean i dont

glacial sapphire
#

yes

lapis sigil
#

yeah well

#

i code a new ai for my game

#

im curious about ppl who do as well

#

that ai is more complicated compared to btrees

glossy spire
#

@glacial sapphire I have a similar problem. I've tried using a blend space to play the turn animation, reducing the alpha as it gets close to the correct angle, but I've gotten mediocre results. The best I've gotten is to only play the fast 180 turn when I know for sure the target is behind the character, like for example if they've just been shoved away by the player.

#

If you find any good techniques I'd love to hear about them!

ocean wren
#

There's nothing fundamentally wrong with UE behaviour trees, but they're not the only solution. Honestly doing your own in BP is probably the worst idea though if that's what you're thinking ๐Ÿ™‚

shadow python
#

how one would use FGenericTeamId ? I have team settings based on game state with own relationship test functions
I've implemented IGenericTeamAgentInterface::GetTeamAttitudeTowards which does tests between actors but other code still relies on statics

#

AttitudeSolverImpl is static, so i can't set it to something pointing to game state

shadow python
#

IGenericTeamAgentInterface looks like an ancient legacy tbh

misty wharf
#

@shadow python override GetGenericTeamId to have the actor return some team ID, then use GetTeamAttitudeTowards to determine the attitude of actor towards another actor. It may be simpler to just create a FAttitudeSolverFunction since this is used by default and is team-based rather than actor based, this is done using FGenericTeamId::SetAttitudeSolver

shadow python
#

i do set solver with lambda in game state postinitcomponents and reset on endplay

#

the problem is the complex setup

misty wharf
#

Oh?

shadow python
#

players = playercontroller / player primary pawn type + number sattelites
bots = aicontroller / ai primary pawn type (almost same as player) + number satellites
satellites = aicontroller / sattelite pawn type

misty wharf
#

well you should be able to set it up on the pawns, have them return an appropriate team ID from GetGenericTeamId

#

that's all you need on those

#

unless you have some ability to change their team IDs

shadow python
#

i did implement GetGenericTeamId in my Playercontroller (with field)
for pawns get generic team id does owner chain traverse to lookup for controller and calls it

#

with owners go in chain like this ai/player controller > ai/player pawn > sattelite pawn

misty wharf
#

so what's the problem there? It doesn't seem that complicated

shadow python
#

yeah, was concerned if it was right way to do it

#

seems like it is

misty wharf
#

Yeah, as far as I know that's how it works

#

the attitude solver is used by default and seems the easiest way to just define team attitudes, and the actor-specific overridable GetTeamAttitudeTowards thing can be used if you need actor-specific overrides of that logic

shadow python
#

i noticed it calls getattitude on actors which often are pawns, so pawns have to implement it and take info from controller which knows about them

misty wharf
#

Yeah, it might call them based on what actor is being perceived

#

haven't looked at it in that much detail, seems to work on pawn... my implementation is extremely simple though, it just returns everything as hostile vs player's team lol

shadow python
#

yeah, mine a bit too complex with two different game modes that manage relations

#

with relation data stored in game state the AttitudeSolver calls GameState method to get the relation

misty wharf
#

ah

#

sounds reasonable

shadow python
#

and now my primary pawn class has 11 interfaces on it ๐Ÿ˜„

misty wharf
#

:D

shadow python
#

secondary 7

misty wharf
#

that's sounds like a lot, how many of them are engine interfaces?

shadow python
#

4 custom rest engine

misty wharf
#

well, sounds like a lot just as numerically, it's probably not ilke a bad thing if it makes sense architecture wise

#

interesting, the ones I recall implementing are GenericTeamAgent, GameplayTagAsset and PerceptionSomethingOrOther I think

shadow python
#

the only problem that sometimes placed pawns loose the owner and when loading level sattelites have no valid owner which is super confusing to solve

misty wharf
#

I've noticed the order of beginplays and possesses doesn't seem predictable so yeah

shadow python
#

so far hardest thing is from sattelite pawns reach to real owner that knows about teams

stiff gale
#

How can you improve making noise to notify other ai that an npc has a threat? Idk if I should use appear radius to warn other ai?

ocean wren
#

There was some issue I came across with the initialization order of TeamID because they'd not inherited the TeamID interface in the right place (it was on the AIController and not on Actor, so if the player had a team you had to fudge it. Also the teamid value was set after some particular use case I can't remember.

misty wharf
ocean wren
#

I've used a notification message in a messagequeue to the squad to notify the squadmembers of the new threat. The basic idea is that the squadmember has alerted and shouted to squadmates, so the logic makes sense.

#

Definitely recommend looking at message queue's for that kind of thing

stiff gale
#

This seems to be the proper way of doing this. Alternatively I could use sphere channel.

shadow python
#

also it is a bit weird. SetGenericTeamId / TeamID is a property of AI controller with no way to set it per-pawn

#

and i haven't found a single use of it outside of FAITextSpawnInfo

misty wharf
stiff gale
misty wharf
#

Probably yeah

acoustic minnow
#

Hey guys, I am having issues binding a delegate for my AIController where itโ€™s not getting called. Does it look like I am missing anything? Itโ€™s worth noting that the PerceptionUpdate works on BP so it is detecting the player so itโ€™s my delegate thatโ€™s not working

//In constructor
PerceptionComp->OnPerceptionUpdated.AddDynamic(this, &ABasicAIController::OnPawnDetected);

//function for delegate to call
void ABasicAIController::OnPawnDetected(const TArray<AActor*>& DetectedPawns)
{
GEngine->AddOnScreenDebugMessage(-1, 1.0f, FColor::Blue, TEXT("Message"));
}

simple crest
#

Never ever bind delegates in constructor, You'll wreck your blueprint

acoustic minnow
#

I also tried it in BeginPlay it didnโ€™t work there either

#

But thatโ€™s definitely good to know

simple crest
#

Maybe try it in begin play with a brand new blueprint, and you're not hot reloading are you?

acoustic minnow
#

No hot reloading

#

I can try making a new BP

misty wharf
#

iirc someone else was having problems binding delegates into OnPerceptionUpdated as well... not sure if they solved it or not, but it was the same that it works fine in BP's

acoustic minnow
#

Making a new BP didnโ€™t seem to do anything

#

Yeah itโ€™s weird I must be missing something just not sure what

acoustic minnow
#

Update itโ€™s working, in case anyone else has this issue you need the function you are calling to be a UFUNCTION ๐Ÿ˜…

misty wharf
#

Now that you mentioned it...

#

He had the same problem lol

#

Which is a bit weird, because in my experience attempting to call a non-ufunction from delegates causes an error, but maybe it's just a warning in Rider, not sure ๐Ÿค”

simple crest
#

IIRC you will get an ensure in the editor, it's something that should have been obvious to bring up

#

at least I feel like it's usually quite hard to ignore that big freeze-up and big red message in the editor output lelthonk

misty wharf
#

yeah

acoustic minnow
#

Strange, I didnโ€™t get any sort of warning. I assume it was the same for that other guy

misty wharf
#

Yeah must've been

#

If it trips an ensure as HoJo suggested, it would usually freeze the editor quite noticeably for like 10-20 seconds

formal lichen
#

Hello, I was wondering how I would get my AI to only aggro onto NPCs within the same area of the map as it. Even if it doesn't have a line of sight on it. However, I still want the AI to wander into different areas and only aggro onto the NPCs residing in the new area. Thanks in advance.

hardy sable
#

Hey, so I was wondering if anyone could help me with this. I have large open world map, and I have setup a nav mesh to cover all of it with the 'generate navigation only around maviagtion invokers' setting ticked but I am finding that if the character is far above the bottom of the nav mesh bounds volume (but still within the volume) then it doesn't generate any path for the actor to follow. increasing 'vertical deviation from ground' helps, but it doesn't reach high enough.

#

to clarify, I am talking about mountains vs the ground

#

also, it works fine if the character is near the bottom

#

also I have set runtime generation to dynamic

hardy sable
#

update, the nav mesh seems to just be spawning below the object. Not sure why

hardy sable
#

ok by setting cell height to a higher value, it fixed the problem

vapid zinc
#

is it possible to do ai in c++ without using the blackboard and keys method

lyric flint
#

If you are NOT primarily a scientist, the way you formulated your question is forgivable. If you are primarily a scientist the way you formulated your question is NOT forgivable for tautological reasons :) there is only one logically valid way to answer it which is a tautology (as P V ~P = T aka it is possible OR it is NOT possible which is always TRUE)

stable void
#

anyone know why my perception strength readings are always =1?

misty wharf
#

iirc the default implementation might always return 1

#

at least for sight

stable void
#

I'm starting to remember why I made my own perception system haha

misty wharf
#

if you implement ISightTargetInterface that allows you to do different strengths at least for that one

misty wharf
#

Yeah

stable void
#

๐Ÿ˜ฆ I'll revert to my senses, I don't need them to be that precise anyway, thanks for the help @misty wharf you've been very helpful!

misty wharf
#

np

stable void
#

Can someone help me understand the tick parent function please? I understand that every tick would go through the parent tick function first, then the children one but what about delta seconds? should it be connected? what would that do?

misty wharf
#

if you inherit from a class which implements its own function, the child implementation runs first

#

you have to separately call the parent from the child implementation, and you can choose what parameters to pass into it

#

so yeah, the delta seconds should connect, otherwise the parent implementation could produce incorrect results if it does something with the delta seconds parameter

stable void
misty wharf
#

just buy my game and leave a positive review if I ever get it on steam LULWW

misty wharf
stable void
#

I've subscribed to the mailing list, good luck with it!!!

misty wharf
#

cheers, that reminds me I haven't sent any emails to it lol

stable void
#

I haven't even thought that far ahead haha

late rune
#

Hi, guys! Does anybody face the problem of Filter class not working on the final build? I have Move to Actor with chosen Filter Class perfectly worked in the editor, but never in final build. Regards.

raven leaf
#

Trying to learn behaviour trees....
What would you suggest I put here for a fleeing mechanic? I want to check if there is a 'safety point' actor nearby, if not then the AI should just run in a direction away from the threat.
What would I put in here? A custom decorator?

vivid drift
#

A service on the Flee selector to try and set nearby safety location as a blackboard var

#

A decorator on each that checks if the nearby safety location is set

raven leaf
#

Thank you @vivid drift

jolly quiver
#

Hello, I have a very basic AI character that runs from one corner to the other. As seen in the sketch, there's a wall that forces the AI to move around it, which is whats happening, but I need it to actually collide with the wall... How would I force the character to stick to a straight line between A <-> B? I'm pretty sure to detect the wall infront, I'd need to do a line trace or something like that, but I first need him to actually just run straight.

ocean wren
#

grandmaMax: It would probably make more sense to make that selector a sequence and do the "look for flee point" and then "go to flee point" in sequence

#

You don't really need to have the flee point testing as a service after all

umbral rock
#

Is there a way to achieve the same functionality using a timeline in a behavior tree? Trying to find a nice way to interpolate values so I can have a smooth transition.

umbral rock
# jolly quiver

Are you just using blueprints or are you using behavior trees as well

umbral rock
# jolly quiver

Something to look into is the EQS system in ue4. There are some good tutorials on it. If you can't find one I can share what I have found. Simply put the EQS (enviromental Query System) allows you to put conditions on finding things actors/locations etc (to my understanding) and based on a set of conditions it will create a set of weights. The ai can then use those weights to determine where to move. Thus you can weight certain locations more or less e.g. closer to walls or further away from walls etc.

#

What are you trying to accomplish by doing this?

jolly quiver
#

Honestly, it's nothing fancy, just a silly idea. I have this little actor dude that's supposed to be running around in a pit, randomly. Whenever he hits a wall, I want him to fall back and pick a new random direction to go to.

#

@umbral rock I can make him run in a straight line, but I can't dynamically detect when he collides with something. This is the current bp that I'm struggling with...

umbral rock
#

Donโ€™t tell it to go to a place then

#

Just pick a vector direction and go till collision

jolly quiver
#

I'm really new to this, could you elaborate?

#

Elaborate on how to actually do it, obviously I know what you mean ๐Ÿ˜„

umbral rock
#

Can you call me

#

Driving atm

#

๐Ÿ˜…

jolly quiver
#

@umbral rock I don't mind waiting, really don't like calls for these kinds of things. Just mention me when you have some time! Would really appreciate any help, since I plan on expanding this quite a lot! Thanks in advance!

timid cliff
pale plaza
#

Hello all, hope you are well. If I have this check, how do I set it up in the BT to kill any logic if it's true?

pale plaza
umbral rock
jolly quiver
umbral rock
#

no worries

#

So one thing that you can do if you only want him to go forward is to put an arrow component that faces the same direction as the character

#

then you can get the forward direction -90ยบ and + 90ยบ

#

so that you only get directions in front of him

#

then you tell him to just move in that direction

#

then on a collision event you can play a montage and pop him back so that he falls

jolly quiver
#

Could you tell me the actual nodes that I need to use?

#

There are always so many different nodes with different purposes, really confusing x.x

#

I understand what you are saying, but I can't quite connect the dots... sorry!

umbral rock
#

where arrow drop is a arow component

#

arrow

#

then you can add things to the x/y portion

#

does that make sense?

ocean delta
#

anyone experienced with AI user interfaces? i have a question regarding initialization during multiplayer

celest python
#

How can I get the value of FBlackboardKeySelector?

misty wharf
#

You mean the blackboard value it's pointing at or what exactly?

celest python
#

The value its pointing

#

FVector, UObject, Float etc

#

Is there any function resolves that returns it?

ruby owl
celest python
#

Ah, alright, I just remembered this was a thing. Thank you ๐Ÿ™‚

ruby owl
#

np ๐Ÿ™‚

real arrow
#

Does anybody have an answer to this, I know itโ€™s back from 2019 but Iโ€™m curious to know

misty wharf
#

afaik it's just that one gets an array of all actors that are being perceived, and the other just gets the specific actor that had a perception update for it

lyric flint
#

Hey I have a problem with ai sense, they only look at the center of the player , but I want to look in the head

misty wharf
lyric flint
#

Okkk ty

shadow python
#

if i have pawns implementing IGenericTeamAgentInterface changes the team, how to invalidate the perception or tell that previously friendly unit is now hostile

stiff gale
#

In AI Perception. do you know how to ignore self made noise?

misty wharf
#

Isn't there an Instigator or such on the noise events? You could check that maybe?

stiff gale
#

That should do it right

misty wharf
#

GetInstigator() probably returns the this Actor's instigator, if any

stiff gale
#

So that function is in the controller

misty wharf
#

So rather, when you report the noise event, set the actor reporting it as the instigator, and then in the perception update you'd check the stimulus' instigator == this

faint fox
#

anybody has an idea how can i change nav mesh agent type for a character?

winged grail
#

Does anyone know if you can bind EQS data to anything besides floats (blueprint preferred but knowing if it's possible in C++ would be helpful as well)?

I was hoping to have the actor class type I was searching for bound to a variable so that I could avoid creating separate EQS blueprints for each type (e.g., I have an EQS that finds all furniture actors within a radius that is bound to a variable, if I could also bind the actor class to a variable then that EQS could be used anytime I was looking for actors within X radius).

formal lichen
#

Hello, I was wondering how I would get my AI to only aggro onto NPCs within the same area of the map as it. Even if it doesn't have a line of sight on it. However, I still want the AI to wander into different areas and only aggro onto the NPCs residing in the new area. How would I go about doing this?

modern vale
#

Hello. Is it possible to have arrays in a blackboard?

modern vale
#

Arrays or lists

misty wharf
#

No

#

If you need to store an array in a BB value, the typical workaround is to create a uobject to store it and store the uobject in the bb

#

obviously you'd need custom decorators to do anything with it but in any case

modern vale
#

Ok, thanks

soft mantle
#

Hi! i'm trying to do a simple MoveToLocation with an ai controller and a character

#

but my character won't move at all

misty wharf
#
  1. Do you have a navmesh? 2) have you verified your navmesh is valid (click in viewport, press P) 3) is the goal location actually on the navmesh and not somewhere else?
soft mantle
#

oh i tought i had the navmesh setup, but it's not poping up green when pressing P

#

the navmesh position seems to be okey and i build the navigation a few times already

#

done, there's an option tickled on proyect setting preventing the navmesh to be built

wild trench
winged grail
# wild trench Does anyone have an answer to this???

I'm not sure I fully understood the question. Specifically, I didn't understand the desired behaviour due to the following two sentences:

"I was wondering how I would get my AI to only aggro onto NPCs within the same area of the map as it."

and

"However, I still want the AI to wander into different areas and only aggro onto the NPCs residing in the new area."

#

But if you want an NPC to aggro characters regardless of line of sight, there's lots of ways. Two quick and easy examples would be to run an EQS for the desired unit type within a specified radius or to do a sphere trace and return overlaps with the specified unit type.

#

If you then want to restrict their movement within a map, you could again tackle it with different approaches. The easiest but least versatile would probably just be creating a collision box and upon ending collision the NPC state is set to return to it's original position.

formal lichen
#

Sorry for wording the first question so poorly, basically what i'm looking for is a way to turn my map into sections. The AI will be able to go to the different sections but can only see the player in the same section as it.

winged grail
#

Ah, I think I get it, and it can see the player regardless of line of sight, but only in that area of the map?

formal lichen
#

yea

winged grail
#

@formal lichen I'm still pretty new, and I'm not sure how sophisticated you're trying to make things, so this might be too simple for your needs, but I would probably just create a third actor (MapSection for instance) that housed a collision box and a variable (or array if multiple player units) to hold the player that was within its collision bounds (UnitsInSection for instance).

Using that MapSection actor and its collision box, you could write something like "On component begin overlap, check if other actor = NPC, if true, using the other actor as the target set MapSectionRef to self. If false, check if other actor = Player Unit, if true, add player unit to UnitsInSection, if false do nothing".

Then have an "On component end overlap, remove player unit from UnitsInSection". (the NPC's MapSectionRef shouldn't matter as it will be updated if it moves to a new section).

#

Then using your MapSectionRef on your NPC (or on your blackboard, if using a behaviour tree) you can get the UnitsInSection variable from that reference and cycle through them (if there are any) and have your NPC do what you want with them.

formal lichen
#

Thanks, i'll try this out.

lone onyx
#

novice question for AI im trying to make an enemy move towards a player. If i walk upstairs the enemy walks into a wall

#

would a node system be the way to resolve this issue

shadow python
#

has anyone successed creating AISenses in blueprints? There is a AISense_Blueprint that is blueprintable but i have no idea how to set the ListenerDataType. which is supposed to be a user-defined struct TSubclassOf<UUserDefinedStruct> but it is not possible to pick one

misty wharf
#

Interesting, didn't even know that was an option :P

timber dagger
#

Hi all, Anyone knows some good document about this perception?
I am trying to alert near by friends when an AI gets damaged.

vapid zinc
#

where can i find good ai tutorials for c++ not BP

misty wharf
#

C++ tutorials don't really seem to exist much. Best I can find is usually "ue4 C++ <name of thing>"

#

usually you can make some sense of things if you just look at the engine code for the thing, and see how it's being used elsewhere in the engine

wraith anvil
#

is there any way to specify a relative location for the perception component senses?

#

like set the location for the "ear" or the "eyes"?

timber dagger
#

as aisense is not complete ๐Ÿ˜ฆ

misty wharf
wraith anvil
#

how does it knows the head location tho?

#

hardcoded by "head" bone name?

#

(that would be awful)

misty wharf
#

the character has a head height value

#

which you can adjust, it just uses that

queen escarp
#

i think it traces to center of mass on default, u could modify it in c++ though

misty wharf
#

Correct, the perception check traces to target actor origin by default, but the start of the trace is from the source actor position + head height

limber flume
#

Hi all
How does the MoveToLocation call from AIConttoller actually move the controlled pawn? I mean what call from Pawn movement component actually make it move?
I suspect AddMovementInput, but not sure

uncut python
#

Is EQS a good option for AI or is that not the best option to use

#

And I mean in general, itโ€™s been experimental for a long time so Iโ€™m wondering if itโ€™s dead

#

I plan on using it to find my player (as a zombie) and I think it may be a a more efficient alternative, especially for multiplayer with its weighting system.

#

And does it work well with crowd controller? (Hordes)

misty wharf
#

@uncut python EQS is fine, but for simple things like "where is the player" you can do much simpler things like just get the player pawn and get the location

#

EQS is really just a convenient way to create sets of locations or actors (using the generators), and filter/sort them based on sets of rules (the tests you can add)

uncut python
stiff gale
#

Should I use MakeNoise or sphere collision and then iterate over the AI NPCs to warn them and change their behaviors?

lyric flint
#

Hey guys, I made recently a dialogue tree but I want some words to be in a different color than the normal text. How to do it ?

#

Here is an example of what I want to do and the current "code" of my behavior tree

spring inlet
#

guess you would have to use richtext box and add the corresponding styles to your text

ocean wren
#

There's a plugin for doing that kind of dialogue. Might be better than trying to get BT's to do same.

#

But if you're up for changing the engine code, you can easily extend the BT editor to add stuff to the BT for whatever you want.

spring inlet
#

but beside of that, he would run into the same problem

ocean wren
#

Well, his problem is displaying text right? Which I assume this system is actually designed for, but the BT editor isn't

#

ouch, 43 quid? ooooh ๐Ÿ™‚

spring inlet
#

it doesn't come with any UMG stuff, you have to setup display yourself, too

ocean wren
#

I wasn't thinking of this one I don't think.

spring inlet
#

ok, maybe you find a link, im curious, too ๐Ÿ˜„

ocean wren
#

if you look for "dialogue" on the marketplace there's a ton of them ๐Ÿ™‚

#

Might be this one?

#

That one was one of the free marketplace items a while back

#

Honestly I don't pay a lot of attention because I can create my own, but seems like evaluating the functionality of these could be useful

#

Hmm, I thought of some project ideas for my students ๐Ÿ™‚ that lip sync plugin is terrible ๐Ÿ™‚

old adder
#

Hello, what is the difference between CrowdManager and flocking, boids technique?
Is there anyway that we can achieve flocking result from the CrowdManager?

ocean wren
#

Its very much a different thing

#

One is basically a collision avoidance system based on crowds

#

flocking is a steering system.

#

Although there's obviously some overlap in aspects. They're not trying to do the same thing

#

the Crowd manager is interested in getting each agent from A to B while avoiding collisions and blockages.

#

But flocking is about maintaining spatial relationships between agents based on forces

#

I mean you can obviously change the crowdmanager to implement steering forces, because it basically uses a direction vector to steer the agent away from collisions. But they're different concerns really.

#

That said, I did add a "push out of the way" force to the Crowd system because I got tired of the problems of rigid body collisions on AI agents, so certainly feasible.

old adder
#

Thank you. I am trying to make AI moves as a flocking group while also keep the navmesh pathfinding feature.

#

Does this mean I should override CrowdManager instead of CharacterMovementComponent to add the steering force?

#

I been overriding RequestDirectMove() in MovementComponent but it does not seems to work as I think.

#

So my problem now is to know where I can actually make meaningful override.

ocean wren
#

Its a while since I did it, but there is a function in there that calculates a vector which is the collision-free vector along the path the agent is moving (i.e. it moves in the direction of the path but modifies that vector to avoid other agents), so you need to manipulate that vector calculation

old adder
#

Is it in the crowd manager?

ocean wren
#

just having a quick look.. one sec

old adder
#

Or is it the CrowdPathfollowingComp

ocean wren
#

Mine was using the detour crowd system.. haven't got the code on this machine so having a quick look see if I can remember where in the engine source it is

#

I take it you're OK with C++ and the engine in general? because this stuff can't really be done in BP

old adder
#

Ah yes, I would be insane to do this in BP.

ocean wren
#

Yeah, looks like its in CrowdManager

#

void UCrowdManager::Tick(float DeltaTime)

#

You see that function? it basically uses detour to update a bunch of vector values

#

You probably need to noodle with the value before that "ApplyVelocity" call near the bottom

#

Basically, that is the final velocity vector its going to use to move the agent

old adder
#

Yup, I see it.

#

I think I still have to write extra component so that the pawn knows which group it belong to and calculate base of that.

#

Thanks, I will have a crack at this.

ocean wren
#

If you want to have grouping and such, then you'd probably be best to have a component that takes the agent vector calculated just before passing to Detour and then modifying that vector. But detour does have some seperation etc in. So maybe you want to just think of it in terms of setting the correct goals to navigate to instead? i.e. set each agent in a group to move to a group point (position + offset) and let Recast keep them together?

#

Basically, recast+detour is a library that does the collision avoidance part. Keeps agents from hitting each other (well, mostly) and navigates them through navmesh space. So what you really want for groups, is to give them distinations that are near each other and have the detour system get them there while avoiding collisions

#

I had a squad of soldiers and I gave the squad a move order. That basically calculated offsets for where to move to for each soldier.. Gave that move point to detour system and it moved them there while avoiding collisions

#

I also added a way for the player to push them out of the way, by having a force repulsion inside that detour velocity calculation (just an inverse of the direction vector away from the collision)

#

But of course your use case might be different

old adder
#

Yes, I do have a group, calculating group centre, and get offset vector for each units and offset the goal base on that.

#

So they will stay in the starting formation after moving is done.

#

However during the path following they would still clump into eachother..etc

ocean wren
#

Yeah, that is in part because UE has rigid collision on characters

#

so the collision capsules get in the way as agents try and navigate

#

especially if they're not a good fit capsule

#

I turned them off

#

Because for the most part, they're not useful

#

Or rather, I turned off agent->agent collision

#

the seperation force is meant to keep them apart.. so better to use that and allow some non-rigid force to keep them apart rather than the very obvious rigid one

old adder
#

I am trying to make them keeping distance from eachothers while moving.

ocean wren
#

Yeah, detour does that

#

but you don't want to use a rigid force for that, if your agents are moving through gaps

#

or they get stuck on each other

old adder
#

So I just subclass the AIController from ADetourCrowdAIController?

#

Do I still need 'Super(ObjectInitializer.SetDefaultSubobjectClass<UCrowdFollowingComponent>(TEXT("PathFollowingComponent")))'?

ocean wren
#

Take a look at the recast+detour library demo on github, you'll understand

#

Yeah, there's a few things you need to use Detour.. you definitely need the Detour Crowd Controller

#

there's another step you need.. but I forget the detail. Might be worth looking at the official docs

old adder
#

Oh.. I am not sure how to use this in the first place..hmm

ocean wren
#

Might be detour crowdfollowing component too

old adder
#

Unreal already use recast, does it have the whole Recast+detour combo too?

#

Or I will have to manually include this to the engine?

ocean wren
#

Yeah, it has a few things.. but I've not used it for a few years so forget the details.

#

Unreal already has it built in

#

you have to choose to use it though

old adder
#

nice

ocean wren
#

I don't think I made a tutorial on it sadly. I usually do for these things, but I figured as it was C++ only it was probably a bit too complicated for my audience.

old adder
#

This is quite great direction already, thank you!

ocean wren
#

I do recommend looking at Mikko's demo project on github.. (he wrote Recast+Detour library UE uses), he also did some excellent videos on how it all works.

#

Mikko Mononen is his name

#

Funnily enough, I just found out this week that Mikko works for Epic now ๐Ÿ™‚ back then he was working for Crytek and more recently for Unity ๐Ÿ™‚

old adder
#

Thank you.

granite vault
ocean wren
#

It should be available on the normal github. The actual library itself is already within Unreal Engine

#

but the demo is in the original library's github, let me find it

ocean wren
#

I wonder why it seems that people have so many issues with AI? is it because the toolsets are just too complicated? or is it something more basic?

#

The concepts aren't that complicated are they? BT's aren't that complex. Although I do think the UE toolset is.. not the best usability wise.

#

Curios if you guys have any thoughts on what a "good" toolset might look like?

misty wharf
#

No idea tbh. I always found it fairly straightforward

#

Much simpler than having to write it without BT's and other things from UE

#

I think the challenge is just how to put it all together since there's no really really obvious way to do things because the systems are very flexible

ocean wren
#

I guess having like a bunch of examples would be useful.. Epic really didn't do a good job of that did they

#

Mind you, I'm not sure I've seen anyone ever really mention any of their samples.. so maybe they would get ignored anyway ๐Ÿ™‚

#

I suppose actually having developer docs would help too

winged grail
# ocean wren I wonder why it seems that people have so many issues with AI? is it because the...

I'm sure it varies from person to person, but for me, as someone with no prior knowledge and who works in a field completely unrelated to tech, who began teaching themselves sometime around March-May, there are several major barriers that I encountered along the way (I'm sure there are more, but these are the ones that immediately pop into my head):

  1. Planning for modularity and scope. - By this, I mean that it's relatively easy to get a character to do a straight forward task (e.g., move to this location, play X animation). It's much more difficult to create a system that seems realistic and is adaptable (e.g., move to the correct location based on what you need to do, then play the correct animation and/or sequence of animations associated with X task). This is further compounded by the speed with which behaviour trees iterate and the disconnect between BT nodes and blueprint nodes in terms of debugging (i.e., break points). I think this complexity is again compounded by the fact that BTs visually appear to function differently than something like the AnimBP state machine and the fact that you need to be very specific with when, where, and how, variables that affect state-based changes are being set/changed.
#
  1. Understanding how something works, when it works, and why it doesn't work in a given situation. A good example of this is the "Simple Parallel" node. It's not immediately (or even latently) obvious that the background tree cannot have a Finish Execute task. It's not in the description, it's not in the documentation (last I checked) and googling doesn't immediately produce results. Another example would be instances in which decorators don't seem to "fire" or cancel a node below them, despite the observer aborts section being correctly entered. Again, it's not immediately evident that the decorating check is not being updated, in what specific instance it does update, and/or how it updates (e.g., does it update if a lower selector continues to fire a task that returns true, what is the order in which a decorator is evaluated, etc.).

  2. Experience with the engine. This is honestly the biggest one, I think people are eager to get started on their projects and it's difficult to temper that excitement with developing strong foundational knowledge. The more experience I get, the more I'm going back and revamping systems I thought were super clever at the time and now seem redundant, bloated, or unnecessary. In many cases, this occurs as I learn something new that the engine can do (a non-BT related example being switching State Machines in an AnimBP based on enumerations).

#

TL/DR - Planning, organization, foresight, documentation, and patience/experience.

ocean wren
#

Yeah, I could see those factors being important. Especially for the last one, because honestly spending any time here on discord is so depressing with so many unanswered newbie questions I just feel bad for everyone.

#

The second one I think is partly usability of the current BT system, which if I'm honest just isn't as clear as it could be. Partly because they tried to be tricksy and optimize the BT rather than do the typical "run from the root" that every other BT I've used does

#

And some of the usability was always a bit suspect due to some HCI stuff. EQS is a good example. Just poorly worded functionality etc.

#

Conceptually they're fine, but they're just not well designed as toolsets.

rose crystal
#

How can I make car racing ai

#

Is there any good tutorials

misty wharf
#

dunno if there's anything UE-specific though

olive schooner
#

I am new to unreal engine can anyone tell me which will be better to use for Ai bots,Blueprints or C++

unkempt barn
#

Does anybody have any suggestions for how to use EQS to find the best location to push the player off a ledge? I'm new to this system so just looking for any suggestions or advice

unkempt barn
unkempt barn
ocean wren
#

Microsoft has a research paper called "Its Unweildy and it takes a lot of time" that pretty much sums up game AI. Too hard. Poor toolsets. Unclear how to specify. Lots of edge cases. So yeah, I've got some sympathy, but surely thats why you need BETTER tools for it, rather than.. lets face it, Epic haven't really put much effort into AI since I started using UE beyond poor Mieszko doing some work in his spare time.

queen escarp
#

@ocean wren do you have some special tool on your mind? i would love to have a descent utility ai framework

ocean wren
#

Yeah, I'm working on some machine learning based cinematography right now, but have considered maybe creating a new AI editor and runtime toolset. But what turns me away from the idea is mostly the support issue

#

Did you try Tom Looman's utility system?

#

I've been thinking that most people would probably be better served by having a system that could generically act given some simple commands. "Go here, pick up that thing". Maybe even using a speech or gesture interface. Trying to imagine what a "good" future toolset might look like. Its such a pain dealing with all the edge cases of boolean logic for instance.

queen escarp
#

@ocean wren machine learning based cinematography sounds fancy and pretty time consuming, are u using cuda torch or tensorflow stuff ?
i am not sure about how supportive epic is tho,
i havent, does he has one ? i just read his blog entry
i would love to code my owen but i am just not convinced yet,
since u need to handcraft the weights to find the best score, i read just once about it to combine utility ai with deep learning

ocean wren
#

Yeah, using a combination of pytorch and tensorflow 2 for the cinematography stuff (using an ensemble of ML models)

#

I didn't use Tom's utility thing, but saw his posts about it. Figured he'd make a decent attempt at it.

#

But yeah, deep learning is a different issue. That moves the problem around rather than really fixing it. Because then you have to have training examples

#

My approach is to train behaviour from examples seen in movies. Hoping to apply that same approach to training behaviour in general (i.e. training from samples of human gameplay for instance).

#

Its still a bit of a fresh area though, so we're in that "not quite good enough" phrase ๐Ÿ™‚

queen escarp
#

@ocean wren yeah its a nice attempt for sure,
i would create training examples lol, but i havent read any paper about utility ai + ml yet, only in gems was something mentioned,
but somewhen i guess i'll plug a nn into it and go for it
ok wow that really is more rnd stuff ha ?
is there some paper comming ๐Ÿ™‚ ? i think i watched a gdc talk about it, ai watched the player and learned from him, it was even dl reinforcement stuff

celest python
#

What Tag Cooldown does is, its returning false if we have the given tags until cooldown finished?

ocean wren
#

Intax: yeah, basically lock out and return failed for X seconds

#

spinynormal: Dave Mark's book "Behavioural mathematics" is about as good a reference on Utility you're going to get. But there's a bunch of GDC presentations. Kevin Dill did a few papers on his "Dual Utility Reasoner" that is worth reading. More in the domain of military simulations, but applicable to games (and Kevin worked for Rockstar on Red Dead Redemption 1)

shadow python
#

in RTS game
if i have a MasterAIController that represents a bot player with PlayerState that manages strategic things
if each of my units is controlled by UnitAIController without playerstate
how would be preferred way to make Pawns aware of player state? (passing master controller as owner when spawning pawn or extra spawn parameter or smth else?)

misty wharf
#

Tbh it probably makes very little difference, so whatever method is the easiest to understand what's going on seems like the way to go

shadow python
#

was a bit tricky to manage teams, with team identifier being in player state, and IGenericTeamInterface implemented by units

#

and some units not related to any of teams with independent unit controllers

#

currently set controllers to request team from controlled pawns
pawns with playerstate (taken from master controller) take team id from them
pawns without playerstate take team id from local field

#

does it make sense?

misty wharf
#

seems reasonable

ocean wren
#

I used a second actor to coordinate agents into squads, then another to coordinate the squads.. so basically a heirarchy of actors with message-based comms between them. Much like the military chain of command.

#

So individual squad members are commanded and respond to command requests from squadactor.. squad actor takes orders from layer above etc.

#

I really liked the message-based setup though, because you can just insert stuff into the command message queue and debug the receipt of messages etc.

#

FMessageEndpoint is what I used if you're interested

#

In theory you could pipe that over a network for debug purposes too

#

On spawn you can just fix up the chain of command.. i.e. who owns which units etc. Also do it dynamically for stuff where you want to merge squads into a larger group.

shadow python
#

it would be a bit problematic a bit with group actors in my case

ocean wren
#

Why?

shadow python
#

existing project

#

can't just redo everything

ocean wren
#

Never say never ๐Ÿ™‚

#

Do whatever it takes to make it work ๐Ÿ™‚

shadow python
#

somehow sneaking in IGenericTeamAgent instead of tons of blueprint spaghett

ocean wren
#

But yeah, I get you ๐Ÿ™‚

#

I'd avoid any sort of blueprint for this kind of thing. We had a hellish time with blueprints crapping themselves and just failing to execute randomly in certain builds

#

and without any clear repro case.. so just in certain builds, without any warning, we'd get a BP failure condition

#

In the end, we had almost all main code in C++ and just simple glue and component data in BP

shadow python
#

in my case i have several people constantly generating blueprint spaghetti and just me writing in c++

ocean wren
#

ouch. I can only imagine the horror

#

not even nicely formatted and functional BP?

#

my students who do BP work tend to do that kind of thing.. they're so excited to have something working, they forget that it needs to be maintained etc.

shadow python
#

does 8 ubergraphs and ~500 functions/events in PlayerController counts? ๐Ÿ˜„

#

everything packed into one bp

ocean wren
#

That counts as the seventh level of hell ๐Ÿ™‚

idle cobalt
#

Is there any good tutorial that teach you how to make vehicle AI like a tank AI ?

ocean wren
#

They did a livestream on doing that a while back.. on the main UE channel

shadow python
#

there are also bunch of youtube videos with vehicles, with basic behavior tree setups

idle cobalt
#

Thanks

ocean wren
#

Tanks are fun to do though.. I did a multi-level system for a tank game ๐Ÿ™‚ because that's my bag baby.. commander, gunner, loader, target selector etc. Fun task to consider the flow of info between them. Probably more complicated than needed to be, but it was a joy to use ๐Ÿ™‚

shadow python
#

i did try to implement path following for tracked vehicles, got stuck on math gave up

ocean wren
#

Commander->target selector "hey, find me a good target to the front", target selector->loader "hey, target spotted, load HE" etc..

#

tanks are easy.. just stop them and turn on the spot ๐Ÿ™‚

#

Basically the same as a human but with a hat for a turret ๐Ÿ™‚ a hat that can 360 no scope enemies

#

Most challenging maths wise was AI for a combat flight sim I was working on back in 2005-6

#

physics based aircraft, with bits hanging off ๐Ÿ™‚

#

in weird 3D air maneuvres

old adder
#

Sadly, I was unable to implement this in the CrowdManager. There is really barely any official Unreal doc about this.

#

I am actually not even sure the CrowdManager recognize which pawn to add to the crowd sim.

misty wharf
#

iirc characters go into it by default but otherwise you need to implement ICrowdAgentInterface and register it with the crowd manager

#

(or maybe ai controllers, not sure)

old adder
#

For everyone controller?

#

If I remember right how to do it was using CrowdPathFollowingComp.

#

But it does not do any changes for me I am not sure.

misty wharf
#

Yeah not sure, my player character implements ICrowdAgentInterface and registers itself with UCrowdManager, which makes my AI's avoid it

old adder
#

Was it in the controller?

#

Or the Pawn?

misty wharf
#

it's implemented in the pawn in this case, but you can implement it in either

#

you just need to register the actor where you implemented it with the crowd manager

#

and if you implement it in the controller, you need to implement the interface so it reads the apporpriate values from the pawn

celest python
#

Whats the proper way of pausing Behavior Tree? Locking AI not working in my case, I'm only able to unpossess AIController

misty wharf
#

have you tried calling Stop Logic on the BrainComponent?

celest python
#

Yep

#

Not working either

misty wharf
#

Claim Task Resource with AI Logic as resource class?

#

and Unclaim Task Resource to unpause

celest python
#

Gonna try, thank you

fluid oriole
#

Hi, what happens when a Generator has no items (Actos or locations)? Does the EQS Query clear the Blackboard Key?

#

For example, if I use the Generator to get Actors of a specific class within the Querier's radius but there are none.

misty wharf
#

The result for getting a single actor from it should be nullptr, so if you're using it with a BB, that would set the BB value to none

mystic solar
#

Hello! Looking for some body who could teach us in BT, EQS, AI etc. for sure paid, for 1-2 weeks half time

lyric flint
#

@mystic solar those are very basic applications of AI tho. Are you looking for something specific?

tawdry zephyr
#

What does "Project Goal on Navigation" do? In my head it basically means it will modify a dynamic runtime navmesh so that the goal isn't available to other actors?

ocean wren
#

If its what I think it is, it'll find the closest point near the goal on the navmesh

#

i.e. it'll "project" the goal to the navmesh

misty wharf
#

iirc yeah that's what it does, if goal is outside navmesh, it attempts to project it to closest point on mesh

tawdry zephyr
#

Ah gotcha

uncut python
#

is EQS gone?

uncut python
#

nvm theres a whole other tab dope

tawdry zephyr
#

How do you know what behaviour tree the selected character's AI controller is running?

uncut python
#

it brings up AI debugging

tawdry zephyr
#

I don't have a number pad

uncut python
#

hmmm

#

ngl i think u need a number pad

#

try that maybe

#

am i wasting my time with EQS? I feel like its too confusing, i thought it would make my zombie AI smarter but its not that amazing

#

wtf does this mean\

#

nvm restarted engine it was some weird bug

tawdry zephyr
#

I'll just change the shortcut

#

Huh that just lets you control an AI

#

How do you get the debug data without a numpad

#

Most people don't use those anymore

#

OK found it

#

Hmm nope

#

Doesn't activate

#

Whoever came up with this did it wrong

#

What's the console command for the equivalent

#

Anyone? console command for AI debugging?

#

OK so there's no AI debugging in UE4 with commonly used keyboards

#

No ones got time for this nonsense

uncut python
#

Ik itโ€™s kinda crazy I just had this issue even with a num pad u have to turn in numlock for it to even work

#

Crazy

unkempt barn
uncut python
unkempt barn
#

I mean i like the concept. raw perception is not really what our brain uses for decision making, there are functions in our brains (and most other animals) that automatically filters and evaluates the information from our senses before using it to make decisions. So i see the merit in making a peripheral system that is responsible for converting sensory information into useful information

#

that being said, it's not a super intuitive system (from the little i've done with it)

uncut python
#

Ya itโ€™s very weird to use 100% on in the same boat as u

unkempt barn
#

haha well I'll be sure to share any good tutorials I come across on the topic

simple crest
#

it will be a cold day in hell when i give up my numpad

simple crest
#

simplified, the only purpose of EQS is: you give it a list of things, and it will rank them somehow and choose one

celest python
#

How do you guys handle melee attacks in AI? I'm thinking about line tracing with a little distance each n seconds and if the hit actor is enemy disabling BT and play melee attack montage & deal damage

#

There are many ways to do this I assume but I'm wondering if there is any examples for that

misty wharf
#

My fps game's melee enemies just perform them the same as any other attack

#

BT triggers the attack, which then does whatever - play animation, do trace, apply damage

celest python
#

How do you check if its in the range or not in BT?

#

Or just deciding its time to attack in BT?

misty wharf
#

It just has logic that tries to get close enough first

#

once it reaches the player it doesn't need to check anything since it's close enough at that point

#

then it keeps attacking as long as the player remains within range

celest python
#

Makes sense, thanks

neon carbon
#

is it good to have a bunch of AI ( for example forest animals ) use AI behaviour trees? will it take a lot of toll on the performance?

#

frame rate drop etxc

misty wharf
#

it depends on the BT, it's very hard to say up front

shadow python
#

when implementing AIControllers is it preferred to have BehaviorTreeComponent and BlackboardComponents as class default objects or let them be created on run behavior tree call? or create BTComponent and let blackboard be optional

patent hornet
#

they are already on the AIControllers

misty wharf
#

Doesn't the default implementation have those?

#

Yeah

patent hornet
#

BrainComponent is BTC

shadow python
#

they get created when calling RunBehaviorTree

#

AIController has only pathfollowing/actions in CDO

patent hornet
#

i never felt the need to alter engine's default behavior here

#

(obviously, from previous answer)

#

but if they are created when BT is ran, adding it to CDO might force you to do some manual cleanup if changing BTs

shadow python
#

oh, ok. well. will just make bunch of variables in controller and pass them after RunBT call

#

was asked to add some configuration pass global variables to blackboard that needed to be applied when BT started

shadow python
#

i feel dumb, i didn't notice InitializeBlackboard so could just override it and don't do anything else

#

is there any way to prevent huge amount of FName constants being passed when setting blackboard keys?
apparently there are quite a lot of typos all over the project after renaming blackboard keys and leaving Set* methods with bad key names and tracking them all is quite a problem.

since all SetValueAs does not check for result of SetValue and SetValue does not even warn about bad keys

#

spent several hours debugging just to find out that SetValueAsObject with DefenderTurretActor was missing an 'r'

neon carbon
misty wharf
#

Really, does it happen if you don't run their BT's?

simple crest
#

The BT would normally be very small compared to other things - such as a character movement component cost

queen escarp
ocean wren
#

spinynormal: yeah, there's a few papers using that kind of approach

#

one in particular uses RL to generate physics forces on a powered skeleton to generate motions from YouTube videos of specific motions (usually backflips and the like)

#

I'm using a non-physics based approach, based on graph neural networks and generative scene graphs. Trained on an extended version of the movienet dataset.

normal river
tawdry zephyr
#

Yes

#

I use a 60% and it has full functionality once you adapt, number pads are obsolete

#

Then again I taught myself to type (~120WPM now) and I never used numpad when learning so I've always used the row of numbers

#

So I can understand people who are used to using numpads rely on them and think they're necessary (they're not)

#

I did get pretty fast on a numpad just so I knew how to use one effectively when required, but then got rid of it and never looked back

#

This is the first time in my entire life I've been affected by not having a number pad and it's for the silliest of reasons

simple crest
#

Anything smaller than an 1800 layout is only fit for hipsters and book writing, no hardcore technical work sorry. Off topic pseudo-trolling aside, what exactly are you seeing when you rebound your gameplay debugger keys? Apostrophe let you choose an AI, but are you saying you couldn't enable/disable the categories along the top bar with rebound category keys? @tawdry zephyr

#

Trying to think about it I feel like a long time ago I tried to control the categories somehow and found something else hard coded so I guess it won't surprise me if this turns out to be true bonk

elder ridge
#

I spent some time reading up on UE's implementation of Behavior trees and EQS, and the only thing I have a hard time understanding is how it impacts performance and when. For example if you have 100 moving characters/actors (NPC's), is it better they share one larger tree, or do you normally want to split them up, or should I keep the tree pretty basic and lean more on EQS?

#

Sure it usually comes down to testing and profiling, but is there any available general guidelines on it? To save at least some time

#

I also saw the newer "swarm" (niagra?) that was talked about in the UE5 videos. Does it use a totally different system then?

ocean wren
#

EQS is actually kind of useful as a general purpose query mechanism, because it does a time-sliced query for you and generally doesn't kill performance unless you make it ๐Ÿ™‚

elder ridge
#

Like a town with people that want to eat, sleep, work etc. Depending on skills, time of day, stats and such

#

maybe not doing the same things every day and so ๐Ÿ™‚

#

Its mostly for aesthetic reasons though, not as much actual gameplay

ocean wren
#

That said, there are some usability issues in EQS that can trip you up. I think it needs a refresh UI wise, but just don't have the time and energy to do it ๐Ÿ™‚

elder ridge
#

So do you think skipping EQS mostly is wise?

ocean wren
#

The niagara thing is more about doing "smart particles" so I wouldn't rely on that for AI

#

No, EQS is sound, if you can understand it

elder ridge
#

Oh, I thought it was environment query in general

#

not just sound

ocean wren
#

Its like most of the AI tools in UE, basically works, but has issues of documentation and usability

#

EQS is basically a response to requiring data about the world for an agent, but wanting that data to be gathered over time rather than in one blocking operation

elder ridge
#

So it might be more common to simply do it yourself then? Instead of the Behavior trees etc?

#

In that, I mean the default implementation

ocean wren
#

Well, put it this way, using BT's and EQS will work. It'll be a pain, but it'll work. Using something like blueprints? it'll MAYBE work eventually. Maybe.

#

BT's are pretty standard fare in Game AI, so worth learning

elder ridge
#

I was thinking if you have a large amount of actors, I rather just want each actor to query the current state of the world, and choose certain actions based on some variables. I thought if making them query less frequent (maybe every 10-30s), it would be less heavy on performance

ocean wren
#

That said, the UE implementation isn't the most user friendly and has not great docs.

elder ridge
#

like looking at the time of day, current action, how the current stats are and such

#

might be easier to make something myself then

#

Kinda looks like it was the norm ๐Ÿค”

ocean wren
#

Yeah, you can control how often the EQS queries run for sure, but inside EQS it actually controls how much of a query runs per frame

elder ridge
#

Ah I meant as a custom implementation of a simple state machine, instead of EQS etc

ocean wren
#

i.e. if you're gathering data about 100 raycasts, it doesn't do them all in one frame

#

for stuff that is pretty much global info like time of day, just feed that into a blackboard entry, I wouldn't use EQS for that

elder ridge
#

Since this is less about what they see, and more about what they do and where they are, so it wont require any rays or per-frame updates, it might be easier to skip the behavior tree all-together

#

and just have a simple state machine

ocean wren
#

EQS is really mainly for spatial querying (hence the Environment part)

elder ridge
#

ah gotcha, then I think I can skip EQS for now, that clears that up at least ๐Ÿ™‚

ocean wren
#

I use EQS for cover selection etc..

#

You can use it to query where things are on the map for instance

elder ridge
#

I guess I will just have to dump a large amount of AI actors in and look at the performance differences. Was just trying to find some resources or guidelines that might make the process a bit shorter or less painfull to debug ๐Ÿ™‚

ocean wren
#

Generally, if I need to do like raycasting in a batch, I'd use EQS

elder ridge
#

Ah okay, yeah that makes sense

ocean wren
#

Its a bit difficult to give you rules of thumb because AI is kind of game specific. But there are some gotchas depending on what you're trying to do

#

For instance, the default agent count in Unreal Engine is 50. Try doing more than that and some of them won't work ๐Ÿ™‚

elder ridge
#

In my case, its simply town NPC's living their daily life, so just doing activities based on their own local stats and some game world states and nothing else

#

so there is pathfinding in it

ocean wren
#

Ok, so to do something like that.. yes you'd have a BT with some blackboard values for time of day, you'd use EQS for "find me activity X nearby" style queries

elder ridge
#

Ah okay, I will give that a try then, see how it works out. If the agent count is normally 50, it would be interesting to see how people do it in a larger scale then

ocean wren
#

Take a look at the presentation for how they did the AI for the beach scene in Bioshock (its on youtube)

elder ridge
#

sure il look it up! Thanks for the pointer ๐Ÿ™‚

ocean wren
#

There's a number in the editor settings, you can set it to a higher value, it just defaults to 50

#

Usually for sort of "world filling" character stuff. You'd have a smart-object system (smart objects coined by the sims AI) where it announces its availability to satisfy some need.. then you have a query system that says "I need X, find me anything that satisfies X near me, sort by distance" (EQS) and some way of locking that resourse so that others know you're using it etc.

#

EQS is roughly based on some work by Matthew Jack on CryEngine and their environment query system.. might be worth digging up documentation on that to understand the concepts.

elder ridge
#

Sure thing, will do that then, really appreciate the explanations ๐Ÿ™‚

ocean wren
#

AI is fun ๐Ÿ™‚ or at least should be!

queen urchin
#

hello guys
Can you help me with AI?
My AI ignore other players and just attack player1

ocean wren
#

I can't read that BP, get a higher res screenshot?

queen urchin
ocean wren
#

How does your blueprint select which enemy to attack?

queen urchin
#

maybe on this BP

#

I did that just following this tutorial https://www.youtube.com/watch?v=TjoE7Pmank0

Hello all and welcome to the first episode in Making a Zombie AI in Unreal Engine 4. In this episode, we create the zombie character and controller, as well as set up the foundations for the AI logic.

Project File Download Page: https://bit.ly/2X89w85

Follow me on Twitter at @radon_yt.
Subscribe for more videos like this in the future.

โ–ถ Play video
ocean wren
#

So the AI sense is fed into a blackboard item. But where is that blackboard item extracted to then use in the attack?

queen urchin
ocean wren
#

Ok, that's the blackboard.. but you need to get the value you saved INTO the blackboard and take it back out to then use to attack

queen urchin
#

maybe this?

#

AI just chase and attack only player1 and ignore other players even when player1 is dead

ocean wren
#

It's probably because you're only ever setting player 1 in the blackboard

#

You need to go back over your setup and actually understand the parts rather than just do whatever the tutorial does

hoary nova
#

hey guys, any tips how to create an enemy horde optimized (for replication)? my fps drops after spawning 10-20 enemies (simple character pawns with just a sphere mesh and simple move to location function every 1 sec). Using physics instead of navmesh is faster ? Or BTs ?

ocean wren
#

Whats it for?

#

I ask, because someone at Epic did a presentation at one of Epic's dev days about creating a massive horde style thingy. Using niagara and some tricks

#

Pretty sure you'll find it on Epic's website somewhere. Can't remember the name of the presentation though.

hoary nova
#

i want to make smth like back4blood type of enemies

#

so not very massive, but around 50 enemies i think

ocean wren
#

don't know it.. how many enemies are we talking about?

#

Have you profiled where you are losing performance? Might be a simple setting you can tweak

hoary nova
#

not sure how to profile the ai thing

ocean wren
#

50 doesn't seem like a lot. But default setups can be a bit crap.

#

Well, time you learnt then ๐Ÿ™‚ there's a video or two on the Epic channel about using insight to profile game loops. Its a useful skill to get started with.

hoary nova
#

ok, i'll check it out

ocean wren
#

If you search for Insight profiling on the Epic youtube channel you should find them. I've seen like 3 different presentations

#

And one on the aidebugger too

celest python
#

50 of enemies can create significant framerate drops with 4 players especially if its listen server

#

Your problem will not be related with AI framework, it will be related with RPC sending time, CMC's Tick time and rendering them

#

Back4Blood probably doing some shenanigans that can not be done easily in UE

#

@hoary nova

ocean wren
#

Only way to be sure is to profile it

hoary nova
#

hm... so at the moment from insights tool i got that characterMovementcomponent_tick for 60 enemies takes 7-20ms and then i have an extra waituntiltaskcomplete that is also 8ms, but probably because i create a timer for each enemy actor and that is quite bad, so now i'm trying to make bt and see if i can optimize this a bit, also thinking to remove CMC and make only physics actors might be better?

ocean wren
#

I've heard that CMC can be quite heavy time-wise.. but it might be useful to drill down further and see if its a single function being heavy handed

celest python
#

CMC's FindFloor function is notorious for its CPU usage

#

But thats not only one

#

Too many traces, RPC sending time, OnRep updating time etc

#

BT only can optimize the MoveTo function and its doing that indirectly by ticking the system with time-slicing

ocean wren
#

You'd think some enterprising soul would go in there and rewrite it wouldn't you?

misty wharf
#

have you looked at CMC

#

it's like.. you touch it and everything comes crumbling down

#

:D

#

and it makes all kinds of assumptions like the direction of gravity and such and it's nigh impossible to change, but some absolute mad lad has done that for the directional gravity plugin on the marketplace

celest python
#

Yeah that one is insane

misty wharf
#

UE makes all sorts of very annoying assumptions about the orientation of the player character as well

#

You would think that if you look up, it would look up relative to the orientation of the camera

#

but haha no why would it do that?

#

so if you turn the character upside down and the camera with it, now you have to do all of that logic yourself and it just gets kinda annoying to do :D

#

(I was working on a small space ship type thing at one point)

misty wharf
#

No idea, if he's the author of Directional Gravity then probably :)

granite vault
#

One paid. Another is free

misty wharf
#

the free one's the one I tried so whoever made that

granite vault
#

Oh. It says Tefel

misty wharf
#

who's Roman anyway?

#

That name sounds vaguely familiar

#

Ah, that's because a friend linked a github page for texture 2d arrays which had his name on it :D

granite vault
misty wharf
#

Ahh I see :)

granite vault
misty wharf
#

Yeah looks similar conceptually as the free one

#

the free one uses a C++ based CMC-derived movement comp which is probably the main difference

granite vault
#

Yeah. I wonder how he does it in 100% BP

misty wharf
#

I'd guess a custom movement mode and just reimplements the movement logic there

#

I'm not sure how performant doing all that math in BP's is though... Although it's probably not a big problem unless you've got tons of characters based on it moving about

granite vault
#

Yeah. Switching to non-character would help a lot in this case

hoary nova
#

can one ai controller control multiple pawns?

#

or that does not make sense?

ocean wren
#

its not designed to

#

So not really ๐Ÿ™‚

hoary nova
#

FloatingPawnMovement component seam to work much better than cmc, it also have auto update tick registration that turns off tick when actor is not moving which helps a lot in multiplayer, just that it looks a bit laggy on client side and i have to interp position

odd trout
#

I have some general questions about best practices in setting up AI. Where should I store and update my pawn's stats (ie hunger)? Should everything be stored and modified inside the pawn and the AI just gets these variables from the pawn or should changes to my variables all be done within the AI then sent out to the pawn?

#

Also, is it best to move variable values between the AI and pawns by casting or with interfaces. Virtually every tutorial I've seen uses hard casting. Is that a bad practice or something that is okay to do in this instance?

jovial kraken
#

Hiho I have 2-3 general questions about all inclusive.

I figured I would build 2 types of AI for general monsters and 2 types for bosses.

General monsters AI:

  • Aggro Range
  • Aggro music
  • Chase on / off
    ... What else should go in here?

Monster specific AI:

  • attacks
  • Fight and flight behavior
  • Loot and drops
    ...

My Question:
What exactly should be in good general AI?

Is this a good way to build a general AI that counts for all monsters + an additional special AI for each monster?

Would a better solution be General AI = parent + Specific AI = Childes?

Is the death of the monster also regulated via the AI โ€‹โ€‹or via the character BP?

odd trout
#

The game I am making also has multiple speed settings which makes this more complicated because I'm unsure of if/how I should go about updating the intervals of services and waits in the behavior tree and/or the frequency of AI ticks.

ocean wren
#

DavidS: It makes more sense to store state data like hunger levels on the character itself. That way you can have it do the logic for hunger. The AI just needs to know about it to change behaviour later, but things like making the character die when hunger reaches a threshold should be part of the character imho.

#

As for moving variables? I wouldn't worry about it initially. Do it whatever way you prefer and then profile it and rework if its a problem.

#

Raikun: You can run sub-behaviour trees within a main behaviour tree. So you could build a "general" tree and then have specific subtrees for specific characters.

#

I think you guys need to stop worrying about doing "Good" or "right" AI and just get something working. Refactoring will be required either way. So get your things working and figure out the pain points.

odd trout
#

@ocean wren Thank you!

jovial kraken
#

Or do you need more specific Infos about my questions?

misty wharf
# jovial kraken Some Ideas?^^

It makes sense to have a base actor or a base blackboard for shared things yes. It's not required but it can be convenient. For death, it can be done either way, depends on what works better for your specific usecase.

fossil pine
#

I have a question does someone know a way how to spawn an actor behind the player and follow them like that. Finally like in "slender the eight pages"

ocean wren
#

I suspect so, yes.

misty wharf
ocean wren
#

No, nobody.

misty wharf
#

lol

fossil pine
ocean wren
#

I do

#

In fact I know like a dozen or more?

#

I even did my own a few years ago

misty wharf
#

Is everyone doing slenderman games

ocean wren
#

Is that what all the cool kids are doing now?

#

Its hard to keep up with all the trends

misty wharf
#

Well I mean considering you said you knew dozen videos about that and had made one yourself too lol

ocean wren
#

Oh, no, I meant a video about having an AI follow the player

misty wharf
#

Ah :P

queen urchin
#

Hello guys
Could you help me please.
My AI keep attack player even when player is dead. I am not using BT.
AI attack BP:

queen urchin
#

Nevermind
Everything works fine now

lyric flint
#

I have an honest question:
Can u only work on AI through Blueprint? Or is it just be it's faster to start with the basic attributes and then make some advanced mods in the ide/code? Maybe it's not needed at all?
My question is not stupid, I am only ignorant.

simple crest
#

? There is nothing you can "only" work on in blueprint... Some things are more convenient in blueprint, and lots of things are only possible with c++

ocean wren
#

I do all my AI in C++, because its reliable and you can debug it.

river osprey
#

Hey guys, I've got a fairly simple question but can't seem to find an answer! Is it possible to 'restart' a behavior tree?

#

I have a Tower Defence enemy and want to send it back to the spawn point and restart the tree. Wanted to avoid destroying it if possible.

misty wharf
#

have you tried stop logic or whatever the node was called?

#

destroying the actor should be fine tbh

river osprey
#

I'll take a look for it, I wasn't even able to track that info down.

#

Yeah I'm just being a bit lazy. Wanted to avoid tracking status like slow/burn and health. But it might be the simplest solution

pallid mica
#

Aloah, does anyone know what Run Behavior Dynamic is supposed to do?
It allows specifying a GameplayTag.

#

Ohhh

#

I think it just made click

#

It's supposed to allow swapping out the whole Sub Tree Asset during runtime

#

Not realllly having a usecase for this or being able to come up with one, but well

misty wharf
#

@pallid mica I use it in my AI's - they have a list of tasks they need to execute, and each task has its own behavior tree. The main BT runs until the AI reaches the tasks stage, at which point it runs the task-specific BT's as a subtree, until it has executed all of them, and then it runs some finishing stages. Works quite well for this I think :)

misty wharf
#

The tasks?

pallid mica
#

In the 3rd node from the left?

#

Yeah, since it's meant to be set dynamically during runtime

misty wharf
#

Ah, yeah the BTT_NextCustomerTask sets up the subtree

pallid mica
#

Makes sense

misty wharf
pallid mica
#

What type of AI is yours?

#

Some RTS worker unit or so?

#

(something like that at least?)

misty wharf
#

Yeah sorta like that I guess, my game is a video rental store simulator and this is the customer AI

pallid mica
#

Alright, cool, will keep that in mind when designing the trees

pallid mica
#

Do peeps still use the PerceptionSystem?

misty wharf
#

I'm using it at least

pallid mica
#

Iirc it requires some little c++ to make proper use of it. at least I recall having made my own sight sense instead of using the base one, is that still the case?

#

Also I only used it on a project that had one AI, are there any performance issues with 10+ AIs on the screen?

#

Cause Epic likes to overload stuff with more and more stuff

misty wharf
#

You need C++ for the teams part of it, and to tweak some sight-related settings such as if you want the sight perception to look at the head of some character instead of the origin, but if you don't need anything that specific it works fine in BP's only

#

The main performance thing with it is that it appears to do one linetrace per stimulus source that's within range at least for sight, so you get number of perceivers x number of stimulus sources number of linetraces per tick - but if it goes over a configurable time limit, it timeslices it, which can result in delays in actors reacting to perception

pallid mica
#

But you'd need to do that anyway

#

Even in a custom system

misty wharf
#

the number of traces can be reduced by using the teams function so that anything the actor doesn't need to perceive goes into some other team and you mark it to not perceive say friendlies

pallid mica
#

I kinda have to trace the targets to check if they are visible haha

misty wharf
#

yeah probably

pallid mica
#

Yeah that's actually fine I guess

#

We will have team changing AIs, but in most cases it#s x AIs vs 1 Player

#

So they theoretically only need to trace the player

#

Looking at the Sight Sense code, lots of stuff going on for something that theoretically only has to deal with some line traces :O

misty wharf
#

It seems to have some kind of "stimulus strength" feature as well but I've never really tried how that works, I'm guessing it might just report the strength of the stimulus in the events it sends

#

not sure what else it does behind the scenes tbh

pallid mica
#

Have you done any senses from scratch?

#

Just wondering if that is a lot of work

misty wharf
#

nah, I heard you can create custom ones for it but haven't needed to do that

pallid mica
#

Right, guess hearing, seeing, is fine

#

They also have Damage, Team, Touch, Prediction

misty wharf
#

I think some people just roll their custom systems, I was under the impression perception was the current thing you should use, replacing things like PawnSensing

#

I don't think EQS would even work as a replacement for it

pallid mica
#

No it won't work

runic flare
#

Hi, I have several supported navmesh agents defined in DefaultEngine.ini -- I just deleted the old agents and made a new set to match some gameplay design changes

#

when I build paths on my map it's still building some of the old navmesh agents

#

Ive tried regenerating Binaries and restarting the editor but these old navmesh definitions are still hanging around somewhere

#

does anyone know where these are cached and how to clear them out so my navmeshes will build only according to the project settings?

runic flare
#

I have now cleared the nav agent section out entirely and my Nav Mesh Bounds Volume is still generating meshes using the old definitions

pine steeple
#

@runic flare did you delete the recast data from the world outliner?

runic flare
#

@pine steeple I did yeah

pine steeple
#

thats odd

#

i normally just delete the recasts in the level, delete the bounds

#

then drag new one in, resize, and voila

pallid mica
#

I have some old code where I used Perception stuff and my own Sight and Hearing sense, where all I did was bAutoRegisterAllPawnsAsSources = false; in the constructor.
Guess what, I have no idea why I did that, but I recall this being a good thing.
Anyone some idea what that boolean is about?

#

Seems like this is basically just registering every single pawn as a source, even if the Pawn is not relevant

#

So turning it off, but turning on the boolean for register as source in the config of a specific pawn should cut down on redundant sources

neat heron
#

Howdy, when you're making heavy use of Levels for organization (level for light, geo, logic, ect) and streaming, i take it you want to have navigation on it's own seperate layer(level) right?

#

Or do you want the navmeshes to be like, baked onto the various geo layers so that navigation logic only loads with the areas? each route seems like it has ups and downs.

or should it be on the persistant layer? i actually forgot the persistant layer existed for a moment (woops)

Fwiw i'm mostly just learning the system and am making heavier use of level than i need to in a short fps game just to make sure i understand them.

spring inlet
#

i would put it on the geo level, as it's the only data affecting the navmesh

#

unless you work with a lot of navareas and such

pine steeple
#

navmesh is a pain on non streaming levels, and must be on a persistent level, iirc

pallid mica
#

Yeah I also recall it having to be on the persistent level

pallid mica
#

Can it be that SimpleParallel and RunBehaviorTask aren't good friends?

#

Seems like the RunBehavior instantly returns something that finishes teh MainTask of the SimpleParallel

#

Took me a bit too notice

#

Found multiple people having issues but no one that could explain why

#

The Task itself reports InProgress as NodeResults until the "DeactivationNotify" calls back.
Not sure what that is though

queen escarp
#

show us a screen

haughty edge
#

Hi guys! Can anyone tell me the difference between find path sync vs find path async? Currently I'm trying to see if it's possible for me to multithread the path finding part for my AIs. I don't really have much experience with multithreading in Unreal engine, so I don't really know if I'm looking into the right thing :P

wise iris
#

While using a dynamic navmesh with invokers, trying to find out how feasible it is to add holes/obstacles in the navmesh after it's been generated.
Has anyone here modified the (dynamically) generated recast navmesh at runtime?

pallid mica
#

You can't go backwards if that's what you mean

pallid mica
simple crest
#

I'm guessing Lorash's Q is asking if two paths can each lead into the same next node... I don't think so

wise iris
#

Or how do you mean?

pallid mica
#

There is a NavArea with that NULL Type

#

Don't know how it's called exactly

#

Compared to the ones that just increase cost

#

You should be able to spawn those runtime with NavModifiers

wise iris
#

Interesting, will note that down

pallid mica
#

Try it at least

#

Been a while

#

We also once had multiple NavMeshes

#

But we had to cut one out due to memory concerns

#

No each node only has one entry iirc

#

If you connect another one it disconnects the first

pallid mica
#

Given you want to add Multithreadding, you need c++ anyway, so you should be able to read through source

haughty edge
#

Roger that

#

Is it feasible for path finding to be multi threaded? Or it might require a huge re write

#

I'll look into find path async more and then come back :))

pallid mica
#

If the code is so heavy that you need to offload it onto a different thread, then that means it will take a while until your AI gets the next path

haughty edge
#

I'm not very experienced so it's a really wacky solution, it's not terribly demanding if there aren't that many AIs, but I do hope to support as many as I can in the future.

#

Another not really related question, is there a way to place nav links when the nav mesh is generating? Because I only know how to add them after the nav mesh are done generating, and then it will start regenerating again :P

pallid mica
#

Yeah I think the last time we worked on something like that with the company was when we were making a few thousand AIs

#

But that was such a custom solution, it's not worth talking about

haughty edge
#

I don't think I'll ever have thousands in my game but that's amazing!

#

I thought AI move to task is multi threaded but I think I'm mistaken there :P

umbral musk
#

I have an NPC which I need to move to a location to perform an action. As a player, I could be standing in the way. So I call the NPC AI "MoveToLocation" function, and I bind an event to move complete. When that even fires, I look at the result of the event. If it's anything but "success", I have the NPC "ask" the player to move out of the way, unbind the event to make sure it won't be called again, wait a few seconds, and repeat the process.

This seems to work EXCEPT even when the player moves out of the way and the NPC attempts to go to the location again, the NPC still thinks it's being blocked. Any ideas? My navmesh runtime generation is set to dynamic and my "Dirty Areas Update Freq" is set to 2

dull loom
#

how do I get the NavMesh from the AI Controller?

winged grail
#

Hey, I'm just wondering if anyone can point me in the general direction/methodology for solving a problem I'm having with EQS:

I've got an EQS Query that generates a set of items/locations around an actor's "Target Actor" (i.e., the querying actor has a variable called "Target Actor", the EQS Query generates items on a circle using this "Target Actor" as the center). The items have an overlap test/filter that removes the appropriate item from the EQS Return if a pawn is overlapping it.

However, I can't seem to make the overlap ignore the querying actor. I thought that checking "Skip Overlap Querier" would have worked but it doesn't seem to effect it (I'm assuming that the test is considering the "Querying Actor" as the circle centre [i.e., the querier's "Target Actor"] rather than the actor that is calling the EQS).

Any thoughts or resources would be super appreciated, thanks!

ocean wren
#

You can add a second filter that takes out any items that are near the querying actor

#

The query is basically a set of scoring mechanisms.. so just add another one that essentially removes anything near the query actor

#

Skip overlap querier is there to ignore the actor doing the querying (most of the time you don't want to target yourself for instance)

alpine junco
#

Just to sanity check - do behavior tree nodes, like tasks for example, only run on the server by default? I'm assuming all behavior tree logic runs on the server only, right?

celest python
#

Yes @alpine junco

winged grail
# ocean wren You can add a second filter that takes out any items that are near the querying ...

Hey, thanks for the response and sorry for the slow reply! I had a meeting starting up right after posting. The problem I'm having is that my querying actor isn't being skipped for some reason (I'm assuming because the circle itself is not being drawn around the querying actor but rather around a "Target Actor" variable that is set in the querying actor's blueprint).

I'm essentially trying to tell the querying actor to draw a set of approach locations around their target actor, then approach that location as long as it is not being overlapped by an actor other than themself.

#

I'm not sure how legible this is, but it's a visual to demo the problem I'm having.

#

Picture of the overlap test as well (with skip overlap querier is enabled)

west lark
#

How would i make an AI that attacks my player and allows to be attacked and has different levels, so like a boss and a pawn type, and also has its own health bar that shows?

winged grail
#

That's kind of multiple separate things and it wouldn't all be encompassed by AI. You would likely make an AI that can attack the player, which would be separate from your "boss" character's blueprint, which could in turn be separate from your "pawn" character's blueprint (depending on the route you went), you would then likely code the health function within your character blueprints or within a function library or component, again depending on the route you took, finally, you would create the health bar as a widget and add it to your character blueprint(s) as a widget component. If you search for combat AI in google you'll find some nice tutorials that should serve as a starting point.

#

I found some of Ryan Laley's stuff helpful when I was first starting out, but you'll have to extend it on your own as it's usually pretty base level in terms of functionality. There are also some longer tutorial series for various genres depending on what you're making.

ocean wren
#

Butter: Gotcha, so in the EQS system, each filter has a query context. You can use different contexts to get different results. So your query context for the first filter might be the target so that you can use it for evaluating positions around. The second filter can have a different context, that actually provides the player to avoid overlap with. The point is that the filters flow top to bottom down the stack, so you can exclude the results of one with the next. Does that make sense?

#

You can use the EQS testing pawn to visualize what the results of each does too btw.

#

So you can check if its using the right objects in your EQS queries (can be useful, sometimes I've managed to mess up and give it the wrong agent in my contexts)

#

So you might want to check that you are passing the right objects via your query contexts using the EQS testing pawn.