#gameplay-ai

1 messages ยท Page 149 of 1

celest python
#

Nevermind, it was not 'dynamic' at all, I misremembered. It just letting you know when you hit a specific notify in an animation and can be usable in BPs

#

But maybe you can check your own conditions when notify hit? Like doing this manually, instead of bindings things dynamically

mossy nexus
#

I mean the binding needs to be dynamic

#

basically check for the animation to either use the logic on a) anim notify, or b) at the end of animation, if no anim notify exists

mossy nexus
#

perhaps it would be something like splitting the animation up into a startup, active, and backswing setup

#

and start the logic at the same time as the active part of the animation

#

but I'm not sure that would gel with the current animation pipeline

glacial sapphire
#

Hello everyone! I'm trying to pass a variable from my AI to a task. what i put in the object?

mossy nexus
#

presumably the controlled pawn?

glacial sapphire
#

no

#

the AI

#

how do I take a variable from my AI and set it to my blackboard?

#

do I use cast or is there another way to do this?

acoustic minnow
#

You will want to cast to the class that has your variable which would be your AI controller or the AI itself then create a blackboard key and set it as an int or whatever type of variable it is

#

make sure your blackboard key is public. When you add your task to the behavior tree you will now be able to set your blackboard variable to that key in the detail panels of the task in the behaviour tree

calm kite
#

How can I prevent creating this navigation part on the actor I spawn in runtime. I want the actor to affect the navigation, but I don't want to have the navigation on it.

past lodge
#

How do i get vector into a float value for move up/down and turn right/left. I want to use the same movement function for the AI with the player function that bindsaxis for the playerinputcomponent

mossy nexus
#

so for composition's sake (and due to UE4's inherent architectural limits) I'm trying to make a component that I can just slap on anything that needs to be associated with my AI director subsytem. does anyone have experience with this kind of setup? I assume I still have to write a bunch of class specific logic that may be repetitive?

misty wharf
#

I guess it depends on what the component does

mossy nexus
misty wharf
#

All of it? :D

mossy nexus
#

I mean I can't readily put in e.g. an Attack() function because that would be different per AI

#

so already there it gets class specific

misty wharf
#

Right, so if you wanted it to automatically handle it, you could do an interface on the AI pawns and have the component talk to its owner actor through it

#

This would probably require the least amount of glue logic to be duplicated across the actors

mossy nexus
#

yeah but that's just a weaker way of doing composition

#

with the component, I can do the same AND add generic logic that is true for all classes

#

I don't think glue logic is necessary in either case, it's rather a case of not repeating logic and avoiding too much class specific logic

misty wharf
#

You could have a base class for the component and then have different components for different types of actors as well

mossy nexus
#

the ideal would be having class specific data but have the logic be dictated entirely by component

mossy nexus
misty wharf
#

Well it sounds like some of it is very actor specific

#

so the only way to really make that generic is to put it behind an interface or such as mentioned

mossy nexus
#

I don't think I agree with that. putting down an interface means all the logic will be class specific

#

it's not generic logic that works for all classes then, it's just that each class implements its own version of the logic

misty wharf
#

But so far what you've said is that you have logic which is specific to each actor type

#

how do you plan to make that generic?

mossy nexus
#

like I said, the ideal situation is having each actor have specific data that is used in a generic way

misty wharf
#

Yeah I guess you'd just need to have the component query for it

mossy nexus
#

now that I think about it perhaps it would be possible to do it like that. have a bunch of items and let the item attribute dictate which function should be used on the component... perhaps that is the way

mossy nexus
misty wharf
#

Yeah

mossy nexus
#

makes sense. thanks for the bounces

misty wharf
#

๐Ÿ‘

restive turret
#

AI Behavior Tree flickers when it wants to chase the player

misty wharf
#

The task is probably failing which then restarts the tree

ocean wren
#

Evening fellow AI

restive turret
misty wharf
#

If it's a move node it can fail for various reasons, such as missing navmesh, or invalid move location

restive turret
#

alright thanks i will look into it

misty wharf
#

Visual Logger usually has some more info on why moves fail so you might wanna check with that :)

restive turret
#

never heard of a visual logger how do i access it?

#

wait u meant the log?

#

if yes then i must be a dumbass

misty wharf
#

Window->Developer Tools->Visual Logger

keen crow
#

how do I stimulate one sense because of another? I added a handler for UPerceptionComponent::OnTargetPerceptionUpdated and want to stimulate Sight Sense from Damage Sense when damaging actor is outside of Sight Sense green are but still within its red area

misty wharf
#

just move your handling logic for senses into their own functions and call the appropriate functions from your handlers

#

this way you can just call that function from your damage handling code instead of having to do some really roundabout way of sending sight stimulus

mossy nexus
#

what would be the absolute cheapest way of getting a route between two points on navmesh?

#

the route is only a needed for a check

#

not traversal

vapid zinc
#

i am doing an ai without BTs or BBs all in c++ should i put the ai logic in the ai controller class or the character class?

misty wharf
# mossy nexus not traversal

I'd imagine you just have to do NavSystem->FindPathSync or such.. this is what I'm doing for reachability checks between buildable things and NPC's so they don't attempt to move to things they can't reach

misty wharf
#

Basically the character is like a "dummy" which something else orders around

#

This makes it easy to swap out the AI logic if needed, or just call the functions directly with no controller for testing purposes

mossy nexus
#

that's my setup, plus a director that dictates everything to keep it more in line with ECS

hearty niche
#

how do I bind a function to success or fail of Move To Location in bttasknode?

misty wharf
#

You need the node to be instanced first off, then you just bind a function to it the same way as anywhere else

hearty niche
#

instanced?

#

I did override the execute task function and wrote my logic

#

what dispactcher would I be binding to?

misty wharf
#

Oh - if you're just doing it in BP's, just call the regular move to node which has the on finished pin

hearty niche
#

its cpp I am just converting my bp to cpp for performance

#

I think the right word was delegate

misty wharf
#

ah

#

yeah you need to mark your C++ task as instanced, it has a function or a flag on it somewhere that you just make true

#

I don't recall off the top of my head where the delegate for the move is but it should be in the move request or the pathfinding comp I think.... just look at the code for the BTTask_MoveTo or whatever it was called, since it does all this already

hearty niche
#

wait how do I mark it as instanced?

hearty niche
misty wharf
#

Interestingly it looks like it's actually not instanced

#

so they did it in a different way for that one

#

instead they seem to just use the tick feature to check when the movement is done

hearty niche
#

I found a delegate called on delegate finished in the path following component that could be what I am looking for I guess

celest lodge
#

For some reason if my player is at the x the enemies get stuck at the circle, I have a nav link proxy that is left to right only set to have them jump down, and if I am elsewhere not on that platform they are able to traverse the stairs just fine, I can't figure out why they clump if I stand there though

celest lodge
#

I set it under smart link, not simple link was my issue, I changed it there and now everything works

hoary peak
#

I'm using the MoveToActor node to have two AI's walk towards each other and for the most part it's working but sometimes they overshoot and pass through each other. Is there a way to make it update more frequently?

runic flare
#

Try this?

#

You might also want to tune the Acceptance Radius based on how close you want them to get so they recognise they've "met"

woeful coyote
uncut python
#

are there any tutorials on replicating AI? Im having a tough time getting my ai to chase and attack me correctly

celest python
#

Anyone tried to use BTs as individual logic trees?

#

It seems impossible due to design

celest python
uncut python
celest python
#

Movement is replicated by default if you run move to task in server

#

Attacking logic is depending on you, you need to replicate it in your character/pawn class, ofc that depends on your way of doing things

uncut python
#

@celest python I see, the biggest issue im having is geting AIPerception to replicate where it will chose the cloest player to go to

#

so i kind of made a work around but as soon as i switch it to run on server it shits the bed

woeful coyote
uncut python
pine token
#

any idea how to handle navmesh building in an infinite world? i make a voxel game and currently i just move the navmeshbounds volume around and then trigger a navigation rebuild, but that is causing a lag spike although i enabled "lazy" navmesh building and threaded navmesh data collection

pine steeple
#

why are you replicating AI stuff?

#

@pine token use NavInvokers on large world

pine token
#

i still need a navmeshboundsvolume with invokers

#

seems like OnNavigationBoundsUpdated updates the bounds

runic flare
#

Has anyone run into a situation where their AIs won't choose the correct navmesh?

#

I have multiple navmeshes, each with a different agent radius defined

#

but my agents keep choosing the default mesh regardless of their capsule radius

#

I've narrowed it down to this method UNavigationSystemV1::GetNavDataForProps -- here NavDataInstance is always NULL so the MainNavData is returned

#

any ideas?

stone walrus
#

why we use tree meshes in foilage if it already have lod

mossy nexus
#

does anyone know what this decorator actually does?

#

it seems entirely useless, or very arbitrary

#

does it discriminate beween blackboardkeyselectors?

misty wharf
#

Huh?

#

What that does depends on the type of the blackboard value

#

For objects and such, it does nullptr checks, for numbers it can do greater than, etc.

mossy nexus
#

what does it do for vectors

misty wharf
#

Dunno, try selecting a vector value in its properties and see what options it gives you I guess :)

#

the options change based on what it can do with the value

mossy nexus
#

it doesn't give options

misty wharf
#

It might not do anything with vectors then I guess ๐Ÿค”

mossy nexus
#

I don't get notifies either. result change or value change... what's the difference?

#

what does it mean that a vector value is set or not is not set

#

it's written so obtusely

misty wharf
#

my understanding is that value change will trigger even if the same value is reassigned, result change triggers only if the actual result changes (eg. false becomes true)

#

set or not set for vectors doesn't make any sense yeah, for objects that's a nullptr check

mossy nexus
#

so what's going on? looking at the code I can't find anything

#

there's BlackboardKeyType.h that houses the enums used and some generic functionality, including comparisons

#

but there's nothing that seems used in that node

misty wharf
#

Not sure what it'd do with vectors, I've only really used that with integers and objects

mossy nexus
#

surely it's means to be used for vector comparison too

simple crest
#

99% sure if you look at the code it's written like, if a vector is 0,0,0 it returns true as "unset" (yeah, it's very lol)

pine steeple
#

isnt InvalidVector MAX_FLT?

simple crest
#

ah yeah. I'm probably thinking of how it treats bool by accident

keen crow
#

I've started learning custom NavLinkProxies and I have a couple of questions

  1. Say I have a nav link for mantling on ledges and I have 4 crates in a row and I want my AI to mantle from 1st to 4th. Do I just place my custom nav link proxies one after another on top of each other or is there a better way?
  2. Is there any event to subscribe to or a virtual function to override to handle reaching end point of nav link proxy? I have a slide mechanic and I want my AI to start sliding on reaching left point and resume walking when it reaches right point but I just can't find anything to override
misty wharf
#

look into smart nav links, this allows #2 at least

keen crow
#

Could you be more specific what exactly must I do with smart nav links? I'm inheriting my link proxy from ANavLinkProxy and already subscribing to OnSmartLinkReached event to start an action, now I need something like OnSmartLinkLeft event but I can't find one

misty wharf
#

you need to determine it manually based on when the actor reaches the end of the link

keen crow
#

I still don't get you.

when the actor reaches the end of the link
this is the thing that I want to know how to do it

misty wharf
#

You need to handle it in your actor that's moving. You can create a custom smart link component, which has an event which fires when a pawn reaches it, with the destination point for it as well

#

Then you tell the pawn to move to the destination point, and the pawn can have an event for when this completes, which you listen to

#

iirc you can also extend the nav link proxy actor to create your custom navlinkproxy which can handle this logic too without needing a component... but if you want to have a smart link as part of an existing actor then you'd need to make a component for it

nimble vessel
#

Im so happy I think I finnaly got it down how I should think when using sequence and selectors

nimble vessel
# mossy nexus what does it do for vectors

It checks if the vector has been set. Clearing it will make it "unset". Although I have a had problems using blackboard based condition when it comes to vectors a few times. Therefore I wrote my own decorator for checking Vectors.

mossy nexus
#

but

#

I found out yesterday that the Set has to do with whether it's within bounds of the AISystem

#

so it's completely useless unless you use that

#

but you won't understand that information from just reading Set. it doesn't implement arithmetic operators for FVector as it does for float

misty wharf
#

Well that's kinda weird :P

#
FORCEINLINE bool IsValidLocation(const FVector& TestLocation)
{
    return -InvalidLocation.X < TestLocation.X && TestLocation.X < InvalidLocation.X
        && -InvalidLocation.Y < TestLocation.Y && TestLocation.Y < InvalidLocation.Y
        && -InvalidLocation.Z < TestLocation.Z && TestLocation.Z < InvalidLocation.Z;
}
#

Yep, this is all it does

#

InvalidLocation is FVector(FLT_MAX)

#

so it literally just checks if the vector value is within the bounds of the float datatype

#

which seems like it would pretty much always be unless something was horribly wrong

ocean wren
#

Probably fails with NAN ๐Ÿ™‚

odd nexus
#

Hi there. How can I build a path with a vector array for an AI? So, I have a vector location for each frame (25FPS), the goal is to move the AI along the Path for a 6-7 seconds, but the movement should be smooth and realistic

mossy nexus
ocean wren
#

What have you tried so far?

odd nexus
# ocean wren What have you tried so far?

I have tried to make it with Behaviour Tree, with ServiceNode, that update the target location by using the for each loop and with the Task Node MoveTo. But this for loop ends immediately, that target location is defined only throught the last element of the array.

odd nexus
simple sigil
#

Does AIPerception support interval updates? I'm looking at wanting to revaluate what's already perceived to be able to react to changes like distance. So if my AI sees a group of actors it can switch target if who is the closest actor changes. Right now I'm getting OnPerceptionUpdated events when an actor leaves perception, a new one joins, and if there are any fired stimulus events such as damage. I don't see a straightforward solution for rechecking stored actors to update the behavior tree.
I'm not sure if AIPerception is meant to function with PawnSensing (They seem to do a lot of similar things so kinda like it's own implementation. I notice that PawnSensing has EnableSensingUpdates and SensingInterval which would allow for the kind of behavior I'm looking at, but I don't really want to mix & match two systems if they're not meant to be used together.

misty wharf
#

@simple sigil you can use a BT service which goes through the list of currently perceived actors and assigns the appropriate actor to a BB value

#

Or you can do it on tick in your AI controller and assign to BB, or do it in a BT task whenever it gets executed, etc. - various ways to do it :)

#

AIPerception afaik supercedes PawnSensing

dapper spear
#

Hi may I know what is the difference between behavior and tasks? I thought they were the same? Some tutorials mix the name. Thank you

tranquil reef
#

hello!
does anyone know how I can get this dynamic age value in blueprints?

frigid cipher
#

This condition is Failing, despite the Key Query being Is Set, and the bool is True. "value: true (fail)"

celest python
#

Do 2nd decorator evaluated if first one fails in BT?

pine steeple
#

no

#

you can use a composite decorator if you need to make an or

hearty niche
#

Is this the right way to check if pathfinding is complete in cpp?

Controller->GetPathFollowingComponent()->OnRequestFinished.AddUFunction(this,"ReachedLocation"); // inside another function

void UBTTask_FindLocationRelativeToPlayer::ReachedLocation(FAIRequestID RequestID,const FPathFollowingResult& PathFollowingResult){
if (PathFollowingResult.HasFlag(FPathFollowingResultFlags::Success))
{
FinishLatentTask(*BTComponent, EBTNodeResult::Succeeded);
}
else if (PathFollowingResult.HasFlag(FPathFollowingResultFlags::InvalidPath)||PathFollowingResult.HasFlag(FPathFollowingResultFlags::Blocked))
{
FinishLatentTask(*BTComponent, EBTNodeResult::Failed);
}
}

misty wharf
#

Does it work? If yes, then yes, if no, then no

#

:D

hearty niche
#

I mean syntax ๐Ÿค”

misty wharf
#

What do you mean? If it compiles it is the right syntax

hearty niche
#

I guess I should test it. Sadly the rebuild also rebuilt the engine again :/

misty wharf
#

ah

#

I don't use an engine source build so thankfully don't have that problem :P

hearty niche
#

ue5-main so yeah

misty wharf
#

I would imagine there must be some way to exclude it from being built, similar to how the EGL distributed engines work

hearty niche
#

not that experienced so no idea. The problem is when I right clicked my project and clicked rebuild, it should rebuilld my project not the engine -_-

#

second time this is happening

hearty niche
keen crow
#

How do I make AI do something when he enters and leaves a zone? For example I'd like to place an area on a map in which AI character starts sprinting when it enters the zone and stops when he leaves it

hearty niche
#

you could just use a trigger and on begin overlap set the variable on your AI to make it sprint and disable it on exit. Pretty sure there are other ways though @keen crow

keen crow
#

Hmm I guess I could but for some reason that doesn't sound right although I'm very new to AI in games. I was hoping there's something to do with smart links in NavLinkProxies or just some existing funcationality in AI components or smth. Like I know you can handle an event when a character enters first point of NavLinkProxy but I couldn't find an event or a function to override when the character leaves navlink. But thanks anyway, I guess I'll try it your way

lyric flint
#

I want to:

  • create a scene in unreal that plays a boxing match between 2 computer controlled players
  • make camera move the way it moves in real life boxing translations
  • record screen of this game, together with CSV file containing 3d transforms of the actors/control rig movement data with time stamps)
  • develop a Classifier using this training set, so it could
  • if 1080p video of real life boxing game translation recording is given, spit out this stream of floats that is convertable into UnrealEngine animation
#

How it approach the development of classifier? Say I have a training set - many video files and huge CSV files for each of them

ocean wren
#

Wow, you go for the real easy questions first don't you

#

Try classifying content from an existing dataset first, there's plenty of pose estimation datasets out there with hand annotated keypoints for still images at least

#

There's a few from Michael Black's lab for 3D too

#

But you're talking about a pretty big project. This goes to the heart of a thing called "Motion Matching" if you want to search for that term in semanticscholar or google scholar

#

CMU also has a 3D pose dataset with video too if I recall (from their multi-camera surround volume)

#

3D pose estimation from video isn't really a solved thing yet though

#

Ah yeah, CMU Panoptic dataset.. useful for you I think.

hearty niche
ocean wren
#

NavArea is what you want, its basically a volume, but honestly you could just use that thing that was on the marketplace for this kind of thing?

#

Navlink's are meant to be just connectors between navmesh chunks, so not really what you're after

#

You could basically do it with any volume where you can get enter/exit events.. then just change your values on the AIController and feed them to your blackboard as per usual

#

Navarea is a volume, but it also changes the cost of navigation. But that doesn't really sound like your goal, so just use a trigger volume instead and change a property on the controller to say "I'm inside a trigger" on enter and unset it on leave

hearty niche
ocean wren
#

Trying to optimize BP's with interfaces seems a bit redundant.. if you're doing things in BP its going to be slow anyway ๐Ÿ™‚

#

But yeah, why not

hearty niche
#

I mean you would save on trying to cast to the right thing and not be stuck with one parent class

ocean wren
#

So our recommendation is.. use a trigger volume, set a flag (that gets put in the blackboard) and unset when exiting

hearty niche
#

any actor with definition for the logic would do its thing or else the nothing happens

hearty niche
ocean wren
#

Yeah, that's the usual way

hearty niche
#

I doubt what he wants to do needs to got to the BB

#

you could just set the walk speed on character movment. he just wants to change speed

ocean wren
#

Well, might as well do things right, throw it in the BB and use your BT properly

hearty niche
#

unless his BTs affect movement speed in some other way as well

ocean wren
#

Yeah, fair point.. I was thinking he wanted a bit more complexity than just setting the speed

#

You could do the same thing and have an AI queue for a ladder for instance, or wait for a traffic signal. I was kind of thinking of those types of use-cases

hearty niche
#

hmm those are different cases as I said. changing movement speed by going into BB and all sounds kinda more complicated than needed

ocean wren
#

It can be useful to also allow filtering via tags or some such to enable/disable volumes for different classes of actor

#

Yeah, for just speed you'd just set the movement speed as you said

#

But when is AI ever just about speed ๐Ÿ™‚

hearty niche
#

that's one way of doing it I guess

#

isn't tag comparing kinda expensive?

ocean wren
#

If you did it every frame, then yes it would be bad.. but once? nah

#

remember this is simply onenter/onexit stuff

misty wharf
#

Aren't tags just names so they should be fairly cheap to compare

ocean wren
#

If you're worried about speed, you could always use a hash

misty wharf
#

Of course it depends on whether you also need to find the object which contains the tag first and not just look at tags on some ref you carry

ocean wren
#

Well, in this case, you'd get the overlapping actor on the entry, so you could just get the tag value directly once and switch behaviour, as you say, a string comparison although if I recall, the tag values have some optimisation? can't remember if it was the UE default tags or our own

#

I've used hashes as tags before to avoid string comparisons, so you could easily add your own "tags" container component that simply uses hashes rather than tags (hash the tag string into a hash number and do a number comparison instead)

hearty niche
ocean wren
#

But in this particular use case, I doubt you'd notice any perf problems

misty wharf
#

iirc a tag in UE (and gameplay tags too) are FNames, which are basically converted into some kind of numeric lookup or something so it's faster than a string comparison

hearty niche
#

yeah saw an article by Tom Looman on those. Might check them out soon

ocean wren
#

zomg: sounds right..

#

We rolled our own version years back too

#

Not hard to do, generally useful

#

Boils down to a unsigned integer comparison, so its damn quick

#

Well, I guess bitwise comparison in UE's version

#

Would recommend ๐Ÿ™‚

#

Vegito: I hope you're cache-ing those spherecasts ๐Ÿ™‚

hearty niche
#

why would I cache? it is a bttask which checks if there is a friendly blocking the way to the player. If not, shoot or else task fails

#

tag comparison is something I could optimize though

ocean wren
#

I guess it depends how often you're shooting, but if you have a lot of enemies that'd mount up

hearty niche
#

as of now I am just converting my bttask for ai to get a good location to the player to cpp for performance.

It has an eqs, patfinding and a timer with distance checks which gave 60 fps with 20+ enemies. Gonna optimize that one first

misty wharf
#

Tbh you might not see much of a difference if it doesn't have a lot of BP nodes

hearty niche
#

I do have a lot of distance checks every 0.5 seconds

#

one enemy to player, one player to eqs origin point (whre the player was when the eqs was called),etc

keen crow
# hearty niche I doubt what he wants to do needs to got to the BB

@hearty niche @ocean wren my original question with a sprint was just an example. The real problem is I have various mechanics for player in my project like mantling, sprinting, sprinting to sliding, sprinting to wallrunning, proning and say I have a logic in my AI controller that under some occasions AI character just goes from one point to another by AI Move To Location functions. Now I need to know how to teach AI characters to slide under low obstacles, how to wallrun over pitfalls, how to use ladders, etc. I managed to implement mantling for AI but that was easy because I just had to create a custom NavLinkProxy and invoke base character's Mantle function, but things get harder on situations like sliding, wallrunning, sprinting, etc where I want AI character to start some action before obstacle and finish after it so that it can reach destination point set by AI Move To Location. Your idea with trigger volumes is nice but I haven't worked out yet how do I determine if by entering the trigger volume should character really start say wallrunning or if he is doing some other login like chasing character or hiding in cover or whatever

ocean wren
# keen crow <@!428266140385411075> <@!152527068045770752> my original question with a sprint...

Hmm, I see. In that case, I probably wouldn't mark up the world and instead would build a navigation controller on top of the movement component to alter the methods that the movement component uses to traverse. Maybe even call it a traversal component. The idea of this component would be to classify the neighbourhood around the agent to determine how best to move through the world locally. So might do a bunch of sphere/raycasts to determine if it needs to duck etc. Wall running would be a proximity check for a bunch of raycasts or a spherecast and contact distance check to activate wallrunning. They did mention a bunch of this on the Wolfire blog back in the dev phase for that game, so might want to look at that. So the main advice I'd give, is to build it into the characters movement otherwise I could see your world being full of hint volumes and getting a bit difficult to edit.

#

Usually, what you'd do, is try and identify nearby opportunities for smart movement. So is a wall near me? then wallrun, if there a gap coming closer in front of me? start sliding. The way you discern those opportunities is up to you. You could always mark up the world (they do this for assassins creed games for instance), but it feels like you'd be wise to do some mix of ray/sphere checks and world markup.

#

This kind of thing is related to the "smart object" concept in game AI, where we annotate world items with potential uses and animation data and lets AI's decide which nearby smart objects satisfy their needs

keen crow
# ocean wren Hmm, I see. In that case, I probably wouldn't mark up the world and instead woul...

The idea of this component would be to classify the neighbourhood around the agent to determine how best to move through the world locally. So might do a bunch of sphere/raycasts to determine if it needs to duck etc. Wall running would be a proximity check for a bunch of raycasts or a spherecast and contact distance check to activate wallrunning.
is it something EQS is designed to solve? I've watched some videos about it but it seems kinda complex and I'm not sure if it really fits for problems like mine

ocean wren
#

EQS could certainly be part of it for sure

keen crow
#

then I guess I just don't know AI in UE4 good enough yet to solve my problem. I'll try to learn EQS more because as you said

I could see your world being full of hint volumes and getting a bit difficult to edit.
that scares me too

ocean wren
#

So here's an example of one thing I've done.. I want to stack a group of AI soldiers up on a door, breach the door and make them enter the room in a "spec ops" manner. So I have components on the door for "stack up locations" where I can edit those per door to make the stacking work. The AI soldier uses EQS to find the stack point that is 1) closest to the door 2) not already occupied 3) on the correct side of the door etc..

#

Now I don't want to annotate EVERYTHING in the world. But doors and door handles are obvious special cases, so makes sense to mark those up.

#

But walls? no, I'll sphere/raycast for those

#

Now I've seen some games (notably some CryEngine ones) where they basically have designers annotate the blueprints for every item that can be placed in the level. So cover locations, mantle locations etc.

#

Personally, I'd balance it a bit.

#

Annotated world content looks better generally. Less prone to making errors. But adds clutter to the editor unless you can switch off visualizations etc (you should enable that)

#

So for instance, you could annotate windows to allow soldiers to shoot out of them by standing in a certain position OR you could just get the soldier to find actors with the tag of "window.open" and go and stand at the nearest middle point of the window and fire and hope it works ๐Ÿ™‚

#

The latter actually does work most of the time, but means you need fairly open windows and kind of fails if you start to have fancy windows where they don't fully open etc.

#

Always a bit of a tradeoff

#

You can also have smarts in the objects themselves. My door example, the door controlled the execution order of the breaching because it had different sequences for breacher entry1 entry2 etc.

#

Ladders were another one where I had more of a smart object approach. Because you want them to queue at the top or bottom if someone is on the ladder etc.

#

ideally you need your squad to cover the other end of the ladder ๐Ÿ™‚

#

Same for elevators, trucks, carts and the like.

#

So you hand off some AI from the character to the object to be interacted with. Instead of "use this <door" you go "door, I want to use you, tell me how"

#

If you were being a proper AI programmer. You'd build an ML model from examples of your own world traversal and apply that as your traversal component ๐Ÿ™‚

keen crow
#

honestly this approach with "smart objects" is not really to my taste right now because my previous enterprise background tells me that objects like doors shouldnt really controls actors, or characters how should they interact with it but still thanks for advises. For now I guess I'll fill my EQS knowledge gaps and return to my problem again

ocean wren
#

Well, just know that the smart object approach is what Bioshock uses, and the sims

#

and plenty of other games

keen crow
#

guess i'm too narrow minded then ๐Ÿ™‚

hearty niche
#

there is no right way of doing stuff in gamedev as I said earlier. As long as it works does not stall fps any smoke and mirrors trick can be appropriate

ocean wren
#

The reason they use it, especially in the sims case, is that you can do extra content packs with new objects if you make the behaviour of object usage reside in the object itself.

keen crow
#

good point

ocean wren
#

So they can do loads of new content packs by editing a base "use me this way" script and edit it for new objects. A toaster and an oven for example.

#

There was a nice presentation from GDC by a guy called John Abercrombie about Bioshock's smart objects in the beach scene.. its on YouTube

hearty niche
ocean wren
#

John now works at Epic ๐Ÿ™‚

ocean wren
hearty niche
ocean wren
#

Its a pretty popular pattern, not without its downsides of course.

ocean wren
hearty niche
#

what are the downsides tho?

ocean wren
#

Well, your world becomes cluttered with annotations. Some poor schmuck has to annotate everything. Some poor schmuck has to check the annotations are correct. Often annotations work ok in test cases but when placed in real levels they fail. Stuff like that.

#

For example.. I annotate a door to say "you can use me, just stand here and play the door opening animation", then some other schmuck decides to place a barrel in front of the door. The AI finds the door smart object, tries to navigate to the "you can use my stand here" location.. and fails ๐Ÿ™‚

#

One response to that of course is to have an AI whose purpose is to try out all the smart objects ๐Ÿ˜‰ so do coverage testing.

#

Just have them move around the level trying to use smart objects for stuff.

#

And log any failures

#

Automated testing of AI is definitely getting to be more common for the industry. I know plenty of devs who do it, including most of the bigger publishers.

#

For instance, if you aren't automatically testing your navigation, you're missing a trick

#

Hell, we did it on worms 2 back in late 90's early 2000's

#

Not so much for indies though

#

sigh ๐Ÿ™‚

#

Had a good discussion with a guy from Naughty Dog about it one night in a bar. Apparently they'd not done it fully yet. It was after a presentation by Microsoft where they had like 500 Xboxes testing overnight. I suspect they do it these days ๐Ÿ™‚

misty wharf
#

Worms 2 PogChamp

#

...I was 10 when that came out

#

probably got it a year or two later but it was pretty great lol

#

I didn't really play the rest of them after that tbh, but they more or less felt like "worms 2 but with more"

mossy nexus
#

I'm sitting with a problem of defining high alert actions for AI. I've found 3 cases that I'd like to implement (each of which I know the logic for):

Raise Alarm
Attack
Escape```
I'm thinking whether or not I should implement these as behavior tree actions (that are unknown to the AI, but the AI has a type preference between them) or if I should put them directly into the AI as behaviors so that the BT can have a generic `UseHighAlertAction`
#

Worms armageddon was Worms 2 with better singleplayer content in form of missions IMO. for a long time it seemed like the premium version of worms 2 that us worms 2 peasants never had access to. I was already an adult when I first tried armageddon

ocean wren
#

WA was basically a rewrite of a lot of the frontend part of W2, had some neat weapons and generally was a bit more polished and less cobbled together ๐Ÿ™‚

#

Oh and I rewrote the servers and whatnot for WA

#

although it was still a nightmare when we got chinese players and half a million of them tried to logon at once

mossy nexus
lyric flint
#

Where to read / watch about new Unreal Machine Learning plugin?

celest python
#

Works for my system, might not be suitable for your system

mossy nexus
celest python
#

I wanted to encapsulate attack actions because while some AI's can only do melee attack some of them has multiple weapons and behaviors, so I needed to decouple this system from BT, otherwise I would need to create BTTask for each behavior

#

Instead of I just create gameplaytask-like objects now which can be callable from single bt task for each AI

#

Also since gameplaytask class is just a variable, I can change it dynamically

mossy nexus
#

so I'm thinking for my system to use a generic HighAlertAction that just calls whatever the current high alert action is (this can be an attack, but it can be other behaviors), and let the AI themselves handle it depending on circumstances

#

like an AI might have their preferred action changed dynamically to ESCAPE if they realize they can't win

#

however, that would mean I would need a new behavior tree for every type of action

#

which isn't great

celest python
#

You might not need to. You can do a similar system to mine, but there is one pitfall. For example AI realized it can win, and executed ATTACK behavior. But player did something and they changed their mind and now they want to use the behavior ESCAPE. You somehow need to solve how you can signal this to BT and reset the current running ATTACK task

celest python
#

It's easy to fix but I'm struggling to find the most clever way

mossy nexus
#

I think if it has committed to an action already, then that's that

#

the next action becomes the important action IMO

#

I wouldn't attempt to switch actions mid action

#

but if it's in the process of reaching a place where it can execute that action, then it can switch

#

equally in my system I don't query the next task until right before it is being used

celest python
#

Alien Isolation solves this by using some kind of states in BT (zoombapup will love this lol), before any kind of action they evaluate decorators similar to "Should Search Rooms" or "Should Attack Player". If "Should Attack Player" returns true, they just run a single task and if something that can prevent this situation happens, its already considered before "Should Attack Player" state so they can cancel it without any problems. For example if some NPC damaged the Alien very badly, they already runned "Should Run Away" before "Should Attack Player" so next tick, before running attack behavior they will execute running away behavior.

#

If you are not switching them as frequent as me, then its a good pattern imo.

mossy nexus
#

like I said the only crucial moment for me where a switch cannot happen is from when it queries the next action, to after the next action is executed

#

at that point it will have committed to whatever action. anything up until that point is fair game

#

but my case is made worse a little (or better, depending on how you look at it), because I've chosen to use a data actor as a generic type to hold all data for actions

#

and the same data actor is being used for high alert actions as with passive actions

#

perhaps I just need to subclass it for some extra specific high alert based logic

#

but I'd rather keep that in the AI component, and not in the action itself

mossy nexus
#

(though in some cases it's not possible - for instance, for animations, the animation notifies decide when the event happen with every animation)

mossy nexus
#

I've basically created an AI Component that hooks up to the AI director

celest python
#

Nice

#

Because AIController would be a bad choice

mossy nexus
#

the component handles perception logic, as well as instinctual behaviors (e.g., high alert actions). anything else is handled by the BT

celest python
#

I just store behavior-related things in the class directly, and try to instance/subclass things as possible

mossy nexus
#

I would, but it would remove the genericness of being able to just slap a component on an actor and make it work

#

I do hookups between components on the actor though... like when health matters

celest python
#

Behavior itself shouldn't be generic in my opinion. BT can be generic but pawns actions and behaviors not

#

I do my best to instance everything as possible

mossy nexus
#

well like I said, actions depend on what the action data actor has stored

mossy nexus
celest python
mossy nexus
#

so far I'm thinking:

- Pool of potential attacks (Data Table or UObjectList) on the AI component.
- On high level action -> if Attack -> Query an attack from pool based on conditions.
- Spawn ActionData Actor with Attack at target's location.
- Adjust AI component's sense towards action
- BT handles movement and action once everything has been setup
celest python
celest python
mossy nexus
#

nope, real time

celest python
#

So then you will do something like my system, BT will only signal to X (actor/component/action .. anything) and after that it will handle tracking the target goal etc.? - asking to understand your case

celest python
#

One thing I can recommend is decouple your AIComponent

#

Don't use it as base of everything

#

Do AIPerceptionComponent, AIAttackListComponent, AIBlahComponent but not AIComponent

mossy nexus
#

that's why I wanted the action data elsewhere

celest python
#

It still communicates with single component that handles many things

mossy nexus
#

I would decouple, but that means I have to use the actor

#

and I don't want to use the actor

#

there would have to be a lot of repeat logic in actors if I have more than one actor with the component

#

I handle perception in the component, but not behavior generally. Perhaps the AI director should have responsibility for creating the correct action for the AI

celest python
#

Can you make me understand, why it will repeat logic? It will split the tasks, one of them will do X, other one will do Y and owner actor/pawn will act like a base of them

celest python
mossy nexus
#

yes but consider: any communication between components must be handled in the actor

#

I make one single exception, because I use one type of component as "eyes" for the perception, and the AI component gathers these themselves

mossy nexus
celest python
#

How do you calculate how AI should react/attack?

#

Based on which stats

#

Position, health, direction etc.

mossy nexus
mossy nexus
#

any time perception triggers, stress increases

#

at certain thresholds behaviors become unlocked

celest python
#

So you kind of mapping behaviors based on stress level then? That data actor provides "stress level" and if its higher than X, you're doing Y etc.

mossy nexus
#

yep

celest python
#

Probably an utility system would work better for you

#

Instead of BTs

mossy nexus
#

the BT takes into account stress levels and tells the AI to do things based on that

#

I don't think so?

#

I've used BTs to model all other behavior

#

the high alert stuff is my last issue

celest python
#

Nah I was meaning generally not for this specific case

#

You can ignore it

#

So why don't you literally map your tasks then, I mean literally using TMap<>

mossy nexus
#

I still think I will have to make three different subtrees for the three high alert behaviors I have

mossy nexus
celest python
#
struct FAIAlertBehaviorWrapper
{
  // Possible alert behaviors for specific stress levels
  TArray<UAlertBehavior> AlertBehaviorArray;
}

TMap<float, FAIAlertBehaviorWrapper> AlertBehaviorMap;
celest python
mossy nexus
#

ah I see

#

yeah I do that already, but in a different way internally

celest python
#

Instead of UAlertBehavior it can be FAlertBehaviorData which also holds conditions for that alert etc

#

And it can be UDataAsset to differentiate it between situations, AI types etc.

#

So AI director or data actor can only select a data asset

mossy nexus
#

I think the map is a bit overkill as it would make behaviors very unpredictable

#

I stick to thresholds because they keep things at a baseline

#

and players need fairly predictable behavior to model their playstyles

celest python
#

How about TMap<FVector2D, FAIAlertBehaviorWrapper> AlertBehaviorMap; then

#

Adds a range/threshold ๐Ÿ˜„

mossy nexus
#

I think the BT kinda solves the issue without having to deal with complex mapping

#

it outputs behavior based on stress thresholds

#

and it's very easy to see the visual of what's going on

#

plus I can access passive behaviors as well, when there is no stress

celest python
#

That way you need to handle differentiating that 'actions' -- which leads us back to your first question

mossy nexus
#

well... I would have to anyway

#

the map solves a problem I've already solved

#

but I think at least I've understood that the director needs to have the responsibility of the action data, based on the preferences of each AI

#

and yeah, maybe you're right with the map I wouldn't have to make subtrees, but that would come at the cost of not using a behavior tree

celest python
#

Well each decisions has its trade offs

#

But I can say, I would never duplicate BTs or use subtrees

mossy nexus
#

I'd prefer using the behavior tree since it works perfectly for all other behaviors

celest python
#

You will still use BT

mossy nexus
#

well you can execute subtrees by creating generic BT subtrees

#

which I will probably make use of

celest python
#

I always prefer to do things like that

#

BT just signals in my projects

#

Not handle things

#

I'm kinda abusing it in some way

#

I'd need to create toooo many BTTask if I would try to handle behaviors there

mossy nexus
#

same

#

which is why I think the action data in a separate spawned actor is the best

#

data separate from logic

#

I just need to understand how in the end, the action data is generic enough to be used by all AI components and their actors

celest python
#

Is ActionData "Action Handler actor that stores data based on AI's stats" or just "ActionData just stores data" ๐Ÿ˜…

mossy nexus
#

it stores:
transform
animation
animation notifies
(potentially it stores projectiles)

#

I would love to make it so I could use it for the AI to e.g. open doors or do other interactions

#

but I don't know that I can do that without adding logic to it

#

but basically I spawn it in world, tell the AI "here's your next point, figure out what you need to do with it"

#

in the case of a projectile, they might need to fire a projectile at the location

#

in case of an animation, they might have to reach the point and do the animation on the point

#

etc.

celest python
#

How many AI do you have?

#

or Max AI count

mossy nexus
#

hard cap around 100, max at any one time will most likely be 20 or so

#

AIs are generally a massive threat to players that require thorough assessment

#

you're not going to just walk up and kill one

#

(but then, they're not actively looking to kill you either necessarily)

celest python
#

Is that ActionData created for each AI or its simply an AI director?

mossy nexus
#

it's an actor in the world

#

each actor in the world has different data

#

for instance they are also used as patrol points and points of interest

#

they're placeable in editor as well

celest python
#

Then having a seperate AActor is a bad design plan. It is similar to your example of yesterday, like you're giving players a defensive objective but you're not preparing them enough for that. It's not a disaster, but its not good either. I know it's an intentional choice but either way its not a good thing. Anyway I know thats not a subject but just wanted to point it out

mossy nexus
#

I'm not sure what you mean?

celest python
#

I mean using actors for this is not a good choice

mossy nexus
#

what would you use?

celest python
#

Depends, probably it will be something against your design but not actor. Probably I would just code it inside pawn or into a component

mossy nexus
#

but... that doesn't work

celest python
#

If it requires you to use actor for any case its bad

mossy nexus
#

it needs a separate transform

#

because otherwise you can't use it as a position in the world

#

likewise the points control animations because animations are pertaining to the world locations

#

if it was a struct in a data table, there'd be a disconnect since you'd have to find out where to place them, then go in and create a struct in a data table to represent them

#

but you'd have no visual control over how the data would work in the world

#

now you could argue that it just needs to be an actor at design time, and that once the game begins, the actor self destructs and sends its data to e.g. the AI director to create structs, but I'm not sure that would be preferable

#

mostly because there is more complexity once you start including stuff like conversations between two actors who are scripted to speak to each other. maybe once I know the full scope of complexity that would be a viable solution

#

and that solution will only work insofar they stay as pure data actors. if I start introducing logic, I won't be able to convert them.

celest python
#

From what I can see you sorted out things based on your way and thats working but I'm not able to see your whole system, I'm just sharing what I've seen around the industry: Usually not having seperate AActors how handling things is a general rule. For example, once upon a time we refactored a whole sense and suspicion system because I used UObjects instead of structs. It's not something "never do it", but if there is a way that you can do it without actors, even if its ugly, do it that way, in my opinion. Even with working indie studios using actors idea was not welcomed.

#

I'm just sharing what I've seen around the industry:
I just pointed it out to make you consider again, totally not to imply you should change it etc.

#

Also having seperate spawning (also frequently destructed and recreated again?) AActor can be taxing for memory

#

It depends on hardware and your project

mossy nexus
#

well it's not a mobile project, haha

celest python
#

We were developing for PC and we refactored whole UObject based suspicion and perception system to USTRUCTs ๐Ÿ˜„

mossy nexus
#

I've taken this system out of companies that I've worked with that worked on stealth type games. the only difference is that none of those companies used UE. the concepts, however, remain the same.

celest python
#

Yeah, I was going to ask that too

#

I sensed that non-UE concept ๐Ÿ˜…

#

Maybe thats why I'm disliking it

mossy nexus
#

well consider this: there needs to be an atomic class that you can place in world, that can carry data

#

unless there is a more lightweight version of actor, then actor is just that class

#

if there was a FStructWithLegs that carried a transform around, I would of course use that instead

#

but given that limitation, there aren't really great options inside the engine

#

I also can't imagine the nonsense it would be for any designer wanting to use a non visual system to place down patrol points or model behavior points for AI in world

#

but perhaps the self destruct option has merit. the actor gets killed off come game time, but passes on its data

#

in essence being a proxy for the data

celest python
mossy nexus
#

every level may have some ~50-150 points in total

celest python
#

But I don't know, even with that project, we were not explicitly placing waypoints, we were defining 'areas', and we were handling the behavior based on that

#

Waypoints were just single FVectors

mossy nexus
#

right, but those can't be placed in world... at least not by default

#

and FVector also doesn't signal direction

mossy nexus
celest python
#

I understand

mossy nexus
#

now you might be right that I don't need to spawn them through cpp for action data though. perhaps I need to make a FActionData struct and then just use the actor as a wrapper for that data

uncut rune
#

Why does the Agent Radius setting in the recast manager always get reset to 35 whenever I restart the editor? Is that supposed to happen?

celest python
mossy nexus
# celest python I understand

thanks for the conversation btw, I've made some notes. I'll see how can wrap my thoughts around what you've mentioned

uncut rune
celest python
#

Is it happening with every recastnavmesh in every level?

#

or just this one?

uncut rune
celest python
#

Then we're missing something

#

But I dont have any idea currently, maybe its intended

#

There was a agent radius config on project settings

#

Maybe its using that somehow

uncut rune
celest python
#

Sadly I don't know then. Maybe someone else had similar issue can help

final loom
#

How taxing is it do you figure to have a few dozen AI perception systems running at once?

mossy nexus
#

depends on how taxing each of the components inside AI perception are individually

#

if they're well optimized a few dozen shouldn't be a massive issue

final loom
#

Hmmm, how might I optimize?

#

I mostly have sight, sound, and touch.

mossy nexus
#

I don't know your systems

#

so I don't know how you'd optimize them

#

but generally: fewer checks, cheaper checks. avoid square root, avoid traces

#

avoid normalize

final loom
#

I was using the built in AI Perception system.

mossy nexus
#

I don't know the built in system

#

I made my own

past pelican
#

woah

final loom
#

What? It's not that crazy.

#

Not sure what needs the default one didn't fulfill for them though

celest python
mossy nexus
final loom
#

Alright. I don't know if it is too limited for me either, but for now I think it will work.

cold trout
#

anyone know if NavLinkProxies work for CrowdFollowingComponent somehow?
I've got a custom NavLinkComponent that notifies NPCs when a smart link is disabled (when being used) and Invalidates() their navigation path, but they dont actually stop and repath.

#

Definitely had it working ok when npcs just had PathFollowingComp

celest python
hearty niche
#

I am getting a crash on my BTTask node for some reason any ideas why @misty wharf?

Error: Failed to find function ReachedLocation in BTTask_FindLocationRelativeToPlayer

this is the dispatcher I want to bind my function to

Controller->GetPathFollowingComponent()->OnRequestFinished.AddUFunction(this,"ReachedLocation");

the function :

void UBTTask_FindLocationRelativeToPlayer::ReachedLocation(FAIRequestID RequestID,const FPathFollowingResult& PathFollowingResult){
if (PathFollowingResult.HasFlag(FPathFollowingResultFlags::Success))
{
FinishLatentTask(BTComponent, EBTNodeResult::Succeeded);
}
else if (PathFollowingResult.HasFlag(FPathFollowingResultFlags::InvalidPath)||PathFollowingResult.HasFlag(FPathFollowingResultFlags::Blocked))
{
FinishLatentTask(BTComponent, EBTNodeResult::Failed);
}
}

misty wharf
#

@hearty niche my guess would be the delegate add is wrong. Have you tried AddDynamic(this, &ThisClass::ReachedLocation)? Tbh haven't used non-dynamic delegates much so if it's not a dynamic one you might have to ask on #cpp how to do it correctly

hearty niche
#

hmm

hearty niche
#

Controller->GetPathFollowingComponent()->OnRequestFinished.AddDynamic(this, &UBTTask_FindLocationRelativeToPlayer::ReachedLocation);

misty wharf
#

Is it actually a dynamic delegate?

brittle lark
#

Hi
How can I disable all AIs in level ?

brittle lark
celest python
#

Way 1: Have a boolean on your game state something like "bPlayingSeqeuncer" and check that boolean first before evaluating other nodes in BT
Way 2: Loop all AI Controllers and disable logic, then do reverse when sequencer ends
Way 3: If you're with C++ maybe there is more advanced way with UBrainComponent but not sure

mossy nexus
#

I coulda sworn I posted a question here but

#

AI touch sense without collision, what's the go to?

mossy nexus
#

other answers: gameplay tags

queen karma
#

anyone has a good tutorial for behavior tree? followed few tutorial but i think they are outdated

misty wharf
#

Outdated how?

#

I've not noticed there being that many changes to how BT's work, maybe the UI has changed just a bit but the method of operation is still the same

timid condor
#

hey guys, I'm trying to set a location for an AI to move to through an EQS. My level is huge so I have to use a navigation invoker. However, if the point my query selects is outside of the navigation invoker's range, my AI won't move there. First screenshot is my nav mesh range and my EQS range. The second is another game that I'm attempting to emulate while I learn. When the second game does a "Move to" in the behaviour tree, it seems to generate a path for it to move through while mine doesn't and subsequently can't move to the point. How can I do this?

odd nexus
#

Hi there. How can I move an NPC from one point to second point and then to third point without stopping? That NPC is continuously moving toward third point location, without stopping at first and second location.

timid condor
# timid condor

alright well I'll figure out how to do this at some point. For now I just conceded to losing 20fps by massively increasing the nav invoker range.

undone hull
#

i've actually been looking for something like this, do you have any doc on Nav Invokers? ๐Ÿ’™

timid condor
undone hull
timid condor
#

Ah yeah that could totally work

timid condor
# timid condor

What I was trying so hard to achieve, was what you can see here. Where the ai has a nav invoker, but also a new nav mesh that is set up along a path to the target location. I could not for the life of me figure it out. very frustrating

#

This game is going to have mod support soon though, so when it does I should be able to take see how it was done

undone hull
# timid condor What I was trying so hard to achieve, was what you can see here. Where the ai ha...

the GDC yt channel just released how the AI on Death Stranding tackled this kind of issues dude, hope it helps ๐Ÿ’™ --- https://www.youtube.com/watch?v=yqZE5O8VPAU

GDC

In this 2021 GDC AI Summit session, programmer Eric Johnson explores the unique AI challenges faced during the development of Kojima Productions' debut title, Death Stranding.

Join the GDC mailing list: http://www.gdconf.com/subscribe

Follow GDC on Twitter: https://twitter.com/Official_GDC

GDC talks cover a range of developmental topics incl...

โ–ถ Play video
timid condor
#

Oh awesome I'll watch that now

#

thanks

undone hull
#

๐Ÿ’™

ocean wren
#

FWIW, I think they added the grid based pathfinder to get around the navigation issue for large terrains? I think Miesko was using it for Fortnite at one point. Although I don't remember where they showed that. It was prior to them ripping off the PubG gameplay, so pre battle royale back when Fortnite was a sort of tower defency thing.

mossy nexus
#

is it worth it to make a service for (slow) projectile avoidance?

#

I'm a bit uncertain that a service can abort tasks in favor of other decisions

#

so I was thinking decorators instead

misty wharf
#

Services can't affect control flow afaik

#

I guess you could use one to set a BB value which is then watched by some decorator which then affects control flow

mossy nexus
#

I mean a a decorator is going to be cheaper I guess

#

so if services can't affect flow control, I have no issue using decorators

pine steeple
#

you can use a service to detect for projectiles

#

which then changes your BT to avoidance via decorators

split grove
#

I already asked this in the blueprint server, but this question might be best suited here. Does anyone know of a tutorial on how to make AI "Road Network" spline? I want to be able to make paths that AI can Transverse and have a choice from different paths not just one "straight path". If what I am asking is confusing, which it might be as I am a half wit. lol Assassins Creed GDC talk on "Meta AI" is what I am looking at replicating

final loom
#

Is there any event or function that gets called per each end of a offMesh Nav link whatever it's called? That would be super useful

sullen pier
#

Hello have a question, so we have BTTask and PawnAction who can explain for what we need Pawn Action?

#

Is there any method to use PawnAction inside BTTask? because i found that some implementation is copied in both of them

#

And looks like Pawn Action may listen brain component messages

celest python
#

Pawn Action was used before gameplay tasks

#

Zoombapup knows more about them

#

AITasks or BTTasks should be able to listen brain components too

#

@sullen pier

celest python
#

UE5 probably (personal opinion: %99) will use AITasks (though UE4 also using AITasks right now, you just need to enable a flag on project settings) and not gonna use pawn action anywhere

#

I dont recommend using them if you dont have any specific use case

sullen pier
#

@celest python thx, the actual use was just reimplement to use interfaces for both PlayerController and AIController

#

with brain component

#

rts/fps like mode

#

and found that PawnAction may be instanced inside cpp

#

Is there any way to abort All BTTasks? for example move to location if i switched to manual controll?

celest python
#

Probably you can lock the brain comonent

#

It should reset the BT

sullen pier
#

Ok, thank you!

stray violet
#

Hey there,
I'm in a BTT and want to update a variable on my ABP.
That alone is easy enough, but the changed boolean begins a transition into a new state, which involves a montage playing during that transition in the state machine.

Is there a neat way to do this in a BTT and either wait for that completion?

misty wharf
#

You would need to listen to some event that triggers when the animation completes

#

and trigger the Finish Execute from that event

stray violet
#

Thanks, thats what I ended up on. Now I just gotta debug why my LeftStateEvent isnt firing

mossy nexus
#
Ensure condition failed: !SearchData.DeactivatedBranchStart.IsSet() [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/AIModule/Private/BehaviorTree/BehaviorTreeComponent.cpp] [Line: 1592] 
There should not have more than one deactivated branch. (Previous start:[0:4], New start:[0:4]
[2021.10.27-21.48.17:230][493]LogOutputDevice: Error: Ensure condition failed: !SearchData.DeactivatedBranchStart.IsSet() [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/AIModule/Private/BehaviorTree/BehaviorTreeComponent.cpp] [Line: 1592] 
There should not have more than one deactivated branch. (Previous start:[0:4], New start:[0:4]

[2021.10.27-21.48.17:230][493]LogStats:             FDebug::EnsureFailed -  0.000 s
UE4Editor-Win64-DebugGame.exe has triggered a breakpoint.```

I'm getting something like this, and I'm not sure why
gloomy scroll
#

Hello, how do I make the playerAI avoid enemyAI?

I have a player AI and an enemy AI. I would like the playerAI to avoid the enemyAI so I setup the enemyAI with an obstacle volume affecting navmesh. The problem is that if I do this the enemyAI pathfiding becomes finnicky/jittery, because it is having trouble navigating with a volume around itself as obstacle. I want playerAI to avoid enemyAI but I don't want enemyAI to avoid playerAI (hence I am not using rvo avoidance).

misty wharf
#

I would imagine there must be some way to configure either RVO or crowd avoidance such that only the player character uses it

pine steeple
#

there is

#

RVO has flags on who should be avoided or not

#

1 could be player, 2 could be enemy

#

1 can avoid 2, but 2 should not avoid 1

worthy python
#

Hi! How can I get "OverlappingActors" from custom "EnvQueryTest" ? Now I have empty array (but it's 100% must find overlapping actor). Why logic to find overlap is not working from this class?

#

It.IgnoreTimeLimit() is just experement. Same result without it

devout dove
#

Hey anyone know how to fix this issue with the hand

pine steeple
#

you need to use IK

#

to keep the hand attached to the gun

#

also looks like you imported the animation for a different skeleton and never had the pose setup properly.

devout dove
#

lk?

#

i use the default UE4 skeleton

misty wharf
#

inverse kinematics

keen crow
#

How do I make some logic to execute even when a branch is aborted by some decorator on a branch with a higher priority? Is a service with OnBecomeRelevant and OnCeiseRelevant overriden a good place to have this logic? I'm kinda confused that services are kinda for updating constantly while a branch is executing and not for obligatory in and out logic but I can't think of any better place

mossy nexus
#

can you sketch a diagram of what you're trying to do?

keen crow
#

Something like this for example. Decorator from left branch will abort right branch. And in the right branch I have an entry node SetPatrolMode(true) and an exit node SetPatrolMode(false). As I understand if the patrol branch is aborted by left branch, SetPatrolMode(false) wouldn't get fired so I tried to place this logic in a service StartPatrol which has OnBecomeRelevant and OnSeizeRelevant overriden. Is it ok to do so?

misty wharf
#

Does it work? If yes, then yes, if no, then no

#

:D

#

It seems like a reasonable way to achieve this type of modality to me

keen crow
#

I'm still new to BT so just wondering if there are better ways. What bothers me in such solution is that services are designed for regularly ticking and updating state of AI. This OnBecomeRelevant and OnSeizeRelevant actually come from BTService ancestor (UBTAuxiliaryNode)

misty wharf
#

It might be possible to also use a decorator for it... I don't remember for sure if they had that function though

#
 *  Other typical use case is creating a marker when specific branch is being executed
 *  (see OnBecomeRelevant, OnCeaseRelevant), by setting a flag in blackboard.
#

btw it says that about it in the code so I think your usage is perfectly fine

keen crow
#

but I think I should check it

ocean wren
sullen pier
#

@ocean wren yes thx, already investigated that

ocean wren
#

I used them, they do work and all ๐Ÿ™‚ so hey, why not?

#

Personally, I modified the classes to allow channels of actions and used them for things like tank control where actions were at different levels (gunner, commander, loader etc)

sullen pier
#

its quite simple, but im tried to use it in PlayerController as a top down brains

#

after possess

ocean wren
#

I think the use case was more just a simple queue that was "fire and forget"

misty wharf
#

It feels like there's a bit of overlap with pawn actions and bt tasks too, since at least in my case I have a lot of bt tasks for those types of "actions" my npc's do and I sequence them in BT's :P

ocean wren
#

Yeah, that makes sense.

#

I used a channel-ized version because I like the simplicity. Just shove an "action" into a queue and it gets run in order. Add some queue shuffling/clearing/locking etc and I guess it is a bit like the GAS.

#

Made sense for a layered AI I was building at the time

#

for controlling a tank

misty wharf
#

Yeah

sullen pier
#

i refactored pawn actions to brain component with behaviour tree, but again found bttask and aitask using controller->move fly etc

misty wharf
#

bt's are great for sequential stuff but they're not the best if you need something to happen simultaneously I think

ocean wren
#

Its the kind of thing that's actually fun to program ๐Ÿ™‚ doesn't feel kind of braindead like the blackboard implementation ๐Ÿ™‚

#

Yeah, BT's really aren't designed for that layered stuff. No "walk and chew gum" ๐Ÿ™‚

misty wharf
#

you mean kick ass and chew gum lol

ocean wren
#

well, yeah ๐Ÿ™‚

#

Man I'm wiped today.. did 4 hour workshops and then 2 hours of project meetings. I need a weekend off ๐Ÿ™‚

celest python
#

Until a few months ago my everday was like that ๐Ÿ˜„

misty wharf
#

PSD and ICC file format investigation ResidentSleeper

ocean wren
#

ICC the colour thing?

misty wharf
#

yeah

ocean wren
#

I'm covering someone else's classes as well as my own, so timetable is pretty brutal, means I have to spend all weekend in prep

#

At least I get to play a bit with the class. doing sentiment analysis on multiple chat streams next week ๐Ÿ™‚

misty wharf
#

nice, was just watching some CS on twitch and thinking they really need something like that to get rid of all the shitposters lul

ocean wren
#

I had a final year CS undegrad project to make a teams joke bot, but nobody took it ๐Ÿ™‚

#

I was dissapointed

#

Although, I've got a couple doing lip sync and text-to-speech-to-text for metahumans ๐Ÿ™‚

#

with dialogue generated by GPT2/3

#

which if you ask me, is fun, but then I'm a bit warped ๐Ÿ™‚

misty wharf
#

I'd love to be able to use something like that for my game as I generated stuff like movies and movie synopses procedurally

#

but I have no idea how any of that ML stuff works and I bet it would be way too heavy for it anyway lol

ocean wren
#

naaah man. Thats what I work on in my own research. PCG cinematics and behaviour

#

ML based.. by learning from movies

#

Stealing all the ideas from Google and Facebook and NVIDIA ๐Ÿ™‚

sullen pier
misty wharf
#

Yeah never really looked at that in much detail other than seeing that Behavior Tree is a subclass of that

sullen pier
#

i mean implement new logic

ocean wren
#

Its about bloody time someone just rewrote the whole goddam AI system for UE. I mean I'd do it, but I don't think Epic care ๐Ÿ™‚

#

Its so far from "good" ๐Ÿ™‚

#

I have bigger fish to fry right now too.. what with consultancy and research projects and the like

misty wharf
#

it seems to do the job pretty well at least in both projects I've used it in

#

but neither of them really required super complex logic

ocean wren
#

Its ok. It's just not "good" ๐Ÿ™‚

misty wharf
#

lol

ocean wren
#

I mean more about the usability and documentation than the code. Although the code has some bad smells too

misty wharf
#

documentation is a problem with almost everything in UE :P

sullen pier
ocean wren
#

I just feel so bad for all of the people coming into the channel and not having a clue where to start on things ๐Ÿ™‚

sullen pier
#

code is quite good, with lots of comments ๐Ÿ™‚

misty wharf
#

I'm sure Epic could afford to hire a couple of folks to fix the docs

ocean wren
#

I worked on an AI system for MMO's called StoryBricks where we actually thought about how inexperienced users might think about AI

#

zomg: and yet, many years later, here we are ๐Ÿ™‚

misty wharf
#

Thanks Tim. alex

ocean wren
#

He's too busy rolling in his mountains of money to care about AI and documentation ๐Ÿ™‚

celest python
#

Why would people pay for UDN if there was a good documentation

#

/** An Octree */

misty wharf
#

Mmhm

ocean wren
#

?

misty wharf
#

You'd never know half of the stuff in C++ exists unless someone tells you about it on #cpp :p

ocean wren
#

My favourite part of the codebase is the node editor code ๐Ÿ™‚ I'm twisted that way.

celest python
#

They namespaced something I cant remember and for that reason I was not able to automatically rename assets when they created, after that I never opened editor code again

ocean wren
#

Editor coding and plugins are the real powaaah!

#

๐Ÿฆพ

pine steeple
#

@celest python UDN is for dedicated Epic support, not documentation

gloomy scroll
uncut rune
#

I'm using SimpleMoveToLocation to move my AI character along a navmesh. However, when the goal location is outside the nav mesh, the AI character stops moving. I want him to get to the closest point in the navmesh instead. Is there a way to do this?

mossy nexus
#

AIMoveTo and acceptance radius I suppose

#

or you could map a path maybe

#

I'm having an issue where a decorator is being skipped despite being true. I'm not sure how I'm supposed to handle higher priority tasks that are transient in nature that then also allow it to return

humble hedge
uncut rune
humble hedge
humble hedge
celest python
keen crow
#

Where can I read about running behavior trees from behavior trees? Currently I don't understand how do I pass some data from parent BT blackboard to child BT blackboard and how do I stop child BT from parent BT (I assume just by decorator) and from inside child BT itself?

pine steeple
#

you can not run bt's from bt's

#

but you can run child bts via Run subtree

#

slightly different as your main tree is still running.

#

and you can't have different blackboards

#

Child BT must use same blackboard as parent bt.

keen crow
pine steeple
#

runs a sub tree, but parent tree is still running, and they can not have different blackboard than the parent

keen crow
#

ok I got it thanks

#

btw is it a good practice to run subtrees or should I avoid that?

pine steeple
#

i use them regulary

#

i use the Run Dynamic

#

and i inject different trees based on ai behaviour

#

makes the BT's cleaner for complex AI

#

used alot inside our "Hunter" monster

keen crow
#

what do these tags mean in run behavior dynamic task? i didn't understand a thing -_-

pine steeple
#

Gameplay tag

#

you pass into AIController->BehaviourComponent->RunDynamicSubtree

keen crow
#

but what does it mean to run a behavior dynamically with an injected tag?

#

its like in the context of a running subtree I can somehow read those tags?

pine steeple
#

you choose what BT to inject into it

#

like this

#

then the BT will ibject BT_DogEvade into it

#

and run that

keen crow
#

it seems like I don't know a lot about BTs because none of that makes any sense for me yet -_-

pine steeple
#

so for example the above, by default this node will run Basic monster evade

#

but with my injection above

#

it will change it to use DogEvade

keen crow
#

oh wow. I guess I understand it now but can't imagine a usage for this yet. I'm currently only learning with just 1 type of enemy

pine steeple
#

yeah its more for complex stuff

keen crow
#

seems like some BT-level polymorphism

pine steeple
#

i keep my bt's generalized as much as possible

#

and inject things in when needed

#

but there is a limit

#

(works fine for basic monsters, but gets less manageable on complex ones)

#

so for them, i make unique behaviour trees

keen crow
#

cool. its rather clear for me now, thanks again

pine steeple
#

yeah BT's are hard to get used too

#

but i have around 100ish bt's

#

for 30 monsters and human AI

#

lot of them are small subtrees which gets injected into the main tree

keen crow
#

@pine steeple can you help me with another question? Before I started learning BTs I was playing with custom NavLinkProxies. I managed to make a simple one for jumping on a ledge just by subscribing to OnSmartPointReached event. But I couldn't find out how to set up a custom NavLinkProxy where a character needs to start one action and the beginning of the link and stop doing it when it leaves the link. Like for example I have a mechanic for a player to crawl or crouch to go under low obstacles and I can make character crouch or prone when it enters first point of NLP but I don't know how to make character uncrouch once it gets through the obstacle. I asked this question before and someone suggested just using custom triggers which makes the bot uncrouch once it leaves the box collision but after discussion we agreed that it would become cumbersome to maintain as there are more and more NLPs and harder actions like sliding under obstacles, running walls, etc. So is there any better way?

pine steeple
#

you just need to check if AI location is nearly equal to target location (end location)

#

that is the only way

#

that is how we handle vaulting

#

though the vault calls in to the AI controller

#

and tells the AI controller its finished

#

and this then ends the link

#

but same principle

misty wharf
#

I have a similar setup for going through doors although in my case the AI controller figures out when it's reached the end by itself and informs the link

#

it's a bit annoying because you can't really pause its navigation pathing, give it a new nav target, and then resume the previous pathing later

#

or rather, you probably could, but if you use f.ex. AI MoveTo, changing to a new nav target for traversing the link would cause it to consider the pathing finished

mossy nexus
keen crow
#

Is it possible to somehow group or categorize blackboard keys?

misty wharf
#

nope

keen crow
#

so everyone is fine with having dozens of blackboard keys in one blackboard?

#

or if I have dozens of keys in one BB then i'm doing something wrong?

misty wharf
#

No idea tbh. I have some BB keys and a bunch of decorators which access other data that's not in the BB

meager bobcat
#

how do you get a blueprint bttask to tick?

meager bobcat
#

oh i had Lock AILogic ticked in my task and it stopped tick

#

now my shit ticks

uncut rune
# humble hedge I think you have to trace through code to see why it is not valid. There are lot...

I gave up using the ProjectPointOnNavMesh function. I honestly think that function is broken. I noticed that they used it in the MoveTo function in the AIController class and doesn't seem to work there either after doing a couple of tests. I just ended up using EQS and made a custom context for the player. That seems to be the only viable solution for this problem without changing the source code.

pine steeple
#

it works fine for me

#

i use ProjectPointOnNavmesh a lot.

golden owl
#

Hey everyone, I'm doing a gamejam and time is running out on me, I'm trying to do a barebones quest system, I already finished the dialogue system and need some help
How do I make an AI decorator that checks wether or not you have a quest item (bool on char)

uncut rune
# pine steeple i use ProjectPointOnNavmesh a lot.

oh, then its probably not broken then ๐Ÿ˜‚ . For some reason, it always returns 0,0,0 no matter how large or small I make the extents. I even mimiced the same implementation from the MoveTo function in the AIController and got the same buggy results. So idk ๐Ÿคทโ€โ™‚๏ธ . Im not too worried about it now tho.

gloomy scroll
#

Can someone explain the difference between a task with "AI move to actor or location" and a simple "move to"? With "AI move to actor or location" whenever there's a "wait" in the BehaviorTree the AI executes another "AI move to" task during the supposed wait.

#

But if I use "Move to", it respects the "Wait" lol

lyric flint
#

hello, how can you add collision to ai for the whole body?

#

mine is kind of giant

#

and i want player to be able to cross between it's legs

gloomy scroll
# lyric flint

increase capsule radius and capsule height size. When you click on the capsule component in the viewport, it shows on the right.

lyric flint
gloomy scroll
#

add 2 capsules for legs, leave a space between them

lyric flint
#

haven't seen that option yet. how can you add another capsule?

gloomy scroll
#

are you on bp viewport or mesh/skeleton editing?

lyric flint
#

bp viewport

#

i already have the skeleton collisions

gloomy scroll
#

On the viewport, to your left there will be a list with the components. Above the list there will be a dropdown menu. Clik on the menu and select capsule collision.

keen crow
#

what's the usage of Push pawn action node in BTs? I tried googling about it but it seems just like the tasks so why ever use it?

grizzled bolt
#

Anyone here have any idea on creating ai that can do flanking?

ocean wren
#

Yes, use EQS and make the dot product calculation bias to the sides of the player

#

But... I'd recommend against it, players will be getting shot in the head and dislike that they don't know why ๐Ÿ™‚

#

Other than that, its just the usual setup

#

You could bias the EQS to choose routes to the flanking position that are visible from the player, but that just looks a bit haphazard

grizzled bolt
#

Don't worry, the Player is not gonna get shot in the head by the enemy

I tried using EQS, it didn't worked out as I expected since its responsible for generating position and doesn't really care about the pathfinding. So, most of the time, the enemy will go in front of the Player and then proceed to the generated position, which makes the enemy look stupid ๐Ÿคฃ

But you mentioned using EQS to choose routes, can you share a bit more on that?

ocean wren
#

Generally, you can use the EQS to bias the chosen location in a direction. So use perpendicularity to choose "off to the side". But yeah, if you wanted the pathfinder to not pass in view of the player, you'd need to modify the cost of the navmesh to score against any visible navmesh polygons

#

But my experience is that flanking comes across to the player as enemies just running away.. then later shooting you from behind/side

#

We had this exact same problem a looong time ago on one of the first first person shooters on the amiga

#

What we ended up doing is making the enemy take cover.. then wait a bit, then try and move up.

#

But always in view of the player (aside from when its fully in cover of course)

mossy nexus
grizzled bolt
grizzled bolt
#

Thanks for your input!

quasi glade
#

hey, does anyone know why 'ai move to' can suddenly stop working or work incorrectly? I had this setup and it was perfectly okay and some day AI just stopped moving (thought it still tries to but stands still)
my built nav is ok
no obstacles
no additional components except volume trigger, pawn sensing and some fancy smoke (all component have 'affect nav' turned off)
did not alter any movement component settings

mossy nexus
#

most likely it can't path to one or more of your locations

quasi glade
#

debugged all locations, it behaves the same everytime, feels like the pawn is stuck, it doesn't even rotate towards next destination

mossy nexus
#

did you read what I wrote?

quasi glade
#

y

mossy nexus
#

so what did I say?

quasi glade
#

says success

#

though in debugging it does not do the thing after 'on success' and keeps playing like it didn't

#

even when I make a loop after 'on failed' it keeps looping, but says success

mossy nexus
#

then do as I said and put the enum on OnFail

quasi glade
#

k

#

says aborted ๐Ÿ˜ญ

mossy nexus
#

aborted most likely means that it's outside of navmesh

#

or it received a different order

#

what it could also be is

#

because you have a delay

#

it triggers the delay and starts moving to another point within a second

#

your setup needs wokr

quasi glade
#

unfortunately the issue remained still even after I turned off delay

#

recreated navmesh, rebuilt it and yet AI still does not move

#

what can that red spot be?

mossy nexus
#

try and see if there's a path to your location on the navmesh

#

there's a node for that

quasi glade
#

I checked all locations with 'navigation raycast' it said true and named the final point for all of them correctly , so I guess it does work

mossy nexus
#

there is a node called find path on navmesh or something, use that to check

quasi glade
#

okay thanks I'll check it

keen crow
#

I'm having a problem with understanding trace test in EQS. Why are the spots behind walls aren't filtered out by trace test that requires to hit the context?

#

And here's the EQS query

#

what am I doing wrong?

misty wharf
#

@keen crow it's kind of a confusing system - only blocking hits with bool match enabled means that it will count hits that hit anything as success

keen crow
misty wharf
#

iirc you need to have it count things that don't hit anything as success

keen crow
#

How do I do that?

simple crest
#

What's in the drop-down trace settings?

#

Advanced

keen crow
#

Default values, I never touched them...

#

yoooooo

simple crest
#

Raise up the trace so it doesn't always hit the ground with those settings. And probably disable "only blocking hits"

keen crow
#

Thank you thank you

misty wharf
#

Yeah it's kind of confusing how it works at first lol

keen crow
#

not perfect but at least seems correct

#

still curious though what can be wrong with these ?

#

Current trace test settings

queen olive
#

A quick silly couple of questions. I have navmesh set up and ai bp controller and blackboard with a look for new location move to wait system in place working well. My model has a walk/run with a walk left/right. how do you go about making it not so wooden I.e gets to xyz rotates 13* then walks straight to xyz2 in a direct bline of sight and how would you go about adding the walk left right as it turns a curve of sorts not just spinning on the spot. Second one is I only have 100 in scene and the FPS drops dramatically iv seen 1000s used in a niagra crowd. Not sure if I can have them as physically gotta Le things with ballistics or not and if not Iโ€™m guessing as the bullet gets close it should be turning it from a niagra to a physical meshโ€ฆ..

dull loom
#

Hey guys, do you know if there's any way to avoid the hard deceleration when aborting a move? I'm using dynamic navigation and when the path is recalculated the previous move is aborted and the acceleration drops to 0. This sudden change is breaking something in my Animation Blueprint.

silent cove
#

Not sure if this belongs here or in #cpp. But is there an easy way to completely reset all blackboard key values?

mossy nexus
mossy nexus
mossy nexus
#

I'm actually wondering if this would be possible in BP now...

#

but my initial reaction is no, since you require latent functionality

silent cove
mossy nexus
#

given that they are wrappers, there is no good way to flush them

silent cove
#

crap :/

mossy nexus
#

it might be worth considering how many values are dependent on being flushed

#

in my general AI BT I have 1 variable that I flush

mossy flame
#

Hi, does anynody know if Hearing in AI Perception registers events from Report Noise Event adjusted to walls and other geometry. For example if there is a wall between Pawn and Actor who reports Noise Event does he hear it in a same radius if there was no wall? Thank you

misty wharf
#

Hearing doesn't have any kind of occlusion

#

you'd have to implement that yourself

mossy nexus
#

if you got the chops you can use a navmesh for it

#

I've done that

queen olive
mossy flame
#

thanks a lot, yeah pathfinding is probably the way to go.

mossy nexus
# celest python Check Visual Logger to see why it is being skipped

so with debug icons or what have you installed, this actually bugs out and I get an error: cpp Ensure condition failed: !SearchData.DeactivatedBranchStart.IsSet() [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/AIModule/Private/BehaviorTree/BehaviorTreeComponent.cpp] [Line: 1592] There should not have more than one deactivated branch. (Previous start:[0:4], New start:[0:4] [2021.11.01-22.31.28:633][586]LogOutputDevice: Error: Ensure condition failed: !SearchData.DeactivatedBranchStart.IsSet() [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/AIModule/Private/BehaviorTree/BehaviorTreeComponent.cpp] [Line: 1592] There should not have more than one deactivated branch. (Previous start:[0:4], New start:[0:4]

I'm tagging you just in case you would know how to resolve this?

celest python
mossy nexus
#

this has to do the skipping

celest python
#

Set a breakpoint to this line and check values of .Describe() functions' returns

#

If new end is lower than previous end, it complains about you're returning back to a previous node on a selector

#

Which is not a valid thing, afaik

#

Also, can you share the visual logger screenshot?

celest python
mossy nexus
mossy nexus
mossy nexus
#

I figured that if it aborted lower first, then came back it would retry lower due to being a selector

celest python
#

Honestly since I never tried to do this, I never got a similar error too, but just having a guess what you're tried to do is probably against the design of BTs. Maybe someone with wider experience can say something with more confidence

celest python
celest python
mossy nexus
#

like it stops play because of the error but I can resume and it'll not pop up again and never cause an issue again

celest python
#

Lets you know something is wrong and never bother you again

mossy nexus
#

fair enough

#

but yeah it's only between those two nodes

#

I have 5 nodes springing from the same selector

#

the others have no such issues

#

trying to understand why the relationship between these two nodes is like that

celest python
#

Is there any other nodes that returning to previous node?

#

And working flawlessly?

mossy nexus
#

yep

celest python
#

Hmm

#

Maybe the reason is when the 2nd one (the one on the left) failed, it should execute the 1st one again, and its also failed

#

If not, I think you should see visual logger if it will provide more info. I don't think I can brainstorm more about this without knowing further informations since I never saw the same error before

mossy nexus
#

just for reference

#

the lowest three have no issues and work perfectly between each other

#

one of them isn't implemented so it always returns false

#

so it remains untested

#

the two other high prio nodes have issues between each other

#

the visual logger has no info

#

and sequence breaks the order so I'd have to rearrange logic to trickle down

#

but perhaps that is the answer?

celest python
mossy nexus
#

no but I can't get it to the point where I would get the error

#

like I would have to change the logic of the BT tasks

#

I don't think it would work

#

hmm now strange the third one doesn't trigger like it used it

#

very weird

celest python
#

That might not be pointing anything since the error was relevant with selector node

mossy nexus
#

well consider that with a sequence every task has to succeed

celest python
#

SearchData is a selector thing

mossy nexus
#

so in order to pass it down the chain I would have to succeed each of them

celest python
#

No I'm not saying you shouldn't use selector, its just error was related with selector node itself

#

So when you removed, error can be gone

#

It might not be giving correct clues to find the error

#

Maybe @ KaosSpooktrum knows more about this situation, but I'm afraid to @ him, he might be busy ๐Ÿ˜…

mossy nexus
#

I might give him a prod the next time he's around

#

thanks for the rubberducking at least

#

aha, the problem happens with the cast intent node regardless

#

perhaps it doesn't like that it is aborting itself

#

it has no problem aborting lower prio, but it has a problem aborting itself... which doesn't make any sense. it should search for other nodes then, and there are other nodes. maybe it's because there need to be two separate decorators

#

hmm

celest python
#

. (hi Kaos :D)

#

I'm an idiot, did not see your "abort both" flag at the first stage

mossy nexus
#

yep

#

that's intentional though

#

or at least, how I have understood the "aborts both" observer

#

for as long it stays true, it aborts lower prio

#

as soon as it turns false, it aborts self

celest python
#

So if Cast Intent returns false, it will skip the right one even the right one is true

mossy nexus
#

well it shouldn't

#

it should restart the tree no?

#

if it aborts both at the same time when it's false, let's say (worst case scenario)

#

then the tree restarts, and it reevaluates every node in order

celest python
#

No? It will just continue to execute other nodes

mossy nexus
#

then why would it not check and execute the next node in order?

celest python
#

You're aborting 'both'

mossy nexus
#

yes

celest python
#

self and lower prio

mossy nexus
#

yes

celest python
#

which prevents the execution of next node

mossy nexus
#

so worst case, that means it restarts the tree because the selector fails

celest python
#

But selector does not fail

#

Every sequence or node should fail

mossy nexus
#

it does, all children aborted

celest python
#

You said it continues to execute other nodes flawlessly? thinkmanny

mossy nexus
#

it skips that one node

#

but in the case of it aborting the tree

#

that's fine too

#

because it restarts

#

and finds the right node

#

the BT doesn't just die

#

it reevaluates in case of failure

#

my point is just

#

in either case, it skips a node with a decorator that is true

#

if it restarts the tree, then cast intent is now false, the next node has a decorator which is true (and aborts lower prio), of which path it should then take

#

but it's definitely something to do with the aborts both. even with just two nodes (the other have no decorators), it still causes the same issue

#

and I know it didn't use to be an issue

#

this is logic I hadn't changed for a year or more

#

interestingly, other aborts both work as intended

celest python
#

Is there any possibility previous decorators affecting the condition of your skipped decorator?

#

Quick example, first decorator sets the "targetplayer" and since all of them checks targetplayer is valid or not, whole execution stops

#

Or maybe something is wrong with notify observer settings?

mossy nexus
#

hmm I only have one, on a separate selector one level up. it basically initiates the BT values

celest python
#

Have you ever breakpointed the BT? Maybe some insteresting stuff come out

#

While doing that you can examine the values

#

on editor

mossy nexus
#

I have.

#

there isn't anything

#

other abort both nodes are working as intended

#

this is starting to seem more like a bug

mossy nexus
#

(at least not here)

celest python
#

Can you both debug in BPs and inside of the IDE to pinpoint exact location that assertion happening?

#

put breakpoint to that ensure on line 1500~ and put another breakpoint to start of the BT in editor

#

also there should be a function or a condition to call that decorator on that function body

#

it should show you why it is not being called after that assertion

#

Is it just me or our messages are being deleted lol?

#

I was trying to find the logs you posted

mossy nexus
#

ok so now... I changed some of the low prio decorators on the nodes that otherwise worked fine

#

and the entire tree works as intended now

#

except I still get that ensure issue

celest python
#

Literally everything got deleted on me

mossy nexus
#

wait what?!

celest python
#

what the hell ๐Ÿ˜‚

mossy nexus
#

ok so now... I changed some of the low prio decorators on the nodes that otherwise worked fine
and the entire tree works as intended now
except I still get that ensure issue

celest python
#

@mossy nexus are messages deleted on your side too or am I seeing things? I really need a sanity check on this

mossy nexus
#

nope I see all our correspondence @celest python

#

have you tried restarting discord perhaps?

celest python
#

Yeah restarting solved, that was a very weird issue though ๐Ÿ˜‚

mossy nexus
#

perhaps a discord server failure somewhere

#

and they had to get a backup

celest python