#gameplay-ai

1 messages ยท Page 160 of 1

lyric flint
#

I could do that. I'd really rather have the navmesh just update when the doors move since that's significantly less work on a level that is 100% in-doors

simple crest
#

hmm. you and i have opposite ideas of what is significantly less work ๐Ÿ˜„

#

though there could be good cases for dynamic navmesh usage instead... imagining a really "w i d e" door where you need characters to run across naturally such as diagonal

lyric flint
#

? I click a boolean on the doors problem solved. Alternatively I am placing down hundreds of nav link proxies

simple crest
#

cpu work is a thing too...

crimson galleon
#

navmesh update is relatively cheap, one way or another - doesn't seem like something thats done a lot, just on door opening, even then it could be set to lazily update every second and probably be fine. Funny enough, Death Stranding had to hand place a ton of nav link proxies over all cliff drops so the Ai could traverse down.

simple crest
#

i mean...

  • I would not personally ever call navmesh generation "relatively cheap". we might be agreeing that it's far from a death sentence, but it's not something you should just casually use. you could make it async so at least it won't hit the gamethread, but then it might incur a small delay before it takes effect now. I'll admit though it may not be a problem if your game is simple and you have ample CPU budget to throw away.
  • unless you keep updating the navmesh while an animating door moves (expensive), you may have to wait for an animating door to fully open or close before you can actually invoke an update. that might cause weird AI behaviour, i.e. walking into a door that's closing or not choosing to go through door that is opening. with a nav link you could update it instantly when the door starts changing state. can maybe work around it a bit if you just have a collider for the door you turn on/off and the visual representation doesn't really do anything.
#

pros and cons anyway, do what you think is best

viscid oasis
#

Any clever ways I can force a pawn off a ledge?

#

Not trying to get the AI to jump down to the ground - I want them to walk straight off the ledge.

celest python
#

If bNotifyTick set to true, what could be the reason to a decorator not calling it's tick function?

ocean wren
simple crest
#

AddMovementInput(FVector(towardsdeath)); sadcatthumbsup kill Noooo

celest python
#

๐Ÿ˜„

crimson galleon
ocean wren
#

it could be sweet release! MovementComponent::GoTowardsTheLight(FVector(m_vYourAncestorsAreWaiting));

#

Well, you get notified as you change path points and the final path point to go to just goes in that direction until its reached, so you could fudge that part to just... overshoot a bit ๐Ÿ™‚ which seems like a very bad idea to me ๐Ÿ™‚

#

But it'd look funny

#

Just be sure to post a video here

viscid oasis
#

Thinking lemmings going over a cliff!

ocean wren
#

Do you ALWAYS want things to overshoot the paths though?

#

Is this something the player selects? i.e. a point to go to?

#

Or is it meant to be automated?

viscid oasis
#

Automated, only when there's no alternative created

#

So, additionally, the nav is generated at runtime

#

(but that may not really matter.)

ocean wren
#

I'm just thinking that if the path itself is trimmed to the navmesh bounds, then you'll have to check if the last nav path point to see if its near an edge of the navmesh (i.e. a side of a navpoly without a connecting poly)

misty gale
viscid oasis
#

I was also thinking of using nav link and making it jump to a point way below the ground and making em die over a collision box

ocean wren
#

That does sound sensible, use the functionality that's there

#

Or you could do a Rama and automate it ๐Ÿ™‚

#

Just launch yourself over any navpoly edge that isn't bordered by another navpoly

#

That sounds fun, I might try that ๐Ÿ™‚

gaunt pilot
#

hi. how can cast to player AI in player controller?

viscid oasis
#

GetAIController()

gaunt pilot
viscid oasis
#

You're in the pawn, yeah?

#

Dumb Q but is your character using an AIController?

gaunt pilot
#

my main player character have ai and i wanna cast to ai in the player controller

viscid oasis
#

Okay, so where you cast to AIController and pop that into the playercharacterAI, that doesn't work?

#

Is it possible to disable AI Navmesh temporarily? Maybe that's my solution?

misty gale
#

Its not the navmesh itself blocking your character from walking of the ledge

#

Its whatever movement component you use along with the path obtained

#

Disabling the navmesh wouldnt give you a new location beyond some random edge :)

viscid oasis
#

hmm couldn't I override the character movement with just pure input?

misty wharf
#

if you just give the character movement input it will go where ever

#

only navigation movement locks into navmesh

viscid oasis
#

Noooooooooooooooo

viscid oasis
#

Not working unfortunately.

simple crest
#

probably fighting against the AI which is in control of it or something

viscid oasis
#

Hmmmmm yeah

simple crest
#

reject ai controller return to lemminge

viscid oasis
#

Hold up.

#

Yep yep.

viscid oasis
simple crest
viscid oasis
#

lol

#

It looks to get to the edge and then I override it. The challenging bit is my navmesh is generated over a voxel of instanced meshes

misty gale
#

How so?

#

How does that change it ?

celest python
viscid oasis
#

Mainly with debugging, tbh.

#

It's really weird. My first character attempts to stop and the movement input kicks in, and over it goes

#

but the subsequent characters just walk straight over.

misty gale
#

Herd mentality ๐Ÿค” or perhaps hive mind ai...

viscid oasis
#

... my god

#

BP_Skynet

#

I wonder if I don't bother with an AI Movement toward a goal at all. I can just have it run as an input in a certain direction, and override that whenever I need em to do something else.

#

It's a 2D plane anyway, so there's no real pathfinding tbh.

misty gale
#

Input or interp

#

Input sound better

viscid oasis
#

yeah input is working fine.

celest python
viscid oasis
#

Thanks for the help everyone

sharp light
#

I'm using FindPathToLocationSynchronously to get a predicted movement for my characters but I've noticed an issue. The character (cylinder) on the left is possessed by another player and the one on the right is just a character placed in the world. When I try to path through the character on the right, the pathing avoids the character properly. When I try to path through the character on the left the pathing wants to move right through.

If I run show Navigation I can see that the un-possessed character on the right is affecting the navmesh and the possessed character on the left is not. It's the same character actor in both instances with their mesh set to Can Ever Affect Navigation = True. Any idea what might be causing this?

#

If I enable Runtime Generation I see players now affect the navmesh .. but the pathing behavior becomes erratic with the movement trying to correct itself repeatedly. It's important that my characters follow the predicted path from FindPathToLocationSynchronously. Players will move only on their own turn so I don't need to worry about players pathing into eachother

misty gale
#

Are you calling move to several times?

simple crest
#

You're updating nav mesh data for dynamically moving characters... Simply stop doing this, it's a bad idea. Use detour or rvo or implement some other way for characters to avoid each other

#

Oh wait.

#

Sorry I missed the turn bit reading too fast on phone GottaGoFast

#

Even still, you're going to have to do a bunch of weird messing around with this method

#

Like setting the currently active player to not affect navmesh gen, and setting all other characters to affect it, and update the mesh at the start of every turn

sharp light
simple crest
#

As for your original Q I didn't help at all for that, sorry :(

simple crest
#

Like "Why are some characters affecting nav mesh and some aren't" ?

celest python
#

If an agent affects the navigation it causes issues

#

It wont be able to move properly or even fail to find a stable path for the goal

#

Because the point it's standing on wont have a navigation

#

I dont know if get the question right but

#

iirc you can also try to get the 'current path' from AI Controller instead of trying to predict it

#

And alter the process

sharp light
#

I think I'm gonna try disabling affecting navmesh for current player and updating the nav mesh after every move. Just gotta find where to trigger the navmesh update/rebuild in c++

#

I know I've done it before somewhere (I think in BP) but can't remember where or how

#

Ahh, right it's a console command Rebuild Navigation

#

Which .. doesn't seem to work anymore. hm

sharp light
#

Well, I'm calling UNavigationSystemV1::Build every time a player moves. I can't tell if it's actually DOING anything, the output log tells me
LogNavigationDataBuild: Display: UNavigationSystemV1::Build total execution time: 0.00s so either it's doing nothing or it's doing it really quickly.

My characters still aren't affecting the navigation mesh though even though I have them set to "Can ever affect navigation". I'm just waiting to see the navmesh update to show they are considered to be in the way then I'll deal with the tweaking of making sure the current player doesn't affect itself.

#

I'm thinking my navigation build isn't doing anything

small gazelle
#

how can i display AIPerception debugging?
I am in a laptop and cant press numpad 4

sharp light
#

I'm thinking Runtime Generation = Static completely prevents rebuilding, even when you try to force it

sharp light
small gazelle
#

it can be shown in editor?

#

like my upper image

sharp light
#

It will show above your other windows

#

you have to turn on numpad in the options button though

small gazelle
#

I made it

#

though i mean in blueprint view

sharp light
#

You want to show AI perception debugging in the blueprint editor?

small gazelle
#

right here, in the viewport

#

to adjust angles

sharp light
#

I think it can only run in in game - the component is not active when not playing

small gazelle
#

ok tyvm

sharp light
#

Np

ocean wren
#

wow, updating old UE code from really old versions of UE to 4.27 is a real chore ๐Ÿ™‚

tardy talon
#

Whats better to use, pawnsensing or perception?

small gazelle
#

the boilerplate chatacter is not beign deteted by AIPerception sight what am doing wrong?

#

this was the issue

ocean wren
#

Well hell, I finally managed to get this damn thing compiling!

#

Kind of need an analytical method of getting closest point on the spline now though. Sampling it is not going to work out ๐Ÿ™‚

#

Man, its a long time since I messed with Unreal character movement.. anyone know if there's a default air movement velocity? I need some aftertouch when launched in the air.. I'm pretty sure there was?

misty gale
ocean wren
#

Think so... but can't recall the name ๐Ÿ™‚ haven't touched this stuff in many years ๐Ÿ™‚

#

Same with the movement.. I know it exists, just don't have it saved in main memory anymore ๐Ÿ™‚

misty gale
#

FindInputKeyClosestToWorldLocation

ocean wren
#

Hmm, doesn't that find the vertex and not the point on the spline?

misty gale
#

There's a ton of options ๐Ÿ˜›

#

I found Input key to be the one i was after atleast ^^

ocean wren
#

Thanks, I'll take a look tomorrow

#

Technically, I want the distance along the spline in spline 0..1 space that is closest to a world location.. ๐Ÿ™‚

misty gale
#

Knowing the total diatance of the spline, all thats left in my original function is to divide by it

#

I think distance had to be updated manually when creating it tho? Didnt play to much around with it once my setup was working

ocean wren
#

Thinking of how to minimize the number of "closest" splines I need to check..

#

Imagine I've got say 1000 spline paths

misty gale
#

Need some rework aswell... some custom stuff .. where i can combine intersections etc

#

Probably some cached vector array of sorts

sour fable
#

anyone can help with ai vs ai?

ocean wren
#

Probably fudge it and have a large collision sphere to enable the spline checking for overlapping splines.. then do the checks for those

#

then the physics sweep and prune can at least minimize the spline checks

misty gale
#

I dont really need to know about the splines beyond the collision of them,

#

So that might be my best bet towards goal

ocean wren
#

Yeah, I'm riding them, so need to be able to check where to aim for etc

misty gale
#

Im simply fomlowing them, the navmesh handles the pathing already so

#

Riding them - rollercoaster kinda thing?

ocean wren
#

jet set radio kinda thing

#

or jet grind radio if you're in US I guess ๐Ÿ™‚ for some reason they changed the name

tardy talon
#

wish me luck imma implement some flying AI

lyric flint
#

Hi all anyone know how I could have it so a For Loop from array dosen't fire the next loop until it's done one it is one ?

#

I'm trying to have it that the AI will got to array item 0 then on next loop on success item 1 and so one

crimson crown
#

In short, how would I make it so one AI pushes another out of the way?

What I've got right now is a series of AI characters moving towards a target location. When the first AI character gets to the target location, its 'AI Goto' node returns a success and it stops moving as if it were a static object. When subsequent AI characters get to the target location, they try to move around the first AI character so they can get within the acceptance range of the target location. If they manage to do so, it looks like they basically turn into a static object.

After enough time, there's too many AI characters sitting "statically" over the target location, the ones that have yet to reach within the acceptance radius are basically stuck perpetually trying to get there. What do I need to do with the AI that have already succeeded in their movement command so that they can get moved by those that have not?

crimson crown
lyric flint
#

so I tried that it seemed to break the AI when it reached the first entry it kinda broke didn't really know whether it had succeed or failed etc so I scraped For loop for now trying a bit of a manual way of doing it

high cedar
#

I am using a tile grid system of my own design, and I have a job system for when I tell my workers to, say, build walls or furniture. How can I prevent my units from walking into a tile that has a pending job attached to it?

high cedar
#

I was thinking of using a grid EQS, but wasn't sure how to implement it

crimson galleon
crimson galleon
high cedar
crimson galleon
high cedar
#

my jobs are UObjects, which are added to my UTiles which are handled by my AGridWorldController. the gridworldcontroller has multiple ISM's to manage the in world meshes for the tiles. the Tiles know about their location in the world, and have a pointer back to the gridworld managing them

#

so when the job for making a wall is finished, the job is deleted -> tile gets a new UInstalledObject -> the ISM manager for walls places the mesh in that location which updates the nav area

#

so my first instinct is to place a ANavModifierVolume at that job's location, but the default ones that get spawned don't have a brush made

crimson galleon
# high cedar so my first instinct is to place a ANavModifierVolume at that job's location, bu...

i guess that works, unless you're saying it doesnt ๐Ÿ˜› but i was wondering what was there because of there is already a mesh object to mark the pending job area, then it could just have a collision that affects the navmesh area, for example, first set it to obstacle just in case AI are current in or set to path through it, then to null to remove it (hopefully safely enough that any AI in that area have left it by the time it is nullified)

high cedar
#

only saying it doesnt right out of the box because newly spawned ANavModifierVolume has no UBrush x3x

#

just need to fix that I think

crimson galleon
#

ah, well if that doesnt work, maybe you can handle it with a simple mesh box that is hidden since collision can still work on hidden meshes

high cedar
#

hmmm, ok

crimson galleon
#

i know it sounds weird, im thinking of games where the area gets marked by a flag or the building framework or construction tape to show where it is to the player and that seems to double as a way to handle navmesh updating

high cedar
#

oh, that. I'm going to be using a decal actor that references a 100x100 size canvas render target to "color" the ISM meshes for what's going on. namely used for my marquee selection

crimson galleon
#

so the ISM gets creating after the pending job completes right? its not there during the pending job?

high cedar
#

yeah

#

for now, I might place a ghost model of what is to be placed later

crimson galleon
high cedar
#

I think I'd still need to block the nav area if I change floor tile types

crimson galleon
#

most likely, but the pending area can handle the transition from normal to obstacle to null so that the thing built can already be null

#

i wouldn't think nullifying right away would be good for the rare occasion something is there already or is going through it, i guess if its turned based its probably not an issue

high cedar
#

definitely not turned based, more like a base builder like rimworld

crimson galleon
#

it would cover some situations, but i figure there still might be a problem where an AI decides to go through the high cost area because it's the only way to get through - then it nullifies, and now they are stuck, so i guess this needs a better solution regardless

misty gale
#

Would you need a new nav modifier when you already have the mesh instance? With collision it surely can affect nav aswell

high cedar
#

mesh hasn't been placed yet

misty gale
#

Ah , and ISMs cant be set invisible per instance i think... guess you need a placeholder

high cedar
#

yeah

misty gale
#

Another ISM

#

๐Ÿ˜„

#

which basically is just an invisible cube for doing this^^

high cedar
#

right now I'm trying to spawn an AActor with a UBoxComponent at the location

crimson galleon
high cedar
#

I mean.....

misty gale
#

guess my reading was to fast ๐Ÿ˜›

crimson galleon
#

but would ISM even be necessary? its a temporary thing

misty gale
#

true, it could be anything really

#

but walls?

#

there's a lot of questions i guess

#

if its a 1000 block wall, perhaps?

crimson galleon
#

i think its like rimworld

misty gale
#

if its 1 by 1? perhaps not

#

never player

crimson galleon
#

never played, so if you are familiar, then maybe ISM is applicable

#

well then

high cedar
#

I can definitely confirm spawning 1000 actors just to block off an area isn't a good idea harold

misty gale
#

reminds me of that other game... dont starve?

crimson galleon
high cedar
#

I guess I'll make a ISM for this

crimson galleon
#

dont starve is more 1 by 1 as you mention

misty gale
crimson galleon
#

i think in rimworld you can cue up several tiles

high cedar
#

yeah

crimson galleon
#

so yeah, i guess limit the player there

#

i was actually thinking of 1 tile at a time

high cedar
#

well the AI units can only work on one tile at a time, but right now if they stand in tiles that have pending jobs then another unit builds a wall on top of them

crimson galleon
#

well... couldnt you tell the AI to get the hell outta there at some point?

high cedar
#

which I could either A: teleport them out, or B: prevent them from standing where a pending job is

misty gale
#

before "completing" the building, get all units in volume, and tell them to gth out

crimson galleon
#

the issue i can think of, is a situation where multiple tiles are already built on and then building another makes it very limiting to where the AI can path to, but i still think its better to try to tell the AI to move somewhere then solve for teleport

misty gale
#

Try to move -> if failed -> teleport

crimson galleon
#

i think there is a degree of player-made problem, like boxing in their own units, but aside from that, the AI should obviously try to get out of that area

ocean wren
misty gale
#

That wouldnt directly work with existing solution I think , since the ai is already using the nav system

ocean wren
#

Oh, so you already have an object.. so my advice, would be to disable collision on the builders and tiles entirely

misty gale
#

atleast, as i understood it..

ocean wren
#

nobody ever collides the builders with the tiles ๐Ÿ™‚

#

use the pathfinding to avoid the tiles sure.. but collide? nope

high cedar
ocean wren
#

don't do that ๐Ÿ™‚

#

A* is easy man

#

collision is way too bloody harsh and has tons of edge cases

high cedar
#

like preventing the unit from standing on a tile with a pending job harold

ocean wren
#

There's even an A* pathfinder in the codebase, built for Fortnite back when it had builder mode

#

yeah, but a pending job shouldn't block a unit right? so having collision on it is weird

#

seriously, play almost any builder game and you'll see, the units path through "pending" builds.. they path around built items

misty gale
#

semi built is also blocking, isnt it ? in games where there are stages of build progress

crimson galleon
#

i was thinking of when the job completes and several other jobs have been cued, how the AI could path out but then has to continue to find a place to move to until it can find a free space - though again, i feel part of this is caused by the player - meaning the AI could still get boxed in

#

i dont play many builder games though ๐Ÿ˜ฆ

ocean wren
#

Well, yeah, players can always be idiots.. but you can always teleport in those extreme cases, or just let the builder die (timberborn kills em)

crimson galleon
#

the ones im thinking of usually have a buffer around the built structure

ocean wren
crimson galleon
#

it would seem better to make the area high cost before nullifying it to get AI out of that area and hopefully keep them out, but even then, its not 100%

ocean wren
#

Yeah, this is the kind of fun project where you have to playtest what happens

#

See what you find acceptable

#

But for my part, I'd try and avoid physics interactions on objects as much as possible, both for performance and for AI reasons

high cedar
midnight scroll
#

The earlier conversation with building around AI is amusing. I play Oxygen Not Included.. They didn't bother fixing it, they just mark the ai as "Entombed". Suffocating til death or release. ๐Ÿ˜„

high cedar
#

yeah

ocean wren
#

Timberborn kills your builders for all sorts of reasons ๐Ÿ™‚

misty gale
#

Not sure there's a proper fix for it anyways ๐Ÿ˜›

crimson galleon
#

well i think boxing in your own AI is the fault of the player

ocean wren
#

I don't think there is

crimson galleon
#

im just thinking of how to get the AI the hell out of build areas in particular cases

ocean wren
#

I think its fine to kill players boxing in builders... its another mechanism the player can learn

misty gale
#

heck even The Sims kills the npc if the player blocks them ๐Ÿ˜›

crimson galleon
ocean wren
misty gale
#

teleporting could open you up to much worse things anyways

#

all these bugs, edge cases and whatnot

crimson galleon
ocean wren
#

I guess the teleporting thing depends a lot on the game style

midnight scroll
#

Anyone who plays a builder game more than five minutes pretty much understands that you have to build things up in tiers. And as a developer, you really shouldn't fix all the player's problems or you're making an ant farm more than a sandbox game. Player still needs to play the game.

crimson galleon
#

i still like having a buffer, but only if that works for the design obviously, then the AI can always move between built tiles

high cedar
#

well in my case it might work, since it's going to be a robot themed game, so teleporting them out of stuck situations may work

ocean wren
crimson galleon
crimson galleon
#

i think it would work to have them "ghost" through until they can get to a navigable spot

#

just b-line to nearest place

ocean wren
#

I think most games get around it by not building things immediately. So if you build an enclosure, most of the AI will be able to pathfind out of it by the time its complete

crimson galleon
#

and if worst case, put a timer that kills them if they take too long

ocean wren
#

I guess this is something you should test per-game

crimson galleon
#

im thinking of blizzard rts games where there is a buffer between buildings so builders and similar sized units can always move between them

ocean wren
#

Build rates and number of builder units etc.. probably impacts this a lot

crimson galleon
#

pretty sure the buffers are high cost

high cedar
#

can't really do that, remember this is a base builder like rimworld or dwarf fortress, but in 3d

crimson galleon
#

games ive not played ๐Ÿ˜œ but if it doesnt work it doesnt work

#

kill em, kill em all

misty gale
#

robots would just run out of jucie , stop working

celest python
#

Is it normal my KeyID is 255 from the beginning?

#

I guess this is causing the issue I'm trying to solve since yesterday

#

Same blackboard key on another BTTask is not 255

simple crest
#

that's an invalid key though Thonk

celest python
#

Isnt invalid is -1?

simple crest
#

no

celest python
#

lol Epic setting a negative value for uint8

        typedef uint8 FKey;
    const FKey InvalidKey = FKey(-1);
#

It'll be 255 if set to -1 i guess

simple crest
#

so the obvious hope is that you just didn't pick a key with your FBlackboardKeySelector

#

and the non-hope is that you found another bug in the least maintained systems in UE4

celest python
#

I guess I found a bug or I discovered something else

#

Because I solved now

#

TargetGoal.ResolveSelectedKey(*OwnerComp.GetBlackboardComponent()->GetBlackboardAsset());

#

I needed to call this manually

#

Why would I have to* resolve the key by myself on ExecuteTask?

#

Anyway in the end it appears to be fixed, thanks for showing interest in my issue HoJo ๐Ÿ˜Š

simple crest
round jungle
#

how to make ai?

#

im new here

tardy talon
#

Try to figure out how to make AI and if you get stuck on a specific problem then you can ask here and get a useful answer

sharp light
#

Sounds like you might be better off using waypoints than the ai pathing. I feel like it will be tough to get that level of accuracy. I think the biggest thing will be making sure your agent radius keeps the ai an accurate number of units away from the walls

#

(this coming from someone not super experienced with this)

#

Hit "show > navigation" in the editor to see the effects of increased agent radius

#

Hmm maybe try tweaking the "Max Simplification Error"? If I see to recall, that will affect how complex the shapes are

#

Might me able to tweak it to make the corners more .. corner-y

#

Hmm, try tweaking the character movement's acceleration too. Possibly if it's high enough you won't see the slowdown?

#

but it might just kinda jitter around .

#

You're welcome!

#

In the characters make sure "Can ever affect navigation" is disabled for the class defaults, capsule (if there is one), meshes, etc

#

Oh wait, are they TRYING to walk through eachother but they collide?

#

Ok, that's just normal collision that needs to be tweaked. Gotta be either capsule or your mesh that collides with others of the same type

#

What is the "proper" way to change navmesh generation? (Cell size + agent radius). I see I have these properties directly on my RecastNavMesh in the world but editing them gives the error

LogNavigation: Warning: Changing AgentRadius directly on RecastNavMesh instance is unsupported. Please use Project Settings > NavigationSystem > SupportedAgents to change AgentRadius

If I go to NavigationSystem > SupportedAgents, I can add a supported agent but what exactly does that DO? Define defaults to be used for RecastNavMesh instances? I deleted my recastnavmesh to force it to regenerate and now I get

LogNavigation: Warning: NavData RegistrationFailed_AgentNotValid, NavData instance contains navmesh that doesn't support any of expected agent types.

Really unsure what the proper process is here.

#

Oh, I see.. it's weird. You gotta change params in the Navigation System settings, then delete your RecastNavMesh, then click your NavMeshBoundsVolume, uncheck "Supported Agents > Default" (or whatever your agent name is), then check it again.

#

I get some REALLY weird navmesh generation though. I mean, look at this. With an agent radius of 20, it generated the mesh so it literally clips into the object

#

Ok so that โฌ†๏ธ is a result of the Max Simplification Error. It simplified the shape so much that it clipped the object.

#

Do you have the mesh set to no collision?

#

Hmmmm are you sure there's no other component on them that might be colliding?

#

I guess it's POSSIBLE it's the AI movement doing this. The movement finds it can't go around the enemy so it completes a partial movement that just leads up to the enemy ..

#

For testing, maybe make the path wide enough so that one COULD go around the other and if you could just plop an enemy down and keep it stationary

#

make sure that the moving enemy goes around instead of trying to go through

#

that should at least tell you if it's the AI pathing or something weird with collision channels

#

Ok, so it is an AI pathing thing

#

Somehow your enemies are still affecting navigation

#

It's weird because they should not affect nav generation by default

#

What plugin? Just out of curiosity

sharp light
#

When an AI move is blocked, it will sit there trying to move for 4-5 seconds without success. Is there any way to lower this timeout?

sharp light
#

โฌ†๏ธ Found my answer

UPathFollowingComponent* PFComp = GetPathFollowingComponent();
PFComp->SetBlockDetection(5.0f, 0.2f, 3);

These numbers are for BlockDetectionDistance (default 10.0), BlockDetectionInterval (defaut 0.5) and BlockDetectionSampleCount (Default 10). By lowering the detection distance and sample count, my AI will timeout within a second if it is blocked

glass onyx
#

Question; for static navmesh level streaming, when building a path to an area that is not loaded, does the path building job handle loading in the sublevels?

ocean wren
#

Doubt it

sharp light
#

Anyone have success with the crowd avoidance? My AI keep running into eachother .. it's like the agent radius is too small, but I see no place to configure that. It doesn't seem to use the same agent radius as normal pathing

sharp light
#

Here's what my crowd detour currently looks like. Often the player will correct themselves multiple times, sometimes they will get stuck on other players. I really don't care if they take the FASTEST path but I definitely want it to work cleaner than this, ESPECIALLY since there aren't even any other moving actors.

pastel drift
#

Is there no way to retrieve which "CanBeSeenFrom" point the AI saw the perception stimuli? Currently my working solution is to do those traces myself to retrieve that data.

old adder
#

Does behaviour tree has a OnEnd/OnFinish event that i can bind to?

crimson galleon
old adder
#

It does have an OnTaskFinish

#

But that is quite specific

crimson galleon
#

well BT's dont really finish

#

a task within a BT can though

old adder
#

but it does know what is loop or runonce

crimson galleon
#

BT's can loop

old adder
#

anyway I can get an event when it restart from root?

crimson galleon
#

there is a loop condition

#

i dont really understand

old adder
#

Ah I mean, it does know where root is to return to it

#

any event indicating a restart/end that I can get?

#

There seem to be no composite node event.

crimson galleon
#

i still dont get it, i think you're trying to do something that doesn't fundamentally work with how BTs operate. I believe BTs execute from the root each time and will change to a different branch based on how conditions change

#

you start from root, then a selector to decide which branch, even if there is only one, are you trying to check something from the root level every time it executes? I guess there might be a way to run a task at the very beginning of the BT each time as a way to determine when it restarted, but again, im pretty sure that's every frame

modest totem
#

Hello, I'm working on City, i want create traffic with simple cars (color boxes/pawns). I know i can use splines but I don't know what to start with. Then i want to spawn car and tell him to go to this location and he will go along the splines. Any help

astral sail
#

Hey ! I followed a Youtube tutorial to start with IA, i'm quite happy with the result
My wolf is chasing me and attacking me when in melee range.
Issue is, because of the 1.2 second delay, he is not moving anymore when he's attacking. It's waiting his attack to finish before allowing him to move again.
I'd like to copy the WoW mechanism on that matter. But if i change the Parallel finish mode, it wont even wait for the attack to be finished.
How to make him finish the attack animation while chasing me if i start moving during his attack ?

viscid oasis
#

Look into anim notifies.

#

You using montages?

astral sail
#

yes i use a anim montage

#

upper body

#

i think ive done like the tutorial says

#

in the tutorial, result is the same

#

the character is attacking without moving xD

#

he set up so he can attack while moving with the player character

#

but the AI doesnt

viscid oasis
#

So, if I understand correctly, you don'

#

t want the wolf to move until the animation attack has finished, yeah?

astral sail
#

no no, that is what is happening right now

#

I do want him to be able to move whatever he's attacking or not

#

right now, attacking makes him stop moving

viscid oasis
#

ohhh

#

Yeah, sorry

astral sail
#

๐Ÿ™‚

viscid oasis
#

So, two things obviously to check. 1. the actor is allowed to both move and attack at the same time. By the sounds of it, that's working.

#

Now you want to ensure the animation blend is able to work with the wolf attack animation + whatever locomotion?

astral sail
#

yeah

#

thing is

#

i feel like right now

#

even if he's attacking while not moving

#

only upper body attacks

#

i mean im fine with that

#

but maybe thats a hint

#

regarding how the logic is right now

viscid oasis
#

Yeah

astral sail
#

maybe i did the blend wrong or smth

viscid oasis
#

okay, and locomotion is a blend 1D from idle (X=0) to full movement (X=400) or something like that?

astral sail
#

yeah

#

simple BS

viscid oasis
#

yeah cool cool.

#

So from what I can see your instincts are right - you want to blend between the two animation from a certain bone and up / down

astral sail
#

i guess yeah

viscid oasis
#

Okay, I'm a bit rusty but try a blend depth on your wolf neck of 1, not 0.

#

And see what happens.

#

And triple check if that bone is called what you're referencing there.

astral sail
#

yeah i copy-pasted it

viscid oasis
#

yeah nice

astral sail
#

let me try depth

#

it doesnt change anything

#

i mean im actually unsure

#

thing is he is attacking while "finishing" movement

#

or if you prefer

#

he's starting the attack before stoping movement

#

but attacking leads to stop movement

#

i feel like this main issue is related to the Behavior Tree

viscid oasis
#

Show me the BT?

astral sail
#

removing the delay will cause him to not have a cooldown

#

the 1.2s delay is in MeleeAttack

viscid oasis
#

That's okay. Would it work if his attack animation had to take into account he's ready to attack again?

#

Ahh

#

Ok, first reverse what I've done JIC.

astral sail
#

yep

#

set to 0

viscid oasis
#

Cool

#

So, in your attack montage, you want to create a notify

#

that signals the end of the animation.

#

What you wanna do is have a way for your BT to check if the wolf is ready to attack again. This is different to your cooldown and is more about the animation has completed.

astral sail
#

so its too soon in the anim

#

i thought it was to be used later

#

to trigger the damage

viscid oasis
#

Yeah, but you also want to notify that the montage is over.

astral sail
#

i guess its another notify ?

#

ok yes

#

makes sens

viscid oasis
#

yep.

astral sail
#

let me put it at the end of anim

#

but the anim itself

viscid oasis
#

There's a few ways to do this, TBH, but this is a way I prefer since it's more event-driven.

astral sail
#

is shorter than the time between attacks

#

that im thinking of

viscid oasis
#

Yeah like 'AttackFinish' or something.

astral sail
#

i want his cooldown to be longer

viscid oasis
#

I reckon start your cooldown after the animation has finished, but up to you.

astral sail
#

sure

#

so, how do i link

#

this "notify"

#

to the behavior

#

^^

viscid oasis
#

Great question

#

ok, so your anim notify can be signalled from your animation instance.

#

AKA animation blueprint.

#

If I recall correctly, this can also be called on your Pawn BP too.

#

Either way, you want to then get a reference to your AIController -> BT -> SetBlackboardKey(Bool) bWolfAnimationReady (or something).

#

So, first create the key in your BT.

astral sail
#

bool ?

viscid oasis
#

yeah true / false.

#

Boolean value.

#

There's different types of Blackboard keys you can set. One of them is a bool. You still have to feed in the name of the key.

astral sail
#

ofc ofc

#

i already have few BB keys

viscid oasis
#

Ah nice

astral sail
#

Then we need to programm a new task ? or service ?

viscid oasis
#

Ah you can add it as a task I think

astral sail
#

(I can share screen in pm if you want)

viscid oasis
#

Add to the 'CanSeePlayer' task stack you got there

#

As another check.

astral sail
#

those are decorators

#

shall i create a service ?

#

no ok

#

but its a service i mean ^^ not a task, right ?

#

started this :

#

wonder if its the right positioning

viscid oasis
#

Close. But I'd treat the 'wolf animation ready' as just a value.

#

And I'd set it off and on via the animation BP.

astral sail
#

with a cast, then

viscid oasis
#

Yeah a few levels deep, I'm afraid.

#

We need to tell the BB about the new value.

#

This is how I'd do it, but there's other ways naturally.

#

so I'd image it'd be a chain like Blackboard->AIC->Pawn->AnimBP

astral sail
#

oh i was starting in the event graph from the animBP

#

but ok

#

ok, where do you create that chain exactly ?

#

in the AI blueprint ?

viscid oasis
#

Two places - up to you.

#

Pawn.

#

Or Animation BP

astral sail
#

(a bit lost tbh)

#

ok lets go with anim bp

viscid oasis
#

Cool

astral sail
#

do i use the notify there

viscid oasis
#

So Animation Blueprint is a class that sits under Pawn.

#

Yep

astral sail
#

I've created a bool : "IsAttackFinished"

viscid oasis
#

Great

astral sail
#

How do I set it ?

viscid oasis
#

Where have you created that bool?

astral sail
#

AnimBP

#

๐Ÿ™ƒ

viscid oasis
#

Ah, no create it on your Blackboard.

astral sail
#

oh we're using this one

#

its there

#

ok

#

already done

viscid oasis
#

Great great

#

So, now you have to reference your blackboard via your animation blueprint.

astral sail
#

this i fail to

viscid oasis
#

Well, how do you think you'd go about it?

astral sail
#

with a cast ?

#

i cant cast to Blackboard_wolf

#

also tried cast to BB component

#

dunno what to put in there

viscid oasis
#

Why can't you?

astral sail
#

dunno ๐Ÿ˜ถ

viscid oasis
#

heh

astral sail
#

trying this

viscid oasis
#

Lemme show you

#

oh, paste what you've got

astral sail
viscid oasis
#

Ah, good idea but our blueprint doesn't know how to reference that.

#

You've gotta move up the chain, so to speak.

astral sail
#

so, AI

viscid oasis
#

So if you wanted to reference your pawn, how would you do that?

astral sail
#

but then it needs something

#

wait i try again

viscid oasis
#

You know where the AI lives?

astral sail
#

well there will be multiple wolfs in the game

#

so im unsure on how to use the animBP

viscid oasis
#

I mean, your AI Blackboard / Behaviour Tree.

astral sail
#

"self" ?

viscid oasis
#

hmm kinda.

astral sail
#

self actor ?

viscid oasis
#

Let's talk about inheritance for a second. That'll help.

#

You know how inheritance works?

astral sail
#

i kind of understand it regarding parent/child blueprints

#

thats about it

viscid oasis
#

Okay. Well, basically things inherit from a base class. This is kinda fundamental to OOP but whatever.

astral sail
#

okay

viscid oasis
#

Okay, so in a typical game

#

PlayerController
---- Pawn
---- SkelatonMesh
--- AnimationBlueprint

astral sail
#

right

viscid oasis
#

Ah, technically the pawn doesn't live under the player controller.

#

The Player Controller just possess the Pawn - makes a reference to it.

#

But I digress.

astral sail
#

yes true

viscid oasis
#

When you have AI
AI Controller
---Pawn
---- SkeltonMesh
---AnimBP
--Blackboard
--Behavioural Tree

#

Same deal - pawn doesn't technically inherit.

astral sail
#

okay yes

#

makes sense with the previous image

viscid oasis
#

So, in most cases, you have to tell the blueprint what you want to access and see.

astral sail
#

so in this case

#

we want to access the blackboard from the animBP

viscid oasis
#

Yep, but we need to go up the tree.

astral sail
#

cast to AI_wolf ?

viscid oasis
#

Gotta up the tree

#

AI Controller
---Pawn
---- SkeltonMesh
---AnimBP (start here)
--Blackboard
--Behavioural Tree

astral sail
#

isn't AI controller the top ?

viscid oasis
#

Yep, correct.

#

AH

astral sail
#

my AI controller for wolf is AI_wolf

viscid oasis
#

No no

#

Sorry

#

ugh, lemme draw this.

astral sail
viscid oasis
astral sail
#

Yeah ?

viscid oasis
#

Okay, so you're at the blueprint animation.

astral sail
#

i dont get it xD

#

i want to access behavior tree

viscid oasis
#

That's okay. This is a new mental model

astral sail
#

blackboard *

#

no i mean i get your model !

#

i dont get what im missing

viscid oasis
#

You're at the Animation Blueprint. You have to go up.

#

Here

astral sail
#

oooke

#

ok so a lot of get

#

let me try

#

tried get skeletal mesh

viscid oasis
#

I'll give you a hint

astral sail
#

<

#

wanted to start climbing your model

viscid oasis
#

The AnimBP is directly accessible by the pawn.

#

BP_Char is my pawn.

#

Unreal, understandably, has some things under the hood to make accessing parent objects easier / safer etc.

astral sail
#

ok let me try

viscid oasis
#

Good! BUT! How does the blueprint know what sort of controller you're referencing?

astral sail
#

still cant access blackboard_wolf

viscid oasis
astral sail
#

oh

#

didnt see

viscid oasis
#

Clooooose

#

Get a little more specific and you're there.

astral sail
#

yeah, one cast per action

#

makes sense

viscid oasis
#

yep; you're just saying 'Hey, blueprint, I want THIS specific class."

astral sail
#

by the way

#

would the cast work if i put get AI controller instead

#

?

viscid oasis
#

Great question.

astral sail
#

controller will work with both i guess ?

viscid oasis
#

I'll be honest, AI Controller for me doesn't work for some reason, despite my having an AI Controller.

astral sail
#

where get AI controller is only working if its AI

#

ok ok

viscid oasis
#

Controller for me works. I'll dig into the code.

astral sail
#

using the normal one

viscid oasis
#

Defs if it's a Player Controller ,it's controller.

#

So, with how AIs and stuff work, you won't get access specifically to a Wolf_Blackboard.

#

So we gotta use a name reference to that specific key.

astral sail
#

the name we used

#

we'll use make litteral namer

#

right ?

viscid oasis
#

Yeah.

astral sail
#

ok thats why

viscid oasis
#

In this case, it's a name.

#

And it's VERY specific, so be careful

#

I've had issues in the past with conversions of strings to name, or enum to literal bits etc.

#

Strings you should be fine, but JIC, use names.

astral sail
#

yeah is a name

#

let me screen

viscid oasis
#

nice.

astral sail
#

so now

#

i dont really know if it will actually help in the behaviour tree

#

what i mean is

#

2 things :

#
  1. should not this one be elsewhere ?
#

and 2) We need to untick that boolean at some point, right ?

#

just in case :

viscid oasis
#

Good questions

#

Q1. Should that be elsewhere? Well.. it's up to you.

#

Basically, if you don't want your wolf to do anything until that animation is true, then put it there.

#

but entirely up to how you want to approach it.

#

In answer to Q2; Yeah, you want to have a trigger for when the animation starts and when it stops.

#

And it's almost identical to the animationstart - you just need an animation notify for when the animation should be finished.

astral sail
#

as i said i want him to be able to move freely no matter what

#

if a wolf chases you, he wont stop when he has to bite ^^

astral sail
#

aaand another question to myself on where to put the decorator

astral sail
round sand
#

Hey,
I have used a single blackboard for two behavior tree but the boolean keys seem to have different instances for both the boards. Any way I can use the same instance of the board?

viscid oasis
#

@round sand yeah, should be a setting on the blackboard that says sync. (or something like that)

#

@astral sail Yeah, pretty much you're just setting the bool value the other way.

#

This might just be a UE5 thing, but in my test I had access errors if I didn't reference the component directly.

round sand
#

in my cpp I think i have made objects of blackboard instead of using the one which is already been instantiated

viscid oasis
#

@astral sail might cause you issues -

viscid oasis
#

Looks good - run a breakpoint on that 'Get Blackboard' JIC.

astral sail
#

oh

#

yeah no we use the GET

#

right ?

viscid oasis
#

There's a func called 'GetBlackboard', and there's the component itself.

astral sail
#

yes, i'm not touching that

viscid oasis
#

Try GET and if you have issues, reference the other one.

astral sail
viscid oasis
#

It'd be pointing to exactly the same one. My AI Controller is a bit modified

astral sail
#

we re using this one

viscid oasis
#

You -should- be okay with that.

#

Well see!

astral sail
#

yeah

#

okay

#

run a breakpoint ?

viscid oasis
#

Right click on that node

#

er.. component.

#

And 'Toggle break'

#

Basically the system will stop and take you to that when it's triggered. Handy for debugging.

astral sail
#

works on the cast

#

but not on the function

viscid oasis
#

Yeah, fine.

#

Cool cool.

astral sail
#

that will debug what ?

viscid oasis
#

Ah. Debug as in if you have a bug in your game

#

It can help you get rid of that bug - debug.

astral sail
#

nevermind

#

i mean

#

i understand this helps debugging

#

without having to print string or wtv

#

but i dont know how you get notified

#

that, i.e., this castTo failed

viscid oasis
#

The editor will literally stop and take you there

astral sail
#

oh

#

ok

viscid oasis
#

When that point gets highlighted. You can hover on the end points and it'll say stuff

#

Yeah, it's fine for small things, like 'is this running?'

astral sail
#

okay

viscid oasis
#

Don't worry too much about it.

astral sail
#

so now

#

that i have my 2 events

#

i dont know where to put the IsAnimFinished decoration

#

in melee attack ?

viscid oasis
#

Do you need that, though?

#

It turns off in the BT once the animation finishes.e

astral sail
#

yeah that's what i thought

#

but

#

that's why i was wondering about the link between all of that

#

and my issue ๐Ÿ˜„

#

how is all of that related

viscid oasis
#

mmm?

astral sail
#

to letting the wolf move freely

#

shall him be attacking or not

#

๐Ÿ‘€

viscid oasis
#

Sorry, I'm not sure of your question?

astral sail
#

Well

viscid oasis
#

Should the wolf be able to move regardless of its attack?

astral sail
#

well that was my issue , maybe i misexplained

#

its like

#

he is stoping

#

when he's attacking

#

It looks as follows :

#

Chase me => Is in melee range ? Yes => ATTACK and wait before doing anything else

viscid oasis
#

I guess you want to check if the wolf is able to attack again?

#

So maybe you put the animation ready check in there?

astral sail
#

i'm not sure to get it

#

let me just try

viscid oasis
#

Yeah, see if it's somewhat working

astral sail
#

right now

viscid oasis
#

Then tweak it based on your logic.

astral sail
#

with the IsAnimFinished thing on the top

#

the wolf is not even moving

viscid oasis
#

What's the default bool state?

astral sail
#

is there a default somewhere ?

#

when created in a BB i dont see where

viscid oasis
#

Click on it in the BB

astral sail
viscid oasis
#

er..

#

Maybe I'm crazy.

astral sail
#

no but like

#

i think i know why

#

and thats why i was wondering

#

about the positionning

#

of that decorator

#

like

#

this bool

#

get touched

#

when the attack anim is called

#

but at the beginning, the wolf doesnt attack me YET

#

so the Bool IsAnimFinished

#

is False

#

and will ever be

viscid oasis
#

hold up

#

Your bool state - is it telling the BT that the wolf is ready to attack, or that it can't attack?

astral sail
#

its telling that the anim has started or that the anim has ended

#

attack anim *

viscid oasis
#

Okay, so if there's no animation started, you can go ahead and do the rest of the BT, yeah?

astral sail
#

well, the decorator is at the top

#

so i guess it returns false

#

at the very beginning

#

and that is why the wolf isnt moving ?

viscid oasis
#

Yeah, so it needs to have it's default state set to true.

astral sail
#

how do i do that :/

viscid oasis
#

Which you should be able to do there? But maybe I'm wrong.

#

One sec.

astral sail
#

i mean i can set it to true at begin play

#

but i feel like it wont help us

#

let me try

viscid oasis
#

Nah that'll work

#

You can also just reverse the decorator - to 'not set', and switch your aim notify

astral sail
#

ok so

#

i did this

#

i jsut set it

viscid oasis
#

So if the wolf attacks, turn ON the bool.

astral sail
#

at begin play

#

so yes

#

yes its happening

#

but now

viscid oasis
#

good

astral sail
#

everything is smooth

#

but

#

i have the same issue

#

regarding wolf's movement

#

its same as before

viscid oasis
#

As in, the wolf is moving and not attacking, or attacking and not moving?

astral sail
#

yes

#

let me remove the delay

#

sorry

viscid oasis
#

lol which one?

astral sail
#

in "MeleeAttack

#

"

#

now he doesnt wait between attacks

#

he'senraged ;D

#

same pb as before

#

i put the delay in what we've created maybe ?

viscid oasis
#

heh

astral sail
#

in the FINISH notify

#

?

#

but then he will just stop moving

#

let me try

viscid oasis
#

So, the wolf attacks and keeps moving?

#

Monitor your BT as the wolf is moving - see if you can follow it along

astral sail
#

yeah i have two screen

#

i know exactly whats happening

#

shall i screenshare ? ๐Ÿ™‚

viscid oasis
#

sure

elfin sonnet
#

Is there any way how I can get a blacboard value into a EQS context?

#

I have a vector position n the blackboard and I want to use the position as a context for EQS generator

#

but the blackboard key selector have nowhere to be shown, because the context is just an item in the generator

elfin sonnet
#

hmm, I think I found a "solution". I will not search for the blackboard value from the context, but I will create a standalone task that will take the blackboard value and hard-set a context value.

#

the context will basically act just as a temp data structure

misty wharf
#

@elfin sonnet how are you setting context values directly from a task? Just wondering as I had some EQS stuff I wanted to parametrize and it didn't seem very straightforward to do that

elfin sonnet
#

yeah I havenยจt figured it out yet, but I just discovered something called FAIDataProviderValue - that could maybe work with the first method

misty wharf
#

Ah :)

elfin sonnet
#
#

yeah, this seems to be it

#

gonna try to replicate this

#

so maybe the context could take the value from the generator data-bound value

misty wharf
#

It would be handy to be able to directly pass values into the context but it doesn't seem like how it was designed which is a bit odd

#

I looked into it a bit and couldn't find a good way to either construct a context, pass values into it, then pass it into the query, or get the context from a given query object.... I'd imagine it might exist but wasn't very obvious at least where it is

elfin sonnet
#

my main problem is that I can't pass the blackboard values by reference (into the EQS context) so I have to hardcode the BB key names, lol. I will see if that works, but for obvious reasons I'll have to write a custom generator that will hopefully be able to choose a BB key by variable.

#

and then somehow get that variable from the generator to the context... if context supports getting the "parent" generator

#

but I have no idea if that's the correct way

misty wharf
#

something that could be worth a try is try getting the querier

#

if you pass the pawn as the querier, you can then grab its AI Controller, and grab its BB

#

you could then access the BB directly, and maybe you can set the BB key names as parameters for the context so you can configure it in the EQS editor

#

Whether it's any better than what you proposed not sure :D

elfin sonnet
#

oh yeah, I am actually doing that now ๐Ÿ˜„

#

I am yet to test it, but I think it will work.

#

I had this, but that ofc doesn't work (there is nowhere to set the values in the editor, the context is just a data structure for the generator)

#

so I have to hard-code the key names as FName

#

instead of FBlackboardKeySelector

#

if it won't work I will have to read up on the FAIDataProviderValue and eventually try passing the "start location" via the generator into the context

round sand
#

hey how to sync a single blackboard with two behavior trees?

modest totem
#

Hello, I'm working on City, i want create traffic with simple cars (color boxes/pawns). I know i can use splines but I don't know what to start with. Then i want to spawn car and tell him to go to this location and he will go along the splines. Any help

ocean wren
modest totem
#

yeah but main thing for me is how to make AI find path like what splines do bot needs to use to get to location

ocean wren
#

sort them by distance from the end of the spline to the target location?

#

It sounds like what you actually want is more of a graph

#

say a graph of waypoints.. a "waypoint graph" if you prefer ๐Ÿ™‚

misty gale
#

I wonder...

#

Waypoints sounds nice actually

#

But i wonder how i'd solve the pathing in terms of when to force ai over a road vs free walk

#

If a waypoint is within treshold, but is not connected to a endpoint at desired location (within treshold) but still gets the ai closer... should it follow the road..?

#

Guess i should just play it out and see what fits

#

Guess regular pathfinding solves it anyways . Probably no need for custom waypoints

#

Sometimes its best not saying anything ๐Ÿคฃ

mossy nexus
#

we're in a for a ride

misty wharf
#

Hasn't there been a couple instances where they became extremely racist or something, that vaguely feels like an AI mental illness lol

celest python
#

Microsoft's Twitter AI was a nazi lol

misty gale
#

You know what they say

#

|| Shit in, shit out ||

ember river
#

Rubber duck time
My projectile is set to report noise on hit, however my AI seems to not hear it and to into investigate mode. Le why?

misty wharf
#

I would start by debugging whether the appropriate nodes even run. Does the noise get reported at all? And does the perception update run at all?

ember river
#

Thanks for answering, I'll double check

#

Negative

#

I can shoot at his feet and still no response

misty wharf
#

Yeah so check if the report node or the perception event run

#

since first need to eliminate the possibility that the logic is wrong there

#

Secondarily, I'm not a 100% sure what "TargetLocation is set" does in the blackboard decorator, since technically speaking a vector is always "set" since it can't be a nullptr

#

so in theory that could be an issue

ember river
#

It does get called in the projectile on hit which is good

#

TargetLocation is where the hearing ping is

misty gale
#

Is it a valid location

#

Is the question ^

#

If its an invalid hit, fvector would be 0,0,0

ember river
#

I'll double check, gimme sec

misty gale
#

Not sure how a hit could be invalid but who knows

ember river
#

Aye, okay so in the AI controller, I need to find out if the Stimulus Loc is a valid loc?

misty wharf
#

I'd just print it before/after setting to see what value is being put into it

misty gale
#

^

ember river
#

Will do

#

Gimme sec, and thanks SO much for assisting guys

#

100% not even getting called

#

That's in the AI controller

misty gale
#

Check the bullet hit aswell

#

The hit loc

#

This part

ember river
#

bullet hit is fine, I have vector

misty gale
#

Ah ok

ember river
#

Indeed

#

So basically the pawn is not hearing in general then

misty wharf
#

Did you remember to configure the hearing sense?

ember river
#

In controller

#

In the game.ini?

misty wharf
#

Hearing looks correct, is the detection by affiliation set up how?

ember river
#

This ist he DefaultGame.ini

#

I was instructed in the tutorial to add the second script for AISense_Sight

misty gale
ember river
#

Perhaps I need to add the hearing to script in the default game .ini

#

?

#

I don't think that's the issue

misty gale
#

I've never done that..

ember river
#

It was from Unreal themselves

#

But yeah, nor have I haha I thought it was weird

misty gale
#

๐Ÿ˜…

ember river
#

Anywho, we know it's not sensing it in the AI controller at the very least

misty gale
#

Isnt there a component for the noise stuff?

ember river
#

This is inside the projectile

misty gale
#

Not the reciever but a 'sender'm

crimson galleon
#

Chris has hearing set on the actor and AI

ember river
#

@crimson galleon Come again?

crimson galleon
#

was responding to Squize

ember river
#

Oh

#

At this point in my prototype, only my player character and this projectile has AIPerceptionStimuliSource component

#

In my player, it's set to this

#

In my projectile it's set to this

crimson galleon
#

you followed/watch that one ai tutorial with the drone scanner enemy?

ember river
#

100%

#

That's the very one!

crimson galleon
#

yeah, i dunno then lol

#

ive not worked with hearing, just sight

ember river
#

Ayeeee

crimson galleon
#

maybe there are other vids on hearing that can help

ember river
#

I have some experience with hearing, but I don't think it was efficiant. I had a Make Noise running on a tick which worked, but I don't think it was the best

#

That's the thing, I'd have to cycle through so many vids and just to get to that one tiny moment where my exact problem is touched upon. Some of these vids are hours long

misty gale
#

I have it working on step

ember river
#

I know what you mean and I already searched a bit. Figured I'd ask in here

#

Nice

misty gale
#

Crouching makes less noise etc

ember river
#

I tried on stepping, that didn't work either haha

misty gale
#

There was something about loudness that was messed up

ember river
#

Actually it did, I didn't have the instigator plugged in. Well walking makes noise and works haha

misty gale
#

๐Ÿ˜…

ember river
#

okay, some progress, turns out hooking up instigator to the actor instead of self worked...but I don't know if it's the whole bloody actor loc or just the loc of the shot yet

crimson galleon
#

do you destroy this projectile after it hits? like after the report?

ember river
#

Yes, that's exactly what I do, insta destroy

#

Maybe a small delay is needed?

crimson galleon
# ember river

i cant imagine it being the problem, but maybe it existing for a little longer, or perhaps hidden so it still exists makes it work

#

it sorta makes sense, but shouldnt ๐Ÿ˜„

ember river
#

Aye, well thanks for rubber ducking @crimson galleon @misty gale @misty wharf

misty gale
#

Wouldnt instigater be whoevever shot the bullet ?

ember river
#

Ideally, but when I do, it does not work

misty gale
#

You had self

ember river
#

I put Self in but when I do, it does not register

misty gale
#

But self is bullet

#

Not the shooter

ember river
#

Can you explain that but differently

misty gale
#

Shooter is bullets instigator

#

Or owner

crimson galleon
ember river
#

Aye, but in this instance, I want the AI to investigate where the bullet hit

misty gale
#

Yes

#

But you wanna tie it

#

To who shot it

ember river
crimson galleon
misty gale
#

Not hardcode player char

#

When you spawn the bullet

#

You either plug in an owner or an instigator, or both

crimson galleon
ember river
#

Sure, So on bullet spawn, set owner

misty gale
#

Instigator plugin player

ember river
misty gale
#

Then get instigator for instigator in noise event

ember river
#

As in, in the projectile, in the noise event, somehow get instigator?

#

This part, I'm confused

misty gale
#

Ye

ember river
#

?

misty gale
#

Yes

#

Instigator of bullet is player

#

๐Ÿ˜„

ember river
#

So then now I can GetPlayerCharacter in there?

misty gale
#

Noo

#

No need

#

Instigator == player

ember river
#

BTW this is working, the AI is moving towards where I shot now

#

Aye, I guess I ask that because the Target is Self

#

So that would just be a Self (projectile) is the instigator, not the player

#

I'm probably just not understanding it right though haha ๐Ÿ˜›

misty gale
#

And projectile is destroyed

#

So instigator = null

#

Instigator of bullet would be the owner/instigator of gun really

ember river
#

So for the record, this is what you mean right?

misty gale
#

Yes

ember river
#

Awesome sauce

#

Thanks for explaining btw

misty gale
#

Now we're getting the instigator of the bullet, which would be the instogator of the gun, which in your case is the player

#

It could now be any player.

ember river
#

Indeed, well I call the projectile in the AnimBP on a notify

#

And the player BP has the player arms and AnimBP

#

So PlayerBP > SkelMesh > AnimBP > Projectile Shoot > Projectile

#

?

misty gale
#

Unlike my setup but if it works it works?^^

ember river
#

Hell yeah, it totally works as intended now

crimson galleon
#

so it was PEBKAC all along....

ember river
#

Yes, PEBKAC....