#gameplay-ai

1 messages · Page 106 of 1

pine steeple
tropic lily
#

It’s sort of workin...

#

He’s now stopping in the corner facing the wall contemplating all that went wrong in its 2 day lifespan

pine steeple
#

and you checked the eqs and whats it doing in the gameplay debugger?

tropic lily
#

I did check it’s stats and I thin fixing the staring at wall problem

#

But he keeps stuttering when moving and it looks always

#

(Also how do I debug with this thing?)

pine steeple
#

what stats?

tropic lily
#

I mean details

#

In the blueprint (my bad)

pine steeple
#

use the gameplay debugger

#

press the ' key

#

click on the AI

#

and use numpad keys to select which info to display

tropic lily
#

K

wide geyser
#

does anyone know the best solution for doing an EQS trace test against visibility but AI character also blocks visibility so the best choice point is not an actual hiding point with respect to the player? My AI character blocks visibility and i use that for other trace tests in blueprints so i don't want to define a whole new trace channel for my AI character but I really only want the EQS to return visibility blocked traces and exclude characters/pawns from the trace .

void cloak
#

Are there any better ways to get the AI to climb vertically up a surface? i'm currently using navlinks but that doesn't work without me tilting the shape slightly, creating a launchpad effect(also, why does that happen?)

pine steeple
#

im confused

#

navlinks should link the mesh to the mesh over an obstacle

#

or mesh to another mesh

#

@void cloak so your ai approaches the obstacle and should climb onto it?

void cloak
#

yeah, no fancy animation, just simply jumps up onto it

pine steeple
#

you using smart links?

void cloak
#

smart links?

pine steeple
#

create a navlink proxy blueprint

#

and there is an event called on smartlink reached

#

it returns the end position of the nav link

#

i mean it has the end position of the nav link

#

then you need to lerp your character up the obstacle (can use a timeline)

void cloak
#

i see

pine steeple
#

or apply jump and a forward force

void cloak
#

thx

pine steeple
#

if you need any help with it let me know

#

smart link is a single link (left and right points) same as a normal nav link but disables pathfollowing whilst using the link and you can do whatever needs to be done, then renable path following

#

@void cloak if you get stuck i actually have a small project here doing exactly what you need

tropic lily
#

How do you die?

#

Is it possible for there to be a test/decorator that only lets the EQS task activate when it’s within certain proximity of an EQS pawn?

pine steeple
#

you know what an EQS pawn is for?

#

seems your mistaking its purpose

tropic lily
#

I barely know anything about it

#

Does it set up the environment for the EQS task or is it just a debugging tool that tells you which areas are more fitting?

pine steeple
#

debugging tool

tropic lily
#

Oh

#

I see now. Removing them didn’t change anything

#

Still, it’s annoying it keeps stopping to get a new vector

#

Also I want to make it use EQS when it seems like there’s only one path to go

tropic lily
#

Anyone know how to fix that?

pine steeple
#

run the eqs as a service

#

rather a task

arctic crag
#

Any Ideas what would cause "MoveToLocationOrActor" to succeed without actually moving? I have the acceptance radius as 5cm.

patent hornet
#

it adds pawn's overlaps by default

#

which can include stuff like WidgeComponents

#

and if you're close enough that one of your overlaps is within 5UU...

#

also, stopping previous MoveTo will return success iirc

tropic lily
#

With EQS, how do I keep him from standing in corners like some a little kid who farted in mom’s mouth?

#

Also how or what can I do with the Query Config thing?

pine steeple
#

you need to debug why he has stopped

#

whats the BT doing? what is the eqs query saying?

#

and the config is for changing EQS query values at runtime

#

or per AI

tropic lily
#

(How do I click on the AI in debug mode when the camera is connected to the mouse)

ivory cloud
#

@tropic lily If you look at the top of the blueprint (on the line with the Play button) you can select which instance of the actor in the level you're watching for debugging.

#

Hi folks. Having a really strange/frustrating issue with pathfinding. I have a pawn class that's set up to turn around and run directly behind them when they register a stimulus. On the move to, I have "Use Pathfinding" unchecked.

#

When they register the stimulus, they turn around and run in the opposite direction of where they were looking, but most of them appear to still be using pathfinding

#

You can see below their initial starting positions and then at the bottom where they ended up. Ones that didn't pathfind ended up in the over-turned porta-potties, and ones that did are to the side or behind them

#

I am 100% sure that it's because they're still using pathfinding, because when I delete the navmesh, they suddenly behave as intended

#

I've tried every setting on the moveto node and also tried turning off RVO avoidance to no avail. Any ideas?

ivory cloud
#

Upon a little more tinkering, it seems like it's because the ai I'm using is a child of the detour ai crowd controller. Is there any way reason that would use pathfinding when it's explicitly told not to/any way to turn that off while still gaining the benefits of it when you do want to use pathfinding?

tropic lily
#

With Unreal Engine’s boundless capabilities in the world of graphics, you better have some hyper realistic shit flinging in a porta potty game

ivory cloud
#

They're not really the focus, but I do have a decal that slowly spreads outward from the porta-potty once it falls over. You just can't see it here because they're placed incorrectly. And yes, I'm definitely an adult.

tropic lily
#

Same. I’m just more open in how disgusting I am

#

Speaking of disgust, at least in the intellectual level, I need help

woven pilot
#

Hi there! So if I'm working on AI in a 3D space game, what would "replace" the navmesh? Would I have to brute force most things or are there tools?

heady arrow
woven pilot
#

Thanks! Although I think this is overkill, my game will have the odd asteroid field and half a dozen ships in combat. The motion also is steering based so it's smooth, not just movement in a straight line like in that plugin

tropic lily
#

Hey how do I make an sequence skip over a task if certain conditions are not met for that task?

#

I want it to skip over it and not get stuck because a key isn’t set

patent hornet
#

that is what decorators are for

tropic lily
#

I know but which decorator is it?

#

I tried the blackboard one but it just got stuck waiting for input

desert cipher
#

Why do my Ai act like T-Rexes? if I don't move..they don't seem to know i'm there. melee guy runs up, attacks me, and if I'm not moving, despite being right in front of him, he thinks I've disappeared and runs off to do patrol stuff.

desert cipher
#

So what appears to be happening is that after my AI sense sight sees the player. The AI moves to the player, performs a melee attack, and despite being right in front of the player, the AI controller is then losing sense of the player. The range on the sight is 1000/1800 with an auto success range of 500. If the player doesn't move the AI just seems to fail to sense them with sight. https://blueprintue.com/blueprint/q13p2mmh/ There is a full copy of the BP, easier to see...but I'm failing on the print node "Failing Successfully sensed" Is there some minimum distance that sight doesn't work?

runic token
#

i know in my case, the eyes for my enemies are attached to a socket on the mesh

#

when they perform certain attacks, the animation can result in the socket going behind the player, resulting in sight being lost

#

like when the lean/lunge forward

desert cipher
#

But when the animation is finished the sockets should go back to their normal place right?

#

In my case the AI performs the attack, stands in front of the player for several seconds , then just wonders off

#

how often does perception update?

#

I just timed it there now, it's about 9-10 seconds after the attack before he fails out and wanders off

runic token
#

i don't know the frequency for sight updating, and my enemies do re-capture sight of the player when finishing the attack once the animation has finished

#

sight should update faster than that

#

are you aware of the gameplay debugger? it can show the sense of your perception component

desert cipher
#

I also have my AI sensing on hearing and damage.

#

I've seen that

#

but..

#

I can't get it to work if I deposses my controller

#

my pawn

#

It only seems to show details when I'm actually in the player pawn.

#

so if I deposses to get a better view of what's going on, the overlays and stuff disappear

runic token
#

same here

desert cipher
#

let me try it though..it's uhm... ' to enable it right?

runic token
#

should be

#

you will probably need to also toggle perception using the numpad

desert cipher
#

I've already been standing in front of him for over 10 seconds now.. he hasn't failed yet..but still not really doing anything

runic token
#

perception says your still in sight though?

desert cipher
#

That one did

#

I moved around, he started to attack me again

#

then the next time he failed out

#

even though I was right in front of him

#

It's hard to see from the first person view

runic token
#

were you still in his sight during his attack the whole time, or did he lose sight?

desert cipher
#

I'm trying it again, I seem to have better info on this one.

#

This guy has wandered off

#

I still seem to be in sight

#

but he's doing patrol

#

he's only supposed to do patrol if the enemy key isn't set.

#

but it should be set, since he's sensing me

runic token
#

are you using decorators to abort pending tasks? cause it might wait until it finishes patrolling before it tries to attack you

#

I had that issue when making it attack

desert cipher
#

if I move, he'll react.

#

he just doesn't react to me standing still

runic token
#

so as soon as you move, it then acknowledges you?

desert cipher
#

As soon as I shot that cactus near him, he changed behaviour and came at me.

#

Because i made a noise

#

and he reacts to sound.

#

but after one attack he just stands there.

#

and then goes to patrol again.

#

despite me being in range

#

if I move around him, like strafe or whatever. he'll just k eep attacking over and over like he should

#

stop moving and I'm a ghost.

#

let me try to take a quick video

runic token
#

how long does he wait once you stop moving, or does he just stand there forever?

desert cipher
#

Once he stood there a long time, but usually around 10 seconds

#

this time he's standing there indefinitely

#

But it's failed several times

#

I have a bunch of log messages from that check failling

runic token
#

i noticed in the video that the green sphere for sight isn't tracking you like it does for my character

desert cipher
#

His behaviour tree is in the right place right now

runic token
#

do your characters have stimuli source components?

desert cipher
#

uhm...

#

I've never needed anything like that

runic token
#

the is within range decorator is aborting both self and lower priority

desert cipher
#

I've been running range AI for months now without issue, just today trying to set up melee

#

they always seem to see and pickup the character

#

the only stimuli generator I've set up myself was making a noise when the gun fires and where the bullet impacts

runic token
#

ok

desert cipher
#

and a noise when the player lands from a jump

#

but with range AI I never stay still

#

so I wouldn't have noticed this issue

#

stay still and they slaughter you in a few seconds

runic token
#

is that what its stuck on when its not moving? the yellow outlined parts?

desert cipher
#

Yes the melee attack

#

but I've checked that and it seems fine also

#

all the expected values are there

runic token
#

something in the behavior could be stalling it?

desert cipher
runic token
#

the melee sequence tree

desert cipher
#

his check shows that he is not in the middle of a melee attack so it should be moving forward.

#

other nodes are returning correct values

#

The animBP has an anim notify that resets that boolean, since the attacks are of different lengths.

runic token
#

whats in the melee sequence tree?

#

is it just the single task?

desert cipher
#

Showing him on melee attack

#

but there is no reason for him to be hung up on that.

runic token
#

i think for your melee task, you need to end it Finish Execute

#

you got it for when you start the attack

#

but not for when your already attacking

desert cipher
#

ah

runic token
#

it might be pending for a finish

#

thats my guess

desert cipher
#

let me try that

#

I always miss little things like that.

#

at least once

#

Thanks so much man.

#

That was it

#

That was foolish. haha

#

Good news is, I learn from those kinds of things pretty well 😉

runic token
#

its happened to me too

desert cipher
#

Don't suppose you know how to get them to stop snapping to their original location after doing an animation? I've got 2 attack animations that move them ahead, but when they finish they snap back to the starting point. I tried checking the box for root motion but that didn't seem to help

runic token
#

were the attacks montage based?

desert cipher
#

nope just an animation

#

the third one

#

I think you saw it in the video, the one where it jumps up and spins

#

it ends up a couple meters ahead, but then snaps back

runic token
#

i mean, a montage asset in unreal

#

you can create an anim montage from an animation

desert cipher
#

No, they're regular animation assets

#

not from montages

runic token
#

ok

desert cipher
#

do they work better as a montage?

runic token
#

and your using an anim blueprint?

desert cipher
#

Yes I am

runic token
#

in your anim blueprint, in class defaults

#

there is a root montage mode, by default it should be set to from montages only

desert cipher
#

Ah

#

yes

#

root motion from everything?

runic token
#

yes

desert cipher
#

Okay let me try that

#

it was confusing because I used the same animations for my first person and it had no problem with it at all

#

ah nope

#

that didn't work

#

just had an AI do the big power move and he still snapped back

runic token
#

have your animations enabled root motion?

desert cipher
#

Yes, you can see it's enabled there.

runic token
#

does the animation still snap back in the preview window?

desert cipher
#

well yes...because the animation loops

#

so it loops back to its starting point

pine steeple
#

you need a blend to a finish attack montage or something

#

it wont auto blend back

desert cipher
#

ah really?

#

I thought the root thing would reset it's location

#

so that when the anim blueprint sent him back to idle, he'd move to idle on the spot

pine steeple
#

can you gif the animation playing?

desert cipher
#

in the game or preview editor?

pine steeple
#

preview

desert cipher
#

that snap back is just from the animation looping in preview. The animation finishes up ahead.

#

The other odd thing about that animation..is if the AI starts that attack and I back away quickly, he'll teleport in the middle of the move in front of me.

desert cipher
#

Just found this: "I am using mixamo anims and they currently seem to have no usable root motion" the anims I'm using are from mixamo. That might be the problem there.

river crypt
#

Any good tutorial/source for vehicle AI (3d Side Scrolling Shooter)?

river crypt
#

??

foggy sluice
#

Hi I'm new in the AI, but I want to learn AI in the behaviour three.
I want to make a simple bot like in the shooters.
Can someone suggest a nice video tutorial how AI works and how I can make a simple bot. Thanks!

patent hornet
#

check pinned messages on the channel

foggy sluice
#

Oh nice)

#

@patent hornet Thank you! I see so many tutorials great

ivory cloud
#

Hi folks. I'm still having an issue with pathfinding around the Move To node, but I have a much better handle one what's happening so maybe I can explain it better now.

#

I have a pawn set up with an AIcontroller that's a child of the DetourCrowdAIController. I'm attempting to make the pawn ignore pathfinding in certain situations, but the DetourCrowdAIController is ignoring the Use Pathfinding flag being unchecked on the Move To nodes.

#

I'm 100% sure this is what's happening, because I've swapped the pawns over to a child of AIController and they suddenly respect the Use Pathfinding flag. While using the DetourCrowd version, I've tried everything I could think of to make the pawns not pathfind, and the only thing that has made a difference is flat out deleting the Navmesh.

#

Does anyone know if this is intended behavior? If it is, is there any blueprint accessible way to change it? Or should I just give up now and pursue a different solution?

fast cosmos
ocean crystal
#

fail

fast cosmos
#

Failed to check the condition, or what exactly?

ocean crystal
#

the condition failed

fast cosmos
#

Thought it's an error or something, 'cause each time it appears my BT breaks...

#

Aight, thanks

desert cipher
#

I'm still having this issue where if I stay still, or don't create a "noise" then the AI will lose track of me. Like their sight doesn't seem to keep track of me unless I do something else, like jump, shoot them, etc.

#

they sometimes see me with sight, but even after chasing me for a little while, their perception seems to lose me , even when I'm right in front of them.

#

it's not a behaviour tree issue, it's the AI controller reporting that it can't see the player.

lyric flint
#

Alright so I have the classic AI Move to random point in the navigation area.. blueprint set up

#

Cuz idk how to use blackboards yet frankly.

#

Anyways, Im trying to have it chase the player but not be able to go to that player in one move

#

Basically, have it chase in the style of Baldi (assuming you know who that is)

#

Without blackboards, is it possible to make that?

dreamy surge
#

I have an issue where my AI walk and sound like a marching army, I have 2 foot steps sounds each time the AI hits the ground but these 2 get repeative, how can I make my AI foot steps more realistic when I can onky add 2 foot steps sounds

woven pilot
#

@dreamy surge how are you spawning the sound?

south prism
#

My Ai has waypoint where it moving to but my problem is, the AI is look in the walking direction but the foots are walking like right or left and not forward

dreamy surge
#

I am spawning the sound with a cue file

jovial valve
#

I'm working on a reinforcement learning, model free AI system in UE4 based on a biologically inspired intelligence model. The backbone of my approach is to use a "Goal Oriented Action Planning" system, where agents choose actions which best satisfy their motivations.

near jetty
#

@jovial valve you literally couldnt throw more buzzwords together

#

also a bunch of those are separated things altogether

wild mortar
#

I'm trying to have a boolean shared accross all instance of a certain Blackboard

#

but for some reason when I set that boolean using one of the AIC that's using that blackboard

#

the other blackboard are not synced. I.e the boolean is false on the other one :\

#

Can someone please clarify with me how the Instance Synced option in the Blackboard works?

#

Thanks in advance!

#

tho I'm still seeing the problem :-?

#

From the AI debug UI, I can see clearly that the first AI spawn who set that boolean to true has his boolean true:

#

however, when another AI spawned, this boolean value is false (bAggressive):

#

And here's my blackboard setup for that key:

#

Does instance synced works across all child instance of a blackboard or they must all using the same blackboard for this to work?

#

the only thing that might not make this work from what I'm observing is that, my BB_Wolf and the BB_Hannibal are child of the BB_EnemyBase and thus they might not be the same "instance" :-? ...

lyric flint
#

@wild mortar Can you confirm that your AI controllers instantiate the same blackboard resource?

wild mortar
#

How may I check that?

lyric flint
#

Are you using blueprints or C++?

wild mortar
#

I can definitely print something from the OnUsingBlackBoard event

#

I'm using Blueprint

lyric flint
#

Unfortunately I usually use C++, so I'm not sure how to instantiate in blueprint

#

BlackboardComp->InitializeBlackboard(*avatar->BehaviorTree->BlackboardAsset);

floral bobcat
#

I use UseBlackboard where you specify the BlackBoard blueprint to use (asset)

#

Jeff is probably doing the same

wild mortar
#

I'm actually just letting the behaviortree decide what blackboard to use

#

I'm using SpawnAIFromClass to spawn my AIs

#

and in there it lets me specify the tree

#

I thought that it would also infers from the tree the Blackboard :-? ..

floral bobcat
#

mmh it's true that they are associated in the Editor so it must know somehow? I do the same but I have Use Blackboard as well on BeginPlay of the AIController

latent spruce
#

I believe my question fits in the category. I am trying to broadcast a float from my placer character to all AI in range. The variable would then be used by the AI

lyric flint
#

in blueprints, perhaps you can check to see if your behavior tree or blackboard asset is instantiated , And if they are, are they instance of the same asset?

wild mortar
#

Yeah, is there an identifier that I can use to check that?

floral bobcat
#

yeah, do a get blackboard isvalid and a print of a totext

#

I'll do it too because I'm also interested in the answer, I don't know as of yet if the AIs blackboard entries are actually synced in my case

wild mortar
#

Hmm, I tried both ToText and ToString

#

but they only return "BlackboardComponent"

#

not an identifier for the actual instance

#

Here's my BP:

lyric flint
wild mortar
lyric flint
#

maybe some helpful hints there, I apologize if there isn't any

wild mortar
#

Thank you for providing the resource !

#

Hmm, I wonder if a blackboard is a child of another blackboard

#

I.e, this setup:

#

Where I have my WolfBB be a child of the EnemyBase BB

#

and the boolean I would like to sync is from the parent

lyric flint
#

If your Boolean is an enemy base BB, then I don't see a problem

#

is in*

wild mortar
#

Yeah, the boolean I wanted to sync is in the EnemyBase

floral bobcat
#

is EnemyBase key sync or you change the sync flag on the child?

wild mortar
#

Yes, EnemyBase key sync like so:

lyric flint
#

I'm approaching this in terms of memory pointers

#

if both AI controllers point to the same memory address when accessing their blackboards

wild mortar
lyric flint
#

then there should be sync

wild mortar
#

Hmm, I wonder if in BP I can print something like the memory address or the instance ID of the blackboard being used

lyric flint
#

if one AI controller points to a different memory address than in the other one, Then you end up with two objects, out of sync

#

out of sync by design

#

would it be possible to use the same enemyboard BB For all your AI controllers as a test?

#

With trial and error and see what the difference is when your AI controllers use only the parent BB, or if there is a mix-and-match parent/child BB

#

The joys of programming this troubleshooting is 😃

#

just remember at low level is just plain ol' C++ pointers

wild mortar
#

I'm actually setting it up so that these AI are using the same blackboard and see if that works

#

Just gonna do it in a separate project real quick cuz I don't want to experiment on existing stuff :p

floral bobcat
#

you could actually get all blackboards and compare them

#

to debug the issue, I hope == would tell you if those are different instances? maybe not.

#

I'll shut up and let somebody with more experience help you xD

lyric flint
#

Actually cat, I mean the same boat as you, most of the time I think I should just shut up and let somebody else with more experience help

#

@floral bobcat But in the end it's a learning experience for all of us

#

motivational speech FTW 😃

#

depends how == is being implemented, but in case I suspect it would be == of the same memory address

floral bobcat
#

hahah great

wild mortar
#

Just wanted to say thank you to both of y'all for the suggestion. I mean we're just slacking on this chat, I don't think exp matter :p

#

Hmm interesting

#

I'm testing this out with an actor

#

as a synced instance

#

and it works

#

I.e, I'm having an Actor reference in my Blackboard that point to my player actor

#

And everytime the AIC uses blackboard, it quickly grab the player via get player actor and then set it in the blackboard

#

But if the player actor key is already set (i,e I grab it and check for validity), then it will not get the player actor again

#

and this actually synced properly

#

I wonder if this is because for boolean, the value in blackboard are stored by value versus the actor being stored by reference?...

floral bobcat
#

is it a pain to use an Integer to test that out?

lyric flint
#

In case you're feeling adventurous later, I learned a lot from YourUEPath\Engine\Source\Developer\AITestSuite\Private\Tests\

#

there are some good tests of how to implement everything at the backend from C++ and don't use blueprints at all

#

not needed for the issue at hand though

wild mortar
#

Yeah I'm gonna test out with an interger real quick

#

A bit off-topic, but do you know of any free tool that streamline the C++ coding when it comes to header inclusion? @lyric flint

#

At the moment for C++ I'm pretty much just search the header in the Engine folder

#

Hmm, @floral bobcat integer does not seems to work

lyric flint
#

I don't know of such tool 😦 are there commercial ones?

floral bobcat
#

what do you mean by streamline? you mean an inclusion tree of all the headers?

wild mortar
#

By streamline I refer to how in .NET C# or some other language where the editor derives where a class might come from and allow me to choose between different header to include

#

Behavior similar to how in intelJ editor with Java/Android

#

BTW, I found the problem!

#

So it was because of AIC instance

#

For each AI, I used a different AIC that's a child of a base AIC

floral bobcat
#

but a class can only come from one header otherwise the compiler would complain. And you can "jump to declaration/definition" from any variable in most modern editors

lyric flint
#

@wild mortar "So it was because of AIC instance". YAY! 😄

wild mortar
#

Yeah, it seems

#

if I tweak the boolean/int from the base AIC itself

#

then all the instance are synced correctly

#

This's gonna be a bit tricky because I just want to toggle that boolean only when a certain monster is spawn :-? ..

lyric flint
#

Add conditions

#

maybe like a switch, and keep track of the monsters class by assigning an integer unique

#

that's how I usually do it

wild mortar
#

Yeah I will probably use a public int in the base AIC then set it for each of the AIC and then do just that

lyric flint
#

because I love the integers so much, and I hate strings, I usually FNV64 everything

wild mortar
#

Haha there was a GDC session some year ago when a guy from DigiPen said if you use string comparission in your game he would gladly give you a whacking :p

lyric flint
#

And he was right!

#

just imagine the defense in CPU cycles used to evaluate one integer versus one array of chars

#

difference*

wild mortar
#

yup

lyric flint
#

preaching programming without efficiency is like my grandfather running the marathon

#

he may eventually get to the finish line, but definitely a few days later 😃

wild mortar
#

anw thanks a lot @lyric flint and @floral bobcat for all the suggestions. I guess the lesson is if I wanted to sync any variable from a base BB, I better do it from the base AIC.

floral bobcat
#

glad to be of assistance

lyric flint
#

And also glad to see my eccentric self sometimes act like a normal person 😃

wild mortar
#

So after an hour of fiddling with it, it appears that the parent AIC was not the case

#

After adding the logic to check for the type of AI who's toggling the boolean/integer

#

The other instance of the BB is now not receiving the right value. Only the AI that passed the branch check

#

So it seems that my simple test with the integer prior was actually a fail test, probably I messed up the condition for that one :\ ...

lyric flint
#

@wild mortar In C++ there is a function OnTargetPerceptionUpdated

#

there may be others, but this one I used before

#

if you can confirm that

#

your AI controllers are instance of the same AI controller class

#

the AI controller class instantiates on possess the same blackboard resource

#

and instance sync Is enabled on said blackboard resource

#

trace the variable that should be updated in the OnTargetPerceptionUpdated

#

but perhaps InstanceSync calls/is being called from a different function under the hood

#

This is what happens under the hood

#

` if (Key.bInstanceSynced)
{
UBlackboardData* const OtherBlackboardAsset = OtherBlackboard->GetBlackboardAsset();
const int32 OtherKeyID = OtherBlackboardAsset ? OtherBlackboardAsset->GetKeyID(Key.EntryName) : FBlackboard::InvalidKey;
if (OtherKeyID != FBlackboard::InvalidKey)
{
const FBlackboardEntry* const OtherKey = OtherBlackboard->GetBlackboardAsset()->GetKey(OtherKeyID);
check(Key.EntryName == OtherKey->EntryName);
check(Key.KeyType == OtherKey->KeyType);

                    const uint16 DataOffset = Key.KeyType->IsInstanced() ? sizeof(FBlackboardInstancedKeyMemory) : 0;
                    const int32 KeyID = BlackboardAsset->GetKeyID(Key.EntryName);
                    uint8* RawData = GetKeyRawData(KeyID) + DataOffset;
                    uint8* RawSource = OtherBlackboard->GetKeyRawData(OtherKeyID) + DataOffset;

                    UBlackboardKeyType* KeyOb = Key.KeyType->IsInstanced() ? KeyInstances[KeyID] : Key.KeyType;
                    const UBlackboardKeyType* SourceKeyOb = Key.KeyType->IsInstanced() ? OtherBlackboard->KeyInstances[OtherKeyID] : Key.KeyType;

                    KeyOb->CopyValues(*this, RawData, SourceKeyOb, RawSource);
                }
            }`
#

perhaps you can make manually an array of AI controllers and check at certain triggers how they exchange information with each other

#

Because sometimes it's just a matter of the order they update their internal state

wild mortar
#

Thanks so much for the insight @lyric flint . I'm setting up some test on a separate project and I will try your suggestion

#

I think I found the problem. It seems that Blackboard are instanced per Behavior Tree, and since my two enemy uses different behavior tree, the blackboard was not synced properly.

#

In my empty project, I have a setup where there are 2 AI character. The first has the parent AIC while the second uses a child AIC

#

The BP of the first is the base while the BP of the second is a child BP

#

only when I change the BT when I spawn the AI using SpawnAIFromClass will there is a new instance of the BB

#

Further experiment suggest that the BT itself is not the case

#

but the actual Blackboard

#

I must use the same blackboard, not child blackboard

#

i.e, blackboard that inherit from another blackboard is not the same instance as its parent

fallen wedge
#

While trying to optimise the cpu usage I found that my NPCs take 15ms per frame, especially this "charmovecomp" thing.
Any idea how I an disable this as long as the NPCs are irrelevant (far away)?
Disabling the movement component has no effect

https://i.imgur.com/7HBRUt9.png

patent hornet
#

that handles a lot of things, including checking for overlaps

#

which is probably your issue

serene pelican
#

This function is never reached, although the AI snaps to one of the points

#

no messages or something

floral bobcat
#

Ahà, i have to fix this on my game as well. I think the navigation link only tells the ai that he can go there but not how. I have the jump animation when the ai is in the air and sometimes it manages to do it. I might look up how to do it properly later.

little bridge
#

does anyone know a good tutorial series for learning AI?

#

for complete beginners?

lyric flint
#

@little bridge It depends what you want to do. That is what you want your AI to do

#

there are some choices ranging from finite state machines, behavior trees, environment query systems, machine learning

#

for example if you made the card game, finite state machines would be your way to go. I reversed engineered Gwent, the original card minigame from Witcher 3 a while back, and It uses finite state machines

#

if anyone wants to see and learn from their implementation, let me know

#

now moving forward, behavior trees

#

C++ or blueprint?

#

YouTube also have some EQS Tutorials

#

And I think I've seen a plug-in on marketplace For a machine learning agent

#

but the most common approach is behavior trees. You can start with the tutorials from Mathew Wadstein

#

And then get confused between the intricacies of decorators services and tasks 😛

little bridge
#

thank you 😃

lyric flint
#

@little bridge no problem 🙂

pine steeple
#

@serene pelican did you get the navlinks working

#

i have used them alot so pretty versed with them

tardy carbon
#

What replaced UNavigationSystem::SimpleToMove() in 4.20+

lyric flint
#

@tardy carbon Maybe UNavigationSystemV1:: ?

tardy carbon
#

I looked around there I will double check

#

when header in api doc says this Runtime/NavigationSystem/Public/NavigationSystem.h

#

its Eng.ijne/?

tardy carbon
#

I did it all is good

ripe whale
#

Has anybody here worked with custom BTService nodes written in C++? Not blueprints?

#

I'm having a really weird problem where the tick rate that I specify on the nodes is not being respected

#

it seems that my service nodes are ticking at the frame rate or something similar

#

even though they are set to only tick once every .5 seconds

#

in c++ and my ArgoCheck.cpp service is ticking way too much

lyric flint
#

YourPath\Epic Games\UE_4.xx\Engine\Source\Developer\AITestSuite\Private\Tests\

#

@ripe whale

#

I learned some stuff from those tests 😃

ripe whale
#

alright cool I will check them out, you think my answer is in there somewhere?

lyric flint
#

Those are behavior trees implementation without any blueprints, everything C++ low-level backend or other similar fancy words 😃

#

I just hope they should give you some sort of hint @ripe whale

ripe whale
#

Alright cool I will take a look thanks

ripe whale
#

I figured out my problem... I forgot to call Super::TickNode in my BTService derived classes lol!

#

At least it only took me an hour to figure out

sterile solstice
#

Hey. I'm looking for tips for a good pawn architecture, meaning character/AI controlled possibly.
Where would I update the blackboard values ? AIController right ?
Should I access actors of the scene like with GetPlayerPawn in a BT node ( Service, decorator etc ) ? Or do I set a blackboard value with it ?

serene pelican
#

@pine steeple No, Haven't make it work yet

elfin socket
#

@sterile solstice Yeah you want all AI stuff done through the AIC because in multiplayer it will only happen on the server, which means less work for each client to do and that there won't be any strange local AI behavior.

sterile escarp
#

Hey guys I'm a bit stuck. I'm currently making an RTS game but I'm stuck getting the AI to work the way I want them to. They are not going to do much. The player sends them to a marked location. If there is an enemy in sight, they shoot and if there are no enemies in sight and the the AI is close to the enemy base, shoot at that. My problem is that once the AI kills its target, its just standing there without continuing to attack other enemies if nearby. Is there any good tutorials or resources to create something like this?

pine steeple
#

well if they get stuck and wont find a new target the BT is probably stuck in a task

#

have you ran the game and watched the BT to find out WHY they are stuck?

sterile escarp
#

Yes, the AI does not receive a new target when the current one is destroyed. I am adding all "updated Actors" from the AI Perception component to an array and if the current target ==null get the next valid entry in the list. Its just not working :/

pine steeple
#

you should have a service which checks to see if the current Attack Target key is a valid actor, if its not, remove it from the perception array of actors and request a new one

#

and the units attack the same target? if so i would have a kind of Manager to keep track of the current target for that unit

sterile escarp
#

The AI have different arrays of targets and attacks what's closest

#

I'll run through my code again and see if there is something I'm missing

pine steeple
#

yeah but if the attack target is not getting changed in the Blackboard, then the BT won't know what to do

#

my bt aborts its current stuff if the Attack Target changes

sterile escarp
#

Ok, I'll try that then 😃

#

I'm not aborting it now

pine steeple
#

kinda like that

sterile escarp
#

Ah I see

#

I'll try that, thanks 😃

floral bobcat
#

@elfin socket wait, behaviour trees are played on the client as well?

elfin socket
#

@floral bobcat Only if the code to run the behavior tree happens on the client. If you do it from the AIC then it will only ever happen on the server

floral bobcat
#

Mh, do you mind clarifying it for me? Where is a BT Service run? I've assumed it was run in something like a BT blueprint and run on the server.

#

(BT = behaviour tree)

sterile solstice
#

Well if you setup the BT in the Character, it will happen in every client

#

The AIController is only present in the server

latent crane
#

Hi. Just getting started with UE4's Behavior trees, trying to decide if they're just too open-ended for our designers or not.

One thing I noticed was the Run Behavior nodes, and I started wondering if I could just let the designers deal with a high-level tree, while a programmer implements lower-level trees that deal with all the nitty gritty details of casting rays, etc.

So I was wondering how can you pass data between trees running as part of Run Behavior and the one calling the Run Behavior node? Blackboards look like they're used for storing data within a tree, but can you have multiple blackboards that are shared between multiple trees?

#

Or just in general, how do you get parameters to sub-trees run via Run Behavior and results back?

lyric flint
#

@latent crane Instance Synced enabled, maybe?

#

@latent crane A C++ programmer in your team can take a look at the tests from the source code C:\Program Files\Epic Games\UE_4.xx\Engine\Source\Developer\AITestSuite\Private\Tests\

grim citrus
#

Hello
I have found some strange behavior.
The navmesh on these spiral stairs only works correctly if it is places on or very close to the edge of a Tile. Any clue on how to solve this?
https://puu.sh/BQieR/cc1bcb822b.png

#

The navmesh can be solved by reducing Cell Size, but then the navigation of the AI breaks

latent crane
#

@lyric flint So that basically changes the variable from a normal instance variable to like a static/class variable, right?

lyric flint
#

@latent crane Check void UBlackboardComponent::PopulateSynchronizedKeys() in d:\Program Files\Epic Games\UE_4.20\Engine\Source\Runtime\AIModule\Private\BehaviorTree\BlackboardComponent.cpp As an example of what happens when you sync the instances under the hood.

latent crane
#

Thanks!

ripe whale
#

Has anybody used UCrowdFollowingComponent?

#

Or does anybody know of any good tutorials on UCrowdFollowingComponent and/or UCrowdManager?

patent hornet
#

as long as you use just one agent, and don't need anything too fancy

#

it works out of the box

ripe whale
#

By one agent you mean one AIController with UCrowdFollowingComponent? That's fine but I will want to use multiple instances

#

That's the whole point of it right?

patent hornet
#

by one agent i mean one supported nav agent

#

as in, single RecastNavMesh per NavMeshBounds volume

cursive vector
#

anyone know how ue4 stores navmeshes when you use world composition? is it one navmesh for the persistent level, or does each sublevel store its own? kinda seems like its the former.

pallid mica
#

Iirc one NavMesh

#

On the PersistentLevel

#

Or at least navmeshes only in PersistentLevel

#

I put them in sublevels and that didn't end well :D @cursive vector

cursive vector
#

hm, there are navmeshboundsvolumes and then therest the recastnavmesh actor. it seems the latter is automatically put into the persistent level. not sure if that means there's only one navmesh and its stored in the persistent level. when you say you put them in the sublevels, do you mean the boundsvolumes, or the recastnavmesh?

cursive vector
stuck oar
#

A similar nav gen bug was fixed, but haven't seen that one I think.

#

but if you're getting this bug which looks like they don't do an null check on the index, you could fix it yourself. The other issue I had was the mesh associated nav data, say some mesh affecting navigation, it would get cleaned up and the nav gen would crash. The fix ended up them replacing it with a weakptr.

cursive vector
#

i could fix it in that place, but im worried that the data is in a bad state and it will still cause issues elsewhere. though i will probably just try that... B)

dreamy surge
#

My ai is really dumb, what's the best ai scripts on the market place?

#

Anyone recommend anything?

pine steeple
#

what do you mean your ai is dumb?

#

my AI is very smart and i used no external market place stuff

dreamy surge
#

Well my ai can't jump to dodge bullets, my ai can't walk on walls or ceilings and my ai can't use or jump over obstacles. My ai can't jump over open spaces, my ai can't take cover or throw granades my ai can't walk through doors that have physics that I can walk through

#

Can you ai do any of the things I mentioned?

lyric flint
#

@dreamy surge Hi, I don't know your exact approach to AI, but let's try an Aristotelian approach: Potentiality and actuality. Out-of-the-box the potentiality of the unreal AI is robust but it's actuality is minimal to none

#

meaning you need to tell it what you expect of it, and how

#

a common ways to use behavior trees

#

behavior trees extend and improve the AI actuality

#

For example, your AI needs hearing perception, So when a grenade actor enters its hearing, It should have a task in its behavior tree telling it to Dodge

#

and so on

#

the same thing for grenade and visual perception

#

this way you're potentially smart AI becomes actually smart AI 😃

pine steeple
#

@dreamy surge sure if i program them to do that.

#

programming is about making things work how you want, relying on third party stuff all the time is not good. and you will never learn

#

My ai jumps over barricades and leaps on buildings, it jumps gaps between land

#

it gets taunted by flares which make it run to the flare to investigate

#

so yeah ai can be as smart as you need it to be

#

just need to put the work in

#

i have spent 3 months working on purely AI, its not a quick and easy task and there is no simple "drag and drop" to make things work

polar hound
#

Hey you guys! I am new to Ai but we made a blackboard and got all that working, I was wondering say if you have multiple ai that can move towards the player, how do you stop them from all moving to the player once one has seen the player?

pine steeple
#

have the first AI who spotted the player notify all other AI that he has the target

stuck oar
#

like what kaos said, you create a state which is used to delegate periods when each unit can attack. so in your blackboard, have a boolean like, IsAttackingPlayer, and make this a synced variable, so all AI with that BB see the variable. When one AI is ready to attack, it check if the IsAttackingPlayer is false, if so, set to True, then have the AI attack. Other AI that try to attack before its finished, see IsAttackPlayer is true, thus do something else like wait or grunt. Original AI is done attacking, now another AI checks if IsAttackingPlayer is false, then.... @polar hound

polar hound
#

Sweet thanks you guys!

floral vector
#

Why the flow stops if I put the top selector as a parent of the others? If I connect the Root to the lower selectors they work but I need the parent on top.

patent hornet
#

all your decorators are failing

floral vector
#

Ahh...ok 😃 Thanks @patent hornet

stark zealot
#

How can I make my AI zombie run towards the closest player in the game without having to constantly get an array of all actors and calculate distance between them? Right now it works but it is so laggy because all my zombies are contantly doing that. What is a more efficient way?

patent hornet
#

cache the players

#

never use get all actors

#

there is always a better way

#

compare distances squared instead of distances

#

calculating square root is expensive by comparison

stark zealot
#

Ok. I'm going to have to research how to cache the players. I have no clue how to do that

dusky lodge
#

Why dont you use a volume?

#

Set the volume to the "agro" radius, then you only have to keep track of anyone that is inside that volume

#

Ohh i see, you want the Zombies to always know where the player is.

#

Ignore me then lol

patent hornet
#

common approaches include having the players register somewhere

#

on BeginPlay

stark zealot
#

Yea basically like Call of duty zombies. Round based mindless killing lol

patent hornet
#

most people will use a AIManager of some sort, but GameState is fine for now

#

you can also populate the list of players via GameMode by iterating over PlayerControllers or PlayerCharacters

#

you can do GetAllActors once, then save the array somewhere accessible

dusky lodge
#

AIControllers only exist for the server so it would make sense to have an Manager that exists on the Server which when Players are spawned will cache a ref to their Pawn for the AIControllers to access.

patent hornet
#

there is literally a hundred ways to get this done

stark zealot
#

Ok so i can make one array of all players and just update it if they die or leave. But what about calculating the distance between the zombie and the player? That's what is lagging it up. How do you get those distances without using up so much?

patent hornet
#

compared to getallactors?

#

no, its not

#

GetAllActorsOfClass is one of the most expensive functions you can call

stark zealot
#

Ah. So getting rid of it will fix it all and I can still use the calculations. Gotcha 😉

patent hornet
#

it literally iterates over everything in the world

stark zealot
#

Dang. Then why does every stupid video and tutorial use that crap?

patent hornet
#

compare distances SQUARED if you want to make the distance calc cheaper

#

distsquared = (x1-x2)^2 + (y1-y2)^2 + (z1-z2)^2

#

dist = sqrt(distsquared)

#

first is dirt cheap, second is not

stark zealot
#

Ah! ok I see now. Thanks man! Learn something new every day. 😃 Also is that the Dragonheart dragon from the PS1 game for your profile pic? Pretty nice! 😉

patent hornet
#

i think this one is older

dusky lodge
#

GetAllActorsOfClass is not as expensive as you might think. The UObject system stores Actors in HashTables which is what GetAllActorsOfClass uses to find those types.

#

At most the BP version GetAllActorsOfClass would probably be close if not O(N)

#

C++ ActorIterator would probably be O(1)

patent hornet
#

that depends on how large the world is

dusky lodge
#

It depends on alot of things yes.

patent hornet
#

it is also sloppy in a way that promotes bad coding

#

much like the UGameplayStatics functions for grabbing Players, Controllers and such

dusky lodge
#

Why do you consider it sloppy?

patent hornet
#

its never an optimal approach

dusky lodge
#

Id agree that there is more optimal approaches.

patent hornet
#

but it is just there, too easy to just do

stark zealot
#

all i know is the dude on the UE4 live stream says never to use it. IDK i'm new to this whole thing

patent hornet
#

so it gets alot of people stuck on it being the "proper way of doing things"

dusky lodge
#

But considering it may just be searching for a single Actor, like a Manager Actor that you didnt or couldnt cache, then its perfectly fine.

patent hornet
#

i mean, i will occasionally use a TActorIterator to cache something

#

which is fine

dusky lodge
#

@stark zealot The main reason why someone would say not to use something, is probably because you wouldnt realise the implications of its usage.

patent hornet
#

i will also admit to using GetAllActorsOfClass, but never in runtime 😄

dusky lodge
#

We are getting a little offtopic here though 😃

pine steeple
#

@stark zealot i actually made a CoD zombies style game

#

with mystery box and everything

#

and wall buys/perks

#

and the AI is super simple

#

just wish the CMC wasn't so heavy :/

stark zealot
#

@pine steeple Hey man! I remember you said something about that. Nice! I finished up the weapon system and am trying to get the Ai more optimized.

pine steeple
#

cool

#

i made really smart logic with Wave spawning aswell

#

it takes the amount of people in game, the round number, does some math and returns the amount of zombies per round plus a health increase

stark zealot
#

That's what I'm working on as well. Did you do that in Gamemode? or GameState?

pine steeple
#

custom RoundManager

stark zealot
#

Gotcha

pine steeple
#

just a UObject that gets spawned in GameManager and can be accessed from it

#

i like to seperate logic where possible

#

GameMode*

#

i like to keep GameMode clutter down

torn karma
#

Hey guys, I'm making a paper2D game. Was running around testing some functions when I noticed my AI had broken over at some point over the last day.

The only things I've changed in my game were mostly expanding the tilemap and adding background objects. Never touched AI.

Nav mesh is fine.
Ran a check on all AI components to check for collision hits / overlaps and nothing came up.

I'm using a Move to Location and Move to Actor.

Any ideas?

severe badger
#

After the update to 4.20 my AI start getting Jittering on the client side, it is a really annoying issue, anyone would know why this is happening? A have seen a lot of o people having a similar issue but I have not seen a solution yet. Any help would be appreciated! Thanks!

Seems like the AI rorate very fast and create a crazy motion blur effect

Here is a image of the issue:

wild mortar
#

I think the Move To node was changed somehow in 420

#

Are you putting break point in your BT?

#

and what behavior is it being stuck at?

#

@severe badger

ripe whale
#

There were changes to the navigation system in 4.20

#

New: Most Navigation System-related code has been moved out of the Engine code and into a new Navigation System Module. Game-specific code using navigation system functionality might need to be updated.

#

Doesn't mention anything about Move To specifically though

ripe whale
#

Can somebody help me understand how UPathFollowingComponent works together with UNavMovementComponent to actually move an AI character?

#

Like I am assuming that moving an AI pawn would consist of the following steps:

  1. The behavior tree executes a task that calls UPathFollowingComponent's RequestMove function
  2. RequestMove calls into the UNavMovementComponent to actually move the character? I see that there are two functions on UNavMovementComponent, RequestPathMove and RequestDirectMove
#

Does the UPathFollowingComponent call one of those functions to actually move the AI controller character?

#

As far as I can tell the only thing UPathFollowingComponent does is take a MoveRequest object and then call RequestPathMove and RequestDirectMove on the UNavMovementComponent

#

is that understanding correct?

cursive vector
#

dont quite remember, but doesnt RVO avoidance live in the pathfollowingcomponent?

stuck oar
#

RVO is movement component

#

The Path Following Movement calls Request Path/Direct Move on the Character Movement Component and Path Following Component tracks the path goal.

ripe whale
#

What’s RVO??

severe badger
#

@wild mortar Hi Jeff, Thanks for the feedback, I actually fix the issue, I just used another Animation BP to test and worked great, so It seems like something on that specific bp was broken. Thanks for the tips! 😃

stuck oar
#

@ripe whale I was answering Dividual. It avoidance behavior for the movement component.

hearty rock
#

any good resources on "idiomatic" behavior tree design? currently working my way through chapters @ http://www.gameaipro.com/ , but maybe there are some good non-beginner UE4 samples out there too..

patent hornet
#

try checking pinned messages on this channel

#

gameaipro is not really light reading

hearty rock
#

👍 thanks, I'm not a big video tutorial fan but the pinned one looks pretty decent

ripe whale
#

I don't know why video tutorials are so popular, I really dislike them because it is so hard to find specific pieces of information since they are completely unsearchable. Also I can read a lot faster than I can listen to somebody talk

hearty rock
#

yes, but I'm going through it selectively.. only choosing chapters that seem relevant

#

in my experience packt publishing books don't seem much better than most video tutorials

stuck oar
#

@ripe whale Game AI Pro is great, I can highly recommend it. I was rushed when writing Unreal Engine 4 AI Programming Essentials, and also didn't grasp the complete concept of teaching as well as I do now. So while you can still likely learn something from it, it's a bit rough. So I apologize for that. I can't really work with publishers, they all rush you to make something because they're worried about the market and not the content typically. Most fail to realize good content can last a very long time.

hearty rock
#

\o/ writing is hard, I appreciate your effort regardless of anything I say @stuck oar

stuck oar
#

ty

#

@ripe whale is your dislike for video tutorials is because people don't get to the point quick enough?

hearty rock
#

my dislike is that a lot of them need serious editing to get to the point. put some slides and diagrams in my face occasionally so I can skip through a video and see relevant information and maybe watch a segment once I find it

patent hornet
#

mine is because they are just sloppy

#

in order to get through to as wide an... audience as possible they frequently disregard good programming practices

ripe whale
#

@stuck oar After I wrote that I was actually thinking I need to give that book another shot, I didn't read enough of it to actually give it a proper review. It just didn't feel in depth enough, but maybe that comes later

#

I dislike video tutorials because there is always a lot of stuff I have to sit through that I am not interested in and there is no easy way to skip ahead or read quickly

#

And also searching, if I have a book I can easily bookmark interesting or relevant parts

patent hornet
#

and 80% of them start with an hour's worth of slapping together a really basic UI

ripe whale
#

and go to the index if I need specific information

stuck oar
#

Hey no worries, you guys are not offending me at all by what you say. I accept the criticism and want to improve.

patent hornet
#

i never looked at AI Programming Essentials, but i saw a few Packt books

#

categorized them as pretty shallow

stuck oar
#

I didn't know this before I started working with them but I guess that how it works for most people

#

Most people when talking about publishers, consider Packt to be pretty low on the bar.

hearty rock
#

videos really excel when they combine spatial information with audio.. so mousing around a diagram or interface in addition to explaining the next step or whatever

stuck oar
#

also all your reasons about tutorials is completely accurate

#

It's something I am looking at personally, because I realized this too

#

right

flint trail
#

what's going on here?! 😉

ripe whale
#

We are talking about books versus tutorial videos and the pros and cons of each

flint trail
#

I see

#

well, one thing for sure - not enough of either on the subject of AI in UE4

#

alot of stuff either outdated or bad practices or not covering what needs to be covered

stuck oar
#

@hearty rock what you're saying is video embedded into written tutorials. so you read some text, see an image with some subtext, then more text saying lets do whatever in this image, and then have a video which explains whatever information in the specific context

#

in a way, sort of how UE4's styles their docs

hearty rock
#

I actually prefer just a straight up video on youtube with occasional cuts to slides. video inside text gets doubly confusing for me 😛

#

but short clips (<1 min) inside an article to illustrate are good 👍

#

Two common cases when I'm actively seeking tutorials:

  1. I know the "beginner" part and want to skip ahead in the video... but how far until I get to something relevant? A slide provides a good marker when seeking in a youtube video
  2. I want to refer someone to a particular segment rather than "somewhere in this video..."
#

I rarely rarely rarely sit through the whole video or even article unless it's absolutely my first exposure to a concept

stuck oar
#

Okay, how do you feel about uDemy courses when it comes to those two cases?

hearty rock
#

only ever use them for the third case of "starting learning from 0", I would never consider them for the first 2

#

WELL. case 1 applies for Udemy courses, but in that case I usually skip entire introductory videos rather than within them

stuck oar
#

I don't know if you've tried some of the more popular UE4 courses on there now. But do you feel that having the courses broken up like that makes it easier to digest? Or do you feel like the chunks are still too big or the overall course is just not concise enough?

hearty rock
#

I went through Ben Tristem's course, IIRC each video was between 10 and 20 minutes long? That was a good format for sit down and follow along. The biggest benefit of chunking I noticed was it forced the videos to have descriptive titles and laser focus on a particular task

#

I do feel like I could refer someone to a specific section of that course if they had a question

stuck oar
#

So if you had to choose between written, YouTube, or uDemy course that is chunked up, to learn from, what would it be?

hearty rock
#

(but that relies on the person having access :\ )

stuck oar
#

not in every case but just your default

hearty rock
#

tough question! if I wanted to pick up a new skill I'd default to Udemy

#

there's nothing stopping Youtube tutorials from emulating the format though, but I notice a lot of them... don't.

stuck oar
#

true

hearty rock
#

caveat: this is my default for learning specific software, but if I want to learn theory I'll default to text w/ pretty pictures

stuck oar
#

exactly the way I feel

#

alright I don't want to bombard this channel with too much sort of off topic chat, but thanks for the feedback. I really appreciate it.

hearty rock
#

no problem, are you making this sort of content? 😄

ocean crystal
#

wouldn't surprise me if he was :P

stuck oar
#

😎

flint trail
#

I prefer video tutorials that contain diagrams and schematics, aside from anything else

stuck oar
#

yeah I appreciate some good visuals too

flint trail
#

also, if anyone is set out to make a book, make it digital so you can update it and correct it

#

(in addition to printed edition)

stuck oar
#

There is this one book on game programming patterns I always skim through from time to time that is web based

#

love it

flint trail
#

I like paper, but I have always been puzzled why not to have a PDF of the book and update it / correct it as time passes by. I purchased a few UE4 books that became useless a few released down the road.

#

Also worth noting that there are no tutorials about making proper anim BP for AI. AI and anims go hand in hand and yet that part of AI is always omitted in the tutorials.

stuck oar
#

True, the process for book formats can be improved. I am sure if you just did a self hosted pdf like you said, or maybe amazon and only do the web / kindle format so you can update it instantly maybe. I haven't really looked that far into that.

#

And yeah, there is a whole lot on AI & AnimBPs, and I agree, they are basically married.

#

What I've done in the past is created a common AIAnimInstance for AI, and this would be updated by the Behavior Tree. Then each AI Skeletal Mesh would use an AnmBP which derived from the common AnimInstance.

#

Definitely made things easier in terms of replication and general animate state communication.

pine steeple
#

animgraphs are a whole different ball game

#

a good anim graph is quite complex

patent hornet
#

and agnostic of the controller

woven lion
#

Hello Guys, I'm trying to get my ai character current acceleration but always return 0, but i can see acceleration works by increase or decrease MaxAcceleration in movement component and logging speed... any idea why i can't see current acceleration ?

pine steeple
#

there is a check box somewhere

#

to enable it

dusky lodge
#

Is it just me or do Behavior Tree Decorators not take Enum Parameters directly?

#

Is this intended?

#

I cant pass a Enum Literal as a parameter into a decorator

#

It doesnt appear on the Decorator Property List on the node.

#

It also seems to affect the operation of the node.

patent hornet
#

@dusky lodge you want something like that?

dusky lodge
#

Well that would work yes, but im more asking why cant a Decorator take an Enum Literal as a parameter?

#

Is it by design or more of a bug?

patent hornet
#

don't know, can't say i ever tried an enum that wasn't in the BB

#

it does take floats just fine tho

#

might have to do something with AIModule not having any idea about the enum types in your game module

dusky lodge
#

Yeah its not a huge issue, i just noticed that it wasnt a thing.

ocean crystal
#

that doesn't seem right

#

how are you defining the input?

dusky lodge
#

Its simply an exposed enum property

woven lion
#

@pine steeple Thanks I found it

flint trail
#

Do you happen to know why AI's tree is still running after I got AI Controller, got brain of it and stopped logic ? (and also disabled tick on the actor)

flint trail
#

anyone ?

pine steeple
#

something else re-enablingit?

flint trail
#

highly unlikely - it's a self-contained AI character

#

and once tick is disabled, nothing should work

pine steeple
#

tick wont disable the bt tho

#

stop logic would but why it aint stopping is weird

#

i use it all the time never had issues

flint trail
#

hmm

#

Does it make any difference whether I do it in the character or in the controller ?

pine steeple
#

no

#

aslong as you are getting brain from the controller

flint trail
#

it could be a bug in 4.20 - actor isn't even ticking and yet BT is still running.. I couldn't find a way to make it stop running

desert cipher
#

This is a very basic guard AI I've created that follows the player and attacks the enemies of the player for a short time. The issue I've noticed with it, is that for some reason, sometimes when they are following the player and do not have an enemy they'll randomly shoot. It's very clear that they don't have an enemy tag set, because their pose is different, if they have an enemy their rifle is raised and aiming, and if it isn't, they shouldn't have an enemy. I've verified this with a service on the enemy is set side that polls their target. All the various enemy classes have an AI controller, so that service checks if their target has a controller, and if it doesn't , it unsets the enemy tag. This makes sure they don't keep shooting at an enemy that is dead.

#

All enemies will unpossess on health hitting 0.

#

The service itself has a print statement attached to print if their enemy has an AI controller, and I feel like neither of those shoot sequences can be called if that doesn't print true, when they do that random shooting, there is no print statement from that service.

#

<@&213101288538374145> is there some reason none of my images are uploading properly?

dusky lodge
#

They have probably been blocked by Discord

desert cipher
#

I'm not getting that message though

#

about "explicit images"

#

like I have in the past

#

they're just showing up as a poop icon preview

dusky lodge
#

Mmm

desert cipher
#

if you click the image and click "original" you can see them opened in the web browser.

#

That image I just copied from blueprint that someone posted there.

dusky lodge
#

Its happening on other Servers

desert cipher
#

Yes I just checked too

#

must be discord having an issue

dusky lodge
#

Id say theres a Discord issue

desert cipher
#

thanks

flint trail
high solstice
#

First time trying ai, why doesn't it move?

#

if i look at the behavior tree it just flashes

patent hornet
#

because 0,0,0 is unreachable?

#

you're trying to move to PlayerController

#

and unless you actually attached it to the Player, its just sitting at ZeroVector

vast jackal
covert nacelle
#

guys, anyone else is having problems with navmesh in 4.20?

night relic
#

@covert nacelle me

#

I've been trying to make it work the whole day 😔

covert nacelle
#

what kind of problems?

night relic
#

my pawn isn't moving

#

Those 2 navigation testing actors not connecting each other means the mesh doesn't work right?

covert nacelle
#

yeah

#

they should connect

night relic
#

what could be the problem?

covert nacelle
#

the problem we're experiencing is that there's something off with the supported nav agents

#

did you move your project to a previous version to 4.20?

night relic
#

No, I just created it on 4.20

covert nacelle
#

hmm

lyric flint
#

How would I setup an AI which is like RTS style unit movement.

#

I want the unit to be able to move, but also be able to follow the mouse as I right click.

#

However, I also want to be able to split up units.

kindred nest
#

anybody know why there's jitter when using AI MoveTo in blueprints?

#

i read on the forums something about their velocity being set to 0 when updating to a new location or something, but i can't seem to find a solution that works with BP

pine steeple
#

@kindred nest i solved that by making the ai move towards a goal target with goal tracking enabled

kindred nest
#

how do you do that?

lyric flint
#

Is it possible to restart move to location without calling restart tree?

#

Every time I update the BB key with SetValueAsVector()

#

It does not start moving to that new location unless I call RestartTree()

flint trail
#

Do AI without BT

#

All in BP

pine steeple
#

why @flint trail ?

#

Behaviour trees are awesome

flint trail
#

no reason 😛

flint trail
#

(I use BTs)

ripe whale
#

This is a bit of a long shot but has anybody worked with the Boy and His Kite sample project? Specially the AI for the flocks of animals?

#

I am trying to adapt it to work for my game and it is proving pretty difficult to get the behavior that I want

signal wing
red elm
#

hey folks! where is the best place to manage ai features such as health attacking etc, should i use the character class or controller class ?

pine steeple
#

@red elm What gets damaged? what attacks?

#

its not the controller..

red elm
#

@pine steeple lol thanks

high solstice
#

I want my enemies to be able to find cover behind meshes i placed in the landscape, is this possible?

pine steeple
#

@high solstice sure, i would mark meshes as Coverable or better yet use some kind of nav modifier on areas where they can cover and allow them to move into them areas when taking cover

#

lots of approaches to it

high solstice
#

i just wrote some code that scanns the area for meshes that are cover

#

i couldn 't really place nav meshes for every tree since there are around 3k

pine steeple
#

i would use EQS for that

#

find all tree actors, do a DOT to make sure he is behind the tree away from the player

flint trail
#

and I agree with Tom - it feels like there is no AI work being done in UE4 since like long time ago..

pine steeple
#

#gameplay-ai is dead and Unreal's AI system is kinda dead, apart from the new navigation system

hearty rock
#

There was a decent set of utility nodes for behavior trees I saw a while back on the forums... Wonder if they still work

flint trail
#

@pine steeple any idea why? Doesn't make sense to add new navigation system and keep the rest without any updates / improvements

pine steeple
#

no, but maybe its just not high enough on there priority list and the stuff they have is perfectly good enough for base AI

flint trail
#

perhaps

hearty rock
#

improved any system is a big scope 😃 best to do it as piece by piece as possible

near jetty
#

@flint trail the Heavy Gear Assault bot AI was a hybrid beetween behavior trees and that utility

#

so it was a BT, but it could add/remove tasks and it scored them

#

the highest scoring branch is the one that executes

#

was awesome

#

specially becouse you could dynamically alter the scores depending on random stuff

#

so if i give an order to a bot to attack someone, the "attack that someone" goal gets a x10 to its score

#

and it faded over time

flint trail
#

is training course about that coming to Udemy ? @near jetty

near jetty
#

no XD

#

there is a book that talks about it

#

they use it to make a quake bot

#

well, a "2d quake" bot

flint trail
#

then I don't care 😛 kappa

near jetty
#

btw, utility AI will be BEYOND slow in blueprints

flint trail
#

😦

near jetty
#

becouse you are "ticking" so many things to check scores

#

and thats pure math.. bad in blueprints

#

my HGA bots maybe had 40-50 tickers

#

of course i only executed the think like once a second

#

but still

flint trail
#

maybe Tom can make Utility AI plugin for the Marketplace and the Udemy course could use that to make sure performance is high

near jetty
#

btw, there is a even cooler thing deep in the engine source code

#

a Planner system

#

think of it like pathfinding, but for AI logic

flint trail
#

yeah, it's been there for a while and has never been worked on after that

near jetty
#

"whats the best way to reach my goal"

#

yup

#

that one

#

Planner AI is top tier for a turn based game, for example

#

they work so well in them

#

you try to find "whats the maximum harm i can cause in this turn"

#

for a real time game.. im not that sure about them

#

you could try to find the best "score" for what to do during the next second, but then you are trying to predict stuff and can be weird

flint trail
#

I am not sure if that's actual scoring plugin or something else

high solstice
#

reducing the cell height seemed to reduce the size of the tears but doesnt fix that the ai was getting stuck

lyric flint
#

Im having a stuck issue myself.
I have a door that opens and closes via a time line when the player interacts with it.
The AI is definently able to get through it; at least I thought. The size is definently small enough, but the ai gets stuck anyway

#

It passes through the space maybe once, but cant get back out at all.
Ive tried a link proxy, that never changed much.
Ive tried setting the collision of the door itself off when it opens (cuz the door seems to be the problem I think) but that would mean I wont be able to interact with it again to close it. And that'd be no fun.
Ive tried adjusting the door frame/the door's size but that doesnt help either.

#

And keep in mind the AI is a cylinder (its not a placeholder. Seriously, its a cylinder)
And that SHOULD fit absolutely fine

lyric flint
#

Anyone wanna try to think of ways to fix it?

lyric flint
#

K guess I gotta figure it out on my own.

ebon ore
#

Hey guys! Is there a way to manually restart a behavior tree service?

I have a targeting service (which should find a target for AI) and if target should be changed in the end of BT, my AI is stops at the time of the Service interval.
I don't want to reduce the interval, but just manually restart the service to find a new target.

ebon ore
#

Anyone? 😦

bold urchin
#

Hi guys!
I am trying to create a cover system for my AI using EQS. There are going to be multiple enemies in the game so I am using EQ Context to get all the relevant players. In the EQS I have two simple tests. One is a trace test to the context and the other one is to check the distance to the item. The problem it isn't finding the proper points for the cover! It does finds valid points but misses some of them

#

Need help to figure out what's the problem in the query system!

lyric flint
#

I seriously dont think anyone answers questions here.

#

Try asking in the blueprint channel....

cold mulch
#

have you turned on the nav mesh visualizer to see your nav mesh?

lyric flint
#

How do you do that again?

cold mulch
#

press P i think

lyric flint
#

What about during runtime

#

I know about the P one but that doesnt help me for why tf its not going through the gap.

#

It shows it can go through

cold mulch
#

i don't think can visualize in runtime. but i was curious, if the navmesh is just a sliver through your door

lyric flint
#

Actually it kinda is.

#

But I dont need a fat door.

#

Or want.

#

And actually I KNOW there is a way to visualize it during runtime

#

Ive seen it in other people's stuff, but theres literally nothing on how to do it

#

I think its a console command or somthn.

#

But it'd be helpful. Especially if Im actually gonna add doors.

#

But it is a sliver I noticed

#

I mean that probably is the issue but I dont wanna size the AI to be smaller than me or make a fat door.

#

Plus if I can get through it so can they. They're the same size as me.

#

So what gives?

lyric flint
#

How can one solve something like this

#

Oh

#

That.

#

Hangon then..

#

Time to read this on the toilet.

cold mulch
#

in his answer he talks about just adjusting the project navigation settings. i was trying to find out if you could increase a nav area with a volume, but i think they can only block...

lyric flint
#

Nav Editor volume..

#

Ive seen that thing dozens of times.

#

Never used it.

cold mulch
#

i feel like the issue is the sliver of walkable space and the inaccuracy of the ai movement, so widening that walkable area in the door using smaller nav mesh cells or something else in the settings he mentions might help

lyric flint
#

Navmesh cells just curve it and make it pretty.

#

Just adds more time to the nav building.

#

Doesnt help worth crud for me

cold mulch
#

well, some posts are saying that AgentRadius setting in the nav settings determines the amount of padding from non-walkable areas. i've been changing it on my end with no change

lyric flint
#

So that also does nothing

#

Well fudge, you'd think by now there was a simple way to add more of a navigation to the volume

cold mulch
#

ya that would be ideal

lyric flint
#

HEY EPIC GAMES HOPE YA GOT THAT DOWN

#

Then again coding an engine takes supreme skill.

cold mulch
#

a hacky solution would be to make the door not affect navmesh and then add your own null volumes to block out the door frame

#

that seems pretty hobo tho

lyric flint
#

...wat

#

Yeah I dont even know what that is so thats out of the equation

#

Its not the door thats the issue

#

Its just the gap.

cold mulch
#

well the doors collision is what is determining what is walkable or not

lyric flint
#

But if you open the door it becomes walkable.

#

I can walk through it just fine but the AI's just cant,

#

And it has to be because that nav mesh is just so sensative, its just a sliver.

#

If I can fix that one issue then that'll be great. I can do everything else just fine, its just this one lil issue.

cold mulch
#

ya my hacky idea with the door was basically if you look at the collision on the mesh there is a "Can Ever Affect Navigation" checkbox. that will make it not affect navigation at all, then you can manually block the space with volumes so it's a larger walkable area. BUT.....i'm sure there's a better way, other people seem to solve it. I just wanted to make you aware of that setting

#

so you have the full palette of options at your disposal

#

I don't know much more about the nav system tho ,i touched it a while back but never had to deal with doors

lyric flint
#

Its not the door

#

Thats what Im tryna say

#

The door is completely fine

cold mulch
#

take a screenshot with your navmesh on

#

because if its not your door then i'm confused lol

lyric flint
#

sigh

#

Alright here in a bit. Im installing the new version atm

#

Which is taking absolutely forever.

bold urchin
#

Is there a way to check if an EQS item is near a static mesh?

#

Any test or something without having to write C++

patent hornet
#

point grid, sphere overlap for static mesh components for filter test, might turn out not too cheap

pliant flicker
#

@old ore he’s in the hospital. Hell contact me when he get out. I have to keep moving. Kid you being very unprofessional.... I regret speaking to you now. You do good work but who ever is coaching you on a business level is going to ruin you career. You chasing me around on forums but you want to be in the video game industry. You gotta chill....

pallid mica
pliant flicker
#

Thank you. Will do

pallid mica
#

Also move your private dispute to DM please.

idle willow
#

Hi there! I was advised to ask here. 3D artist learning UE here. Making my first functional PT.

I have a simple AI with a BT that only moves him to random location within a certain range. The player can shoot a projectile (Tranqulizer dart). The idea is that when this projectile hits the AI, he freezes immediately. I have gotten as far as to when the projectile hits, the bolean Sleeping is set to true, five second delay and then set sleeping to false.

Where do i stop the AI's movement to make this work?

#

Sorry for my noobness and thank you for any assistance. Have a great weekend!

cursive vector
#

@idle willow maybe show your BT. generally you would write the sleeping boolean into the BTs blackboard and react to changes via decorators in your BT. might have to cancel the current movement in the Abort of you movement task. there is some node called something like stop movement immediately, iirc.

idle willow
#

Yes, looks like i have to delve deeper into BT and Blackboard. Thanks so much for your reply!

cursive vector
#

@idle willow important to know that blackboard decorators can abort tasks (whether they do that is a setting on the decorator in the BT) and in tasks you can override an event called... something with Abort. 😉

flint trail
#

@stuck oar Do you happen to know how I can make AI controller turn/rotate (to target/coord) smoothly when moving and remaining in on spot (like a turret or when melee attacking target), and have character/mesh rotate in sync with it ? (this way I'd only have to worry about working w/ AI controller). All BP / BT, no C++.

flint trail
#

anyone ?

stuck oar
#

@flint trail there is a few approaches. the first most common is turning off rotation being inheritrd then apply it yourself. other option is to work within the systems in UE4. You can do this by modifying the character turn rate, stopping distance from goal, and some others im prob forgetting. The other 3rd option which is a like an extensions of the previous one. Check it out here https://www.unrealengine.com/en-US/blog/a-layered-approach-to-ai-locomotion-in-the-occupation

#

which is matching the animation with the movement of the char component

#

here is example of what you can do with defaults

#

if you want to turn in place, try playing root motion

#

otherwise you may have to update rotation yourself

flint trail
#

thanks, but how does it look like in BP and settings? 😃

kindred nest
#

hey there, does anyone have any feedback on this?

#

i'm trying to make it so the player can push furniture in front of doorways to slow down enemy AI, but it just cuts off the AI's navmesh

#

whereas the behavior i would like is, the ai walks up and detects the object and hits it to move it or eventually break it, but if the furniture is in the middle of the room they would have enough intelligence to walk around it.

#

is there some sort of weight system that's possible? like for example, if you have two entrances to a building and one entrance is blocked. the enemy spawns on the blocked side but the weight ends up being higher to walk around the building than to break through the furniture.

patent hornet
#

it is possible but tricky to setup just right

#

NavModifier components on your furniture

#

but your Ai also has to be able to recognize that there is a path, even if blocked

#

then it gets tricky, while your AI won't be able to path through the obstacles

#

you can request a Path using another NavFIlter class

#

then move the AI to last path point (when you path to obstacle location) with an offset towards the point before last (talking about a query that can path through obstacles, otherwise you will get a mess)

#

and if AI detects a destructible obstacle infront of it, it attacks

#

NavModifiers also have entry cost, and passing costs

#

and you can test/see what they are with a pair of NavigationTestingActors in editor

#

@kindred nest

kindred nest
#

i've never heard of the navmodifier component, i'll have to look that up real quick.

stark zealot
#

So this is just a curiosity type of question, not really something I'm capable of doing yet but how hard is it to make flying AI such as dragons, birds, etc.? Is there some sort of built in navigation or do you have to run traces all the time or what? Again just curious for future projects

kindred nest
#

@stark zealot based on personal research into the topic, it's a bunch of line traces or following paths. there's some fish ai and other types of flying ai examples and plugins out there

#

depends on how reactive you need them to be too

stark zealot
#

@kindred nest Ok thanks, I thought it was probably using line traces. I'll have to read more about it. I would thing a dragon would be hard to make. whereas a bird would probably be easy

kindred nest
#

it depends on what you need the dragon to do.

stark zealot
#

True

kindred nest
#

if it's just flying around in the background looking scary you can just make a sequence and set it to move along a path playing an animation

stark zealot
#

Yea but a Skyrim style dragon would probably be hard because it would have flying and ground states

#

Now i see why some indie games only have flying dragons lol

#

Why doesn't UE4 have some kind of built in navigation for flying?

kindred nest
#

mmm.. what people have told me before is that the tools are available to make your own systems. it's those systems that make your game. what ue4 provides is the tools.

#

i imagine it would be hard to accommodate every game mechanic

#

i'm sure you've seen this, but i was leaning towards giving that a try for fish AI

#

@patent hornet how does the NavModifier component work?

#

i tried making an example following in line to that, using blueprint

#

but it doesn't seem to be working. i've got the basic shape as the root of the actor BP

#

ah ha!

#

i had to turn off Can Ever Affect Navigation on the static mesh root

#

they're jittery as heck, but they push through

#

thanks a lot.

stark zealot
#

@kindred nest Thats cool! I haven't seen that. Also your right about UE4 being a tool to make your own stuff. Thanks for chatting with me. 😃

kindred nest
#

any time! good luck in your projects.

#

so uh.. does anyone know how to handle the jitter issue when AI repaths?

#

i think what's happening under the hood is that their velocity is getting set to 0 instantly.

fallow owl
#

Hm, my AI controller isn't running any events and therefore isn't running at all.

#

It's been set in a pawn's ai controller slot so I'm not sure what's wrong

#

Ah nevermind, apparently the way I spawned it was incorrect

bold urchin
#

How can I stop multiple NavAgents to stop rubbing against each other?

cursive vector
#

@bold urchin avoidance. there's to versions of that built into the engine, rvo and crowd

glossy abyss
#

@cursive vector do either of those actually affect NavAgents?

cursive vector
#

huh? isnt that their whole point? not sure what you mean

glossy abyss
#

NavAgents are parameters built for the navmesh generation

#

btw I'm not saying you're wrong, genuinely asking

cursive vector
#

i thought navagents were just the npcs that walk around on the navmesh.

glossy abyss
#

technically speaking, NavAgents are used to specify different parameters for building the navmesh... although @bold urchin may have been referring to AI controllers

#

AI controllers can be crowd detour controllers or use RVO