#gameplay-ai

1 messages Β· Page 151 of 1

mossy nexus
#

yeah you can see how unoptimized that is

#

the framerate is abysmal

#

this would not fly

#

where I'm from

#

the saving grace of that video is that the camera doesn't move often

#

imagine if you had agency as a player in that situation

#

and you're moving 5 frames per second

#

IMO there's too much focus on big numbers and not enough focus on what makes games more interesting

#

and if someone's requesting big numbers for the sake of big numbers I'll be the first to call it out

#

it's probably more, but it's not 30, let alone 60

#

which is the bare minimum if you had to ship a game on a console let's say

uncut rune
#

I have an enemy AI that is supposed to chase the player on sight. However, if the enemy spawns while the player is in its perception radius, then the OnTargetPerception function does not trigger since it only triggers when the player enters or exits the sight radius, but not when the player is already in the sight radius. Is there a way to check if a specific actor is in the sight radius even if that actor never entered the sight radius?πŸ€”

uncut rune
#

nvm, I just used GetPerceivedActors lmao

ocean wren
#

On the subject of 100k vs 100k etc. You could certainly do it, but you'd basically have to do pretty much everything as compute shaders. Graphics cards are insanely powerful and they're getting more and more programmable over time. Epic did a presentation on doing AI based particles that you might want to look at. Its nowhere near 100kx100k, but you can see the direction you'd have to go in.

#

I think the effort for this kind of thing in Unreal would be far worse than simply writing a custom engine to do it though.

#

UE is good for some things, but not for optimized updates of high entity counts

celest python
#

UE only can render 200 skeletal meshes with a decent computer

#

It's insanely difficult to reach 200k πŸ˜„

#

Even Glass is using vertex-shaders, his meshes are not even skeletal (afaik)

#

But if you'd use a special engine built for RTS, your main problem would be CPU usage, not the graphics at all as zoombapup said

#

Ashes of the Singularity: Escalation uses a special engine specifically built to do this, and when you open the game first thing you see before the main menu is a textbox saying "hey, we tried to optimize this game too much but still please use at least a 8 core cpu"

dawn citrus
#

Can anyone please give me any idea why this task would fail every time

#

It just stopped working randomly and fails everytime now

#

Nav Mesh exists, Origin and Radius have valid values

#

There isn't anywhere that the Nav Mesh doesn't cover inside of the area I want to get a random point in

#

Yet it just fails

misty gale
#

Doesn't spline meshes support custom nav classes?

Turns out they do. Just very fiddly to set up.

dawn citrus
# dawn citrus

*Solved it by enabling "Can be Main Nav Data"*in the project settings then rebuilding the paths.

keen crow
#

Ok I'm having another problem with AI. I have an AI controller and combat BT which makes my bot avoid players line of sight and has an attack service which just makes the Bot shoot the player. It works fine when there is just one instance of the bot on the map but when there are 2 for some reason the attack service is running only on one bot even though during runtime I can see in 1st (not firing) bot that the service should be executed. In AI debug I can see that my player character is set in not firing bot BB (both bots using same AI controller class and same BT and BB). Breakpoints in service code also never trigger for not-shooting bot (but they do for the one who shoots). What could be the reason of such shit?

misty wharf
#

have you selected the appropriate debug object from the dropdown in the BT editor?

#

it won't stop for everything, it usually just stops for the one that's selected

#

there shouldn't really be any reason why it wouldn't work on all of them though, unless the service itself does something weird

keen crow
mossy nexus
mossy nexus
celest python
#

I remember he mentioned they were instanced static meshes in his own server, but I don't know. Maybe he changed it

mossy nexus
#

take a look at his twitter

#

he mentions it there

mossy nexus
keen crow
#

I'm really confused right now. So in my service I'm overriding OnBecomeRelevant method to cache my bots AI controller, the bot itself and the blackboard. But what I am observing is that this method fires twice and it seems that the service instance is the same for multiple bot instances and I was actually expecting them to have different object instances... See here on my screenie fields already initialized a moment ago and the node even has the same suffix in its name - BTService_Attack_3. So is this actually the intended behavior that for multiple instances of NPC characters with the same AI controller and same behavior tree services (and perhaps something else) is shared and not created per instance?

misty wharf
#

Did you make it an instanced service

keen crow
#

sheeeit

#

how do I do that?

#

a field in constructor?

misty wharf
#

I think UBTNode has a field for it which you just set to true for your node child class

keen crow
#

this one looks interesting. I'll check it out, thanks @misty wharf

misty wharf
#

the BTWhatever_BlueprintBase nodes should all be instanced

#

so you can see how they are set up

keen crow
misty wharf
#

you can also use the memory block thing to store instance specific data but never really looked at how that works

#

that's for when you don't make the node itself instanced

keen crow
#

Are there any reasons I should avoid making nodes instanced or storing actors just in class-level fields instead of that scary uint8* NodeMemory thing?

misty wharf
#

afaik non-instanced nodes perform better

keen crow
#

hmm ok. bCreateNodeInstance seems to solve my problem. Now I wonder if instancing service affects performance what would be the best way to store some actors and perhaps some state in service?

  1. Making service instanced anyway and just storing entities in CPP-classes fields
  2. Making service non-instanced and using that obsucre uint8* NodeMemory and somehow static-casting(?) raw data every tick?
  3. Making service non-instanced and just dynamic-casting my bot character and AI controller
misty wharf
#

probably whichever method is simplest

#

I doubt the performance difference would be very noticeable except in special circumstances

#

given that all BP based nodes are instanced + have the BP overhead and they work just fine

keen crow
still path
#

Is there a better way to set target variable for AIs?

mossy nexus
still path
#

Ok, could you recommend some? @mossy nexus

mossy nexus
#

I could but I don't know your code.

#

setting a variable in the AI controller is an OK way to do things, but if you want better ways you'll have to invest time in getting to know code architecture

#

I can't give you a magical solution

#

but your question was if there was a better way

#

and there most certainly is

crimson galleon
#

like if its an obstacle area or through EQS?

#

and nav mesh proxies don't help?

#

might be easier to understand what you're trying to do

pine steeple
#

In blueprint no

#

in C++ its likely doable, never needed to do it, but you can access the path data and determine what navarea a specific point is in

crimson galleon
#

I think these may be your two options unless you want to solve this via EQS, which won't report the specifics, but gives more precision to path solving

#

maybe Get Path Cost?

misty gale
#

Knowing distance, couldnt path cost give you some info?

#

Atleast a guess if nothing else

#

Would be nulled out if you had cheaper and ewually more expensive nav of the same length within the same check, but other than that..

#

Nvm misread the question. This wouldnt help at all for a failed one

ocean wren
#

Yes, the navpoly's you get for a path have a flag for the nav area types on the poly. So you could get those flags and check.

crimson galleon
#

I have a question related to the BT Cooldown Decorator. Is there a way to set it's time through a variable? I've not had success making my own custom decorator and I'm wondering if anyone else has done this or any thoughts on the matter.

pine steeple
#

a cooldown decorator is just a timer

#

lasts x amount, and if timer is active, it returns false

#

either use timer or use tick

autumn ibex
#

The AI seems to be stopping momentarily.. I want it to move smoothly as the MoveGoal is being updated.

mossy nexus
autumn ibex
crimson galleon
#

discord won't let me post what I ended up doing, but it didn't actually work at first. I think restarting the engine is what fixed it.

fickle cedar
#

How does one approach "Making Noise" of different sounds that the AI should hear from different distances?

#

Loudness and Max Range in the Make Noise node don't seem to work πŸ˜•

#

ah ok... looks like Noise has to be made always within the hearing perception radius, but max range changes the distance it is heard from within

mossy nexus
misty gale
#

Loudness also affects the range its heard from , within the hearing perception range

misty gale
#

I assume nav specific data is only accessible in c++?

#

atleast thats what i get from the previous question asked here

crimson galleon
# misty gale atleast thats what i get from the previous question asked here

I would like to there is a lot of way to print info based on navigation, but I don't know of it, I test through trial and error, there is so much to consider that practical testing has been more advantageous than debugging systems. Though, the eqs pawn is great for understand those queries, but again, application is so dynamic there is only so much to gain from what is setup

misty gale
#

Does the EQS return such info? Atm it feels like a dirty hack im doing to find intersecting paths etc

#

Doing some road alignments, but resorted to sphere traces to find overlapping sections, which doesnt feel very smooth

#

if i on the other hand could get some data from each path point, i think i'd be better off , with more predictability

crimson galleon
#

I don't think EQS will return much for this idea, it can analyze the navmesh, but for building roads, that just seems very custom

misty gale
#

Roads are just nav modifiers tho :p the find path to location query does 90% of the lifting

#

I just want additional data along with its path points

#

Or some method of finding it

#

I could chop up the segments and check that way, but that would too be very.. weird

vast relic
#

Anyone here ever done an AI that interfaces with the pawn with the exact same events a Player would?

#

That is, no MoveTo commands etc, just inputs

dry island
#

Does anyone know if it's possible to get the "PawnSensing" component to work with a Vehicle Pawn?

misty gale
#

Is there any reason it shouldnt?

dry island
#

I have no idea, I just know it it isn't

#

It is failing according to my Debug

#

I thought it should work, but it seems like vehicles don't function the same way that regular pawns do, so pretty much everything I am trying has been not working

#

and I guess no one has tried this or made a video explaining this. Been looking for answers for like 3 days lmao

misty gale
#

Got stimuli source ?

#

Pretty sure it worls regardless of baseclass, but guess i havnt actually tested it

dry island
#

Yes

#

I mean, I thought it would too

#

but it doesn't

#

😦

misty gale
#

To late for me to test anything now,

#

So cant verify this by any means

dry island
#

Well I'm testing it currently shrug was just wondering if anyone knew if there was something else I needed...

misty gale
#

The setups are identical i assume..

dry island
#

Not even the internet knows lmao

#

Yeah

misty gale
#

On pawn vs vehicle

dry island
#

So, I've got it working with a regular floating pawn no problem

#

I even have a behavior tree doing random movement logic

misty gale
#

Making noise event or whatever

dry island
#

With the floating pawn

#

but when I do the same thing on a vehicle

#

nothing

#

It just fails

misty gale
#

Correct team? Or setup to register any team?

dry island
#

I don't have any team setup

misty gale
#

The sensing component cares for team anyways i think

dry island
#

I don't even see that as an option

misty gale
#

By default it only registers 'enemies'

#

While there should be checkbox for neutral and friendly aswell if im not mistaken

dry island
#

No I don't see that

#

The thing that's baffling is that it works on other types of pawns

#

So I have a HUNCH that it's something to do with vehicle movement component

#

but I have no idea what

misty gale
#

Wait

#

Pawnsensing?

dry island
#

Yes

misty gale
#

Is vehicle a pawn?

dry island
#

If I put it on another type of pawn

#

It works just fine

#

Yes the vehicle is a pawn

misty gale
#

Odd

dry island
#

Very

#

lmao

misty gale
#

I may be mixing with ai sensing tbh

#

Ai perception*

#

Yepp. I am.

dry island
#

Yeah that's not the component i'm using

misty gale
#

Wasnt pawnsensing depricated for this?

dry island
#

was it?

#

I mean it works on other pawns...

#

I have a ball that I just put in the scene to test out for shits and gigles and it works

dry island
#

Answer says they aren't deprecating it any time soon

misty gale
#

Not sure if it would solve anything tho. Just tossing it out there

#

True

#

I also read it as ai perception is ment to replace

dry island
#

I mean that's fine, I don't need it to be updated or supported, I just need it to work

misty gale
#

But maybe i read it wrong

#

Ye

dry island
#

It's just weird that it works on other pawns

misty gale
#

I agree

dry island
#

hmmm

misty gale
#

Id try the newer one and see what happens,

#

But up to you i guess

dry island
#

Yeah I mean might as well

misty gale
#

Cant help more with pawnsensing :-/ maybe someone else can

dry island
#

I have a feeling it won't work

#

Literally nothing I have tried so far works with vehicle lmaooo

#

Every tutorial I find is just using CharacterPawns. You'd think someone has tried this with vehicles lmao. Am I really the only person making a car game right now?

misty gale
#

Guess you're the first using pawn sensing for it πŸ˜…

#

Whats the use-case really?

dry island
#

The same as any other use case, I want vehicles to chase my player vehicle

#

I guess no one has ever tried using this sort of thing for vehicles

#

Even behavior trees don't work with this 😦

misty gale
#

Based on sound or sight?

dry island
#

Sight

misty gale
#

Singleplayer?

dry island
#

yup

#

It's really just a car driving around, and there are other cars in the area. I want to player to be chased when they pick up a passenger

#

So I was trying to start by getting line of sight chasing happening

#

Then I would expand to make it be based on a condition

misty gale
#

How about checking distance from player, then if < range then linetrace for lineofsight

dry island
#

But the light of sight doesn't work. I've tried using behavior trees also to get the vehicles moving to different areas and that doesn't work either. The only thing that has worked so far is using splines

#

Hmm

misty gale
#

Sounds dirty, but it shouldnt be very expensive

dry island
#

Haven'

#

Haven't tried line tracing yhet

#

Need to look at it

misty gale
#

Do a check on beginplay, then adjust checkrate based on player max speed / distance from range

#

Optimizations from the get go

dry island
#

Interesting

#

Let me try

#

thanks!

#

Well, it's definitely hitting

#

But it's not moving XD

#

lmao

#

Vehicles don't want to move

#

AI move to fails me....

misty gale
#

Got a nav mesh?

dry island
#

yup

#

Just for fun I had it set the throttle input to 1 if the player was being hit

#

and it worked

#

but it doesn't actually follow the player

#

AI Move to is the node that is failing me

misty gale
#

Well one step closer atleast

dry island
#

Yeah At least i know AI move is the problem

#

It just doesn't work with vehicles at all

misty gale
#

Well

#

You can use the navmesh to get some pointers on where to go i guess ^^

mossy nexus
#

time for custom implementations

misty gale
#

Yepp

dry island
ocean wren
#

Vehicles are a lot more complex to path for because you can't expect them to turn immediately

mossy nexus
#

I can't imagine there wouldn't be some chaos theory unknowns when working out vehicle pathing

#

especially when no heuristic for them has been given

ocean wren
#

You basically want to treat vehicles as spline generators, where the spline has to have continuity 1) through all of your goal points and 2) without going outside of your navmesh

#

So basically generate a spline path from your vehicle, but constrain it to lie within the navmesh and to have continuity from previously generated segments (so that one flows into the next). Then have your car follow the spline by speeding up and slowing down appropriately

#

Thats one method I've seen that works

mossy nexus
#

sounds expensive

#

glad I don't do vehicles

#

but interestingly it comes close how to one should think about the player in terms of environmental guidance

dry island
#

hmmm

#

yeah the problem is that isn't dynamic enough

#

Like how do you do that and get the vehicles to chase your player under certain conditions?

#

Just generate a new spline?

mossy nexus
ocean wren
#

Yeah, exactly

#

You only generate short splines so you're not trying to path the whole map, say N navpolies out, so you need to solve for spline within polygon bounds for N polygons, whilst keeping spline continuity between the last spline and the new one, with the new spline ending on a target position

#

Goddam this NFT blockchain stuff is depressing

misty gale
#

I cant remember where i saw this, could be ALS, but atleast i've seen the suggested method applied !

#

with n splinepoints ahead of the char

#

it was some procedural anim thingy

quick sluice
#

Hello. I'm trying to get my boat moving. But it fails to move to a location. I think it has something to do with this rectangle generated in the nav mesh. Is there any way to exclude this pawn from navmesh generation?

misty wharf
#

there's a checkbox can affect navigation or something like this on primitive components

#

turn that off on all of the primitives on it and it should not affect the navmesh generation

quick sluice
#

Alright, thanks a lot!

#

I found an answer on google which say to change collision to overlap all

#

now the thing is gone

#

But I'll check for the can affect navigation that would be better I think.

fickle cedar
#

Any idea why this bool is not counted with or am I misunderstanding how the "Is Set" condition works? The behavior tree should be executing the branch on the left

fickle cedar
#

This is really strange as for some AI characters it seems to work correctly and for some it doesn't

mossy nexus
#

the default decorators seem at best half assed

#

that being said, make sure that your positions are within the constraints of the navmesh

fickle cedar
#

I'll make sure the points are accessible

#

thanks

#

because these points are randomly generated

mossy nexus
#

there are functions for this exact case

fickle cedar
#

maybe some are too high in the air or something

mossy nexus
#

GetPointInRandomNavigableRadius

#

or some such

#

I can't remember the wording exactly

fickle cedar
#

yep I know this one

#

I also want to have that point in box bounds

#

so I get random point in that box but probably I also need to project it to the navmesh somehow

#

or nearest navmesh point to that point

misty gale
misty gale
#

Any way of changing the default nav area class for the landscape? Cant seem to find a setting for it

quick sluice
#

Hello. I've been able to use a navmesh to avoid an island in the sea for a boat ai. But now the boats don't avoid eachother, they pass straight on through eachother. The boats are inherited from a Pawn. How can I make the boats avoid eachother?

mossy nexus
#

I think they need to be dynamic obstacles, and your navmesh needs to be set to dynamic

misty gale
#

Isn't the crowdmanager responsible in such cases?

#

that or custom logic

quick sluice
#

I added a box collider and set it to be a dynamic obstacle. Still they pass straight through eachother

#

I changed the Nav Mesh generation to dynamic, but still the same problem.

#

Alright I think I've got it working now!

#

Thanks for the help

#

I needed the box collider to be on the ocean floor

misty gale
#

The path cost doesnt seem to consistent for some reason..

fluid goblet
#

If you wanted an AI that's asleep (like a robot in shutdown mode) that wakes up due to the player, does it make more sense to have a check in the AI component, and only if it's a success use the blackboard? Or should I just have a lowest state priority branch on the behavior tree that is "Inactive"?

misty wharf
#

both methods seem entirely fine

misty gale
#

When TravelCost is 1, entry cost is 0, can i not expect the cost == distance?

celest python
#

Navigation costs are determined by nav areas iirc

#

You create your own areas and add them to the current nav mesh bounds volume

misty gale
#

I've done that part, but the numbers im getting are not consistent :-/

#

Point 1 to 3 should both be of type "pathbest" with a travelcost of .5, but are not

#

So path between point 1 and 2 is wrong. Higher value than the default(which is the most expensive there is in my setup). . No entry cost on any area..

ocean wren
#

If I remember right, there's costs associated with transitioning from one navpoly to the next.. so you might be falling foul of that?

misty gale
#

something like that does seem to be the case yes πŸ˜• ugh

#

I guess the nav system cant get me all the way there then

#

even my sphere traces for nearby road (hidden meshes) were more reliable

#

probo gonna have to resort to c++ at some point for this

ocean wren
#

yep, its the best way

#

The navmesh system is basically a C++ thing if you want to really drill down into it

misty gale
#

I was hoping to avoid it for the most part πŸ˜…

pine steeple
#

your picture makes sense tho

#

PathBest is cheaper, meaning the AI will take that and it does?

misty gale
#

Point 1 to 2 is wrong, that should also be pathbest

#

But the cost/distance >= default...

#

So the nav path itself is correct. Its just my bp guesstimate of area class that is wrong

misty gale
#

What im really trying to do with this info is to save myself from sphere tracing each unit i move forward with the road to see if we overlap another road and if so, dont create paralell road

#

Sort of like an economic path laying mode, finding cheapest route to new location, even if it means re-using existing roads.

uncut rune
#

Is it possible to have a custom Environment Context to be set to a blackboard key? I'm using AI prediction and sometimes it ends up predicting a spot that is out of the map and I want to use EQS to prevent that and choose the closest valid location on the navmesh.

quick sluice
#

Hello! Before I dive into the rabbit hole I'd like some advice from someone who has some experience with UE AI. (This is my second day) Basically I have a static nav mesh for the level which is working wonders. No problem.

But now I want the two boats to avoid eachother. For what I read I can go two paths:

  • RVO Avoidance
  • Detour Crowd

RVO Avoidance needs to have a character actor and since my boats are Pawns I need to reparent and I think a lot more tweaking.

Detour Crowd is complex and can't be used from blueprints (or the articles are outdated) My C++ is not that good so this will be a struggle.

Maybe somebody who knows something about AI can give me a direction which one is best in my case before I start modifying and reparenting or implementing C++ with a bad idea. Thanks!

ocean wren
#

You have another option, which is to implement your own avoidance model. Which really isn't that hard to do. Have a look at "steering forces" for search terms. I think for the case of boats, I'd use the steering approach because RVO and Detour both work on the assumption that your agents can stop instantly and turn on the spot.

#

At the very least for boats, you could just push the boats apart and not enable collision on them at all, so allow some interpenetration but apply a seperating force to try and keep them from colliding (this is the approach used in Team Fortress two and you hardly notice the penetration)

quick sluice
#

Thank zoombapup! Then I'll dive into this other rabbit hole! πŸ˜„ Thanks a lot.

spark kindle
#

Guys, good morning, any of you knows how to create presets for the ai perception component like Ai Hearing config ?

spark kindle
misty gale
mossy nexus
#

trying to get a quick rundown for what the benchmark of a single AI BT should average at

#

does anyone have any values for theirs?

crimson galleon
#

I've got around 10-20 AI an average, no noticeable frame drops

mossy nexus
#

what's your benchmark value

crimson galleon
#

in editor, fps averages 110

#

and i wouldnt say i have the beefiest of systems

#

im also running realtime lighting only with several thousand mesh instances

#

so their addition hasn't changed anything really

mossy nexus
#

I mean I don't really care about fps, I was thinking about ms/AI

crimson galleon
#

oh i see, yeah haven't noted that

fossil basalt
#

my AI keeps walking off the navmesh (and getting stuck off the navmesh) - i'm using navmesh walking as walk mode and AI Move To node to walk, any suggestions/ideas?

wary ivy
#

does ai move to do any pathfinding or does it simply just move the pawn towards the target?

crimson galleon
ocean wren
#

Be careful, there's a blueprint "moveto" that if I recall just heads straight to the point and doesn't using the navmesh

#

You should be using the behaviour tree's version

fossil basalt
#

i actually even project point to navigation before moving to

ocean wren
#

If you visualize the path with the debugger, what does it look like?

fossil basalt
#

how do i do that?

ocean wren
#

You can use the EQS debug pawn to test out pathing too, I sometimes use that to check my paths are OK

fossil basalt
#

uhm... i can't seem to show navigation paths?

pine steeple
#

also Visual Logger

#

that is my best friend

#

records everything the AI did, what BT nodes it ran, what path it took, what decision it made, etc

fossil basalt
#

yeah i used the visual logger indeed, it seems like it decides to walk outside of navmesh as pathing

#

possibly it's because project point to navigation fails, and i ignore it and still call ai move to, testing that now

#

nope that didn't change anything either

misty gale
#

Wouldnt the moveto just fail if the location is outside navmesh?

pine steeple
#

depends is partial path is allowed

misty gale
#

Ah

fossil basalt
pine steeple
#

any reason you are not using the MoveTo task?

fossil basalt
#

I wanted an acceptable radius stop rather than straight ontop of the player

#

but it walks outside of the navmesh with default MoveTo task too

fossil basalt
#

I debugged it further, it only happens when there are multiply AI trying to reach the player, for 1 ai is fine

ocean wren
#

MoveTo task has an acceptable radius value in it doesn't it?

fossil basalt
#

yep, it's RVO avoidance related, if i turn it off, they stop going off the navmesh

ocean wren
#

Makes sense, the RVO doesn't constrain them to navmesh

fossil basalt
#

how can i make sure that they are constrained to navmesh when using rvo? (without rvo, group of 3-4 monsters act really un-naturally)

ocean wren
#

Have you tried detourcrowd as an alternative?

#

I can't remember if either of them have the final position constrained or not.. probably not

#

Mind you, I know detour can do it.. just don't know if the default UE implementation does it or not

fossil basalt
#

as in DetourCrowd as ai controller base class?

ocean wren
#

So detour has its own crowd following component and is basically a different style of avoidance than RVO

#

the two aren't used together

#

the caveat, is that the UE implementation of detour is a bit... suboptimal and needs some tweaking. The Detour library itself is part of Recast+Detour by Mikko Mononen from back when he was working at Crytek

#

so Epic took his open source lib and built it into UE4

#

but I don't think whoever did the implementation was too well versed in it (not surprising really)

fossil basalt
#

cool, i'll have a look

ocean wren
#

There's a demo in that project that will show you it in action..

fossil basalt
mossy nexus
ocean wren
#

You said it πŸ™‚

#

Imagine if AI had been given the same love as graphics?

wintry osprey
#

Hi,

I'm currently working on an AI that's very simple in theory, but can't seem to grasp how to do it. It's basically just like the Orcs in orcs must die, but when they're obstructed by an object, they should just start hitting what's infront of them.

Currently I have just setup so when the path is invalid, start hitting stuff

#

But it works kinda meh

crimson galleon
celest python
#
    virtual void OnGameplayTaskActivated(UGameplayTask& Task) override;
    virtual void OnGameplayTaskDeactivated(UGameplayTask& Task) override;

Wasn't those functions should be executed if this flag is enabled?

lyric flint
#

Ok I need some help regarding Behavior Tree, the "Is At Location" decorator doesn't take into account the new update key for the new vector location to test
It works well for the first one set at runtime, but when set again it just doesn't take it into account, despite the fact that the value of the key has really changed as I can see it in the blackboard at runtime

#

It's been like 1 hour i'm on this problem and I can't move forward without fixing it and nothing comes up on google

runic flare
#

Even after the Move To and Wait complete?

lyric flint
#

Yes, after Move to has completed, the Is At Location return true, then the Location is set to a new random one in a navigable radius, but Is At Location keep returning true, thus the AI not moving

#

Then it get stuck in this position

#

The custom task

mossy nexus
#

and loop the damn thing

lyric flint
runic flare
#

yeah sequence is a good idea πŸ‘

#

as a next step you'd want to handle the MoveTo failure case but for now using a sequence should get things moving

lyric flint
#

Like this ?

#

because like this it gets stuck at step 2

mossy nexus
ocean wren
#

The sequence should loop anyway

mossy nexus
#

it will

ocean wren
#

because there's nothing higher priority to override it

mossy nexus
#

but it's good practice anyway IMO

ocean wren
#

if you're not seeing looping, you dun messed up πŸ˜‰

mossy nexus
#

for sequences that are unending

ocean wren
#

well, I'd usually not have looping sequence as the default, I'd have that activated in some condition and have idle as default πŸ˜‰

lyric flint
#

so there was something wrong with my initial setup or was it supposed to work ?

mossy nexus
ocean wren
#

Question, what do you think a selector does?

lyric flint
#

me ?

ocean wren
#

Yeah

lyric flint
#

Well it's like a branch

#

I guess ?

runic flare
#

actually as part of this socratic process we're involved in here maybe we could look at my situation:

#

I have a tree like this, the red x's are failures -- what node should execute next?

ocean wren
#

The point of a selector, is to choose one of its children to run.. but you should ask yourself.. what does it do to choose and what happens once its chosen?

mossy nexus
ocean wren
#

The difference between a selector and a sequence is in those questions and its important to get it

runic flare
#

forget the tasks themselves, they can be anything

lyric flint
#

mmh

#

I think I understand a bit more thanks to you

#

basically the selector will choose one of it's children to run, and basically what's happening is that my custom task is never ending right ?

mossy nexus
#

rule of thumb: selectors need 1 task to win, sequence needs all tasks to win

lyric flint
#

ok so I need to set up a succeed condition for my custom task if I understand this correctly

#

don't know how to do that

ocean wren
#

Well, I think for your case, you should have as suggested, a sequence loop that selects a point to move to, then moves to it

lyric flint
#

oh

ocean wren
#

given that you don't want selecting a point to move to "compete" for selection with moving to that point

#

its basically a "Do this then that" kind of sequence right?

lyric flint
#

okay

#

it gets stuck though

ocean wren
#

You don't need the loop decorator πŸ™‚ sequence is the only option right? normally I'd add a root selector and put the sequence below that (I doubt it'd make any difference)

lyric flint
#

yep 😦

ocean wren
#

But you should think about failure cases too.. what if you can't find a new random location?

lyric flint
#

well then I would do something like teleport the ai to it's original spawn point location or something like that, a reset of some sorts

#

because that would mean it has gotten stuck

ocean wren
#

Usually, you'd have an idle loop too, with a wait and animation or something in it πŸ™‚

lyric flint
#

but here it succesfully set a new location, but it doesn't do anything

ocean wren
#

Yeah, handling failure is a useful thing to think about

runic flare
#

you need to call Finish Execute in your Task

#

the tree doesn't know that the task is done

mossy nexus
lyric flint
ocean wren
#

ok, so you need to debug the location, make sure its valid.. and as Andrew says, you need to finish execute πŸ™‚

lyric flint
#

thank you all

ocean wren
#

Andrew: I reckon yours goes to the rightmost simple parallel?

runic flare
#

that's what I WANT to happen, and what I think should happen, but it's not

#

and Im confused

ocean wren
#

The left most one failed, so it went to the next sequence, when the parallel failed it returned failed, so will go to the next in the selector

runic flare
#

the tree flickers between the two leftmost MoveTo nodes

ocean wren
#

I guess it could be that the middle sequence isn't returning failure?

#

there's an option on the simpleparallel to choose to return if one or both parts fail isn't there?

#

been a while since I've done this in anger, since I started doing more ML stuff

celest python
#

Why MoveTo would fail?

#

It will just run again after it's finished

ocean wren
#

Ah yeah, moveto self????

celest python
#

There isn't anything preventing MoveTo to succeed unless there isn't any external factors

runic flare
#

haha sorry, again this is not my real tree

#

just the structure

#

let's say both of my move to targets are off the map somewhere

#

not on the navmesh

#

so they are failing

celest python
#

I don't know if moveto fails if target is not in the bounds of nav mesh bounds, I need to check that

#

iirc it was failing if the properties are wrong or target is invalid etc

#

It also varies if you enabled AITasks etc

celest python
runic flare
#

it should fail or abort right?

ocean wren
#

If I recall, moveto has a timer based failure check, so it likely wont fail instantly

#

it tries to make progress and fails if no movement is accumulated for a given time

#

unless that was one I coded πŸ™‚ memory is hazy now about specifics I've been doing it for so long

runic flare
#

haha, nah it does fail instantly:

#

so Im expecting my next step to run the Wait node

#

but it does not

#

it returns to the leftmost MoveTo

#

rinse repeat

#

trying to figure out why the hell it's doing that

celest python
#

It is a selector, it will keep running MoveTo

runic flare
#

what do you mean??

celest python
#

There isn't any decorator or anything prevents it from running again

ocean wren
#

well, it'd fail the paralle, which would then presumably run the makenoise? or it'd fail up the tree and try and run the leftmost moveto again?

mossy nexus
#

idk I've had MoveTo the task crash on my BTs so I've mostly made my own tasks

runic flare
#

but if the MoveTo fails it should try to run the next node in the tree, L->R

mossy nexus
#

I trust 0% of the original nodes

celest python
runic flare
ocean wren
#

I guess it sees the fail of the middle nodes as failed and reruns the tree from root, which reselects the leftmost in the selector?

runic flare
#

yeah

#

it SHOULD

celest python
#

Btw you can also use Visual Logger and see the results of nodes

#

It should give you exact process

runic flare
#

oh how do I do that?

celest python
#

One sec, lemme open editor

ocean wren
#

+1 for visual logger

runic flare
#

love me some new debug tools

ocean wren
#

You can go crazy making tools for UE, I've written a ton πŸ˜‰

#

One of my favourite things to do these days

celest python
ocean wren
#

naah, I decided against so I can get the consultancy $$ πŸ™‚

celest python
#

Ah, thats an option too πŸ˜„

ocean wren
#

I was tempted for a good long while

#

I was hoping that epic would hire more AI guys and I'd just do that for a bit

#

but they never did

celest python
#

@runic flare

#

On the UE editor, 'window' and 'developer tools'

#

It's the last 2nd one

#

Enable it, start it, then play

ocean wren
#

If you can decypher the editor code, UE is seriously powerful in terms of custom toolsets

celest python
#

Yeah but many things require source build 😦

ocean wren
#

yeah, for sure source build

runic flare
celest python
#

I really wanted to add a automatic prefixer to the engine, but then realized I need to change whole framework (I cant believe they prevented this intentionally)

mossy nexus
#

I just want hotkeys assignable for custom events in editor πŸ˜”

ocean wren
#

prefixer?

celest python
#

For example when I add a DataAsset to the content folder, I want it to be prefixed automatically as DA_

#

So I dont have to check which prefix I should use for assets

ocean wren
#

You can do that with the asset manager though right?

mossy nexus
#

I should get to that

#

I just spent a day of my weekend restructing my content browser

celest python
mossy nexus
#

somehow my editor blueprints are still broken

celest python
#

With custom assets you can add your own prefix from factory though

ocean wren
#

There's an asset manager you can hook into for content brower stuff, like dragdrop events etc

#

I use some for custom datatypes so I can hook in new editors for them

celest python
#

Are you serious? I need to learn asset manager right now then lol πŸ˜„

celest python
ocean wren
#

Hmmm... no sorry, it should be in the docs though, they added it around 4.11 or so

#

Asset... something πŸ™‚

celest python
#

Haha, okay πŸ˜„ thanks for letting me know

ocean wren
#

I basically just traced for an event from the dragdrop operation when dragging a texture into the content browser and followed it down the chain from there

celest python
#

From what I can see, almost everything is hooked to CreateUniqueAssetName function which is a part of a factory pattern in the engine

#

But I'll keep digging it

ocean wren
runic flare
#

thanks for the help guys, turns out Im an idiot, go figure

#

the second MoveTo is indeed failing, but I forgot my custom MoveTo task also clears my BB location key on failure

ocean wren
#

There you go, on that webpage there's the assetactions which allows you to change the name

runic flare
#

AND I have a Decorator on an earlier node that aborts lower priority when the location key value changes 🀦

#

this Visual Logger is a game changer

ocean wren
#

hahaha.. it happens to us all πŸ™‚

celest python
ocean wren
#

ASSET TOOLS πŸ™‚

mossy nexus
#

zoomba while you're here, what would you consider a good average per AI ms?

celest python
#

So if you want to add a custom default name to datasset, or AActor for exampe, you can't without source build 😦

mossy nexus
#

just as a frame of reference I got about 100 nodes in my tree

#

haven't gotten to subtree it yet

ocean wren
#

how many AI entities are you having?

mossy nexus
#

planning on?

ocean wren
#

yeah

#

generally, as ai programmers, we get about 5-10% of a frame if we're lucky

#

so its 5-10% of 16.7 ms πŸ™‚

#

if you're after 60fps

mossy nexus
#

gotcha

ocean wren
#

I've argued for more before, but you know, graphics gets like 85% πŸ™‚

#

but it does depend on the game, I mean if youre going for 60fps console stuff, its a very different ballgame than say the turn based multiplayer stuff I've mostly worked on

#

I mean, I've worked on games where you can use about 5-10 seconds per move πŸ˜‰

#

I once had a chat with some military AI guys and they had 10 MINUTES per move πŸ™‚

celest python
#

move == turn?

mossy nexus
#

I'm trying to make out how much exactly an AI takes per frame, but I think I'm at around 2-5% per frame

#

pre optimization

ocean wren
#

yeah, think of it as a complex decision for strategic AI

mossy nexus
#

I'll have to go look at it but 10% of a frame sounds good

ocean wren
#

I'd say 10% was on the upper end though.. you'll likely get some pushback if you go that high

mossy nexus
#

I don't expect to have more than 20 AIs at any time, 50 perhaps if I make a low res version of a BT

ocean wren
#

I should ask my buddies, see what the concensus is about AI performance these days. Haven't talked about this kind of thing in years since covid lockdowns and my not going to GDC as much

mossy nexus
#

aye I hear that

#

this is just for a personal project though so no stakeholders

ocean wren
#

ah, in that case, you can fight yourself πŸ™‚

mossy nexus
#

generally I've kept my resource use scarce so I can load up on whatever I need

#

in my demo level I have 3 AIs

ocean wren
#

I did a graphics lecture today and found like 3 new UE tools for optimisation, its crazy whats in the damn engine

#

There's a tool to remove holes in meshes πŸ™‚

#

and a tool to remove meshes that are inside other meshes πŸ™‚

#

I guess came from automotive crowd, since they have a lot of engine parts that are.. inside the engine πŸ™‚

celest python
mossy nexus
#

yeah I'm looking at 0.08 ms for an AI, with about a frame max

#

whole AI action

#

oops not my answer

celest python
#

When including navigation and movement it takes slightly more than %10 for my project

ocean wren
#

yeah, pretty much everything AI budget wise

mossy nexus
#

but I will say I absolutely love how the AI works

ocean wren
#

its only a ballpark to be honest.. we'd usually just duke it out until we reach a compromise

mossy nexus
#

you and an imaginary graphics programmer because they don't exist? πŸ˜‰

ocean wren
#

But its always rendering gets the love first.. AI is really a distant cousin to it πŸ™‚

#

To be fair, I always worked on teams where we did everything until most recent work

mossy nexus
#

did I hear wrong that you did work for Team17?

ocean wren
#

But yeah, usually whoever is writing the graphics implementation for the platform that has the slowest renderer was the one you had to fight πŸ™‚

#

Yeah, I worked for team17

mossy nexus
#

fair enough

#

my target is PC exclusive atm, but generally I've kept everything in the green

ocean wren
#

Been an academic for a long time now though, so only do commercial stuff when I feel like it

mossy nexus
#

shader cost is record low, almost no transparency as I've opted for realtime polies as it ends up being cheaper

ocean wren
#

I love the PC, its just so... open! πŸ™‚

mossy nexus
#

the irony is that the game is best played on a gamepad

ocean wren
#

Back in the day, we used to work across a good what, half dozen or more platforms at once

#

hell, they had worms on a set top box πŸ™‚

#

some crazy bastard even wrote a spectrum version πŸ™‚

#

Right now, I'm working on ML techniques for automatically generating BT's πŸ™‚

#

because frankly, its a pain in the arse

mossy nexus
#

I had a lot of fun designing mine

#

but I guess after the first 100 you kinda get tired of it

ocean wren
#

Well, this is for a research project

mossy nexus
#

oh, right

ocean wren
#

Microsoft Research did a paper on it being a pain in the arse though "its unwieldy and it takes a lot of time" is the title πŸ™‚

mossy nexus
#

oops just realized I'm well over budget. I got 0.08 ms for 1 AI, that's 8x budget πŸ˜…

mossy nexus
#

but at the same time automation is all the rage

ocean wren
#

Gotta love it when someone writes a paper that so eloquently states your projects reason for being πŸ™‚

#

Although a little bird told me today, that some other group is proposing similar research to our funding body.. so... hmmm

mossy nexus
#

I am glad not to be in academics though. in my field it seems more of a circle jerk than anything else

ocean wren
#

Whats your field?

mossy nexus
#

design

ocean wren
#

Game design? or product design?

mossy nexus
#

game design

#

academics use game design as a carte blanche for opinions (tm)

#

without much to back them up

ocean wren
#

Yeah, I've met a fair few that aren't exactly what I'd call practitioners

#

But there's some good ones too

mossy nexus
#

so it's just a bunch of people referencing each other then peer reviewing each other telling each other how good they are for writing what they have

#

no problems actually get resolved

ocean wren
#

There's a lot of "media studies" types in game design academia for sure

#

I've been lucky to work with some good ones though

mossy nexus
#

meanwhile neuroscience is just silently making mad progress in terms of HCI and the understanding of the mind, which has been massively useful

ocean wren
#

Yeah, we have a good working relationship in our interaction lab (my research group) with lots of psychologists

#

HCI academia has a bit of that circle jerk thing though too.. I tend to avoid it πŸ™‚

mossy nexus
#

yep I get that

ocean wren
#

I stick to ML and PCG

#

and VR/AR now too

celest python
mossy nexus
#

generally I'm just taking notes from fields that are relatively young but have huge potential implication for games

#

for instance neuroaesthetics

pine steeple
#

.08ms for 1 ai?

ocean wren
#

We're doing a lot of AR/VR for heritage organisations, just sort of happens we're surrounded by them

pine steeple
#

thats 12ms

mossy nexus
pine steeple
#

for the amount of AI i run on screen πŸ˜›

#

150

mossy nexus
#

this is a single BT written all in BP

#

about a hundred nodes

ocean wren
#

neuroaesthetics is my type of aesthetics πŸ™‚

pine steeple
#

i run 150 ai at 3ms

#

o_0

mossy nexus
mossy nexus
pine steeple
#

heh

#

i do a lot of optimizations

#

reducing tick rates for AI that are a bit further away is the big one

mossy nexus
#

I'd love to know which is the most taxing of BT for instance

#

ah, good to know

#

I was thinking of a whole tree replacement for distant AI

celest python
pine steeple
#

yes

#

6ms down to 3

mossy nexus
#

well turning tick off for everything suprisingly makes everything go brr

pine steeple
#

just by tick rate adjustments

ocean wren
#

I've heard it called a "simulation bubble", you reduce rates outside the bubble πŸ™‚

celest python
#

What if 150 AI would be on the screen for the same time?

pine steeple
#

around 5ms

#

offscreen? about .8ms

#

but the average is around 40-50 on screen

#

(little monsters)

mossy nexus
#

what is your max amount of ms taken by AI?

pine steeple
#

these are the highly optimized "Trash" monsters

#

by stat ai?

mossy nexus
#

yes

pine steeple
#

about .8ms

mossy nexus
#

oof

pine steeple
#

all my tasks are C++

#

and the BT's are designed to avoid too many abort stuff

#

which causes additional ticks

mossy nexus
#

that's good to know

#

had no idea that aborts caused extra ticks

pine steeple
#

setting scopes also helps a lot

mossy nexus
#

but I think the service I'm using is the general one causing issues

pine steeple
celest python
#

C++ scopes? { }

wintry osprey
pine steeple
#

Decorator scope

mossy nexus
#

that's interesting

#

so basically it will only do aborts within scope?

pine steeple
#

yes

#

helps bring down the ticks

#

as aborts are checked via tick

#

as seen here

#

BP decorators use this

mossy nexus
#

ah actually it might be a little less

#

I forgot I'm using a BT for my camera currently as well

#

which seems to run at 0.04 ms πŸ˜…

pine steeple
#

one thing also that helped with the AI (CMC side) is using NavWalking

#

and reducing the CMC tick rate based on Significance

mossy nexus
#

did you subclass the CMC for this?

pine steeple
#

oh and moving directly without floor checks

#

when far away for players to notice

celest python
#

Kaos, while you are here, did you ever use FindAsyncPath? If you did, do you know why dispatching finished queries taking almost 0.25ms?

pine steeple
#

i hate that function

#

i had the same issue

celest python
pine steeple
#

mine was also random

#

from .1 to nearly 1ms sometimes

#

it caused me so much headache

celest python
#

Do you still use it? Or did you wrote a new one for async path finding?

pine steeple
#

no i just request path sync

#

and careful when i do that

celest python
#

That takes almost 1ms with ~75 pawns for me, with async path finding it was able to optimize it %25 more but if I only could remove that additional dispatching overhead it would be almost %50

#

If you set moverequest with an AActor engine handles async pathing automatically so you dont get that overhead

pine steeple
#

yeah you must be requesting paths a lot πŸ˜›

celest python
#

Yeah, I have a custom system that adds an offset to FVector type of moverequest

pine steeple
#

my ai move to a dummy actor

#

which i adjust

#

so i get the target

#

then find adjusted vector

#

and set movetarget to that location

celest python
#

What happens if target is moving too fast and frequently?

#

You need to call move to again

pine steeple
#

nope

#

goal tracking

celest python
#

Hmm, so that actor is attached to player

pine steeple
#

no

mossy nexus
#

okay so, I still have 2 AI calls (?) for a single AI it seems

pine steeple
#

it just teleports in world space

#

to where the ai should move to

mossy nexus
#

but without the camera BT I'm down to .04 ms

#

so, score?

pine steeple
#

.02ms πŸ˜›

celest python
#

With C++ implementations you can get to .01ms I guess

mossy nexus
celest python
mossy nexus
#

so it'd be bad if I am calling 2 AIs per 1 AI

pine steeple
#

per AI

#

ai spawns it and just teleports

celest python
#

That makes sense, I understand now

pine steeple
#

so i do EQS query to determine who the AI wants to reach

#

then i adjust that vector and teleport move target

celest python
#

Maybe I could think about that too, but I'm generally scared of amounts of AActor's so I did not even considering using something like that

#

Even glass made a custom move to function for that (but with scene comps)

pine steeple
#

Actors are fine

#

just disable tick on the move target

#

and it adds nothing to game time

#

needs no collisions either

#

just a simple scene comp

celest python
#

I remember 1 year ago my team lead said we cant use UObjects for ~20 data objects and we refactored a whole AI framework to structs, since then I have a trauma lol

#

He was also a very experienced person, weird

pine steeple
#

o_0

mossy nexus
#

sounds very ECS like tho

celest python
mossy nexus
#

ahhh that might be why yeah

#

I have a BT component that is separate from the AI controller

#

but I'm not running a BT on the AI controller

celest python
#

I have something like that too, it adds an extra call count but when no AI exists in the PIE its ms is 0

#

So probably your .04ms is real πŸ˜…

mossy nexus
#

that's annoying

celest python
#

Your max/hardcap AI count is 20 or 50?

mossy nexus
#

hardcap is probably 80, but realistically the player would have trouble dealing with 20 AI

#

hell the player has trouble dealing with 1 AI πŸ˜‚

celest python
#

If you are going to convert those nodes to C++ later on, I would not worry about it too much

mossy nexus
#

yeah I'm not super worried, and I'm certainly not going to be optimizing just yet

#

but I am trying to see if it's an issue I should look into for the future

#

50 AI would be mostly non combat AIs

#

that would just do role behavior and potentially escape

#

and or die

#

the plebs

celest python
#

You can even use significance manager and reduce their behaviors if they are far from players like how Kaos and Hitman does πŸ˜„

mossy nexus
#

I probably will do

#

I don't plan on having huge maps

#

but it's probably good thing regardless

celest python
#

I dont know why but your game gives me vibes of dishonored

#

Especially since you like systemic πŸ˜„

mossy nexus
#

πŸ˜‰

#

one thing I still want to figure out is AI on AI battles

#

well, fights

#

it's not going to be large scale

#

but like 1 vs 1

celest python
#

There are some quite good approaches on the Game AI 360 book

mossy nexus
#

tbh all I need to do right now is implement factions and see how each of them will react to each other

#

while me and the AI director look at the carnage

#

(the AI director is complicit, to be fair)

celest python
#

Release date when? 😈

mossy nexus
#

"when it's done"

#

but so far I demo'd the demo level last month and it was mad fun

#

so getting fairly close to alpha

celest python
#

That's nice to hear, I'll be waiting for your announcement πŸ˜„

mossy nexus
#

I'm not very good at announcing things I'll be honest. I still have to write one more system for feature completeness. then it's just bug fixing and optimization for a long time.

#

but yeah I'm hoping that within a year it's something I can show off

#

preliminary tests have been very fun to play at least (AI being hella hard and rewarding to duel)

tranquil marsh
#

would I need to use perception system If I'm going for a doom style combat

celest python
#

iirc Doom had one

#

You dont need any kind of advanced perception though

tranquil marsh
celest python
#

Behavior Trees also use gameplay tasks

#

GAS or gameplaytasks are not relevant with BT's at all directly

#

DOOM 2016 (and probably Eternal) is using Finite State Machines for example

tranquil marsh
#

alright, makes sense

fair zealotBOT
#

:no_entry_sign: ddwi16#9308 was banned.

celest python
mossy nexus
#

you dont have to use behavior trees for AI

#

but it'd be smarter to use them

#

it's much easier to make functional AI with them than without

celest python
#

Yeah Behavior Trees or FSM is just a very optimized decision maker for specific behaviors

mossy nexus
#

and they're great for visually understanding what the AI is supposed to be doing at any given time

tranquil marsh
#

my thinking is if I'm using GAS I could use gameplay tags to track and manage states
since GAS has delegates for everything I feel like its doable

celest python
#

I'm doing the same but gameplaytags are not bound to GAS btw

#

Its a different module

#

I recommend researching how other games made their AI for a very long time first, then start implementing real stuff

celest python
#

Also ask questions often here πŸ˜„

tranquil marsh
#

For sure πŸ˜„

sharp notch
#

Anyone know how to block navmesh generation on a static mesh instance? I'm painting a bunch of trees and navmesh is being generated on them that I don't want. I tuned the recast rules as far as I could, but it would be better to just block it explicitly.

mossy nexus
pine steeple
#

there is!

#

mark it as Dynamic Obstacle

#

inside the mesh details (when you double click a mesh asset)

sharp notch
#

Excellent! Thank you!

tranquil marsh
#

whats a use case for having a custom EnvQueryGenerator?

crimson galleon
uncut rune
#

Why doesnt the UAISense_Touch class have a report function like the UAISense_Damage and UAISense_Team classes do? The Unreal devs decided to skip that one for some reason.

misty wharf
#

It probably receives those events via some other means

ocean wren
#

They probably didn't use it in fortnite, so didn't bother πŸ™‚

misty wharf
#

lol

dawn pier
#

Is there anyway to check specifically if the AI is moving using the MoveTo command?

misty wharf
#

You might be able to check if the path following component is currently following some path

#

MoveTo goes through that iirc, but so do some other navigation movement things

dawn pier
#

hmm that should be ok though. Since it should apply to when the enemy is moving using navigation only

#

thanks I'll try it

misty gale
#

wait , there's a path following component?

misty wharf
#

on AI controllers

misty gale
#

What does it do? Is it what handles the moveto stuff?

misty wharf
#

Yeah

misty gale
#

Makes me wonder why i'm doing a custom one

cold trout
misty wharf
misty wharf
#

Anyone happen to know what order do BT nodes run when they're part of the same node? Eg. if I have a BT Task which has a decorator and a service on it, what order do they run in? I assume decorator must run first as it may block the task node from being entered, but does the BT service's become relevant run before the task runs?

#

I need to pull some data from the pawn into the BB, so was wondering if I'm gonna need to make a separate task for it, or a service which can pull it for the task node its attached to :P

crimson galleon
#

nodes execute from left to right, and by number order within the node. services can run before a decorator.

misty wharf
#

Hmm

#

I guess the service's become relevant runs after the task starts then πŸ€”

tranquil marsh
#

Services are being executed when underlying branch of behavior tree becomes active
from the source code

ocean wren
#

before or after?

#

πŸ™‚

calm herald
#

@misty wharf @ocean wren
The order is
Decorator -> Service -> Task

#

Devised from very limited testing using Print String πŸ˜„

misty wharf
#

Ah good to know :D I was gonna have to test it at some point once I get this other stuff sorted but you saved me the effort lol

crimson galleon
#

as a caveat, ive noticed the first node connected to the root does not execute decorators, but will execute the service

mossy nexus
calm herald
mossy nexus
#

did you test both cases for selection nodes and for task nodes?

calm herald
mossy nexus
#

noted

calm herald
#

Don't mind the typo

#

Actually, it does show the order right there πŸ™‚

misty wharf
#

Oh you're right, the number order is correct

#

Or rather, in the order you said

celest python
#

But iirc the order of decorators or services are not guaranteed right?

#

A decorator can run before B decorator even if it's on bottom of it

ocean wren
#

That seems.. suboptimal πŸ™‚

mossy nexus
misty wharf
#

Perhaps they also execute in the numbered order on the node

#

but of course in case of decorators any of them failing may abort it

ocean wren
#

This should be in the documentation πŸ™‚

#

I know.. I'll get my coat πŸ˜‰

celest python
#

Also last time I checked it was not being executed by order

#

I was hoping to avoid heavy calculations done in some of my decorators but some of them was running before than the top ones

#

It also sucks if one decorator failed, others also keep evaluated

#

If first one is failed we dont need to evaluate second one blobshrug

ocean wren
#

fix it!

#

make a pull request.. which is a stupid name for a check-in πŸ™‚

celest python
#

I guess they only accept PRs for 5.0 branches 😦

ocean wren
#

You think they're going to add any AI stuff for UE5? πŸ™‚

celest python
#

Of course, one of the Epic staff confirmed AI team is making 'big' updates in #cpp

ocean wren
#

AI team?

celest python
#

Miezsko & rest of the AI guys @ Epic

ocean wren
#

Hmm, we'll see πŸ™‚

celest python
#

Did you see 'Mass' framework yet?

misty wharf
#

Hrms, how would you approach this type of character AI logic... I have a BT service which makes the character hold out its hand (via a montage) when player is nearby and holding an item it wants

But this conflicts with logic where the character must hold the hand out until the receive item animation finishes, because at that point the player no longer holds an item they want and the BT service stops the montage :P

ocean wren
#

Don't think so, got a link?

celest python
#

Sure, one sec

ocean wren
#

So can't you just reverse the montage when the state of "has item" to "not has item" switches?

celest python
misty wharf
#

well the problem is basically that when the item is moved from player to npc, the condition for holding the hand via the service stops ---> the service stops montage

but at this point it should hold the hand out, but if I start the montage when the item is being received, the service will run after and still stop the montage :D

#

...I probably should just redo how the BT works

ocean wren
#

Surely you want to hold the hand out if the player is in range AND has the item

#

and then stop holding it out when the "has the item" becomes false?

misty wharf
#

Correct, but at the point when the item is being animated from the player hand to the npc hand, the player no longer has it

#

for the duration of this short animation, the hand should still be held out so that the item correctly move into it :)

ocean wren
#

Oh, so you want an interim animation to play on the transition?

#

So you could transition to the "grabbing item" anim and then transition to hand not held out when it completes?

misty wharf
#

Yeah I'll probably just move the logic into the character actor itself so that it can handle it a bit better

ocean wren
#

So holding out hand would be player in range + has item, if has item becomes false, then transition to "grabbing item" and then once that finishes playing, animate the "got item, lower hands"

misty wharf
#

since it's in the BT service which just calls functions "start hold out hand" and "stop hold out hand" it gets messy :P

ocean wren
#

You could get fancy and do some IK to hold the hands out in the right direction πŸ™‚

misty wharf
#

It would still have the same problem with the way I currently have it set up I think :D

#

I'm just gonna move the logic from the service into the actor, because the character actor has a state value for when it's waiting for an item, so there's not really much of an actual reason to have a separate service for it

mossy nexus
#

anim montages in services πŸ‘€

ocean wren
#

Sounds reasonable

celest python
misty wharf
#

it's not actually running a montage from the service, it's just calling a function on the pawn that triggers whatever actions it should do

#

the service just measures distance to player and some other rules for it

celest python
#

is it some kind of an 'overseer'?

#

that responsible for signalling things to actor or any other class

misty wharf
#

I mean it basically just does this :P

mossy nexus
#

sketch to have that as a service

#

should be a task

misty wharf
#

It doesn't really make sense as a task because it needs to function while the npc is doing something else (eg. waiting for the player to actually give them the item)

#

but if the player wanders too far it needs to stop holding out the hand

#

but if I move this logic into the character it should work, since I can add some additional conditions for when it does this

mossy nexus
#

that's entirely possible with tasks

#

sounds like a sequence that needs to be aborted

#

if players stray too far

#

I wouldn't micro that logic within a service

#

not only is it expensive but it's also much more error prone

misty wharf
#

basically it's like this

#

but yeah, having it in the service is probably the issue because it gets messy

celest python
#

why not a decorator?

misty wharf
#

it's... not going to actually solve the problem

mossy nexus
#

3 services πŸ˜…

misty wharf
#

because then it's the same problem except it's in a decorator

#

:P

#

I actually don't have almost any services in my other BT logic

#

Was just using them here to see if it's useful

mossy nexus
#

I have 1 service and I consider that too much

misty wharf
#

they don't actually tick except for the HoldOutHand which needs to measure distance and some other rules so I don't really see the problem lol

mossy nexus
#

so if they don't tick... why are they services?

misty wharf
#

Because it's convenient to have them like this and it's one of the designed usecases for them

mossy nexus
#

IMO it seems like you wanted to circumvent having deeper subtrees

misty wharf
#

How would you do the look at player service as a deeper subtree? Basically it needs to call a function which sets the player as the look at target, and when it stops being relevant, it needs to turn it off

mossy nexus
#

simple parallel?

celest python
#

decorator can do this too btw

#

onactivated, ondeactivated etc

mossy nexus
#

yea

misty wharf
#

simple parallel is just weird, I don't like it lol

mossy nexus
#

even a task can do it as long it doesn't succeed

celest python
#

Services are useful if you are not going to affect the execution but gonna manipulate blackboard values

#

its a UE thing afaik

#

You might not see it on other engines

mossy nexus
#

yep that's my reason for using it, it's my BB <> perception system connection

#

this is my AI tree for the record

celest python
#

o_O

mossy nexus
#

I haven't made subtrees yet lmao

celest python
#

My BT's are only 10 nodes maximum lol

misty wharf
#

this is one of my BT's, I have a few about the size of this which are used for different tasks the NPC's are performing, and one which coordinates the task-subtrees

celest python
#

What does this do?

misty wharf
#

it's part of the task system (npc's/customers have tasks like "rent video" or "buy drink")

#

resolving the task causes it to immediately abort the task's subtree

#

as that's how it's set up in the top level BT which runs through the tasks

mossy nexus
#

though to be fair there's some repetition until I replace it with subtrees

celest python
#

Because looks like programmers always need to find their own way to manage states

misty wharf
#

heh

mossy nexus
#

hijack the engine's anim FSM UI and make your own kappa

misty wharf
#

this is what the top level BT's task managing aspect looks like :P

mossy nexus
#

there was a dude here that once made his own boid editor, that was cool as fak

ocean wren
#

There's a marketplace item that does exactly that

celest python
celest python
ocean wren
#

I find state machines... offensive πŸ™‚

mossy nexus
#

they are problematic

celest python
#

Its a love & hate relationship

mossy nexus
#

in an ironic twist I am using behavior trees for non AI actions

#

I use them to control camera for instance

ocean wren
#

state machines feel to me like OOP, they were a cool idea, but not really a "good" idea πŸ™‚

celest python
#

I'd say some kind of evolved utility pattern assuming from your conversations here πŸ˜…

mossy nexus
#

it does feel very dated, like deep inheritance hierarchies

ocean wren
#

exactly, dated and we've mostly grown out of it πŸ™‚

mossy nexus
#

but then I'm no expert

ocean wren
#

Hmm, my favourite? honestly I've not found it yet. I use BT + utility for the most part, but I wouldn't call it good

mossy nexus
#

I do the same

ocean wren
#

but the fundamental boolean logic thing is just a bad idea overall

mossy nexus
#

make a functional language wrapper and use pattern matching

celest python
#

I'm looking for a solution that we can use all of them

#

A 'state' driven logic, but you can use BT, FSM, or anything you want

mossy nexus
#

sometimes I miss C#

ocean wren
#

I do more ML work right now.. but I'm fairly convinced that part of the problem with BT's is just that having boolean conditions is too much for human brains to design with πŸ™‚ we aren't on/off machines πŸ™‚

#

we're inherently threshold-tastic, so ML kind of serves a bit there.. mostly probabilistic in nature

#

I currently work with graph neural networks, so largely graph probabilities

#

to be specific, spatio temporal graphs

#

Think of them as sort of behavioural recommender systems

bright osprey
ocean wren
#

we really aren't :)_

bright osprey
#

No lol, we aren’t

ocean wren
#

So encoding behavioural decisions as on/off just leads to loads of stupid edge cases

#

and my brain doesn't like thinking of things in that way

bright osprey
#

They need to be a gradient controlled by signal strength and opposing resistance to be more accurate

#

As well as frequency

#

I mean obviously more complex than that, but that should be the bare minimum

ocean wren
#

The brains a pretty complex thing πŸ™‚ signals that shut off other signals and the like

#

and of course signals that are filtered through other circuits before being piped in etc

#

its all quite.. fluid πŸ™‚

mossy nexus
ocean wren
#

thresholds when activated give you the feeling of booleans yes..

#

but in reality, the signals are kind of analogue and the threshold values are moving (with blood flows and the like) so its sort of continuous values being thresholded by other continuous values

bright osprey
#

Well the neuron may send a signal, but each neuron has many signal lanes, additionally each neuron sends the signals at given frequencies, and on top of that, they are chemical receptors that could already have a chemical in them so they can’t receive a new one. So one neuron receiving a high frequency signal from one other neuron will react completely differently than a neuron receiving many low frequency signals from all the neurons around it

mossy nexus
#

I suppose that may be it, nested values

ocean wren
#

not really like logic gates πŸ™‚

mossy nexus
#

well they are

#

but they are dynamic, not static

#

but then again I don't understand biology