#gameplay-ai

1 messages Β· Page 25 of 1

dense owl
#

So this way you can actually run code on it too

molten pollen
#

Well the problem is getting him to detect the foliage tree to go to it and transform it into an actor.

#

That's what I am working on right now. I'm gonna attempt it with the perception system though.

main patrol
#

Yeah I was gonna say if you cant get eqs to work, you could use a pawn sensing component to get the nearby actors and their locations

molten pollen
#

Yeah EQS failed. It detects all the foliage at once rather than an instance.

uneven cloud
crystal hatch
#

sounds like a classic example of A* node pool exhaustion. The A* implementation pathfinding is using relies on a pre-allocated pool of nodes to limit the perf cost of pathfinding's worst case scenario - that the path doesn't exist. There are ways to increase the pool size, but it's not a good idea for perf reasons.

Partial paths are the good substitute for super-long paths. I'm guessing that your case of "going in a straight line" results from the path being, well, straight, and the AI optimizing the process by moving directly to the last location.

In general, very long paths are not good for AI - lots of resources used to calculate something that would take minutes to execute, while very often gets interrupted in seconds.

lyric flint
crystal hatch
# lyric flint Hi, may I ask how to use GetRandomReachablePointInRadius in C++? It requires a U...

something like this:

UNavigationSystemV1* NavSys = FNavigationSystem::GetCurrent<UNavigationSystemV1>(World)
if (NavSys)
{
    // getting navigation data (usually navmesh)
    ANavigationData* UseNavData = NavData ? NavData : NavSys->GetDefaultNavDataInstance(FNavigationSystem::DontCreate);
    if (UseNavData)
    {
        // performing the query itself
        bResult = NavSys->GetRandomReachablePointInRadius(/*...*/);
    }
}
hasty jolt
#

Hi everyone. Im looking for a person familiar with Reinforcement Learning and possible experience with MindMaker plugin for UE4/5
https://github.com/krumiaa/MindMaker
I have questions related to server architectures for multiplayer game utilizing RL algorithms for AI and would like to discuss them even if its just theorycrafting at this time. Its a lengthy discussion so i will keep it off this channel, but if anyone has experience with RL in UE4/5 please do dm me!

GitHub

MindMaker UE4 Machine Learning Toolkit . Contribute to krumiaa/MindMaker development by creating an account on GitHub.

crude harness
#

Hello everyone!
I have an EQS that returns a set of locations suitable for cover positions. I want to ensure that two characters do not use the same EQS result. Currently, I have the following approach:

  • A subsystem bakes all the "cover locations" and stores the results in an array.
  • The behavior tree sequence includes a service that reserves a location from the subsystem when it becomes relevant (OnBecomeRelevant) and releases it when it is no longer relevant (OnCeaseRelevant).
  • When running the EQS, I query the subsystem to obtain all the available positions.

Is this a good approach, or is there a simpler solution?

crystal hatch
crude harness
crude harness
#

By the way, is there kind of concurrency system in Unreal, such as mutex? I don't find anything in the doc

bronze ember
#

How to get BTTask MoveTo work properly? I want to bots to reach exactly the destination before switch to other tasks. Most of the time, the bots either stuck at MoveTo task or they switch to other tasks before reaching checkpoint. Much appreciate for the help.

crystal hatch
main patrol
dense owl
ruby flicker
#

Can i get into a call with someone who knows about AI Spawning Coz im useing a blocking volume to spawn my enemies and when i walk through it, the AI breaks when it spawns.

abstract granite
#

Ho do I get an AI to orient a pawn towards the target location?

#

You'd think the path component would be what it orients to

stiff moon
#

Anyone have any clue why my PlayerObject blackboard key being unset is not causing the behavior tree to continue here? Ignore that move to node, it being there is unnecessary

#

Out of range and in-range, but the blackboard based condition doesn't seem to care

#

Just tried setting it on the sequence which results in the same behavior

dense owl
stiff moon
#

Yeah once he gets so far away

#

More or less trying to understand why the behavior tree isn't detecting the blackboard key changing

dense owl
#

oh

#

nvm u did that

stiff moon
#

It only does when it hits the acceptance radius in the task, I'm not sure how to get it to cancel once the player hits a certain distance away

dense owl
#

are you using the MoveTo node because you want to be able to change the range?

stiff moon
#

No I removed the MoveTo node (if you're talking about the one in the BT)

dense owl
#

try unticking lock all logic, that might be telling your tree to stop doing anything until the move is complete

#

the task I meant

stiff moon
#

Ah

#

I was mainly using that for the smooth following, if I set it to a location he walks to that location, then the next, etc. Doesn't look like he's actually following the player

#

turning off the AI lock results the same

dense owl
#

I didn't mean use the location

#

I just meant the BT's move node is prly better to use, unless... you need to change the acceptance radius on a case by case basis, in which case you don't have a way to do that within the BT node

stiff moon
#

I don't mind trying that

dense owl
#

I'd also recommend starting the game, then selecting the debugging object in the task itself, see if the code flows to where you want it

uneven cloud
dense owl
#

Like call a stop movement on EventReceiveAbort?

lilac bone
#

Do AI Controllers use the same MovementInputVector that player's use?

real arrow
real arrow
#

I tried to increase the tile size but for some reason that is still resulting in an invalid path

#

and for some reason it now even happens with partial paths enabled

#

like somehow just changing tile size alone breaks the entire navigation, but still no errors in viz log

real arrow
#

ok I restarted the engine and it was still broken, but then I restarted it one more time and it worked

#

Idk what's up with AI and ghost bugs, I always seem to get them

#

it is very antagonising, also for some reason even after getting down to only like 500 tiles I'm still running into the exact same issues

real arrow
#

and it broke again

#

no this seems like some werid bug

crude harness
dawn schooner
#

There are also limitations to interactions with UObjects, probably everything that changes the state of the game thread cannot be written to directly

crude harness
crystal hatch
quartz shadow
#

Hello ! πŸ™‚
Do you know if gameplay tag are supported as bbkey value ?

spring inlet
#

yes they are (or rather tag containers iirc)

quartz shadow
#

So I have to store a Name bbkey right ?

#

We dont have a gameplaytag bbkey right ? Well gameplay tag store a FName in the end so I guess I could do what I want with that

spring inlet
#

you just put the tag in the container

bleak valve
#

Is it possible to make an unreal engine environment like an open ai gym environment

quartz shadow
spring inlet
#

are you using 5.1?

quartz shadow
#

Yup

spring inlet
#

they're gameplay tag containers, even tho it says gameplay tag, but the container is just a wrapper for several tags

quartz shadow
#

Really weird I dont see taht

spring inlet
#

oh wait

#

you might need to enable GameplayBehaviorSmartObjects and/or GameplayStateTree plugin

#

quite possible that one of those adds them as feature

#

my bad, sorry

quartz shadow
#

Hmmm I see thanks !

cosmic pelican
#

Hi, are there any AI Crowd Separation experts here? I am using the crowd following component instead of RVO, but it doesn't seem to work... I tried setting the CrowdFollowingComponent Settings like this CrowdFollowingComponent->SetCrowdSeparation(true, true); CrowdFollowingComponent->SetCrowdSeparationWeight(0.f, true); CrowdFollowingComponent->SetCrowdObstacleAvoidance(true, true);

quartz shadow
spring inlet
#

that's the smart object one?

#

i think they added it because smart objects utilize gameplay tags a lot, and therefor it's kinda required for them to be available to AI Behavior Trees

quartz shadow
#

Ok I see IDK if, since they separated it in another module, they would have thought about user usage in the future or not , anyway thanks for the link and the support 😁e

spring inlet
#

well, i won't be afraid that smart objects are gone soon... they seem to be a reasonable engine feature to stay

crystal hatch
#

SmartObjects are here to stay. They're already extensively used internally and are one of the core technologies in one of unannounced projects

quartz shadow
#

Yeah yeah I agree with you what I was trying to say is that they created multiple plugin/module for smart object. But, it looks like the feature that interested me is in a separated module called "gameplay behavior" and I was wondering why Epic makes this separation. Probably because they forecast some other usage of this specific module stuff in the future

crystal hatch
#

we split things up for multiple reasons. Modularity enforces better API, for one, overridability, and compile times (when working on that code).

quartz shadow
#

Yep I forgot to mention that part ^^ But since the module name was quite different from "Smart Object" I was wondering if you were forecasting other usage, anyway thanks for your answer 😁

chilly sand
#

Dear Unreal Engine Support,

I hope this message finds you well. I am reaching out to seek assistance regarding some issues I am facing with the State Tree and EQS integration in Unreal Engine 5.2. I would greatly appreciate any guidance or solutions you can provide.

My specific problem revolves around utilizing EQS queries within the State Tree system. Here are the details of the issues I'm encountering:

  1. EQS Query Integration: I am uncertain about the proper method of incorporating EQS queries within the State Tree. I have created the necessary EQS queries, but I am unsure how to utilize the query results to drive state transitions effectively.

  2. Accessing EQS Results: I am encountering difficulties accessing the results obtained from an EQS query within the State Tree system. I am unsure of the appropriate method to retrieve and utilize this data within the State Tree's state nodes.

  3. Updating EQS Queries: I would also appreciate guidance on dynamically updating EQS queries within the State Tree. For example, I would like to modify the query parameters or change the test conditions based on certain events or conditions during runtime.

  4. Running next states like moving to actor it seems that never move to that state to next state like wait or other action state. The moving state which is a child state from the find actor EQS state never end repeating but if I make sure to add succeed or fail on tick do not send over the actor but do not repeat.

midnight scroll
#

I've just started down the path of learning AI stuff a little more indepth. I have a question specific to BTTask node instancing. I've just learned that you can choose to not instance a task by making a C++ version of it.

I'd like to ask what sort of things you should NOT instance? Where should I be drawing the line? What is safe to remove instancing and what is not in general?

harsh storm
#

Well, from what I've learned from @uneven cloud's battle experience is that instancing can cause major performance problems. So I'd say do w/e you can without instancing (if you're being perf'd blocked). So far, I haven't had a need to use instancing (though it would make some things easier). Admittingly, I do have a pretty simple game thus far and have no complex enemies. But Luthage could probably give a better response than this πŸ˜…

celest python
midnight scroll
#

I'm aware of what it means, that wasn't my question.

celest python
#

Its the answer of the question too though

uneven cloud
midnight scroll
#

Why is instancing the default then? What benefit would you ever get out of instancing a task or decorator?

celest python
#

Its not default, its mandatory for BPs

#

C++ tasks are not instanced by default iirc

midnight scroll
#

It doesn't seem to be for non BP nodes. What makes it mandatory in BP nodes?

celest python
#

Because when its not instanced, BT only creates "skeleton" objects and all instances of the BT using same skeleton BT nodes, which means you cant mutate data freely
BP cant construct a struct and work with its pointer unlike how you do in C++

#

and there are latent actions that BP graph needs to track

#

those requirements enforce instanced option on BP objects

#

Luthafe ofc knows better but from my experience instanced is a problem if instanced tasks bloat GC and if you frequently spawn BTs

#

I dont see it as pure evil

celest python
midnight scroll
#

Hmm. Food for thought. πŸ˜„ I'll have to think on that. Not a fan of writing everything down into C++, but could definitely easily do that for a majority of more generic nodes. Specially decorators.

uneven cloud
#

Anything regarding performance depends on what you are doing and how much you are doing. If you have a lot of NPCs that do complex behaviors, then you are going to run into load time issues of instancing nodes and runtime issues of making them in BP.

midnight scroll
#

Yeah, that was what originally led me to this. πŸ˜„ Actor spawn costs being rather high and AI node instancing taking about 75% of that time.

dawn schooner
#

Rn I am happy to have picked state trees for our AI (sorry @midnight scroll must be difficult refactor)

midnight scroll
#

I use those in 5 on my personal stuff. This project is in 4.27 and probably isn't moving to 5.

dawn schooner
midnight scroll
#

Hopefully. πŸ˜„ You're also in their discord, so progress will probably be posted there.

timber stag
#

Thanks and looking forward to responses :))

still crypt
#

What is a reasonable way to discourage my AI from moving between the player and the camera (3rd person camera)?

uneven cloud
uneven cloud
timber stag
still crypt
timber stag
#

thank you so much :))

uneven cloud
still crypt
real arrow
#

so it makes me think the issue is something else

lyric flint
#

Hello. Check out this website that turns text prompts into 360 photos: https://skybox.blockadelabs.com I just found out about it today.

Skybox AI: One-click 360Β° image generator from Blockade Labs

dense owl
dense owl
real arrow
#

Oh I thought nodes and tiles were referring to the same thing

crystal hatch
real arrow
#

oh ok, so a tile consists of several nav polys, and that's what the A* search is using

lyric flint
#

My perception component seems to be registering my Spectator Pawn in the On Target Perception Updated event. Is this to be expected? Is there a way I can ignore the spectator pawn from all perceptions? (This only appears when I run Simulate.)

#

Ah, it seems this is a potential solution:
[/Script/AIModule.AISense_Sight]
bAutoRegisterAllPawnsAsSources=false

real arrow
#

yes

still crypt
#

I've a general question - if I have a behavior tree which is shared by many different characters, how can I vary numeric values on the tree between characters in a clean way? For a lot of the default nodes the numeric value (such as wait time) is tied to the node/tree rather than to the character. I want to share the behavior, but not these parameters. Can anyone give me some advice?

finite gyro
still crypt
finite gyro
#

just fire it before the sequence starts.. you can make the task set the value to a custom wait time for example thats gonna be customized depending on the character possessed

still crypt
finite gyro
#

you can use decorators too

#

you can store the default values in your save file or your preferred blueprint, and then just "load" them from there into the blackboard keys with a task or a decorator when the behavior tree starts

still crypt
finite gyro
#

Im not very good with AI yet so maybe there is different way, someone else should say if there is :D But this is definitely how I would do it. Imo this actually IS cleaner because you have a more practical way of controlling the defaults and custom values, if you store them in one other place all together

#

I have a simple question of my own too, maybe you or someone else can help :D How can I make my own custom move task wait to be finished before moving on to the next task in sequence, just like the default "move to" does?

still crypt
#

Aha, well, I am probably more of novice than you are, and I'm more comfortable in CPP than BP but If you return EBTNodeResult::InProgress; from the initial execute call I think it will wait until you call FinishLatentTask with success or failure

finite gyro
#

Ah im doing BP only though :D

#

i think im gonna have to do it through some bools and decorators and stuff unfortunately

still crypt
#

Mm, what does your blueprint look like?

#

I'm pretty sure you can do this, the AI-execute event says it will remain active until finish execute is called

finite gyro
#

im using that, the problem is that my custom move to task is not doing just one move. It sets a series of these "aimoveto" nodes, even 10 one after each other (moving on a grid), and I just need it to wait until its done with all of them. Otherwise it just fires after only the first move is done

still crypt
#

Well, just call finish execute only once the last move is complete then? Its just a function

finite gyro
#

im also not running the "aimoveto" straight from the AI task, im running it from the character BP, because im using the same function for player controller too

#

the AI task is only calling this function inside the character BP

#

im gonna have to do it through bool checks and decorators i think, ill try at least

wanton compass
#

In UE 5.2 I cannot seem to set the Object type blackboard key as the target in a Move To task, I only see SelfActor and my Vector-type keys. I am convinced that was possible before, to direct an actor towards another actor. Does this have additional requirements in configuration now? Has something changed?

finite gyro
#

at least thats what im doing

wanton compass
#

Well at least I'm glad to know I'm not the only one that has to somehow circumvent this

finite gyro
#

it might have done, Im not sure actually. maybe its intended, maybe its a bug, idk. But I know that my method works so thats what im using :D

#

you could also make a custom "moveto" task, and use the "ai move to" node and plug in your object there, since this one has a "target actor" input

wanton compass
#

Yeah that's probably what I'm about to do.

finite gyro
#

custom moveto task is probably better anyway since you can customize it later if needed

wanton compass
#

Also it minimizes the Blackboard clutter. I'm already concerned as-is with all the control booleans that I'll probably end up placing there.

wanton compass
#

I have figured out my issue. I checked the key filters in the engine and indeed the node does accept actor references but ONLY actor references. In order to properly utilize the node to Move to actor you have to set the base class of the Object key to Actor. πŸ˜„

uneven cloud
still crypt
uneven cloud
uneven cloud
uneven cloud
uneven cloud
harsh storm
uneven cloud
uneven cloud
harsh storm
#

I didn't look at the full thing, figured they were just showing a quick concept and not a full blown solution

#

So I was givin' it a pass at the time.

#

But yeah - that image still has work it needs to do πŸ˜…

#

Maybe you know Luthage - but why do we have 2 versions of the execute stuff in BP? Execute and Execute AI. Wouldn't BTs like always be on AI?

#

I know it supposed to select the correct one to use, but it was something I wondered in my younger years and just never found an answer

uneven cloud
#

The execute AI is newer and the older version has not been deprecated.

harsh storm
#

Good enough for me.

still crypt
#

I'm running a behaviour tree in CPP using: RunBehaviorTree(AICharacter->BehaviorTreeAsset); and it seems to work okay, except checking the tree in the UI during play gives me a message saying its unable to find matching actors. Is there some way to resolve this?

harsh storm
#

Knowing Luthage, they'd probably say to write a service that runs an EQS query to find a location to move to and then put that service on the MoveTo

dense owl
#

Weird tho, I seem to remember them setting a blackboard key inside the task in that first pinned video, mind you it is a bit older

harsh storm
#

Nothing stopping you from doing it

dense owl
#

Actually, those values are dynamically changed at runtime, so that makes sense now.

uneven cloud
vivid pendant
dense owl
#

Prly best to leave it in that channel, we’re more into UE’s AI system here

ocean wren
#

What if UE's AI systems had some ML models available?

#

I mean its got an ONNX plugin right?

#

There's a lot of potential for extending UE with useful tools right now.. I'm building out my own toolset for voice based authoring of behaviour and content (well, voice and motion, but still). Its actually quite fun how quickly stuff like language models can be integrated

uneven cloud
#

Meh

celest python
#

L4D2 Game Director AI

#

but as a pretrained model

#

it would call functions on BPVM based on arbitrary values that can be described with gameplay tags or FNames

#

it would run on a separate thread and would be so easy to train & run

dawn schooner
#

I mean SC2 had support for ML AI right?

#

They have trained bots, which is less interesting to me, but they also had non-scripted AI and it was at grandmaster level (which means better than most people including myself by a huge margin)

dawn schooner
#

Is there a console command to visualize navmesh during a standalone or packaged game?

still crypt
#

Is there a way to stop blackboard key selectors from picking a default value when the BT is opened?

dense owl
dense owl
#

silly question I'm sure, but wouldn't "All matching" return an array of perceived actors? And if so, how would you use that given that a blackboard key cannot be of type array? I thought maybe it didn't matter and I could somehow get the BB key inside a task, get its value there and assign it to an array, but I don't see a way to do that. I found something on the forums from 2018 about making a custom bp and placing it into the world, but I'm not sure if that's what I'm looking for. I'm trying to use the perceived actors generator to give my units a bit of self-awareness so they don't bunch up with each other. Tried playing with agent radius, but that did not seem to work much. I'm currently using GridPathAI and CCD, but it's not enough; the AI is smart enough to make them move up and down and around each other a little bit, but they still look like cockroaches climbing on each other. Idk if there's a better way to do this. I did have a hacky solution in place where if I give a move order, the units look for a navigable point in the goal's radius, to kind of spread them out, but idk how sustainable that will be in the long run.

lyric flint
#

I believe it means you could make a custom actor with a variable such as Targets (e.g., an array of Actors) and then store your custom actor as an Object on the BB?

dense owl
#

πŸ€” not sure how I would store it on the BB but I’ll try to look into that

lyric flint
#

You just have a key of type Object. You can then specify the class that key holds which can be your custom actor. Then store it just like you would a float or a bool.

ocean wren
#

That said, if the system works and has good UX, I think it would be important to show people the alternative to hand coding things

#

I saw an interview with Tim Sweeney the other day, basically crapping on the large language models and generative AI. I think its fair to say that Epic are not going to be part of the AI revolution πŸ™‚

#

Unless and Until someone drags them kicking and screaming πŸ™‚

uneven cloud
lyric flint
#

Speaking of people having issues with simple behaviour trees. I'm trying to get my AI to move and shoot at the same time while facing a target. This (almost) achieves what I'm looking for, but it feels very hackish with the infinite loop. Is there a better way of achieving simultaneous strafe and shoot behaviour? (The parent tree can abort, so I can exit out of this behaviour).

dense owl
#

I suppose running sphere overlaps or whatnot might be simpler tho

lyric flint
#

I think the idea is that you're looking for a location not an actor, so your generator should generate possible locations and then you should used the perceived actors within a context inside of a distance test to score/filter good or bad locations. As opposed to trying work backwards from generating perceived actors.

dense owl
#

Ah i c what you mean

#

That makes sense

dense owl
lyric flint
#

It works decently (aside from some ALS headaches with rotation). I just feel creeped out by the infinite loop!

dense owl
#

Could maybe make it a conditional loop, but as long as you already have a way to abort up and there’s no way it can get stuck… πŸ€·β€β™‚οΈ

celest python
#

but what game director is something very game specific

#

probably you dont even need a transformer for it

#

and model would be so small that you could run it on PS4 under 0.5ms or something

#

it would be basically something just relates array of floats as inputs with TMap<FName, FuncPtr> output, shouldnt be really that hard πŸ˜…

#

and training would be just playing the game

#

</armchairAIthoughts>

hollow token
#

Its my first attempt with ai in ue5 and i made one of my paper 2.5d game but its going well whats wrong with my roam ai, the npc roams now but it will only roam to the edge of the navmesh and freeze

sage cliff
#

I’m so confused why my ai feels clunky instead of smooth like real published games. What’s the secret sauce.

ocean wren
#

animation

#

lots of animation

#

and juicy feedback

ocean wren
uneven cloud
hollow token
uneven cloud
uneven cloud
hollow token
#

?

hollow token
uneven cloud
#

You are telling it to go to a specific location. Is that a valid one?

distant snow
#

I just learned if you name these things exactly the same as a Blackboard Key, it will auto-fill the reference instead of just defaulting to SelfActor 😭

lyric flint
lyric flint
#

I randomly saw this while searching through Discord. Any updates @ocean wren ?

uneven cloud
lyric flint
#

Yeah, that makes sense. Thanks!

lyric flint
#

Is there a reason why my EQS query would return the points in the wall as valid even though I filter on if they are reachable? (see the 1.49 scoring point)

timber plaza
solemn rock
#

Hi, I really need help with my nav mesh. For some reason, it seems to be somewhat inconsistent and does not want to be accurate enough to let me through the door for some reason? It did let me through once or twice before, but after restarting Unreal it stopped working again. Any help would be much appreciated!

solemn rock
#

these are my recast navmesh settings

solemn rock
#

update: there was a screwed up candle in the scene that caused the issue

lilac cedar
wary ivy
pine steeple
#

@lilac cedar help with what?

#

the fact that keeps pathing to the same spot and is glitching out?

gritty peak
#

Is there a way to make a character movement not rotate in place till it faces its target with Ai move to? I would like it if the character to walk in a large U arc to turn around. Any ideas how to do that?

dense owl
gritty peak
#

@dense owl any ideas of a good way of doing that or have any good recourses on the scenic route? i already got the slow turning in place down.

dense owl
#

Not rly, sry, there are more intelligent people here that might be able to give you some clues tho

still crypt
#

There's a function there-in called OnPathUpdated which is run before your AI will start following a given path. You can access the generated path at that point and add some extra points to it to generate a loop/turning circle based on the angle between your original path's direction and the actor's current direction

#

Just make sure you check the extra points are actually pathable so your AI doesn't go out of bounds

gritty peak
#

@still crypt thanks for the response, seems a bit complicated my CPP knowledge is limited. I am more on the art side. I will do further research and keep that in mind.

still crypt
#

Ah, sure thing. if you come back to it feel free to reach out, and indeed its possible someone else here knows a better way. best of luck

crystal hatch
# lilac cedar can someone help me about this?

looks like AI being issues a movement command every frame (or so). I'd say it's alternating between two (or more) locations. If you use BT you should post an image. And as always: look at vislog - this kind of scenario should be obvious looking at the vlog's contents.

alpine rover
#

how do i get my ai characters to formate around a downed ally enemy.. i have an eqs shape i like to use but it is not working. What am i doing wrong?

ivory rune
#

Was the array of your actors generated properly?

alpine rover
crystal hatch
alpine rover
#

yes i have checked all of the debug and it isnt even giving the ai a moveto task

#

even though its in the bp

#

Never done this outside of a BT tho so it makes sense why it could be faulty

ivory rune
#

I just wonder.

ivory rune
# alpine rover

Is this Random right? Seems you could add same actor reference into the array.

lyric flint
#

May I ask why even though I created UAIPerceptionComponent in AIController subclass, it doesn't show up in the Blueprint?

lyric flint
#

Thanks

lyric flint
#

Hi, I would like to ask, in behaviour tree, how can I do concurrent tasks?

What I'm trying to achieve is that the enemy will chase the player, but if it loses sight of the player, it will go to the last seen position of the player and search the area.
Right now I have 2 nodes, one to move the enemy, one to update the last known location. But because MoveTo doesn't end until the target is lost, the sequence is aborted and the last known location does not get updated.

keen crow
# lyric flint Hi, I would like to ask, in behaviour tree, how can I do concurrent tasks? What...

i'd suggest you make a BT service that checks AI perception (or just get first player and check if it's in LoS), stores perceived target and it's last seen location in BB keys. Then make a selector and put your service on it. To the left you could put a BT sequence with a decorator [target is not null], and on the right [last seen location is not null] and put your logic for pursuing player or looking for him in both subbranches

quiet fiber
#

Could someone explain to me why the stop movement function doesn't seem to work when the pawn is near its target location?

karmic pelican
#

Is there a MoveTo function that allows for a movable base?

#

My Location needs to be relative to a moving base actor

quiet fiber
#

I've removed the fluff from the Blueprint for easier reading but this will work when the player isn't close to the pawn when the delay ends just fine, but if they are too close the enemy continues to move towards the player after the delay

quiet fiber
#

I ended up resolving this by forcing the async task to end

#

for whatever reason actually reaching the destination nullifies the stop movement function from working

uneven cloud
harsh storm
#

I've never ran an EQS through that node but I would've assumed the return value is the result

dense owl
quiet fiber
dense owl
#

Oh? How come

quiet fiber
#

I'm doing a tracking attack that I wanted to stop tracking the player after a while

#

so it uses the move to actor to move to the player then stops and then does a move to a set location instead

dense owl
#

Ok well reaching the destination means the movement is done, so stop movement would obviously not work because there’s nothing to stop. Really, you should prly be using BT and EQS for this stuff, but if you say you fixed it in some weird way… I’ll just wait for Luthage to throw the book πŸ“• at you πŸ˜€

quiet fiber
#

I agree that movement shouldnt stop because theres nothing to stop but seemingly it would restart itself for no reason

still crypt
#

What is the difference between the Pathfinding, and Pathfinding(batch) EQS tests? The docs just say the same thing for both of them...

deep bramble
#

I remember there being a checkbox somewhere to show invalid nav links, but I can't find it. Anyone know where it is?

uneven cloud
uneven cloud
uneven cloud
deep bramble
rancid wing
#

anyone have an idea how to make an enemy dodge a projectile

#

like a arrow perhaps?

dense owl
#

With my limited knowledge I would say box collision in front of it, and strafe on component begin overlap

rancid wing
#

well, Im trying to use a bt and the perception component

#

the problem is its detecting the character as well, but I only want it to dodge when it sees a projectile

uneven cloud
dense owl
#

That’s fair, I just meant BT and EQS make a simple patrol movement easier to implement, or at least it seemed that way to me

#

i.e. why not stand on the shoulders of @ MieszkoZ ? πŸ˜…

uneven cloud
harsh storm
still crypt
#

Does anyone know of any decent resources on Melee stacking/ Kung fu Circle type approaches and implementing them? I've had a look through the game-AI pro stuff and while there're some useful bits they tend to assume a level of knowledge above what I currently have πŸ™ƒ

uneven cloud
still crypt
uneven cloud
still crypt
#

Well, by chase I mean moving into combat range from some initial position - potentially reasonably far away from the player. I had tried having them move directly into a slot on the circle, but as the player moves they tend to reassess which slot they want to move to too often and the movement becomes pretty jerky and unnatural when the player moves. Since the query regenerates the slots there's no real memory of which one they had initially chosen, and indeed no guarantee that slot would even be available on subsequent runs of the service...

deep bramble
#

So complex collision and nav mesh don't really play nice together huh. Am I just supposed to keep adjusting max simplification error and add some blocking volumes for tricky spots?

uneven cloud
still crypt
uneven cloud
still crypt
rare citrus
#

Hey, are behaviour trees easy to pick up and understand for a programmer focusing on C++ instead of BP?

rancid wing
#

also, if I do that, I think i have to configure the dodging time for every projectile manually

#

depending on how long it takes to get to the enemy

uneven cloud
stark tangle
#

i need to achieve next:
minion goes to waypoint1, after this forget about this task, and goes to waypoint2, then forget completed task and goes to waypoint3
and, every second check is enemy in range, if so - attack him, then goes to waypoint, he's heading before
how to make it with sequences and selectors?

lyric flint
#

Where can I find documentation on all the events in a BTTask?

#

When I create a BTTask BP it's just a blank canvas. How do I know what built in events/functions are available?

lyric flint
tacit barn
#

Is there a good way to simulate an ai on an npc while the portion of the level they exist on isn't being streamed currently?

lyric flint
#

Is there a way for multiple AI to share some blackboard values?

#

Like if I want to do a squad of enemies that should work together. Once a single enemy sees the player, the others should too etc.

crystal hatch
modern owl
dense owl
#

Except yours doesn’t happen on every single tick. But I’d imagine the same advice applies

elder perch
#

When AI is moving along a partial path to a location, how do you find if it's reached the end of that partial path?

crystal hatch
elder perch
#

So then just listen to one of those notifies and ask it if it was a partial path?

crystal hatch
lyric flint
#

May I ask for Environment Query context, what is EnvQueryContext_Item? Like I get EnvQueryContext_Querier since it's pretty self explanatory, but what does EnvQueryContext_Item refer to? What's Item?

still crypt
lyric flint
#

Ooh, so there can be multiple items?

#

So something like this will check distance and dot product which each generated item in a loop?

crystal hatch
lyric flint
#

Nice thanks!

lyric flint
#

@uneven cloud Further up you mentioned scripted behavior versus behavior trees. What if you need both (i.e., allow designers to take control of the AI to specify paths to follow or objects to use, but allow for the AI to take control when the player has been detected)? I've been trying out pausing the brain component and then letting the designers issue commands in BP, but I'm wondering if it's better to build the scripted behavior into the behavior tree? For example, setting the ScriptedPath variable in the Blackboard would go down the scripted path follow branch. Or maybe there are other alternatives?

meager narwhal
#

Please help 😭
I have this simple AI to 'identify next checkpoint in map then move to target'

If i were to remove the purple floor, or if it gets no collision (right now it's set to invisible wall) the AI won't execute and just loop between 1 and 2, if the purple wall has colision it does run normally

#

the AI is in the brown spheres, character movement is already set to Flying

#

And i could just work with that as ahidden wall with invisible wall physics but i'd rather not having there something i'm not using

paper smelt
ocean wren
ocean wren
# wary ivy well they aren't that useful most of the time

It depends on your definition of useful.. I mean you can't deny they're being applied in plenty of industries.. its mostly that there's new potential for a wide range of applications and it seems a bit short sighted to ignore it.

#

I mean hell, blueprint copilot might actually cut down on the same old questions we get in here every day πŸ™‚

#

MoveTo copilot πŸ™‚

#

EQS copilot πŸ™‚

dense owl
dense owl
#

πŸ€” is there a query only collision in those presets ?

dense owl
#

Oh ok

#

Idk, I’m sure someone here knows what’s going on, but in the interim I would say try using the AI debugger and the vis log - as MieszkoZ always says πŸ™‚, to see why the move task is failing

meager narwhal
#

Yeah i treid with the AI debugger but i'd show me that the current task running is either "nextgoal" or "rotate to face bb entry" and they loop at such speed they look like a fan spining

dense owl
#

You can pause

meager narwhal
#

True

dense owl
#

Like open your BT, use alt+P to start, then pause and use the rewind or w/e to see the arrows going up and down the tree

meager narwhal
#

May try that

dense owl
#

But that will prly only show that it is failing which you already know, so def try the vis log, to see what it says it’s doing

uneven cloud
lyric flint
#

"It entirely depends on what is actually needed, instead of what designers want." is going on my grave. Thank you, that's helpful and I didn't consider having dynamic subtrees. I guess I could make a subtree for UsePath and UseSmartObject and then allow those to be added to the behaviour tree at runtime.

tacit barn
#

Is there a way for AI to simulate what it is meant to be doing if it is in a portion of the level that isn't being streamed currently?

lyric flint
#

If my enemy AI loses perception of the player, I want to have a timer count down to 0 before the enemy "loses" the player. I am currently adding a float to the blackboard called and using a service to decrease it. Is this the right way to do it?

#

Feels pretty long winded to adjust blackboard values in services

#

Or am I meant to do this another way?

#

Furthermore, in services, there's 2 ways to get/set a blackboard value. The Blue nodes feels more "correct" but at the same time I can't give it a key.

dusky lodge
#

Has anyone encountered an issue updating to 4.27.2 source build where Nav Modifier Volumes just simply stop working?

#

I built 4.27.2 from source and they just simply dont work.

#

Blank project.

mellow moss
#

Hey, does anybody know how to make the AI go around walls instead of trying to go through?

#

I'm using the Behaviour Tree Move To node

mellow moss
#

The Detour One

#

Detour Crowd AIController

dense owl
#

Do you have CCD on?

mellow moss
#

No, not sure what it is

#

But I can try enabling it

dense owl
#

Continuous collision detection

mellow moss
#

huh

#

Interesting

#

I fixed it by rebuilding the navmesh

#

The editor shows the correct navmesh but it seems it doesn't actually updates until you rebuild it

dense owl
#

That’s good to know

alpine rover
#

HELP! all blackboard values are Empty. No Idea How 2 Fix This

dense owl
#

Need a little more to go on there, chief

alpine rover
#

all empty, everything is correct in the BB/BT assets and the controller is properly assigned

#

not sure what the issue could be

tender lily
#

Check your BT flow during PIE

analog prawn
quartz shadow
#

Hey do you know if there are some data validation possible with BTNode ? I tried with the classical IsDataValid but when saving BT nothing is running. Behavior tree asset dont call this function on their btnode at save I guess ?

lyric flint
#

ive realised something odd about the perception system. is 'entered sight radius' from sight stimuli based on the actor location (aka a point in space, not a volume) ?
if so is there a way to change this?i have two issues with this...

  • i have interactable items which can be perceived, however if they rest on the ground (z height = 0) then it intersects with the floor and the perception system cant see it. in the above screenshot i solved this by making them z=1, however would prefer to avoid if possible
  • i also wish to have large actors which can be perceived, and if its calculated based on actor location you would have to get closer to them to see them than compared to a small object, which is a bit counterintuitive.

any help or thoughts on this appreciated, perhaps i am even mistaken but its how it appears to me

wanton compass
#

I have multiple AI agents taking part in a real-time combat with the player and I am trying to implement an alghorythm to position them properly. I wanted each AI Agent to calculate their desired position based on individual preferences (e.g. ranged units seeking vantage points, and melees moving in to engage the player). I already implemented CrowdFollowingComponent o avoid collisions between actors, however, I struggle with figuring out how to prevent actors from targeting the same space when they calculate their desired positions. The only thing that came to my mind was procedurally adding NavModifierVolume after a spot gets taken by one of the agents but from what I understand it would require regenerating the navmesh each time so it sounds quite performance expensive.
Are there any other tricks that could help with generating unique target positions for navmesh agents?

rain bluff
#

Instanced foliage actors are not being affected by nav mesh bounds volume, any idea how can I fix that?

dense owl
wanton compass
tawny crest
#

Hey guys, I used smart object from BTtask and Im getting thrown an this ensure every time I change map

dense owl
gritty glen
#

Heyo,

I'm doing a 2D multiplayer game with up to 60 characters, each character being a BOT if there isnt enough players to fill the spots, so potentially 60 BOTs. With 30 BOTs, the game runs smoothly, but the CPU performances tank significantly with 40-60 BOTs, it seems that the MoveTo function is causing it (performances are fine when BOTs arent moving).

Any idea on how to tackle it? Each BOT needs to have its own behavior and they can't be disabled.

I tried using a Pawn + FloatingPawnMovement instead of characterPawn + characterMovement but that didnt improve the performances :/

crystal hatch
# gritty glen Heyo, I'm doing a 2D multiplayer game with up to 60 characters, each character...

it seems that the MoveTo function is causing it
It's not the AI-side MoveTo, it's the character movement which means you'll probably have the same issue with 60 human players.
Thigs I'd suggest are:

  • forcing all the characters to use MOVE_NavWalking (don't remember how that's done, maybe someone else can jump in)
  • disabling character movement component ticking and implementing batched ticking - this will require implementing this mechanic, unless you find a plugin that does that (there should be one, and if there isn't someone should make one πŸ™‚ )
gritty glen
# crystal hatch > it seems that the MoveTo function is causing it It's not the AI-side `MoveTo`...

thanks! Good to know that it's not the MoveTo itself. Player characters move with WASD, so I guess the NavWalking wouldnt work, but maybe a good thing for the BOTs. Regarding your second point, I checked and the movement component has a tick interval variable, and increasing it indeed helps a lot with the performances πŸ™ (though the movement doesnt look as smooth, but maybe i can find a compromise), I will look into the batched ticking

harsh storm
#

forcing all the characters to use MOVE_NavWalking (don't remember how that's done, maybe someone else can jump in)
Can just change the movement mode in the CMC, on the BP itself

#

disabling character movement component ticking and implementing batched ticking - this will require implementing this mechanic, unless you find a plugin that does that (there should be one, and if there isn't someone should make one πŸ™‚ )

The simple way to do this is to create a world subsystem in C++, then on begin play, register the CMC to that world subsystem. Then that world subsystem, on its own tick, just loops through all the registered movement components and calls tick

gritty glen
#

Ill look into it, thank you πŸ™‚

spring inlet
#

or just adjust the tick rate in them?

crystal hatch
#

that's an interesting way of describing an awesome, work-in-progress tool you get to use for free πŸ˜‰

harsh storm
crystal hatch
harsh storm
#

Oh the horror

crystal hatch
#

STs are still very much WIP and under active development. The internal use-cases are what's driving them and those are mostly bug-free. Most of perceived bugs come from users coming up with use cases we haven't anticipated or just came across yet. It's worth reporting those.
A lot of work went into STs in 5.2, but if you want more fixes or features I suggest using main repo.

harsh storm
#

Main reason I dropped ST and went back to the good ol' BT is because the editor would, seemingly randomly, decide to no longer allow you to bind to an output.

#

Most of the bugginess I experienced was around the editor, not the system itself.

crystal hatch
#

editors are hard! πŸ˜„

harsh storm
#

As I always say, better you than me!

uneven cloud
# lyric flint ive realised something odd about the perception system. is 'entered sight radius...

It's based on the actor location. At least for the distance checks. The distance is meant to limit the amount of raycasts needed for sight. If you want to change how it works, you'd need to make your own sight sense.

Why are you using perception for interactable objects?

You need to balance how complicated things like perception are based on performance, dev time and what the player would actually notice. The idea is to create fun player experiences, mostly with smoke and mirrors, not creating intelligent AIs.

ocean wren
lyric flint
# uneven cloud It's based on the actor location. At least for the distance checks. The distan...

ok thanks, that is frusterating that actors with roots at floor height therefore cannot be seen.
i am using perception stimuli on interactable objects as an experiment, the game im making has the goal of emergent interactions between AIs and i find some interesting possibilities in using the perception system beyond pawns. I am familiar with the smoke and mirrors required for game dev.

#

i think ill try and make a sight sense that casts to actors location but if it overlaps with bounds/volumes of the stimuli actor it counts as seen πŸ€”

uneven cloud
lyric flint
desert gulch
#

Anyone here ever had problems with AI pawns not moving when loading a new level? The AI sees the character but I think the nav mesh is bugging out, any ideas?

dense owl
desert gulch
dense owl
desert gulch
dawn schooner
#

on the tick function afaik

#

in 5.1 it didn't work for me if I set task as anything but running in the enter state function

#

didn't test in 5.2

#

and in tick function works ok

#

I use C++ tasks and conditions

high tide
#

Anyone know how I can make some really good shooter AI?
Movement wise

#

Like Dodging, In air movement, Jumping up stuff, etc

ocean pecan
#

Does anyone know what causes AI to stutter like this when using a dedicated server? I've got a map that uses world compositor and I'm using navigation invokers.

#

It works fine in the editor, it only stutters like this when compiling the game and connecting to a dedicated server.

uneven cloud
uneven cloud
ocean pecan
uneven cloud
ocean pecan
#

I've also tested it on a version of the map where I deleted all the objects so perofrmance issues are pretty much ruled out.

uneven cloud
#

You can't rule out perf issues without profiling.

There are events on the path following component, but I'm not sure what is available to BP.

Debugging is a matter of making guesses where it could be failing (movement component or pathing in your case) and verifying by logging what is happening.

dense owl
ocean pecan
dense owl
#

Right but play on client is still on your machine, where as connecting to a dedicated server implies lag

ocean pecan
#

But I also created a brand new map that uses world compositor using height maps from the old map and it didn't lag. πŸ€”

dense owl
#

I thought world composition was replaced by world partition

ocean pecan
dense owl
#

Ah

ocean pecan
#

I get 15 FPS less than I do in UE4 just by switching.

dense owl
#

Eh, 5.2 is not bad

#

But I guess it depends on the system

ocean pecan
#

I'll spend a bunch of time moving to UE5 only to find out that World Partition has it's own set of bugs. 😸

dense owl
#

Yeah, not suggesting you switch right now. Not sure about this issue, but I might suggest asking in #multiplayer , if this only happens in networked conditions

ocean pecan
stark tangle
#

if i chose LowerPriority for Branch 2 condition here, does it mean Branch 2 will be interrupted anytime, when Branch 1 meets his condition to run?

dense owl
#

If you had a branch to the right of it, you would see it turn blue

stark tangle
dense owl
#

And anything on the left is higher

#

There’s a visual indicator when you do this. If you have a B3, you will see it turn blue when the abort lower is set on B2

stark tangle
dense owl
stark tangle
#

@dense owlbtw, this code runs much more correctly, thank u again

dense owl
#

np, just think left to right execution order (highest priority is the branch that gets to run first). If you hover over the circled numbers in the top right of each node, you will see them get highlighted. The way it is structured makes it easy to move things around the BT, to change the priority of a branch

real arrow
#

real quick question, if a task aborts, do I need to add these 2 nodes to get it to properly abort or is it not needed

stark tangle
real arrow
#

observer is the current execution kinda

#

something looking at the current execution of the entire behavior tree

#

so like, when it says observer aborts, that means that when the evaluated condition that is being observed becomes a different value, the entire behavior tree will abort

#

and lower priority means anything that is executing with a lower priority will get aborted

#

I think, I don't use lower priority that often so

dense owl
#

as far as I understand it, the observer is the "eyes" that the decorator is using to check/observe if the specified result or value has changed. When it has observed/has been notified of the change, it will do what it was told, such as abort the branches you instructed it to abort.

real arrow
#

yeah

dense owl
#

tho I'm sure when MieszkoZ or Luthage get on, they will be able to provide you with a far better explanation πŸ˜…

real arrow
#

my man MieszkoZ

dense owl
#

the man, the legend

real arrow
#

indeed

#

without him I never would have gotten to submit a PR to the source engine

dense owl
#

ooh what'd you fix?

real arrow
#

oh I didn't fix anything lol

#

I just exposed a delegate that was previously only avalible in C++ to BP

#

very simple but also imo that delegate was essential so

#

It was AIPerception OnTargetForgetten

dense owl
#

nice

real arrow
#

some part of the delegate was also private too so it was hard to even get it to fire in cpp

#

if you just had the binary version of the engine

dense owl
#

solid PR

celest python
#

Today I found FBehaviorTreePropertyMemory

#

I guess it was a product of prototyping about making BP nodes non instanced

#

I think it'd be possible to copy the BP properties data from that memory block if FBehaviorTreePropertyMemory could be serialized to a BTTask, I wonder why its not utilized

#

maybe its because that copy operation is almost expensive as spawning the object

#

gotta ask Mieszko if I can ever see him around πŸ˜„

dense owl
#

he's often on during EU daytime I think, I've seen him when I stay up late πŸ˜„

celest python
#

I'm on EU timezone too, but I love the night life πŸ˜„

#

I often see Mieszko around afternoon on EU timezone

lyric flint
#

How do folks activate GAS abilities that require data from the Behavior Tree? I have a BTTask that calls Send Gameplay Event to Actor and passes in data through the Payload using Make GameplayEventData , but I'm curious if there is a way that's less... abstracted? It's quite tough to follow calls that are made using gameplay events.

uneven cloud
lyric flint
#

Thanks!

crystal hatch
celest python
#

I was thinking about using something like UFunction->GetOuterUClassUnchecked()->GetPersistentUberGraphFrame because its practically same as FBehaviorTreePropertyMemory, its a FStructProperty that contains the memory info of the event graph and we could instance it instead of the UObject itself but then if users run latent nodes or timers then there is no way to make this work

lyric flint
#

hey everyone, i have a question which has me totally stumped. im guessing the solution must be some kind of very obvious oversight on my part. any help appreciated.

problem:
i have created a custom behaviour tree service, but it seems to not be setting keys. ive debugged my service and inside the service it does indeed set the values to what i would expect. but outside in the behaviour tree itself the keys are not updating. i then ripped out all my bp and just made my service hard-code set a blackboard value (picture one), and it still appears to not be working. (picture two)..

so what am i doing wrong 🀯

crystal hatch
lyric flint
#

@crystal hatch i dont really know what to make of this honestly. this is what the tick looks like. i wonder if its somethign about suspending and resuming branch actions....

crystal hatch
lyric flint
crystal hatch
#

well, that itself is curious. How about gameplay debugger, do you get aby BB info there?

lyric flint
crystal hatch
patent hornet
#

are you debugging the instance of the controller you set the values on? πŸ™‚

lyric flint
#

oh i also wanted it to be a component as i wanted to have a reference to it in future

#

and RunBehaviourTree doesnt return a referecnce

crystal hatch
#

BT component is not expected to be added via BP editor. I'm actually surprised it works at all.

patent hornet
#

but you don't need one, you can just access the default brain/BT component from the controller instance

crystal hatch
#

After calling RunBT you can get the BrainComponent from the AI controller and cast it to BT component

lyric flint
crystal hatch
#

well, a pointer, to be precise πŸ™‚

lyric flint
#

IT WOOOOOOOOOOORKS πŸ₯³
@crystal hatch @patent hornet tysm πŸ™πŸ™πŸ™πŸ™ theres like no way i think i wouldve realised this was the issue lol

crystal hatch
#

I'm not surprised it works now, I was surprised it didn't πŸ˜†

patent hornet
#

usually when you start doing stuff engine does on its own but by hand and in your own way it finds a way to bite you in the arse

#

unless you know exactly what you're doing to start with

crystal hatch
#

and preferably do it in C++ both for richer API and better debuggability πŸ˜„

patent hornet
#

as a rule, if you feel like what you're doing is more complicated then it should be, it is

lyric flint
paper smelt
#

As #gameplay-ai is emerging in our daily routines more and more I wanted to spread the word for Convai an incredible tool for Games and also the real life scenario businesses.. the tool that NVIDIA recently announced a partneship ✌🏼🫢🏼 Here is a sample and a step by step tutorial.

Think of a near future 😍 once we merge everything in a pot With Artificial Intelligence #generativeai and #conversationalAi

https://youtu.be/ibPl_yyDF80

[voice]
bEnabled=true

Add this two line of commands in your game engine ini file.. Can copy paste from here for shortcut.

Welcome to an exciting new era of video game development! I am thrilled to share with you the incredible tool released by Convai.com, enabling creators to bring their virtual worlds to life like never before. We'll delve in...

β–Ά Play video
wispy rain
#

hello. any idea why enemies from duplicated BPs won't move? they are exacly the same as base BP, but are stucking in "move to" node. if I make enemy BP from scratch with the same settings, everything works fine

#

Visual Logger shows that movement failed due to block

dense owl
wispy rain
dense owl
#

That is bad

#

If you want to reuse the same variables make children of that blueprint class and let inheritance take care of it for you, assuming you need to have slight differences between each of them, but a common functionality

#

Otherwise, if it’s supposed to be the exact same enemy, just spawn instances of the same blueprint class

wispy rain
lyric flint
#

Can you post a screenshot of the BP logic with the Move To node and the exact error message Visual Logger gives when movement fails? There are many reasons why this might not be working, but duplicating a Blueprint in and of itself shouldn’t be one of them.

olive prism
#

Hello, a question, does anyone know why the reference to the AI controller from the BTS fails when I invoke it from an administration panel that I did?

The Spawn button calls a Spawn AIFrom class

crystal hatch
crystal hatch
wispy rain
crystal hatch
wispy rain
crystal hatch
#

I'd start by checking what vislog indicates as the reason for failed movement. Maybe it's not movement that's failing at all (goal location outside of navmesh, or not even set, for example). Like I said, there's a lot more information I'd need to be able to tell.

wispy rain
#

ok, thank you. I will dig into that

lyric flint
#

hello slackerz. im back with another fundamental BT question.
i wish to basically replicate an Else If logic in my BT, but i have discovered that a node can only have a single input. i was wondering how you would go about achieving the logic i have sketched in this drawing ?

#

Put the decorator on the collect trash node. If that fails it will use the next node because it is a Selector.

#

i see. i guess the issue i am running into is when the tree starts, there will be a BB value (say, target)
we check if 'trash is visible'
if this is true, we collect trash.
if its not, we survey, which is a more indepth search, which would also set the BB value target
but if we were then to go to the root of the tree once more, the 'trash is visible' test would once again fail, overwriting the target value, and it would just loop

#

is this a situation where i would use a decorator that can abort lower priority ?

#

is this perhaps a better way of achieving the same result? πŸ€”

olive prism
crystal hatch
atomic minnow
#

Hey guys. I have some questions. My AI was spawn in a mulitplayer games. They use ai perception to detect enemy. The player team use 0 , and enemy use 1. The problem is AI enemy attack treat other AI as enemy in a few seconds after they spawn . I did change the team attitude towards team -1 as neutual. Anyone know why this happen?

olive prism
# crystal hatch Now you need to determine why the code setting these values is not being called ...

Dragging the daemon directly from the content browser to the map works, calling it from the Spawn AIFrom class node doesn't work, I really don't know what is causing this

The only thing I can think of is that the On Possess event is not executed correctly, this event is where the reference to the Enemy Ai Ref is stored, which is then called from the BTS (which is what fails)

But I don't know why the On Posses event would not be called

olive prism
crystal hatch
#

set your pawn's AutoPossessAI to PlacedInWorldOrSpawned

olive prism
crystal hatch
#

make sure AIControllerClass is set

olive prism
#

Sure, the AiControllerClass is the correct class

#

(This is the spawned enemy)

crystal hatch
#

I'd debug UAIBlueprintHelperLibrary::SpawnAIFromClass in this case

olive prism
crystal hatch
#

I don't understand what you mean.

olive prism
crystal hatch
#

that's a C++ function. If you don't do C++ then you won't be able to do it.

#

does vislog or regular log say anything when you spawn stuff. What does gameplay debugger show when you pick one of the defunct AIs?

olive prism
#

With the vislog I have an error in the initial execution, then everything is fine

atomic minnow
#

Why the team id will be unsigned char for a moment?

crystal hatch
olive prism
crystal hatch
#

I must admit I find it hard to wrap my head around your type naming. What's Enemy_Parent? Is that a pawn or controller class? I suggest naming things in a way that allow people to instantly identify the super class a given type extends.

#

I mean, your AI controller has a Enemy AI Ref pointing at its own pawn? That's confusing.

olive prism
# crystal hatch I must admit I find it hard to wrap my head around your type naming. What's `Ene...

Sorry, I'm still not used to calling archives for their best practices, let me summarize a bit how this works

I have 4 key files

The Enemy_Parent is the one that executes the AI actions, the daemon is a children of this file

I have the BehaviorTree that takes care of the typical BehaviorTree hahaha

I have the controller that does some initial setup of the attack ranges and also configures the Sensors.

And the Behavior Tree Service is the one that is in charge of changing the states of the Behaviors through the variables that change in the IA Controller

crystal hatch
olive prism
#

EnemyParent has no parent class, he is the parent

crystal hatch
#

it's a Pawn

olive prism
crystal hatch
#

your Enemy_Parent's base class is Pawn

#

anyway, something is not what you expect it to be when dynamically spawning AI. I suggest you go through all calls and ensure every parameter (especially Pawn and Controller classes) are what you expect them to be.

olive prism
crystal hatch
#

when you want to spawn character of type X you need to make sure that's what the parameters to spawn function say. Also, make sure the AIController parameters is what you intend it to be.

#

your log suggests the types match, but there's something off, and I'm unable to tell without debugging it. And this would be best debugged in native code. You can put breakpoints everywhere (spawning, possessing, etc) and make sure things happen in order you expect them to, or find out what's the difference between working and not-working cases.

olive prism
#

Oki, thanks you, i will try

olive prism
#

ohh

#

i put a delay

#

and it works!

crystal hatch
#

I did ask you if you run BT yourself or rely on SpawnAIFromClass . The video shows you do it manually. The issue here is that you run it on BeginPlay while you should trigger BT on Possess - there's no point in running BT without a pawn, and only Possess you have one. That's your bug.

olive prism
#

I did it because I had read what you said about the BT being generated first and then the Possess in the pawn

#

Regarding the manual or with the SpawnAI, I misunderstood the question, sorry

#

Thanks a lot!

crystal hatch
#

don't add a delay. Just change where you run the BT - run it on Possess.

olive prism
#

And delete the BeginPlay?

crystal hatch
#

yeah, I don't think you need it.

olive prism
#

Thanks you Mieszko

#

πŸ˜„

crystal hatch
#

wasn't easy, but I'm glad we figured it out πŸ™‚

olive prism
#

πŸ˜„

#

I learned a lot with this problem

sand kettle
#

Do all decorators in a node have to set notify observer to interrupt in order for that node to interrupt lower priority nodes?

#

From what i've tested it seems to work this way, but it seems strange and unintuitive so idk if i'm missing something

crystal hatch
sand kettle
#

Well in my case all conditions should have passed, but it did not abort the old node until I set all decorators to abort. I thought it would be enough to have only one decorator set to abort

crystal hatch
#

it should, but that one needs to be the one that triggers the whole process. Having said that, what I describe is how it "should work" - even after 10 years of constant use UE4/5 BTs contain edge-case bugs.
Have you verified this scenario with vislog, that it indeed behaves as you described?

sand kettle
# crystal hatch it should, but that one needs to be the one that triggers the whole process. Hav...

Ok after debugging a bit it seems it was not quite as I described. I think I misundersood how aborting works. I guess it makes more sense now.

So I had two decorators - InSight (which did abort) and IsInvestigating (which did not). If InSight was true but IsInvestigating was false, when IsInvestigating became true WHILE in sight, the node did not abort because InSight value did not change for it to abort. So thats why everything worked after changing IsInvestigating to abort.

Basically I didn't realise the blackboard value had to change for it abort. I thought just the decorator condition had to pass.

#

And i've been working for few hours already so my brain was kinda fried xd

still crypt
#

This is probably a dumb question, but why do I need to use UBTTask_BlackboardBase::InitializeFromAsset(UBehaviorTree& Asset) in my BTTasks when resolving BB keys? Is there an issue with using the GetValueAs<Type> functions?

sand kettle
#

Is it a good idea to make a service that overrides OnCeaseRelevant in order to reset values when that node is aborted?

crystal hatch
crystal hatch
still crypt
lyric flint
#

hey all. ive noticed that my BT Service doesnt set BB's until the second time it fires from Root. is there a specific event that would set the BB's before the logic passes down into the children below?

dense owl
#

Is it perceiving the actor on the first pass?

lyric flint
#

yes. altho ive noticed debugging there actually appears to be a latent delay caused by this for each loop node?
Only on the first time tho... which would explain why this happens but i dont understand exactly the reason it would do that.

#

bizarrely completed is firing before the loop. this is not what i expected..

dense owl
#

Might be easier to use the EQS built-in generator to get perceived actors btw

dense owl
#

Should be able to check the contents of the array with a breakpoint.

lyric flint
#

ok so its just a matter of the perception not being ready on frame 0 ig. which makes sense i suppose. i thought it might be an event thing, good to know.

#

thank u @dense owl

lyric flint
lyric flint
dense owl
#

Well there’s EQS and when you make a query and use a composite, there’s a built-in perceived actors generator you can use. Saved me hours of work

lyric flint
uneven cloud
still crypt
uneven cloud
still crypt
wraith anvil
#

I got a character with a nav mesh modifier. but when i do a move to, since the nav mesh sets the nav to null it cannot walk

#

how do i make it ignore it's own nav modifier?

uneven cloud
wraith anvil
#

how do i make other AI not consider a character as walking space then?

#

they keep trying to walk through each other

dense owl
#

Tho that’s gonna start cutting holes in your navmesh so idk that that’s good. There’s agent radius and CCD properties you can play with

#

And diff AI classes

uneven cloud
wraith anvil
#

thanks, i will give that a look

shrewd pumice
#

How do I make an ai that walks on walls/ceiling like a spider?

celest python
#

that's not something straightforward to do

#

there was a plugin on github though

#

might give some insights

shrewd pumice
#

It seems so...

fleet coral
#

Really confusing situation.
So I'm trying to add arrows to some project and when an arrow hits a pawn, it should stick to it and stay on.

So as a first approach I used attach actor to actor, and it all works fine, except once the arrow gets attached, the pawn (who's been shot) starts going bananas, twisting and turning, etc, while trying to use AIMoveTo.

Once I pickup the arrow from them, they go back to normal.

It looks like some physics issue or something I guess, though I really have no idea where to even start on this.

uneven cloud
hard prism
#

so for some reason, when I debug ai, by pressing ', I can't toggle any mode by pressing the numpad

dense owl
#

Like the modes don’t turn green at the top?

hard prism
#

they don't activate

#

i've tried with numlock on and off

#

but no luck

dense owl
#

Have you tried restarting the engine, and also are you sure it’s selecting the right AI?

#

I have multiple in my game so I usually have to use PIE and select the correct actor from the outliner

hard prism
#

well they're all the same, so yes

unborn sphinx
#

so it turns out RVO avoidance doesn't replicate well to clients in multiplayer with lots of NPC lmao

harsh storm
uneven cloud
harsh storm
#

Let me clarify (I'm aware RVO is the MC) - the AI movement logic is all processed on the server, so when the AI is trying to move, it happens on the server, with the avoidance there as well, and that sends to clients. So I'd expect the avoidance to have already happened on the server.

unborn sphinx
# harsh storm Let me clarify (I'm aware RVO is the MC) - the AI movement logic is all processe...

Yeah at first it seemed to be working well. But when I had 15 AI agents running around, the clients (only clients not the server player) would spring around and react as if they were on ice, and bump into invisible capsules, etc.

Disabling RVO fixed this. I think the server and client location of the NPC is being adjusted, but then the player's reaction to the rvo "capsule" is no longer valid, so the client player ruber bands into position, etc.

#

Maybe it was an error on my part to have RVO also enabled on the player character, not just AI characters?

fickle geyser
#

hey guys i was working on a ai for a project, and was making the ai chase the player and attack and it worked. But out of nowhere it stopped working and i dont know why, any help?

dense owl
fickle geyser
#

just got it, i didnt have a aistimulisource

#

rookie mistake xD

hidden fulcrum
#

is it a terrible idea to use multiple behavior trees (not nested, just multiple trees), and switch them out by blueprints with event dispatchers?

dense owl
#

No

fluid cedar
#

How should I make advenced AIs with lot of advenced mechanics (like game bosses)?

#

With behaviours trees?

uneven cloud
#

Depends on what you actually mean by advanced.

fluid cedar
#

Abilities to dodge player attack etc.

#

Something like souls like bosses

#

I create common enemies just by enum states etc. Everything made by code

#

I've never used behaviour trees and I wanna know when to use them

hidden fulcrum
#

behavior trees aren't always the best way to set up some form of ai, but they are a very powerful one, and worth learning for anything that is going to be complex. in a lot of cases they are going to be a good way to model the logic you want them the boss to follow

fluid cedar
hidden fulcrum
#

i would think so

uneven cloud
fluid cedar
hidden fulcrum
#

I think behavior tree is good for selecting the attack to use. For implementing the actual attack you might want to use something like the game play ability system

uneven cloud
# fluid cedar So I should do everything myself in code?

BTs are a great way to organize the logic that is a separation between the action (what the AI does) and the transition (why the AI does a thing).

Bosses are typically more scripted behavior. BTs are fine with it, especially if you already use them for other AI and have nodes that you can use.

uneven cloud
fluid cedar
#

Why are BTs bad for attacks selection?

uneven cloud
#

It creates a complex tree of decisions that is difficult to maintain and debug.

hidden fulcrum
#

It depends on your goal. If the boss going to follow a set of scripted actions regardless of external conditions, then don't bother with BT. If you want them to follow through a series of conditionals, that is exactly what a BT is for. Their purpose is visually representing those conditions. Non reusable BT is irrelevant. Have a different BT for each boss.

#

It's only difficult to maintain if you try and make one BT be applicable for multiple bosses/enemies

sage patrol
#

hello, i'm arriving at a stage in my game where the core components are finished (for now) and I would like to tackle the subject of ai (game is an fps shooter with a lot of mechanics). I've already got a little bit of experience with BTs but because it's a fresh start I wonder if it would be more future proof and also a more solid options to choose the new State tree system. would anyone have an advice on what I should choose (c++ is not a problem for me and I've read that EQS works with state trees when written in c++). thank you

#

please @ me

hidden fulcrum
#

@sage patrol My understanding is that state machines are an older concept in computer science than behavior trees. Epic decided to implement behavior trees first but people requested state machines so they were implemented later. I wouldn't say either one is going to go away or replace the other. You just choose which concept you like better and work with it.

sage patrol
uneven cloud
uneven cloud
hidden fulcrum
#

apparently we have radically different interpretations of what they are then. given that you've offered nothing other than basically saying "you're wrong" it doesn't sound worth discussing

lyric flint
# hidden fulcrum apparently we have radically different interpretations of what they are then. gi...

Behaviour trees aren't always evaluated from the root, so they are not a one-to-one mapping of visually representing the conditions. See: https://gamedev.stackexchange.com/questions/51693/difference-between-decision-trees-behavior-trees-for-game-ai

#

What I'm curious about are people's heuristics for when something should be encoded as a behaviour tree versus a state machine? It seems there is a threshold where one works better than the other, but I can't put that threshold into words.

uneven cloud
# lyric flint What I'm curious about are people's heuristics for when something should be enco...

The main difference is that a state machine has the transitions within the state, where the BT decouples the transitions from the actions. With a FSM, anytime you add a state, you must edit any state that transitions to the new state. The more states you have, the more complicated this gets. You also have issues with NPC variants with different transition conditions.

There really is no hard threshold. It's understanding the pros and cons of each and making a decision based on the needs of your specific project.

past horizon
#

Hi. I have seen this discussion about FSM and BTs. I was reading about other options, like HFSM, GOAP, utility AI. There's one called LTL although that's for self-driving cars. Some I don't like, the others are not fitting for my game. I tried the State Tree, but it's buggy.

Now I'm making a slightly different system that's like HFSM but with changes to make it easier to manage. It has no connection between most states, so there's no need to modify one if a new state is needed and there are other... "improvements". Since this is the first time I'm making an AI for a game maybe I'm on the wrong path entirely. Is it a wrong idea to make a custom AI? What do the more experienced people here think about this?

uneven cloud
past horizon
#

So it's not an inherently bad idea? I've made a prototype but only tried it with very simple behavior. I'll keep testing.

woven bobcat
#

how would one instruct the AI to play higher prirority execution?

dense owl
#

Abort back up the tree

oblique basin
#

Just to add to the discussion on BTs, I'd say that you should view it as a very macroscopic representation of AI behaviour, with each node abstracting some modular complexity. For example, when the AI enters a combat state, it triggers a sequence that starts with calling a "make combat decision" node, which is a series of c++ function that analyses the environment and spits out a combat decision enum. The next node is a selector node that has several branches of behaviour depending on which decision was made. It's generally a good idea to divide branches using discrete variables such as ints or enums rather than a range of bools.

#

With that said, the only way you can really know if it's fit for purpose is to get stuck in. As a developer, you'll have to make many uninformed best guess decisions that will often not work out, but every time it doesn't, you'll learn why and improve.

ocean wren
ocean wren
#

I guess the main thing, is to actually understand whatever system you're using πŸ™‚

#

Seen a lot of people get it very weirdly wrong with BT's time and again

#

I guess partly because they've not migrated from FSM's like so many of us did.. BT's make a lot of sense once you've used complex FSM's and found their limitations

#

And in a similar way, Utility makes sense when you hit the limits of BT's too πŸ™‚

noble spade
#

While playing around with Smart Objects, I noticed that AI agents will move to the original location of a Smart Object even after it moves. After a little digging I found this line in the Smart Objects Overview documentation: β€œEach Slot includes the location and rotation relative to the parent anchor (baked from editor placement), as well as several overridable properties.” Am I understanding correctly then that Smart Objects can’t move?

hidden fulcrum
#

it sounds to me that the part that can't be changed is the relative tranform between the smart object and its parent. you can just move its parent and the smart object will follow

tawdry zephyr
#

I'm using navigation invokers with dynamic nav mesh. In this image there are two pawns with navigation invokers. If I tell one to run to the other, they won't move, because the nav mesh makes it unreachable. What is the intended way to handle this scenario, or is it simply to have a radius that is high enough to cover all possible use-cases for the pawn's behaviour?

ivory rune
tawdry zephyr
#

I have the invoker on AI as well as the player, since they still need to patrol

#

I guess some games just set a radius as far as the player can reasonably see, but I have a more complex spawning system that optimizes them to not even exist in the first place if the player doesn't need them to

#

Massive open world and all that

ivory rune
#

Not really sure what you are trying to do, but if just for patrolling, you may let the AI pick the random point inside the navmesh, right?

tawdry zephyr
#

No no don't worry, I was just wondering if there was something that I wasn't aware of, since you've confirmed that I understand it my question is solved ^^

dense owl
#

I watched this video recently. They dealt with generating a nav mesh in a massive open world very nicely, I thought: 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
#

since trying to make an AI travel over very long distances usually breaks things

tawdry zephyr
#

I'll have a look. My AI won't really travel long distances though πŸ˜„

dense owl
#

ah ok. well, either way if you're trying to move your navmesh around or generate it at runtime, make sure this is set to dynamic. You might already know this, but just in case:

tawdry zephyr
#

Yup, its dynamic with nav invokers

#

So much better than the old ways

#

I replaced the blackboard/bt system with logicdriver state machine and I actually somewhat enjoy AI now

dense owl
#

heh, I'll have to delve into that at some point

tawdry zephyr
#

LogicDriver is expensive but its extremely well made πŸ˜„

ivory rune
dense owl
#

sounds like a paid plugin

tawdry zephyr
#

Marketplace plugin

ivory rune
#

Is it a FSM?

tawdry zephyr
#

I use it to drive my GAS based combo system too. Going to rebuild my dialogue system on it to replace my custom node graph that I made. But AI is it's best use-case I think

tawdry zephyr
#

The dev clearly built it by repurposing anim graph, but its very well done, very clean

ivory rune
tawdry zephyr
# ivory rune How is it comparing to state tree from UE5?

Well, because I have this already, I've got 0 use for state tree. But I was talking actively with someone making something using state tree and it seemed incredibly limited by comparison, but for very simple purposes that require an FSM, I'm sure state tree is fine

ivory rune
tawdry zephyr
#

Sometimes all you need is a pencil and paper, and sometimes you need a fully featured wacom cintiq. State tree is the pencil, logic driver is the cintiq 🀣 Silly comparison, but that's what it seems like for me

#

Well, one benefit with state tree is if you want to make a marketplace plugin that needs an FSM, because of course you can't make it depend on someone else's product

crystal hatch
crystal hatch
ivory rune
past horizon
#

Is it safe to use the State Tree? There's a bug in it that causes crashes. I have a workaround but I don't know if it actually solves the issue or I cause a side effect that hides the bug.

crystal hatch
crystal hatch
past horizon
#

I assume this means compiling the engine? I haven't tried that yet, but it's good to know. I will wait for newer releases then.

#

Although it's a plugin not the engine... nevermind.

crystal hatch
#

note that releases drag months after actual development.

#

it being a plugin doesn't help that much - some work allowing ST changes is being done in other modules (like StructUtils), so you essentially need the full engine

ivory rune
past horizon
#

I already started working on a custom AI with its own editor, so it's not essential for me right now. But the idea of the State Tree looks interesting.

crystal hatch
dense owl
#

So are STs meant to replace BTs altogether in the long run then?

crystal hatch
#

there's no plan to discontinue support of BTs. There's is, however, no feature work done on our BTs either.

dense owl
#

Fair enough

unborn sphinx
#

sorry I had no idea how far ahead they are developing it's nuts

crystal hatch
#

nah, not like that. The work is taking place in Main and every now and then a release stream branches from that to get stabilized and polished. AFAIK 5.3 haven't branched yet (although will soonish IIRC).

unborn sphinx
#

oh that is interesting

#

very curious to see ST in lyra because I've been toying with the bots and man I wanna try something else lmao.

crystal hatch
#

Pity STs are not getting as much community love as Mass does - otherwise we'd have an awesome community-created sample project for STs as well (nudge nudge πŸ˜‰ ).

unborn sphinx
#

mass like mass entity system?

crystal hatch
#

yeah, Mass (capital M πŸ™‚ )

radiant path
#

I've only played around with Mass State Trees but it's not suprising there isn't much love there yet since there isn't much there yet to be honest. Even the most basic things can't be accomplished yet out of the box. πŸ€”

crystal hatch
radiant path
#

Mass

crystal hatch
#

Yeah, no suprise there. MassST was added only as a thin layer between ST and Mass, just for the purposes of the Matrix Demo. No work has been done on that since, the work is focused on developing core ST tech - Mass integration and use cases will come next.

tawdry zephyr
#

I can't remember the limitations but the free version of logic driver may be sufficient if you want a non behavior tree implementation

ivory rune
tawdry zephyr
clever glen
#

I'm out of the loop, is there any work being done to integrate LLMs into AI in terms of dialoging or even driving actions dynamically?

tawdry zephyr
#

I started with free version to see how well made it is, then when I wanted pro features I bought it

#

99% of marketplace plugins are poorly made but this one isn't

ivory rune
ivory rune
tawdry zephyr
#

The way I built by combo system is very unorthodox so I was surprised it had the functionality. Instead of the state machine driving it, gas needs to drive it, state machine updates based on gas instead but the gas ability looks at the links on the graph to ensure it's a legal combo the client initiated and also to see what's next in chain, etc

#

It let me make custom nodes that take a gas ability too

tawdry zephyr
#

The dev really thought of everything and the code is clean

ivory rune
#

Not surprised that they actually having a team to support it nor like you know, individual plugin maker and just have no supporting. Some plugins you have to figure out how to use it even, no document at all.

tawdry zephyr
#

The dev is incredibly helpful actually, good documentation too

#

There's a discord, but not sure if I'm allowed to link invite here

ivory rune
#

Don't worry. It is easy to find out on their official site.

ivory rune
tawdry zephyr
#

This also helps a lot with combat design/testing because I don't need other players to fight me πŸ˜„

ivory rune
#

Well, if for combos, I probably will just use combo graph plugin. (Maybe we are out of the topic for this channel, lol

tawdry zephyr
#

There is no available plugin that can do anything remotely close to what mine does. It ticks between frames so even at 5fps you have extremely accurate hit detection all through the arc of the swing and at the extents. And it has net prediction with server authority.

#

Hmm yeah bit off-topic now

ivory rune
#

Anyway, good to know it and may consider it while on sale.

tawdry zephyr
#

I'll do anything to avoid behaviour trees, I find it tedious and messy πŸ™‚

ivory rune
#

BTs are not that badπŸ˜…

crystal hatch
tawdry zephyr
#

I don't think you're too far off, but I don't want to understand it better than I already do, I was very put off πŸ˜„

dense owl
lyric flint
#

I have another question about BTs. I have a combat tree where the only thing the AI can do, upon entering the tree, is look for a combat target, calculate its distance, and if it's > 500, enter the attack ranged behaviour. However, this initially fails which means, as far as I understand, the services Set Combat Target and Set Combat Target Distance are not run again because their single child node fails. I verified this by checking the Blackboard values these services should be populating and they are not set. Am I thinking about this the wrong way? Is it necessary to have a "default" child that will run when all other children fail?

#

Ah this seems to be what I'm looking for... maybe?

dense owl
lyric flint
#

Yeah now every time the branch is entered it seems to start the service's tick which is what I want

crystal hatch
#

note that this is a terrible BT structure. If the conditions fail nothing will get executed and the whole process will start again the very next frame wasting perf. This is why I always suggest having a "never fail" fallback behavior, like "wait 5 seconds" and have higher-level actual behaviors "abort lower" when conditions are met.

ivory rune
#

I sometimes added dummy wait nodes for most of these cases...

dense owl
#

Same, seems to be good practice

lyric flint
crystal hatch
#

If you have a service producing come data that a condition on the same node or any of its children consumes, then you do need Call Tick on Search Start for things to works as expected.

gritty glen
#

Hi, is there a way to trigger 'finish execute' only when the AI reached its destination ? (I can't use the default 'MoveTo' node in the behavior tree, because I need to dynamically change the querry filter)

ivory rune
tawdry zephyr
#

πŸ˜„

gritty glen
#

aah nice, unfortunately this node doesnt have the option to change the filter class 😦

tawdry zephyr
gritty glen
#

I'll give it a try, ty πŸ™‚

tawdry zephyr
gritty glen
#

thanks a lot!

tawdry zephyr
#

Someone else might have an answer for you that is already done for you if you wait tho πŸ˜„

night robin
#

Hello, I'm just unsure if I should go for the regular Behaviour Tree + Blackboard AI setup if my AI is simply going to be moving between certain point periodically, checking a few conditions each stop, then going back to the base

dense owl
night robin
#

true

halcyon sparrow
#

I am trying to have my AI rotate towards the player when they approach but am running into a problem when I fixed settings for smooth movement for the AI. I was hoping it would be simple to use the Rotate to face BB entry task in my Behavior Tree, but since I change the use Controller Rotation Yaw setting this no longer works. Is there another simple way to rotate the AI? Do I need to figure out how to do partial roatations per frame towards the point?

signal island
#

How do i make ai shoot autofire weapon without tick? im trying to use ser timer and delegates on cpp and dont finishing the aitask for example. im having a hard time figuring this out.

halcyon sparrow
harsh storm
#

Timelines use tick as well.

#

Doing a timeline in C++ is agony.

halcyon sparrow
#

yeah I am looking into it to solve my problem and I am facing this agony

dense owl
tawdry zephyr
tawdry zephyr
#

Turns out, in this specific case, it isn't as simple as the other nodes I made.

This UAIAsyncTaskBlueprintProxy which is responsible for the AIMoveTo node registers itself with UAISystem, however UAIAsyncTaskBlueprintProxy is only exported MinimalAPI so its impossible to derive and I can't bind to the events because those aren't exported either. I also can't call Super on the engine's function that creates it, because before it completes, it is already making the move request to AIController.

I don't know why the UAISystem wants to track these nodes, but I see literally nothing in the engine source that ever accesses this TArray<TObjectPtr<UAIAsyncTaskBlueprintProxy>> AllProxyObjects; cache and it is not exposed to blueprint.

I will submit a pull request exporting this class' functions properly in hopes that I can clean this up in the future. This is the result working properly, but only because I changed the engine source to export what I needed. You can see it still functions as expected.

I have created a temporary version that isn't tracked by the UAISystem and as expected - it works just the same. But I suspect in a future release Epic may make use of their cache so the PR will be important for that. I'll do the PR and setup the repo and send you a link @gritty glen

lyric flint
#

State Trees are really damn good.

tawdry zephyr
#

Here is the PR that I want Epic to support so I can make the UAISystem track the node properly. I don't think it uses the cache at all yet, but very possible it will in future version which will kill this node unless they accept the PR πŸ™‚
https://github.com/EpicGames/UnrealEngine/pull/10528

#

This is my second PR in a short time, are they accepting PR again? They stopped around the release of UE5 (understandably)

ivory rune
tawdry zephyr
#

I found a very serious engine crash with very simple fix that I submitted few days ago, so that will be a better test to see if they're accepting πŸ˜„

ivory rune
#

Maybe they fixed it already? Who knows.

tawdry zephyr
#

Seems the timeframe is about 1.5-2 months based on other PRs. But still many outside that timeframe with no reviewer assigned. So depends heavily on simplicity. I think mine are very simple so they will probably take 2 months.

tawdry zephyr
crystal hatch
#

this PR is so new we don't even have it converted to a jira ticket yet πŸ™‚ I'll bring it in once the ticket is there (I've already taken a look, it's good).
Re overall process, PRs are kinda on hold, but it also depends on target team. AI team is pretty responsive with PRs (although there are some that fell into the backlog and I need to bring them back at some point).

tawdry zephyr
crystal hatch
#

Some teams accept PRs very rarely, while others are very enthusiastic about them (like the AI team πŸ˜„ ). So I strongly suggest PRing AI code πŸ˜‰

tawdry zephyr
#

This was a simple use case that is right up my alley, I think for 99% of things you don't want me touching AI code ;D I'll keep it in mind though, always good to know if I do the work there's a good chance it'll be used

ivory rune
tawdry zephyr
#

I think if you do super simple PRs that are easy to understand at a glance it helps a lot

#

I'm sure they get tons of PRs where they have to spend real time figuring out what it actually achieves (and even more to figure out what it's gonna break)

crystal hatch
#

yeah, the simpler the change the higher the change it will get pulled in

ivory rune
#

That's why we need good coding style to make others understand your codes betterπŸ˜›

tawdry zephyr
#

deltaTime deltatime DeltaTime deltaSeconds DeltaSeconds

tawdry zephyr
#

I could use some advice on handling the nav mesh for bots that can climb. See video for example; in this one I've disabled pathfinding so it "works" for preview. It is no problem to have a set height that every single AI in my game can climb up (275cm), my world has considerable verticality so it just makes sense. Which means I don't need multiple nav meshes. I also specifically don't want to use nav links that require placing by hand, needs to remain procedural. What would be the correct way to implement this?

In the screenshot I have set AgentMaxStepHeight to 275 and it does work but there seems to be some errors (see last video) and I wonder if they're caused by the navmesh, it doesn't fill above my cube properly?

crystal hatch
crystal hatch
lyric flint
#

Could you expand on the best way to do that procedurally? Is that something like walking the nav mesh edges and generating the links?

tawdry zephyr
#

I actually just started looking into it and was googling the same question πŸ˜„

tawdry zephyr
#

Occurs to me you didn't get an @ @crystal hatch

#

I'm thinking PCG might do a good job for this kind of thing but I haven't even really started with it yet, I'll definitely use it elsewhere, but maybe there is something better suited

brittle lynx
# lyric flint Could you expand on the best way to do that procedurally? Is that something like...

You could add a component to the navmesh that, whenever the navmesh regenerates (there is an event for that), regenerates the navlinks. You can query the navmesh for β€œdebug data” which includes the edges as a list of vectors, so that each consecutive pair of vectors is an edge. The edges are directed so that if you normalize and rotate them 90deg around Z (don’t remember if it’s clockwise or counterclockwise), you get the normal pointing away from the wall. For each edge you could try generating a navlink(s) by doing a bunch line traces etc to detect obstacles.

ocean wren
fickle geyser
#

hey guys im having a issue where i kill my ai, but the controller keeps on doing the BT tasks and i dunno how to resolve that

ocean wren
#

There's a checkbox, I think on the character to attach the controller to the character.. maybe that associated it with the death state of the character? been a while πŸ˜‰

#

might be on the controller BP too though..

#

The way to tell, is that your controller should be as a child of the character in the scene outliner

fickle geyser
#

didnt work, i tried creating a new blackboard key so it check if the ai is dead then created a function in the controller, but it didnt work :/

ocean wren
#

Is the controller attached to your character in the outliner when you run in PIE?

fickle geyser
#

ah no

#

and tbh i dunno how to make it attached

ocean wren
#

look for that checkbox, it should be an obvious one when you find it.. "attach to..." or something like that.. I forget the name

#

the basic idea is that because they're seperate actors, you need to attach the controller to the character, otherwise it thinks you're going to reuse the controller I guess

#

Its either on the character or the controller blueprint

#

probably the controller

fickle geyser
#

alright gonna try that

celest python
#

is it just me or zoombapup became red sus

#

his profile picture was gray

ocean wren
#

red?

#

ooh you're right

#

what does that mean?

#

Oh yeah, totally safe and secure πŸ™‚ hahaha

celest python
#

looks like you took your username

#

probably because of that

ocean wren
#

Yeah, I did

#

not sure why that sould change the colour but whatever πŸ™‚

harsh storm
#

That is great!

#

Now I wonder if it made the cut off to make it in the next engine version

crystal hatch
#

it will make it to 5.3

tawdry zephyr
tawdry zephyr
soft vapor
#

I cant choose the GPT4 Module (error missing module) and if I choose 3.5 Turbo Setting, it tells me "Messages" is a needed property.

harsh storm
#

Is there a way to update just a specific area of the navmesh? I have a bridge that is disconnected initially, but over the course of gameplay, it gets reconnected. I'd like to just add in the navmesh generation for this location only instead of trying to do the entire navmesh.

tawdry zephyr
harsh storm
#

πŸ€”

tawdry zephyr
#

If you place it on your bridge it will remove nav from the bridge, then you can just scale/move/remove the nav area as the bridge builds

harsh storm
#

Will the navmesh auto link up once it is in position?

tawdry zephyr
harsh storm
#

Or do I still ned the nav link?

tawdry zephyr
#

It should auto link up

#

Should be easy enough to make a quick map to test it on first ^^

harsh storm
#

I'm familiar enough with nav links

tawdry zephyr
#

That shows more than just nav links don't be confused by title πŸ˜„

#

It threw me off too at first

harsh storm
#

Not sure it covers anything I didn't already know πŸ˜…

tawdry zephyr
#

OK

#

It mentions the NavArea stuff so thought it might help πŸ˜„

harsh storm
#

I do appreciate it!

tawdry zephyr
#

I'm still pretty new to this stuff myself πŸ™‚

harsh storm
#

I just haven't been in my current situation yet.

tawdry zephyr
#

@harsh storm this should be what you want, right? Unless I misunderstood, you should be able to just put one of those over the bridge to remove the navmesh, then resize/move/remove it when the bridge constructs.

#

In that video I'm using it to remove the navmesh where the navlink he's trying to use is, he has bAllowPartialPaths so he tries to get there without the nav link until it becomes accessible

#

If I'm not being helpful I'll shutup πŸ˜„

jovial anchor
#

hello! so im stuck, i have a cloaking bp setup and when i use it i want the ai not see me when i use cloak. How can I achieve this. I'm using Pawn sensing and not im using ai perception

ivory rune
harsh storm
tawdry zephyr
#

I have nav link for climbing up a ledge, and when it wants to go back down it goes to the same one. Of course I can mark it one-way to stop this happening, but I still want them to be able to fall/jump back down a ledge. Thanks to bUsePartialPaths he will run to the ledge but of course he just gets stuck there. I definitely don't want to make nav links for where they can jump down because that's literally everywhere, is there a solution for this out of the box?

#

At this rate it looks like I need to build something that procedurally spawns nav links all through my level anyway

dense owl
#

Easier said than done ofc πŸ˜…

tawdry zephyr
# dense owl Maybe some sort of line trace to generate the nav link where he’s looking, or at...

The game has no concept of a ledge, it simply sweeps geometry to see if what you're about to walk into could constitute one and if so climbs up it, so there isn't anything like being up on a ledge to factor in.

Only way I can see it working is to calculate the path the bot wants to take, then conditionally spawning nav links anywhere that it obtains a partial path, check if that is somewhere the character can fall down, until eventually the nav links form something walkable. That sounds a bit expensive. I was hoping the engine had something to support this, I imagine it would be common but maybe not?

#

It really would be so much easier if I could just set the step height to 275 (the max climbable ledge height), but I get erroneous nav meshes doing that

dense owl
crystal hatch
tawdry zephyr
tawdry zephyr
#

Pooling or ECS. Depends on a lot of things. If you use ACharacter you have no chance of pulling that off. If you have extremely minimal actors but are spawning projectiles then that's writing to memory every time which will destroy your performance which is where pooling/ecs comes in

crystal hatch
#

you'll need Mass (and a lot of work) for that πŸ™‚

tawdry zephyr
#

(Mass is ECS)

crystal hatch
#

yeah, 1000 regular characters is impossible with the current state of Unreal.

tawdry zephyr
#

πŸ˜„

#

This is going to be fun

dense owl
#

Help yourself with #mass pinned resources ? πŸ˜‰

crystal hatch
#

it has never been possible in the past either πŸ™‚

dense owl
#

Lol

tawdry zephyr
#

UE4/5 has ACharacter + UCharacterMovementComponent which has client-side prediction out of the box. It is how you create experiences where players cannot cheat but still feel like they have 0ms latency. The downside is that its computationally expensive. Unless you're trying to make an RTS then for most games it is worth it's weight in gold (and its heavy with CMC being over 10,000 lines 🀣 )

dense owl
#

Fun indeed

tawdry zephyr
#

By not using the character classes, start with APawn and implement only the logic you require for your game

#

I have seen someone do a HISM based approach for an RTS game but that isn't in my skillset

crystal hatch
#

20 is easily doable. ~100 is achievable.

tawdry zephyr
#

You can still get 20 characters unless your game is poorly optimized

#

well, 100 is achievable with Fortnite tier servers πŸ˜„

ivory rune
#

You don't need 100 very smart NPCs, lol

crystal hatch
#

"achievable" means you need to know what you're doing and optimize for that πŸ™‚

tawdry zephyr
#

Unreal can, you can't. Not being rude, just the truth

dense owl
#

It’s not the car, it’s the driver…

crystal hatch
#

why won't you use Unity then? πŸ˜‰

ivory rune
#

Lyrabots always kicked my ass, I don't think they are dumb...

dense owl
#

My troll senses are tingling

tawdry zephyr
dense owl
#

Thank you for joining us and gl with Unity

unborn sphinx
#

lyra bots are dumb af

#

lmao

ivory rune
#

You put 100 AI in a small map, that's the obvious result, dude,

unborn sphinx
#

lyra boths gather list of opposing team

#

target closest one

#

then ipon seeing ANY ENEMY

#

pull the trigger lmao

#

while trying to aim at their target

tawdry zephyr
#

You know what, unreal has a lot of stuff done poorly, AI isn't one of them