#gameplay-ai

1 messages Β· Page 9 of 1

grizzled bolt
#

I am using the Character class currently, its just that the capsule size remains default and the mesh is a lot more bigger than the capsule, so when the character moves to a point, its body is clipping into the walls

celest python
#

it should be get instantiated in UGameInstance::Init

celest python
#

you can try wrapping other body parts with other collision shapes

#

and attach to bones

#

or use a modular mesh and set collision params properly

grizzled bolt
#

this is what it looks like when its moving to another point, the legs just clips to the wall, even with collisions setup.

ocean wren
#

Does it autoregister with every form of gameinstance? Or does it have to be a specifically interited one? my understanding was that it would auto-register and call initialize whenever ANY gameinstance was created

#

seems that aint the case

#

it DOES auto register if I set it as an EngineSubsystem

#

erk.. I meant UGameInstanceSubsystem

#

I've got a UGameInstanceSubsystem derived class and thought it should auto register when the game instance was registered

#

i.e. for the lifetime of the UE execution

celest python
#

are you sure ShouldInitializeSubsystem returns true?

ocean wren
#

good question πŸ™‚

#

and the answer would be no idea πŸ™‚ hahahaha..

celest python
grizzled bolt
celest python
# ocean wren and the answer would be no idea πŸ™‚ hahahaha..

you can debug the SubsystemCollection.Initialize(this); (in UGameInstance line 120) part maybe, if ShouldInitializeSubsystem returns true but it still not get instantiated you probably only can solve this by debugging it since it goes through a few checks to ensure subsystem will be created properly

celest python
#

or just have bigger doors πŸ˜„

grizzled bolt
lofty stream
haughty coral
#

Are Gameplay Behaviors created to be used only with Smart Objects?

If yes, behaviors could use a bit more context (like used slot and its definition) than just SmartObjectOwner.
If not, then having there SmartObjectOwner parameter feels like unwanted dependency.

sacred shale
#

not sure I understand "Sensing Interval" on Pawn Sensing Componrnt, I emit a noise event and it should trigger once every time it hears a noise, but instead it's hitting once every sensing interval, why does it even have a sensing interval? shouldn't it only fire every time a noise is emitted from the pawn noise emitter component?

crystal hatch
crystal hatch
harsh storm
#

@crystal hatch Completely unrelated to AI honestly - but is there anyone I can ping for a PR? I did a simple PR last week and can't imagine why it would be rejected to be honest. (All it does is add a templated version to get the world settings πŸ˜…) Maybe ping the bot to trigger a notification? (I recall you mentioning sometimes the bot just doesn't work for Github PRs)

uneven cloud
crystal hatch
crystal hatch
harsh storm
harsh storm
crystal hatch
#

Don't get me wrong, it's a nice change. But maybe focus on AI changes from now on (and post as PRs!) πŸ˜‰

ocean wren
#

Well, that was quite the journey.. implemented a bunch of different speech-to-text models today..

#

not a fan of websockets πŸ™‚ spent ages trying to debug a connection and it was a parameter being passed wrongly.. I mean why not just give decent error messages!! πŸ™‚

#

But at least I have voice control back in the engine.. not sure I prefer the commercial services or my own deepspeech hacky server

high summit
#

nevermind, fixed it.

sacred shale
#

is there a console command for me to view the hearing radius of the AI Perception's hearing sense?

modern pollen
#

Hi! πŸ‘‹

Does anybody know why i don't see the EQS Scores above the debug spheres is draws in the world when using the Gameplay Debugger? Example of what you used to see:

uneven cloud
modern pollen
uneven cloud
modern pollen
#

I guess yeah. Thats nice to debug an already happened situation but not that useful when you're trying to see what's happening in realtime :/

uneven cloud
#

You record it doing a thing in real time and then walk through the decisions it makes. It's far better than in real time, because it's way too much information to parse while trying to reproduce functionality.

modern pollen
#

I agree to some extent but stopping and starting the editor to try and debug why my thing isn't working isn't that ideal sometimes πŸ˜…

#

Either way, thanks for the tip about the visual debugger, going to be really handy moving forward

uneven cloud
#

What do you mean start and stop the editor? You record while playing. You can stop playing if you want, but you don't have to.

modern pollen
#

Never mind I just figured out what you mean πŸ˜„

lethal helm
#

how can I make actors that block navigation but don't allow navigation to be generated on top of them

#

throwing null nav modifier volumes around the actors works but I wonder if there is a more elegant solution

delicate belfry
#

Hi! I'm probably missing something very fundamental here but why would this cast succeed when the character is placed in a map but not succeed when the character is spawned from another blueprint (via "spawn AI from class")?

lethal helm
#

AIController may be invalid

delicate belfry
#

how should I go about making sure that the cast is successful when I use spawn AI from class?

lethal helm
#

there are lots of reasons it wouldn't be valid

#
  1. You might be running your code before the aicontroller actually possesses the character
#
  1. Your character isn't set up to automatically be given an aicontroller
delicate belfry
#

how do I know if the ai controller actually possessed the character? is there a check I can do?

lethal helm
#

is valid

#

or run your logic by overriding the aicontroller PossessedEvent

delicate belfry
lethal helm
#

I mean I guess that works

#

you know timers are a thing right?

delicate belfry
#

Timer?

#

Like "set timer by function name" type of timer?

delicate belfry
delicate belfry
crystal hatch
silent drift
#

Is there any way to make navigation mesh has less 'border'

#

so it could include smaller area?

crystal hatch
# silent drift Is there any way to make navigation mesh has less 'border'

yes, kind of. The border size is a function of AgentRadius and CellSize. If you lower AgentRadius (ideally done by adding a supported agent in the navigation system's project settings) you risk you agents getting stuck on corners and such if their actual radius is larger than AgentRadius used.

wary ivy
#

and cellsize affects how the geometry of the level is voxelized before generating the navmesh

#

smaller cellsize means the voxels match with the actual level geometry more accurately

silent drift
#

Ahh..

#

So in my picture before! It was stair like platform. Does changing the cellsize it would give navigable mesh to the first platform?

#

and where can i access those function? Or is it a variable i can change in navmshbounds?

crystal hatch
silent drift
#

is it like project settings or is it possible to 'make' my own navmesh like blueprint child?

crystal hatch
ancient wedge
#

Is there anything I can do about these gaps in the navmesh? Happens in a few places on our map. 😦

crystal hatch
ancient wedge
crystal hatch
ancient wedge
proven fable
#

Hey everyone. I have a quick question.

I have this BT here.
The goal is to have the enemy chase the player and attack when the player is within reach.

The issue I have is that if the player is not within reach, the enemy will move right to the player, even if during the movement, the player gets within reach.
How can I make it so when the player enters the enemy's reach, the enemy will abort the move command and go to attack?

harsh storm
#

For the decorator on the move to, have it abort when the observed value changes

#

Just click on that decorator and in the inspector on the right, change it there

proven fable
#

amazing

#

thank you

rich marsh
#

So is state tree supposed to replace the current BT?

#

Or is it just another alternative to solve a different type of AI problem

crystal hatch
rich marsh
#

Oh ok

#

Thanks

harsh storm
#

Oh dang - city sample had 35k state trees running?

crystal hatch
harsh storm
crystal hatch
rich marsh
#

I thought the release notes said "production-ready"?

#

for 5.1

harsh storm
#

ST is, yes

crystal hatch
# harsh storm ST is, yes

Well... it's "production ready" in terms of "stable API" - if stuff changes the old stuff will be deprecated and kept around for at least two engine revisions. It doesn't mean it's done.

harsh storm
#

Yeah. Understand that part. Didn't mean to imply that it was "done".

crystal hatch
#

Just making sure it's clear πŸ™‚

flint trail
#

so, looking at 5.1 release notes I see Smart Objects and State Tree. What is Smart Object and what are the use cases for it ? What are the benefits of State Tree over Behavior Tree? Is State Tree replacing Behavior Tree ?

harsh storm
#

The release notes also explain the use case for a Smart Object

#

It's an object where you build all the interaction stuff in the object itself.

#

So a bench for example.

#

The bench would be a smart object. When someone interacts with it, it's the smart object that tells the actor what to do. Instead of the actor telling itself what to do. More or less.

flint trail
#

interesting

minor pawn
#

Noice

flint trail
#

so, how does one use ST with BT ?

crystal hatch
flint trail
crystal hatch
#

if BTs work for you then you don't need STs

harsh storm
#

Don't use something just because it is new and shiny

flint trail
#

I wish Epic had a new AI training stream to cover practical use of new features πŸ˜…

harsh storm
#

The BT one is still very relevant and super good.

flint trail
#

Smart Objects in particular

crystal hatch
harsh storm
#

SO literally just moves the area of responsibility from the interactor to the interactee

crystal hatch
harsh storm
#

I was surprised when ST's released with docs πŸ˜…

crystal hatch
flint trail
#

it's great though! now I can complain about lack of visibility culling docs for UE5 πŸ˜…

crystal hatch
#

maybe I should start asking for documentation PRs πŸ˜‰

harsh storm
#

@crystal hatch Any particular reason EQS is still in "beta"? Any plans to remove that tag? πŸ˜…

harsh storm
crystal hatch
crystal hatch
harsh storm
#

I have two reactions to that:

  1. 😭
  2. 😁

In that order.

celest python
celest python
#

ah alright, i misinterpreted the sentence

crystal hatch
#

Back in the day when I added UE4ML to the engine I made the docs a part of the code, kind of - I've added a readme.md (or something like that) in hopes it would be easier to find and maintain. Then when we started working on AI for UE5 I've tried to do the same, but ended up writing more code than docs (sucks to be me πŸ˜‰ ). But maybe it's not such a terrible pattern?
Thoughts?

celest python
#

It'd be less accessible for people not interacting with engine code i guess

#

and image/video sizes in the repository can cause issues, without being sure of that

crystal hatch
celest python
#

is Unreal Cloud DDC's docs real? mildpanic

#

i was just going to write how awesome was NPP's docs back then, and how community oriented was the developer, then clicked that and.. dayum

haughty coral
#

For me it would be most beneficial to read there intentions, motivations and possible future plans. These things are many times missing from official docs as it is too.. unofficial. Network prediction did/does it well.

brittle lynx
# crystal hatch Yes. The reason is the editor's UI. The core is solid had except for like 3 or ...

One thing that would be nice for EQS 2.0 is more granular testing of items.

Suppose you have an EQS query that has a bunch of score-only tests and then a filtering test. If you run that in ReturnSingleItem mode, there's a neat optimization: it'll run the scoring tests for all items, sort them descending, and then only apply the filtering test until it finds one item that passes it (instead of running the test for all the items). Because it just needs to find the best item that passes the filters. This is really great for performance if that final test is expensive (e.g. traces or pathfinding).

However, this doesn't work if there are multiple filtering tests like that in the EQS.
It'll run the scoring tests and the filtering tests on all items (except for the last filtering test, to which this optimization still applies).
I'd expect that if there were a bunch of scoring tests and a bunch of filtering tests, that it would only run all the filtering tests until it finds an item that matches them all and then stop.

crystal hatch
brittle lynx
#

That’s not really something that can be done in EQS 1.0 because of all the overhead each test has before iterating through the items: resolving aidataproviders and whatever other setup.

haughty coral
# crystal hatch > I'd expect that if there were a bunch of scoring tests and a bunch of filterin...

I will be finishing initial smart objs & gameplay behaviors implementation in my interaction system and I collected a few (not big points). It is nothing critical, so I am not sure if it is important enough to post it on UDN. Do you think I can just post these here and it might possibly reach Mikko or whoever is working on these things? πŸ˜… No need to answer questions mentioned there as it might happen I will eventually find out anyway when it will be further developed.

harsh storm
#

I mean, I'm pretty sure Mieszko will tell Mikko, lol

haughty coral
#

in that case

- Gameplay Behaviors have no GetWorld() override therefore have no access to funcs like SpawnActor.

- Are Gameplay Behaviors meant to be generic objects used also by other AI systems than Smart Objects?
    o If yes then having there Smart Object owner reference feels a bit out of place (would maybe fit more into Config as a behavior parameter which is dynamically set)
    o If no then it would be nice to have also used SO slot accessible:
            - In my case I have a GameplayBehavior which starts a gameplay ability by tag. I would like to use used smart object slot activity tag for it but there is no way how to access it. As a workaround I had to add tag parameter to behavior config and configure the tag also there.
    
- How do gameplay behaviors compare to AI tasks? I sometimes wonder whether it would make sense to allow creating AI tasks in BPs rather than have a different generic AI behavior/task object. 

- Some objects can be interacted from multiple places (slots) but allow only single interaction at the time. Like a door opening from both sides, fence cutting from both sides or even something like a lever. Would be nice if it was somehow possible to enforce out of the box. It could be something as a "smart object resource which slots claims and other slots using the same resource are automatically deactivated.

- Would be nice if there is a way to hide gameplay behaviors (or even old BT tasks) like PlayMontage or PlaySound. From my past experience these were always a trap for designers on multiplayer projects.
neat marsh
#

About to port my AI behaviour trees over and learn VisAI. Should I instead be looking at state trees?

I'm working on a RTS style auto battler. So 200 units with basic AI like auto attack behaviour, NOT directly controlled.

azure pulsar
harsh storm
#

That won't get confusing πŸ˜…

#

Interesting - state tree doesn't require a pawn. So no controller necessary. @celest python

haughty coral
#

yes, state tree is cool and generic. You can use it for anything. It is GameplayStateTree plugin what make it easily usable by pawn by creating UStateTreeComponent derived from UBrainComponent.

harsh storm
#

The compile button doesn't have a setting where it auto-saves when successfully compiling 😭

celest python
harsh storm
#

You one of those weirdos that actually puts the BT component on your actor?

celest python
#

Not me, but I've seen a few people came up with creative solutions like that

#

not the worst idea tbh

#

its just not decoupled.. or not intended to be decoupled from controllers so it just looks ugly

tender vault
#

Would it make sense to combine behavior trees with a state tree? Or is one meant to be used or the other

ocean wren
#

Honestly, I reckon for engine stuff, documentation should be at least as important as writing the code. I find it a bit weird that there's the possibility of doing one without the other when there's potential for tens of thousands of people to use it (and be confused without the docs). That said, docs take forever to write and are a pain to maintain.

#

Been looking at NBDev as a sort of strange middle ground for some data science stuff

#

jupyter notebook that self documents into a doc site

crystal hatch
crystal hatch
crystal hatch
# azure pulsar As someone who's only worked with Behavior Trees so far, I'm not sure I understa...

I'm not sure they do, depends on the set up. What StateTrees can do is a superset of what BTs can do, and it's an implementation utilizing new language and Unreal features (our BT implementation is at least 8 years old IIRC). ST is the tech of the future, but BTs are solid and it's very well understood how to use them. I suggest using BTs until you understand STs well (and we supply more actual AI tasks for ST).

crystal hatch
celest python
#

My jr brain thinks in theory ST should run slower since evaluating state conditions should be slower to evaluate decorators on large scale thingken

crystal hatch
haughty coral
#

thanks a lot! I will be soon converting our BTs to STs (it is a hobby project) and from what I read about it yesterday It looks really great. I will write down any rough edge in case I find any. But from the first look it looks very nice, It feels like a behavior tree but it allows you to jump between branches however you want. That was often tricky in BTs when you sometimes needed a bit different order of evaluation of things.

echo lark
#

What I find somewhat confusing about ST, is the lack of graph visualization. Not even editable, but at time where you can jump from one state to any other state in tree, it can get confusing, especially in deeper ST hierarchy,

Yeah the graph can get spaghetti quickly, but with some mouse over highlighting connected state, it cloud make figuring out what are possible outcomes easier.

silent drift
#

why does my navigation link cylinder changed size after i resized my cell height in navigation mesh?

tawny raven
#

For UE 5.1, State Tree received significant improvements and is now considered production ready.
^^^according to patch notes of 5.1 release

BUT the 5.1 docu (https://docs.unrealengine.com/5.1/en-US/state-tree-in-unreal-engine/) states the following

You can try out this Experimental feature, but we do not recommend shipping projects with it.
Docu bug?

slow bobcat
#

@crystal hatch I just read about EQS 2.0 and I was wondering if any form of Multi Thread is being considered? whether it is for running not-codependent tests or the entire eqs in a separated thread so we can run several at once outside the game thread?

#

Extra question for @crystal hatch too: any plans to get rid of the FPImplRecastNavMesh? Would make our life much easier when it comes to custom-string pulling implementations or nav generation logic.
I'm referring to this

     * This is a pimpl-style arrangement used to tightly hide the Recast internals from the rest of the engine.
     * Using this class should *not* require the inclusion of the private RecastNavMesh.h
     *    @NOTE: if we switch over to C++11 this should be unique_ptr
     *    @TODO since it's no secret we're using recast there's no point in having separate implementation class. FPImplRecastNavMesh should be merged into ARecastNavMesh
     */```
haughty coral
crystal hatch
crystal hatch
slow bobcat
#

Gonna abuse your patience @crystal hatch and ask one last question:
I read this in the 5.1 release notes (image referring to Dynamic Nav when using the new World Partitioning) and I'm bit confused.
When I first heard about this I read the documentation available and checked a bit of the code, some early tutorials in youtube etc and I was under the impression that Dynamic Nav was a must when using WP, because nav should always be generated around invokers.
Was that not the case? Was the system intended to have baked nav, whether fully static or semi-static (modifiers only)?
Or does that text mean that it can be combined now?

crystal hatch
slow bobcat
#

that's fine, no way one person can stay on top of everything, specially for the new stuff.
Thanks for your time! Keep the good work!

charred lava
#

My BlackboardKey Value changed event won't get triggered in my Behavior tree Decorator class.

void UBTD_AbortOnBlackboardKeyUpdated::OnNodeActivation(FBehaviorTreeSearchData& SearchData)
{
    if (UBlackboardComponent* BlackboardComponent = SearchData.OwnerComp.GetBlackboardComponent())
    {
        BlackboardComponent->RegisterObserver(BlackboardKey.GetSelectedKeyID(), this,
            FOnBlackboardChangeNotification::CreateUObject(this, &UBTD_AbortOnBlackboardKeyUpdated::OnBlackboardKeyUpdated));
    }
}

EBlackboardNotificationResult UBTD_AbortOnBlackboardKeyUpdated::OnBlackboardKeyUpdated(
    const UBlackboardComponent& Blackboard, FBlackboard::FKey ChangedKeyID)
{
    const bool bIsValidKeyValue = Blackboard.GetKeyRawData(ChangedKeyID) != nullptr;
    if (bIsValidKeyValue || bAlsoAbortOnKeyGettingCleared)
    {
        bAbort = true;
        return EBlackboardNotificationResult::RemoveObserver;
    }

    return EBlackboardNotificationResult::ContinueObserving;
}
```Does anyone can know / guess why? 
Edit: OnNodeActivation flag is true
charred lava
#

no

slender gale
#

In state tree; is there a difference between having an evaluator vs having a task on the root node? Are evaluators just sugar for the latter?

normal tapir
#

Has anyone come up with a way to store navmeshes offline for moving platforms? I don’t want the performance hit of dynamic generation or the limitations of a static environment.

crystal hatch
tawny raven
#

The improvements on the StateTree look really good. I am excited to try this feature out because I really like to use finite state machines for AI in general. I do understand though that this is not a FSM, I assume this is to make an improvement over regular FSMs by sharing common behaviors and therefore removing the finiteness, is that right?

uneven cloud
haughty pelican
#

Hey there guys I was wondering if anyone could help me out. I am creating an augmented reality tower defence game where AI must run towards a castle the player needs to defend however the AI move to always seems to be failing when I test it on my tablet. The AI move to never fails in the editor so I am wondering where I am going wrong. I have attached a screenshot below of the AI blueprint. My AI is only spawned in when the player clicks on the screen to place the castle with a plane attached to it. The AI spawn on this plane. So far I have checked that the locations are correct and that a nav mesh is included within the scene. However I am not too sure if the nav mesh could be causing issues when packaging to android? Any help is appreciated!

slow shadow
#

How do I keep the loop in combat while there is a target available? Now it attacks and then pauses

crystal hatch
haughty coral
#

Oh god, changing brain component from BT to ST can get really tricky with Unreal's component serialization. Behavior Tree Component is still serialized inside the blueprint even when I change BrainComponent to a different component name and class. It leads to just empty Brain Component details panel.

#

Normally I would solve this by renaming the variable but I can not do so now as it is BrainComponent of AIController

#

ah nevermind, I had to store it in custom variable like this. I am not sure why it actually worked with BTComponent before. Maybe Behavior Component has been separate var in the C++ class in the past and then removed.

StateTreeComponent = CreateDefaultSubobject<UStateTreeComponent>("StateTreeComponent");
BrainComponent = StateTreeComponent;
echo lark
#

I think you can run StateTree without component

#

it is now contained within single struct

#

btw. I don't get why is every AI system in unreal or marketplace bound to that component. What I want to run StateTree/BT and HTN within single actor ?

#

I mean when I was implementing Utility AI i totally skipped BrainComponent just for that case

haughty coral
#

yeah, I do so too for my own system (you can see my utility reasoners in the component list). For now I will try to stick with it and see where it leads as some AI Tasks have a checkbox for locking AI logic and brain components are reacting to these

#

but it is quite cool that the component is now only a thin wrapper around the struct

cloud ice
#

How can I debug a state tree to see where an agent is at in the tree? (Not using mass) UE 5.1

late dirge
#

Why doesn't Behavior Tree have a Collapse Graph? X_X

uneven cloud
late dirge
#

What do you mean?

uneven cloud
#

There's a task to run a subtree, called Run Behavior Tree.

late dirge
#

Oh snap

plush cargo
#

how do i add the experimental state tree

plush cargo
#

how would i start sensing items with an AI

#

or do i use pawnsensing still

silk fulcrum
#

The Detour Crowd AI controller causes enemies to move reeeeally slowly when routing around each other, any way to fix that slow speed issue?

charred lava
celest python
#

did you resolve your key

#

nvm if you debugged selectedkeyid it must be resolved already

crystal hatch
plush cargo
neat marsh
#

What's a good way to get the closest enemy from hundreds without going through all of them?

crystal hatch
celest python
#

Finally I learned a usecase for TOctree2. The /** An octree. */ comment was a meme in #cpp πŸ˜…

#

But anyway another idea from my jr brain for BP context if you dont have access to C++:
Do sphere trace by incrementing radius each time in a loop until you hit an enemy pawn, and when you hit any enemy, get closest one among hit ones

neat marsh
#

After googling that seems perfect, is T0ctree2 something i can only utilise with CPP?

crystal hatch
neat marsh
#

Haha I'm so lost

crystal hatch
#

and it has no comment πŸ˜›

celest python
#

I'm looping over 100+ FVectors to find closest one pretty frequently in my game, and so far never saw it in profiler

plush cargo
#

how do i add the experimental statetree?
or is it 5.1 only?

neat marsh
#

I think I am over optimising yeah

celest python
#

especially in shipping compiler optimizing it to moon and it gets very fast

celest python
neat marsh
#

My first iteration was foolishly looping over 100s of actors per actor

plush cargo
neat marsh
#

But just having each actor already in an array will probably save me 90% of the performance

plush cargo
#

so its a plugin?

celest python
#

yep

#

enable it in plugins tab

plush cargo
#

aah makes sense, ty

crystal hatch
#

god damn you all, now I want to write a generic Pawn spatial lookup feature!

plush cargo
#

is it a plugin in 5.1 as well ?

neat marsh
#

Lol please do

crystal hatch
plush cargo
#

i see

celest python
neat marsh
#

I'm in BP

#

Was using behaviour trees

#

It moving to VisAI

#

But*

celest python
#

dont tell me you were using Get All Actors of Class per actor panda_nobully

neat marsh
#

To be fair I started with a marketplace asset and it was implemented like that

#

It was actually initially doing that each time the behaviour tree ticked

crystal hatch
#

if your agents are using perception you can just pick among the pawns given AI agent is aware of. It's going to be a significantly smaller set in practice.

#

and less cheatty πŸ™‚

neat marsh
#

I figured that perception in a 100 vs 100 rts type environment would be overkill. They are pretty basic, just move in range and attack unless given 1 of 2 other commands

#

Is perception performant enough for something like that?

crystal hatch
celest python
#

if you have 200 actors to loop and if its happening on BP it will drain some nice amount of milliseconds btw

#

BP loop is a node sphagetti macro

neat marsh
#

Yeah think I'm going to have to get a clever programmer to replace I down the road

celest python
#

but unless you have a gigantic map i guess incremental sphere trace method would be faster because traces are so cheap to execute in CPU

#

it should be slightly faster to do compared to 200 actor loops i guess

uneven cloud
neat marsh
#

Wow thanks @celest python ! I'll try both methods

crystal hatch
uneven cloud
celest python
#

Though I'm confident at best scenario sphere trace should be faster -- but always gotta profile

uneven cloud
celest python
#

By the way I'm still working on this issue, went through almost every stackoverflow post and other game engines to see how splines are handled, yet couldn't understand the trick UE's USplineComponent/FSplinePoints doing. If anyone has any experience with how UE handles spline points can enlighten me about how can I calculate ArriveTangent and LeaveTangent based on bezier spline algorithm?
From what I can see SplineComp calls AutoSetTangents when curve mode is set to Auto and it does something like this:

(1.f - Tension) * ( (P - PrevP) + (NextP - P) )

which I is similar to things on the web I've seen

but then it starts to insert new elements to ReparamTable (seems like a float only curve?) which confuses me a lot, because seems like "interpolation" part is happening on that thing. Do I need to write a custom spline component? because I remember Kythera mentioned UE's spline was too designer oriented to work with AI paths

misty gale
#

Dont you just need to use the custom tangent mode and provide your own results to it ?

celest python
#

yep but the algos I could find on the web requires me to insert new control points -- which seems to be working for the examples they provide on the articles etc. but UE only takes arrive/leave tangents as input and process the spline internally. I'm having difficulty to make algos compatible with UE's method

#

especially that ReparamTable confused me a lot

celest python
#

nope, how did you find it lol πŸ˜…

#

searched something similar for days

misty gale
#

First hit πŸ˜…

celest python
#

i guess I was unlucky cryalot

#

thanks a lot, will try to make it work with this!

plush cargo
#

whats a good way to separate characters from items when i want to use find nearest actor

#

via get known perceived actors

#

i want to find the nearest item in a specific task

charred lava
#

How do I check if a Blackboard key value is cleared or not?

slow bobcat
charred lava
# charred lava How do I check if a Blackboard key value is cleared or not?

That's how if somebody is interested:

const FBlackboardEntry* EntryInfo = GetBlackboardAsset()->GetKey(BlackboardKey.GetSelectedKeyID());
const uint8* RawData = Blackboard.GetKeyRawData(BlackboardKey.GetSelectedKeyID());
const bool bHasData = (EntryInfo->KeyType->WrappedIsEmpty(Blackboard, RawData) == false);
plush cargo
#

Any help with sorting actors in perceived actors function?

#

i want to exclude something

crystal hatch
plush cargo
#

for sure hang on

#

I have a task setup for looking at known perceived actors and finding the closest one.
I want this actor to be of one specific type. More specifically a weapon

crystal hatch
plush cargo
crystal hatch
plush cargo
#

now i learned that πŸ™‚

crystal hatch
plush cargo
#

ok im looking into it like this

#

thanks

#

@crystal hatch it appears to be working i just have to untangle my mess and make sure

plush cargo
#

yeah yeah i ment in my spagheeet

#

πŸ˜„

#

i have to work with this to be able to have the AI not steal my weapon

plush cargo
#

i had to sort even further to make sure the item was available but i learned a lot from this

ocean wren
#

I quite like sphere trees instead of quadtrees, easy to implement, good for moving and updating things, simple maths and reasonable representations

tender vault
#

are there any examples of state tree used for a regular game ai? so far all i've been able to find is how to set up mass ai with zonegraph, etc

#

trying to build a combat bot that i think could benefit from the state transitions - just not sure how to wrap my head around the tool yet skeletonconfused

celest python
languid salmon
#

Anyone who would know why a StateTree Task will be executed constantly even though its current state is set to running, on the tick ?
I am trying to set up a MoveTo type of function for my AI in statetree, but after it gets to its initial first random location, it then starts to execute the same task over and over and over before it managed to get to its location (seems like its just flat out ignoring that it is still currently running?)

tender vault
#

having an issue with subtrees not running - any ideas what i might be missing? the "run behavior" task appears to be called, but the referenced tree isn't actually executing

tender vault
#

the Combat blackboard uses the Behaviors bb as a parent

crystal hatch
harsh storm
tender vault
crystal hatch
shrewd violet
#

I need some help. Why my focal point is what i want, the actor focus is cleared where i want it to be cleared, but the get focal point on actor change. I'm trying to make my ai rotates but it rotates back mid montage

#

Then i just play the montage and launch the character to make the ai dodge

languid salmon
#

Anyone had issues with the AI not caring about the acceleration property in the movement component when moving ?
Does not appear to be set at all when using the Move To function - and also looks like its current speed is just being set to max instantly

uneven cloud
languid salmon
#

its already turned on

uneven cloud
#

What acceleration value do you have?

languid salmon
#

I just tested rotation rate as well, set it to 20 - and turn on the other settings required to use it, does not appear to respect that either

#

I set it to 200

#

Originally it was 1500

#

just tried with 50 acceleration.. same thing

uneven cloud
#

You might need to dig deeper into why that's happening, because I've never seen that not work.

For rotation, you need to turn off use control rotation in the character and turn it on in the movement component.

languid salmon
#

Yeah I havent experienced that either tbh.. first time :/
Works fine in my 5.0 project, but a fresh 5.1 - nope xD

#

And like.. this ? for rotation ?

#

ah yeh that worked

#

ty

#

So its just the acceleration that isnt working then :S

#

I did try and check the acceleration of the AI, and it just doesnt move from 0

shrewd violet
#

ai controller

#

character

languid salmon
#

make sure to reduce the actual Z Value to something lower

shrewd violet
#

what does the z value do?

languid salmon
#

Thats the rotation rate

#

The higher it is, the faster the AI will rotate

shrewd violet
#

i found the problem. Seems like launch actor resets the focus for some reasons

#

i think i will have to use move to instead of launch

#

witch is a boomer for me but at least i found out the problem

languid salmon
#

And now.. out of the blue.. acceleration on my AI is now working.. wtf lol

#

@shrewd violet You can just set focus again after the character lands on the ground if needed. - unless it needs to focus the character at all times, then just set focus right after its been launched

shrewd violet
#

I've been trying but it's like bugging. I'm trying to do some trouble shooting. it's giving problem even with move to location node

languid salmon
#

Have you tried clearing the focus first, and then setting it again ?

shrewd violet
#

it is hoow i'm doying it

languid salmon
#

Ah

languid salmon
#

Unless it doesnt have a specific target, then idk

shrewd violet
#

to dodge behind it doesn't have any actor behind unfortunate.

shrewd violet
outer bear
#

Any idea how I can apply a sort of 'inertia' to my navmesh movement? Even with turning boost set to 0 and acceleration set very low, my pawns always perfectly adjust their speed to track a moving target.

When the target changes direction suddenly I'd like my pawns potentially overshoot it, with a more gradual change in acceleration.

unborn shard
#

Does the procedural mesh component support navmesh?

#

I have a simple terrain procedural mesh and the navmesh seems to be ignoring it entirely and idk why

candid marten
#

Hello, I'm new to unreal and I'm having trouble making an ai do what I would like it to, I'm basically trying to make a cod zombie type ai where it always knows where you are.

trail pelican
#

hey is there any good documentation to start working on AI?

bleak hound
#

Question: looking to make an AI character lead a player character through an obstacle course, a lot of variations on vaulting, crawling, and other features already coded into my PC. How can I get the AI to access those functions properly for what I’m trying to do? I’ve done some basic melee combat stuff that’s essentially a clone of the player character but not sure what to do when interacting with the environment and not the player.

tender vault
plush cargo
#

nothing here

#

that right ?

flat dome
#

Did simple AI get reworked at all in UE5?

uneven cloud
uneven cloud
candid marten
#

i havent done anything with AI yet

uneven cloud
uneven cloud
candid marten
#

alright

plush cargo
#

any good resources that talks about the StateTree ?

plush cargo
#

whats the proper way to make them rotate towards focus point

#

not snap

#

custom task ?

celest python
#

override FaceRotation in C++ and add interp

#

or custom task

plush cargo
#

πŸ‘

uneven cloud
uneven cloud
#

Yeah. The use controller desired rotation. But you must turn it off on the character or it will snap.

plush cargo
#

turn off when

#

this seems easy enough

#

what should i be wary of now

lyric flint
lyric flint
lyric flint
lyric flint
keen crow
celest python
#

We are mixing BTs and ST
Will BT's have a new task to run ST like Run Behavior Dynamic? thingken

echo lark
#

We have now MVP on Discord ! @lyric flint Welcome! (;

celest python
#

Yes, welcome! πŸ˜„

echo lark
keen crow
echo lark
#

that's the neat part

#

you don't and you cant

lyric flint
echo lark
keen crow
lyric flint
# flint trail so, looking at 5.1 release notes I see Smart Objects and State Tree. What is Sma...

(partly copying from another answer)
The main thing is that STs aim to be more general purpose than BTs. ST has some concepts that make them a bit more flexible than BTs (e.g. transitions, data binding). OTOH, BTs are more mature and have better support for build AIs out of the box.

SmartObjects allow to annotate the world for the AI do to stuff. Currently it's quite bare bones spatial database, which allows you to build annotated slots and query them.

We're working on Gameplay Interactions which combine Smart Objects and StateTrees and animation workflows to allow you to create behaviors that interact with the world, like opening a door, or sitting on bench, which can be used by the AI or player.

keen crow
#

I mean if I had a behavior tree brain component that'd always tick the active BT when I only need it when the ST says so

echo lark
#

well, you need to wrap it within something, you can just as well copy paste/the StateTreeBrain implementation into something of your own

keen crow
#

I had another idea, to make the AIC's brain component the StateTreeBrainComponent and create a separate BehaviorTreeBrainComponent that could be triggered out of ST's task. The only concern here would be how do I orchestrate switching between STBC and BTBC

echo lark
#

it's actually easier to leave BT component

#

if you look at implementation size

keen crow
#

doesn't BT always need BTBC? I mean it is passed as a reference to all core BTNode virtual methods

echo lark
#

it does

#

that's why it's better to wrap StateTree into something and leave BT as is (;

keen crow
#

wouldn't that make the BTBC my core brain component and hence main driver of what AI actually does when I actually want this role to be designated for the state tree?

echo lark
#

what will be main thing is the one you run as the main one

keen crow
#

πŸ€” I see, in this case I might need to override something inside the AIC then to make the ST the boss

lyric flint
# languid salmon Anyone who would know why a StateTree Task will be executed constantly even thou...

The task Tick() should return EStateTreeRunStatus::Running for as long as you are not at target yet. If you return EStateTreeRunStatus::Succeeded then the state will finish.

Usually you should set up the path following on EnterState() (return Running if everything is ok, succ/fail if you want to stop immediatelly), and monitor the progress in Tick() (Running until at goal), and do the clean up in ExitState().

lyric flint
lyric flint
haughty coral
#

ohoho, welcome Mikko, this is becoming my new favorite channel after #engine-source :D Quick minor ST bug I noticed yesterday in 5.1,

#

(it is necessary to reselect the state to update bindings list after moving the state)

haughty coral
#

also another bug happened to me but I could not reproduce it anymore. I changed a state to Group. Hitting + for transitions then kept adding more and more -> [None] into the tree but transitions list in details panels was still empty. I will see if it reproduces and give better info then.

haughty coral
#

Also additional thing which I found a bit frustrating yesterday when working with ST Tasks when compared to BT Tasks. EnterState/Tick/EndState are functions returning a value in ST Task. It makes it more difficult to use latent nodes like AI Tasks. In BTTask I would usually just hook AI Task / latent node to execution event and add FinishExecution(true/false) to latent node output exec pins. In ST Task I have to create custom event in the event graph, call the custom event from EnterState and set bools when output exec pins are fired. These bools are then read in EnterState/Tick. Ideally I would like to have EnterState/Tick/EndState return Running by default in C++ and return a different value in case something like FinishExecution is called during the function execution. That would allow these functions to have no return value, have them as events in the event graph and support latent nodes conveniently. But I have to say I did not investigate how tasks are instanced, so I have no idea if having async tasks or variables there is ok at all. Here are BTTask and STTask comparison pics for a task doing the same thing.

versed maple
#

When I read about the ST a while ago, I thought that the BT controlled the AI and the ST were in the smart objects, so when the AI activates the smart objects it uses the ST. I had thought that STs would be used to handle npc crow or figurant.
now, After reading these days i'm more confused πŸ˜…

haughty coral
versed maple
#

BT is a wild horse but when you tame it the BT goes very well, I would have preferred a BT 2.0, the ST interface looks very intimidating hahha

versed maple
#

btw, I can't get my hands on unreal 5 right now but I'm really hyped to try this out. and something I would like to know or I will not sleep. Does ST have services that can run at the same time as task? Like BT

haughty coral
#

That is what I am trying to understand right now. It feels like it is all just tasks and you leave that tasks running forever. But I have troubles combining async EQS, waiting for the result, then doing something (MoveTo) what requires access to the output of the EQS. This is what I have converted from BT now but it is not working as expected yet.

#

but I have to say I am close to giving up in favor of just waiting until there is more info and docs available. I am a bit confused by the fact that some tasks need to be by design running infinitely not because there would be no success/fail output from them available but because I just don't want to complete the state based on them ending.

bleak hound
#

Does anyone know what these symbols mean above my NPCs?

#

I have an AI controller on them, and when I start the level, they all walk away from my PC. Even with two different controllers.

versed maple
haughty coral
#

Okay, so for anybody who finds this later. This state tree is offering more or less same behavior as the behavior tree next to it. It takes a bit practice to think of the tree as of hierarchical state machine. Important piece which is not visible from the tree is that tasks Set Focus, Set Grait, Shoot, Run EQS Query never actually Succeed or Fail. They run infinitely and always return Running state (even if they do their thing once in the EnterState event). That is true even for EQS as otherwise it would end the execution of its child Wait For Query Result state (this was probably most confusing part of it for me). Important piece is also the Wait For Query Result state. It must be there because otherwise Find Loc state would not execute (this is more clear if you properly think of it as of hierarchical state machine).

Now I only wonder what to do in case I will need some tasks sometimes as returning succeeded and sometimes as running infinitely. It might make sense to introduce some bool which toggles the policy for returned state (something like bRunningInfinitely what forces it to never succeed/fail).

Something I think should be improved is the ability to understand whole state tree just by looking at it. Enter and transition conditions are hidden behind (?) icon which does nothing when hovered. And even then I would need to hover every transition to understand the tree. For me it is not a problem as I am author of the tree but I can imagine it could make it difficult to understand bigger trees for other developers. Similar thing applies for the behavior of tasks (running infinitely vs returning succeed/fail) but that can be probably mitigated by naming tasks accordingly.

#

but the way data is passed around without blackboard is awesome.

acoustic walrus
#

Hi everyone!

#

I've been delaying the AI in my "game" for too long and my first approach was to do it just in code, with old school State Machines

#

it worked more less ok, but I have realized that I wanted to learn how AI is done in a professional environment so I will be redoing it using other techniques

#

my first approach to BT's is not very good to be honest

#

how do you find state tree compared to them? Do you think its worth to get into ST directly and skip BTs?

harsh storm
#

I say start with BTs. Much more info out there on them for the time being.

harsh storm
acoustic walrus
#

well, I haven't used them very much yet but I think I see the the annoying part of having to move the data from your character/controller to be able to use in the BTs

#

but I guess that if you can share the same BB for some characters, there is a performance gain

haughty coral
# harsh storm I feel like I'm the only one who doesn't mind blackboards πŸ˜…

The BB concept is not bad just the technical side is a bit dated after all these years. I have enough of things like setting BB keys again everywhere after renaming one or as somebody mentioned, going thru sacred ritual to support a certain struct type. + stuff like referencing by name, being forced to single huge blackboard containing everything and so on. If it ever gets reworked using latest UE and language features it will be a different story.

haughty coral
cerulean cedar
#

hi

outer bear
unborn jungle
#

I even have a single UEnvQueryContext class that can return all of my base common contexts via enum rather than making a separate class for each with a line or two of code in each

#

But it's all down to preference at the end of the day πŸ™‚

potent stone
#

Hi all

#

I made an AI flying and I'm trying to use the "AI Move To" node to move him to another actor

#

When my AI is too high, the node "fails"

#

Anyone knows why please ?

#

Am I missing a parameter ?

#

Even if my another "actor" is too far from "Landscape" (high) it does not work

potent stone
#

I guess the "NavMesh" has a height limit

uneven cloud
uneven cloud
quaint radish
#

Any idea why the AI perception might be spawning at 000, even if the ai is not there?

#

i visualize sight sense for example and its center is at 000.

woven bobcat
#

thank you i'll look at it again
have anyone had experiment granting ability/gameplayeffect using statetreetask? im thinking of making a general STTask for actor to garnting ability/effect to self
i really like the workflow of ST for these type of behaviour

uneven cloud
quaint radish
uneven cloud
quaint radish
#

Hmmm. I put the aiperception component in the controller.

#

I could look for a 2nd/extra controller in the world outliner. But, just in case, any other ideas?

unborn jungle
#

What is the cheapest points test you can do in EQS?

#

Grid perhaps?

#

Assuming identical point counts

#

Or if indentical point counts, each test may be identical in cost?

celest python
#

points are n in O(n)

unborn jungle
celest python
#

point count is just a multiplier to the test(s) overhead

#

ofc each shape has different algorithm but you wont see much practical overhead difference between them

#

I dont recall its name but I'd say the sphere thing -- donut but without inner circles

#

it must be relying on a very simple math

#

grid is one of the most expensive ones -- even though its not something very expensive -- since it does 2d loop and slightly more complex math

unborn jungle
#

Great to know thank you for explaining πŸ™‚

dusk pewter
#

I am at a complete loss as to what in the world is happening.
I have a nav mesh and a simple "move to" behaviour where the pawn will simply look within a radius and move to the next point.
When packaging the game for PC, all is fine, everyone moves.
When packaging for mobile android, the ai pawns simply don't move at all.
I tried manually reloading the nav system by command and C++, setting it to dynamic and none of it worked.
The AI controller is a detour crowd ai controller.
This is the behaviour tree:

#

At this stage, are there any ways i can debug this further?

rich veldt
#

fairly weird question but has anyone had the experience of Instance Editable variables on a blueprint task getting reset to default in the behavior tree upon restarting the editor?

#

specifically an enum

celest python
#

either VCS problem or your BT having serialization errors

rich veldt
#

any fix? dont mind deleting/remaking the task

celest python
#

if same thing doesnt happen on another BT, your BT asset is the problem. if its globally related with task i dont know

rich veldt
#

yeah just this bt

#

maybe just got messed up; duplicated it from another bt

celest python
#

oh if you duplicated the BT asset, i'm pretty confident its a serialization error happening on BT asset

rich veldt
#

oh

#

i deleted the enum and remade the variable

#

maybe its working now (for now...)

#

but thanks for the info on serialization

celest python
#

afaik task's properties are serialized into BT asset directly

rich veldt
#

cleaner to just make a new task class and copy over?

#

ahhh

celest python
#

I'm not sure though. I just had similar issues, especially on nodes rather than properties when I duplicated BT assets

rich veldt
#

maybe i duplicated something with a different ENUM and just changed the property type instead of deleting the property and making a new one

#

and it got confused

#

but since i did that now, it works.

#

interesting

celest python
#

i guess BTTasks has a different serialization thing and custom details panel implementation because they work differently compared to blueprint objects

#

from my experience they time to time do weird things like that and its easy to blame engine code since i can observe most of the time its not related with my project

#

btw similar things happen when you duplicate tasks too

#

just fyi

rich veldt
#

im a few beers in and i meant task when i said BT

#

behavior...task...

#

so good to know duplicating trees can do this too lol

bitter cosmos
#

is there a good 3D pathing Ai for space games? i know theres big name middleware solutions but i cant imagine they are the only ones.

ones that can do both Ai actors and missiles. cant be the only option is to spend more than $2000 USD on just the pathing Ai

ocean wren
#

In a word... no πŸ™‚

#

unless you MAKE ONE! πŸ™‚

hearty niche
#

It has had a steam game shipped on it so it works fine. You'll have to compile on cpp tho

keen sluice
#

Hello good folk!
I'm very new to all of this, but I have a very basic AI set up that moves to the location of the player and it works as intended when the enemy is placed manually in the level
My issue is that, when the same enemy is spawned during runtime, it won't move at all.

Does it need to be "activated" somehow?

timber plaza
keen sluice
keen crow
#

remind me please is it safe to store TArray inside node memory? TArray<FActiveGameplayEffectHandle> to be specific

crystal hatch
keen crow
crystal hatch
# keen crow shouldn't I avoid instancing BT nodes at all costs?

it's better not to instantiate BT nodes, but sometimes it's the only way (if you really really need that TArray in there, for example). One important decision data point is how many BT nodes of that class are you going to have, or how many AI agents will use BTs that utilize these nodes.

woven bobcat
#

this is probably a dumb question but what's the difference between a task and a service?

#

how can i differeantiate what should i put as a service or as a task?

stoic cliff
#

not sure if it's right

#

Can i instance tasks? I want to create a behaviour tree with basic tasks, but change those tasks for subclasses. Is this possible?

vapid parrot
#

When trying to debug AI vision by pressing the apostrophe, not happens. Got debug plugin checkbox ticket and also activated AI debug through Show -> Developer -> AI Debug. Anything I'm missing?

manic karma
vapid parrot
#

@manic karma Yup!

manic karma
vapid parrot
#

I see through the BT debug that it is running the tree on an AI controller

#

Hmm, not sure what to show, when hitting the apostrophe key that should turn up the debug info in the left top corner, nothing happens instead. Tried on a blank project as well etc

crystal hatch
vapid parrot
#

@crystal hatch Thanks, that does indeed trigger it. Cheers, on it πŸ™‚

uneven cloud
ocean wren
#

Evening all

#

whats new?

quaint radish
#

Anyone have ideas for why the AIPerception component (added to ai controller) might not stay with the actor? Currently visualizing sight radius at 000 in the world.

#

Confirmed there is only 1 controller for that AI

#

in a clean/empty project, I used the same settings/setup and everything worked fine.

ocean wren
#

You need to attach your AIController to your actor, there's a checkbox..

quaint radish
#

I tried that too but ill try again

ocean wren
#

there's always a checkbox

#

in the scene outliner you should see the AIController as a child of the actor its controlling if its properly setup

#

otherwise it shows up as a sibling..

quaint radish
#

ai is top right, sight sense visualized bottom left

#

checkbox checked

#

same result

#

clean slate project works fine without the controller being attached as a child. Perception component follows.

ocean wren
#

it says your pawn name is ai spawner? is that right?

quaint radish
#

hmmm oh dear

#

haha brb

#

let me see if that indicates a source of the problem. should not be the spawner.

#

good eye haha

ocean wren
#

yeah, doesn't sound right to me

quaint radish
#

the spawner is not even a pawn so no idea why thats possible or didnt give an error

quaint radish
#

alright

#

updated

#

same issue remains

#

worth mentioning that this project is shared with programmers/c++. Maybe theres something related to how components are handled with c++ that each component needs to be told to stick with the drone/actor?

ocean wren
#

Take a picture of your scene outliner for the AI, does the controller sit at the same level or as a child of the thing its controlling?

quaint radish
#

as a sibling for both projects

#

work day is done for now but can confirm it working on my side project with controller as a sibling

#

screenshot of drone moving forward (through walls because collision lolz) with sight radius/aiperception debugger on.

#

controller not attached to ai drone

#

movement speed was set at begin play within the ai drone event graph.

#

not sure why the eye icon is closed in the outliner for the controller.. possibly because it doesnt have 3d components.

woven bobcat
#

hey guys i wanna ask,does making custom statetreeconditon class wont make whatever blueprint class inherit from it appear in StateTree schema condition list?

#

i make a custom condition class taht have another blueprintimplemntableevent that has input of Actor but when declaring it in statetreeschema,that blueprint class that inherit from that custom conditon class wont appear

#

anyone can check this code to see what's wrong?

#
// Fill out your copyright notice in the Description page of Project Settings.


#include "StateTree/Conditions/STActorConditionBlueprintBase.h"
#include "CoreMinimal.h"
#include "StateTreeExecutionContext.h"
#include "BlueprintNodeHelpers.h"

//----------------------------------------------------------------------//
//  USTActorConditionBlueprintBase
//----------------------------------------------------------------------//

USTActorConditionBlueprintBase::USTActorConditionBlueprintBase(const FObjectInitializer& ObjectInitializer)
    : Super(ObjectInitializer)
{
    bHasTestConditionActor = BlueprintNodeHelpers::HasBlueprintFunction(TEXT("ReceiveTestConditionActor"), *this, *StaticClass());
}

bool USTActorConditionBlueprintBase::TestCondition(FStateTreeExecutionContext& Context) const
{
    if (bHasTestConditionActor)
    {
        FScopedCurrentContext(*this, Context);
        return ReceiveTestConditionActor(GetOwnerActor(Context));
    }
    return false;
}

//----------------------------------------------------------------------//
//  FStateTreeBlueprintConditionWrapper
//----------------------------------------------------------------------//

bool FSTActorBlueprintConditionWrapper::TestCondition(FStateTreeExecutionContext& Context) const
{
    USTActorConditionBlueprintBase* Condition = Context.GetInstanceDataPtr<USTActorConditionBlueprintBase>(*this);
    check(Condition);
    return Condition->TestCondition(Context);
}
#
// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Templates/SubclassOf.h"
#include "StateTreeConditionBase.h"
#include "Blueprint/StateTreeNodeBlueprintBase.h"
#include "Blueprint/StateTreeConditionBlueprintBase.h"
#include "STActorConditionBlueprintBase.generated.h"

struct FStateTreeExecutionContext;

/*
 * Base class for Blueprint based Conditions.
 */
UCLASS(Abstract, Blueprintable)
class CREATIONARTTOOLS_API USTActorConditionBlueprintBase : public UStateTreeNodeBlueprintBase
{
    GENERATED_BODY()
public:
    USTActorConditionBlueprintBase(const FObjectInitializer& ObjectInitializer);

    UFUNCTION(BlueprintImplementableEvent)
        bool ReceiveTestConditionActor(AActor* OwnerActor) const;

protected:
    virtual bool TestCondition(FStateTreeExecutionContext& Context) const;

    friend struct FSTActorBlueprintConditionWrapper;

    uint8 bHasTestConditionActor : 1;
};

/**
 * Wrapper for Blueprint based Conditions.
 */
USTRUCT()
struct CREATIONARTTOOLS_API FSTActorBlueprintConditionWrapper : public FStateTreeConditionBase
{
    GENERATED_BODY()

        virtual const UStruct* GetInstanceDataType() const override { return ConditionClass; };
    virtual bool TestCondition(FStateTreeExecutionContext& Context) const override;

    UPROPERTY()
        TSubclassOf<USTActorConditionBlueprintBase> ConditionClass = nullptr;
};
#

ping me if you can

terse panther
#

Hey there everyone, a small question how would you make AI remain in a specific area or volume and it cannot leave that particular area?
I am asking this in the context of an open world where the nav mesh is generated for the whole world and AI is using Nav invokers.
thank you.

slender gale
lusty nebula
terse panther
celest python
#

you can use a service to set decorator

#

and if decorator returns true, trigger returning back behavior

lapis grotto
#

Has anyone seen any problems with sequence nodes in 5.1? I have a BT that worked properly in 5.0 and the same sequence node does not advance in 5.1 (does not fail, simply doesn't play the children in sequence).

golden scarab
#

Hey everyone, i have a question about combining GAS and BT. I want to create a task that activates GAS ability and finishes execution when ability ends. I thought about using InstanceMemory but i'm not sure there is a way to use it for that particular goal. Any ideas how to approach this?
As alternative I can instance this task and just call FinishLatentTask directly from ability. But then there is another question, how taxing it is for performance to instance a BT Node? How bad would it be, if, for example, 50 ai pawns called a dud ability from instanced task node every 5 seconds?

lapis grotto
#

@golden scarab You could activate the abilities via event, pass in the BTTask as instigator (so you have a reference to it), wait and then call FinishLatentTask once the ability has ended.

#

But you could also just finish the task normally after the ability has activated and add a decorator that stops it from advancing if a certain tag is applied.

terse panther
woven bobcat
#

but with the internal classes,making a bp child of the baseclass showed the bp class in the ditor just not the custom child of the bp one

#

😦

lapis grotto
lapis grotto
feral grove
#

hi I'm new to UE and currently trying to get the MassSpawner from CrowdAI working, while using different vehicle assets. I followed some tutorials, but my vehicles are not driving correctly and my error log is spammed with "Attempting to move a fully simulated skeletal mesh /Game/PolygonCity/Maps/UEDPIE_0_Demonstration.Demonstration:PersistentLevel.BP_Sedan_C_1.VehicleMesh. Please use the Teleport flag"
Does anyone know how to get rid of this error?

crystal hatch
feral grove
#

ok, thank you :)

dusk pewter
#

@lapis grotto I redid the ai btt, bt and bb with a new controller with a task of rotating in place. This worked. I will try the delay

grand halo
#

I am having issues with my NavMesh preview not showing up. I'm not sure if it's invalid or just not drawing. I can press P but it won't show up... Is there any setting i may have ticked off or so?

grand halo
dark topaz
#

when should I call a blueprint function instead of doing the logic directly inside of a task

#

example: predict location of an actor 1 sec from now

#

should this be a blueprint function called through a task in the AI Tree?

manic karma
dark topaz
#

I think this is what I meant by "calling function through a task"

#

it's like

#

I have the character blueprint

#

and their AI Tree

#

and by "calling a blueprint function" I meant calling a function inside the character blueprint

#

or am I getting more tangled here? I genuienly don't know

dusk pewter
misty gale
# dusk pewter

You also need a delay on the false part of the branch to avoid infinity loops

dusk pewter
#

either way it didn't work, on mobile the behaviour tree isn't being run

#

I made a basic tree where the BTT is to spin in place, and that one works

woven bobcat
misty gale
#

Causing infinite loop

#

Adding a delay keeps the loop, but allows life to move on, and perhaps whatever stopped the bt from starting changed its state

#

If not, we stilll have the loop, but its not blocking anything (read game thread)

dusk pewter
#

oh

#

i see

uneven cloud
dusk pewter
#

Does anyone know what this means in terms of what he did?

sacred holly
#

Is there any ways to make behavior trees reusable?
I have tried using dynamic behavior trees but it seems like the blackboard owners HAVE to be the same.
This makes it so that i cannot create modular behavior trees. I cant for example make a retreat function that I can call in the BT of both my knight and archer.
Is there any way I can make behaviors (inside a behavior tree), that use its own blackboard, so that I can use it for multiple enemies?

It seems like dynamic behavior trees can do somewhat do this, however, you cant have dynamic trees within these dynamic trees

golden scarab
uneven cloud
misty gale
dusk pewter
#

does it sound like its at runtime or in editor? @misty gale

#

I tried the editor route unsuccessfully and I am not sure how you would do that at runtime

uneven cloud
sacred holly
#

Besides, if I had to do this for each behavior, the BB(blackboard) would get massive

uneven cloud
sacred holly
uneven cloud
sacred holly
#

Im just trying to create the most modular behavior system I can think of. I'd like to be able to change behaviors in runtime and have small, compact behavior trees

#

And not end up with huge trees and messy blackboards and such. I guess it takes a different design vision with just 1 blackboard. I dont like to create dependencies and I might forget where I changed the location BB value anywhere for example

uneven cloud
#

Mine are incredibly modular. You really only need a MoveTo vector blackboard key that will handle any move to. It's a retreat location if it's retreating. Its an attack location if it's attacking. It's a wander location if it's wandering.

sacred holly
#

yeye i get what u mean xD. I'll have to take a look at it. I thought of doing it that way, but wasn't sure about the approach

misty gale
dusk pewter
#

i set that up in the project settings

#

apparetnly should have an impact and all but saw none

misty gale
#

But isnt dynamic only around invokers?

#

My memory about it has faded

dusk pewter
#

invokers?

dusk pewter
misty gale
#

Nah I was just airing thoughts, wasnt sure it'd even help in your case

uneven cloud
misty gale
#

Ah yes, there was another option for that ! To only generate around the invokers.πŸ‘Œ

dusk pewter
#

i mean im gonna try now without a behaviour tree

#

I exhausted almost all attempts at using a behaviour tree for mobile android

#

and in all cases it seems to fail

pastel pumice
#

So porting a very large simulation to UE where I have been using recast directly with my own layer for pathing across navigation meshes. But with all the 64 bit stuff in UE 5 was wondering if they had something that solved this baked in?

#

To be clear pathing over navmesh boundaries, where the world is too large for just a single navmesh

sacred holly
dusk pewter
#

so neither does this work on mobile but works on PIE

#

gonna move this in the mobile channel since it doesn't seem to be an issue with the AI, but overall the mobile aspect

#

ty

misty gale
#

Whats the fail reason?

dusk pewter
#

At this point I have no idea :/

#

I made a thread to log what I did and I tried everything to no avail

#
#

It always works on PIE and on packaged computer builds

#

but in packaged android builds, anything related to movement fails

#

I thought the nav mesh was at fault and I tried to make it dynamic and rebuild it, works fine on PIE, doesn't do anything in Android

#

but when I created a BT with a task that is NOT move to, it worked!

#

so it seems to be movement related, but maybe not nav mesh related?

misty gale
#

Sounds very much navmesh related

#

Any other movement type probably just works

#

When you "GetRandomPointInNavigableRadius",

dusk pewter
#

other movement like what?

misty gale
#

Does the return bool go true or false

dusk pewter
#

hm

#

lemme check

misty gale
#

Other movement method like simulated movement inputs (just like a player moves, using add movement input(not saying its a valid option for this case, just making a point about it likely being related to nav movement specifically, and not movement itself))

dusk pewter
#

yep, packaging

#

bear with me, takes forever

misty gale
dusk pewter
#

the issue is that it takes a bit longer to package for android and THEN have to upload it

#

and hope that google play updates it fast

misty gale
#

Crossing fingers that i never have to do android πŸ˜…

#

Sounds like a lot of work just to check the return bool from that function

dusk pewter
#

yes it takes this long

#

lol

#

and no i am not running a potato, the PC output takes about 2 mins

#

alright drumroll

#

@misty gale

#

Good catch

#

It is set to false and no vector is obtained

#

so this is failing

granite mesa
#

Hey
How much does it cost to create AI enemy walking in set of paths and detect enemies and apply some attack patterns?

slender gale
sacred shale
#

is there a way I can set the duration of a "Wait" node on a behavior tree from a stored blackboard key?

#

it seems like you can only manually add a regular or random deviation to them

cursive stag
#

Could someone kindly remind me what the console code is to see all generated nav meshes - not just the default?

dusk pewter
#

@sacred shale using the bt only no. You would need to create a btt that tasks to wait as per the blackboard.

#

@cursive stag show navigation

sacred shale
#

is there like a wait function I can add to my BTT?

dusk pewter
#

Delay?

sacred shale
#

thats it

dusk pewter
#

I haven't done it but that is how I would do it

cursive stag
sacred shale
#

i'm making my nodes in C++ so would I have to refactor it for blueprint to use the BP delay?

dusk pewter
#

@cursive stag hmm??? Can you show screenshot

#

@sacred shale oh, cpp.... not sure if the function is called wait. I would ask the #cpp

sacred shale
#

thanks

cursive stag
#

@dusk pewter

dusk pewter
#

That is weird

#

In editor you can see both with p shortcut?

cursive stag
#

no

#

p just toggles the 1

dusk pewter
#
uneven cloud
hearty niche
#

Can I make a navmesh invoker generate a certain area of the navmesh manually?

#

So by default it does not generate the navmesh but if I call a function it does? I have an open world setup and I want my smart object managing encounters to be able to manually generate the navmesh in the combat area. Dynamic Navmesh generation and generatio around invokers is on.

woven bobcat
crystal hatch
crystal hatch
celest python
# dusk pewter

i didnt read the convo above but since its a pure node you are evaluating the function twice

#

since its connected three* times

misty gale
#

Also theres an impure version of the node in newer ue versions. Recommend using that πŸ™‚

hearty niche
#

So I was thinking of blocking them by navmesh

crystal hatch
hearty niche
crystal hatch
hearty niche
#

Manually deciding if the invoker is gon s have a navmesh generated around it.

#

Also I'm thinking of manually deciding points AI stands at if the player leaves the zone

crystal hatch
crystal hatch
neat marsh
#

How do I properly stop/remove/destroy an AI controller? I've tried unpossessing, stopping logic, destroying etc. but it hangs around in the outliner (even when it detaches from the pawn) and keeps executing stuff

neat marsh
#

Thanks, i've tried that one I end up with the same thing, it sticks around and keeps printing debug strings

crystal hatch
neat marsh
#

At the moment the pawn calls an event to the controller to destroy actor on itself after a delay and then calls detach pending destroy on itself. It's all just debug strings in the output log

#

Controller:

crystal hatch
#

as the very first thing on death UnPosses the pawn

neat marsh
#

Tried every combination of unpossess and detach, seperately and together with no luck

#

Thinking its something to do with this visAI plugin...

#

Do active timers stop actors being destroyed?

misty gale
#

No

slender gale
dusk pewter
#

@misty gale my next step was checking if 5.1 was a good packaging engine because 5.0 was pitifully bad

paper kettle
#

How can I determine corners in the path ?

woven bobcat
misty gale
dusk pewter
#

@misty gale I mean I can tinker with the function in c++ but I just don't understand why it fails. Because the nav mesh system doesn't work?

#

I tried reloading the nav system through command and c++ and each time it was successful when using the callbacks

#

So what is left....?

misty gale
#

Im not really sure. It seems the ai is unable to find a location to navigate to, for some reason...

#

Like it cant find any navmesh

sacred shale
#

does anyone know why my AI is still running after I cut off the first arrow off the root node?

#

I'm seriously so confused, it shouldn't run, the only node that's running is the root node and my AI is still behaving like the nodes are connected when the root node is disconnected from everything else

harsh storm
#

Well no one could possibly know without any code or what you're even talking about

#

What is the "first arrow"?

#

Root node of what?

sacred shale
#

this shouldn't be running but it is

#

@harsh storm

harsh storm
#

Β―_(ツ)_/Β―

#

Haven't ran into this before

sacred shale
#

this is so weird

#

this like goes against all logic I've ever known

#

am I even real

#

is the universe even real

#

what's even happening

#

its the equivalent of commenting out beginplay and it still triggers beginplay

prisma lake
#

You have a duplicate file hooked up

#

Or you only think it's running

sacred shale
#

no it is running, the behavior is running as though the nodes are connected, changed a wait node from 1.5 to 10 seconds despite not being connected and it was running as it (shouldn't) have

prisma lake
#

Duplicate the file and delete the original

haughty coral
#

@crystal hatch This looks reasonable and can prevent people shooting in foot when accidently doing stuff with them on the client but I wonder could it be that maybe client wants to get nearby smart object to display some cosmetic stuff like interaction widgets even if it might not be exactly in sync? If I understand correctly, without the subsystem, the player will need to receive these from the server.

crystal hatch
# haughty coral <@333981651245727755> This looks reasonable and can prevent people shooting in f...

The main reason for this is that we don't support client-side smart objects just yet. People could try and would report issues, while we don't really expect it to work. Plus this change is a direct fix to client-side GC complaints - if you have SOSubsystem on the client, and you register smart objects with it, the smart objects will hang in limbo in PendingSmartObjectRegistration that will never get consumed but does reference the ubjects potentially blocking GC from removing them.
We will support client-side smart objects in the future, especially that there is internal work to support player's interaction with smart objects.

haughty coral
#

Great, that is all I need to know, thanks a lot!

dusk pewter
#

@misty gale I noticed the impure exists in 427 and there is a reachable and navigable flavor

#

Gonna test the other 2

uneven cloud
terse bear
#

shouldn't a blackboard be shared between all AI agents?

#

I mean I know it's shared but in my case I have subtrees

unborn jungle
#

Generally, how do games that have massive open worlds with roaming AI handle navmeshes? Do they use that dynamic navmesh that is always generating around the player (invokers)? Are there any new options introduced with UE5?

uneven cloud
harsh storm
#

Well - it depends. Many ways you can handle this.

unborn jungle
harsh storm
#

You can do the nav mesh streaming that Luthage mentioned, you can just have some zones that have navmeshes, you can have preplanned routes and then do more simple local nav stuff as well.

unborn jungle
#

Nice! In my case the world is like valheim so technically AI can be anywhere and can follow you anywhere too so it would seem either a gigantic streamed navmesh or the invoker would be the way to go

#

I just don't want the game to be constantly eating performance from it constantly rebuilding but maybe that's how games like Fortnite do it

uneven cloud
unborn jungle
#

So you'd have a giant navmesh bounds volume covering the entire world for this?

uneven cloud
#

Invokers are incredibly expensive.

unborn jungle
#

yeah and also limited range so you couldn't see an AI more than a medium distance away walking

#

I'll look into the streamed navmeshes, hopefully moving a single rock won't rebuild the entire thing each time

#

Are there any docs on this feature? All I can see from a brief search are people asking about navmeshes with level streaming

uneven cloud
#

Not that I know of. I don't think you have to actually do anything in 5 for it to work. 4 you had to build the nav mesh in a very specific way, but I don't think that's the case in 5.

unborn jungle
#

Yeah at least in UE4 if I tried a single large navmesh it would take an impossibly long time to build once the size goes over about 100K units, wouldn't be feasible for a very large open world with decent precision

#

I really wonder how Fortnite does it since it's a large world AND everything is destructible

#

So the navmesh must be at least semi dynamic

harsh storm
#

They don't need a navmesh

#

It's all players

unborn jungle
#

No there's loads of AI walking around

harsh storm
#

Must've changed that

unborn jungle
#

They can follow you up stairs and open doors

#

Yeah they've added many AI over the last few years

#

Not to mention the recent Horde Rush mode where there are literally 50+ zombies all running after you on the large map

#

Reacting to destroyed walls and everything

#

I'm very curious what kind of navmesh setup they are running

harsh storm
#

Maybe Mieszko will chime in about that πŸ˜…

#

(I just assume he knows what's happing in the Fortnite world being an important AI person and all πŸ˜…)

opal crest
#

There were some posters early in UE5 release who commented that UE5/late UE4 had some changes that made Nav invokers unnecessary in open world maps. (I think it was WorldPartition specifically that helped with that, but there's also ZoneGraph that looks useful for long range nav.)

crystal hatch
harsh storm
#

Not the STW side btw

#

@unborn jungle For awareness

crystal hatch
#

let me know if you have follow up questions

harsh storm
#

So, one big navmesh, then you examine what is a dirty area (what does that mean for ya'll?) and get rid of that specific part?

crystal hatch
harsh storm
#

Ah - do it this way so it isn't constantly trying to rebuild? So you just flush once more or less?

crystal hatch
#

the main point is to avoid initial rebuild of the whole map - the map is so large that most areas will not change from the initial state, and we can build navmesh for that off line, in the editor or via commandlets.

harsh storm
#

Yeah - that's what I was getting at more or less.

#

Makes total sense.

dusk pewter
#

@misty gale so using this I get a false boolean but I do get a vector

#

gonna bring it up to CPP, I am not sure what is happening here

crystal hatch
harsh storm
#

Is there a way to maybe expose this as a simple checkbox? (if it hasn't been already) I've never really had to mess with a giant navmesh to be honest, lol

#

Or anywhere that I can look when it comes to side stepping the dirtying of the navmesh on load

crystal hatch
harsh storm
#

🀩

dusk pewter
crystal hatch
dusk pewter
#

this is in UE4

#

4.27.3

#

but built from source, so I can mod stuff if needed

crystal hatch
dusk pewter
#

dynamic, i can try it back on static but no dice on either so far

#

i'm checking out if i disabled AI somewhere somehow but like I said, it works fine on PC, but fails in android

crystal hatch
crystal hatch
# dusk pewter

I don't think so but I don't have any hard suggestions for you, so I your guess is as good as mine πŸ™‚

dusk pewter
#

ty

crystal hatch
dusk pewter
#

Yes and no. 5.0 was not a good build so I worked on 427

#

Ibsaw they fixed a lot in 5.1 so I might give it a shot

crystal hatch
misty gale
#

I guess first thing is replicating the issue in a new project, be it 5 1 or 4.27^^

haughty coral
#

lol I found out just yesterday and was going to do a PR today

crystal hatch
dusk pewter
#

@crystal hatch @misty gale
I get that but when 5.0 launched, a month later the Google play store required a bunch of updates that barely made it into 5.1 so you couldn't publish

paper kettle
uneven cloud
young lintel
#

Is there a way to use multiple nav mesh bounds in one map but then allowing AI to move between them?

#

Like, one per tile on a very large world partition landscape, for example

unborn jungle
#

Also a side question, how can I pre build navmeshes on sublevels while keeping them dynamic? ( I have a lot of small sublevels in my game (only one is ever loaded at a time) that need only minor secondary rebuilds at runtime, but I've tried all the hacks on the forums but haven't found a way to cleanly build a navmesh for each sublevel to reduce the runtime cost- it appears to generate navmeshes freshly each time a sublevel is loaded, regardless of whether I had prebuilt them in editor before)

#

Tried all kinds of combos by having the nav mesh bounds volume in the persistent level or having separate ones in each sublevel. There are a few forum posts explaining methods to get this to work but I haven't succeeded unfortunately

solid pond
#

I'm trying to see if I'm getting a hit on my player character from the AI but for some reason it only returns false even though I can see it hit, why is this the case?

lapis grotto
#

Does State Tree come with any type of debugger or way of seeing what the graph is currently executing?

haughty coral
#

for now I use VLogs and print tasks

lapis grotto
#

Also, the checks for GAS Tags look for containers on the actor and not at the ability system component of said actor. Who the hell stores loose tags for abilities?

haughty coral
#

ASC owner actor usually implements IGameplayTagAssetInterface which returns tags from ASC.

#

Did anybody use Smart Objects for covers? I wonder how crazy of an idea it is. Not sure if spawning thousands of SOs everywhere and sometimes even dynamically is ok. What discourages me is that there is no nice way to create SOs dynamically in a more lightweight form than a component. Definitions don't seem to be expected to be easily created during runtime what means I would need to spawn single component with single slot per every cover point. That sounds like a lot. Was hoping to do something like this but with SOs https://www.unrealengine.com/marketplace/en-US/product/ai-cover-system . Its API looks almost like SO API, so imo it is a reasonable idea but I am not sure if the SOs are already shaped enough for this at the current stage.

Unreal Engine

A code plugin framework to implement cover mechanics for an AI. Fully procedural and dynamic - set up it only once, and it works everywhere.

lethal helm
#

feels like the only type of game that would want the navmesh to get rebuilt on load would be like runtime procedural generation sort of deals

lethal helm
#

just a LOS test on the target that fails if there is LOS at crouch height

uneven cloud
young lintel
#

Ah, thanks... just means I have to make a prohibitively large nav bounds

#

I have to rebuild it from the command line but the behavior is sketchy

#

I get errors about it being too large

#

Even on an 8x8 km landscape

uneven cloud
#

What version are you on? I remember seeing in the 5.1 release notes they made it so it can be built on larger worlds.

young lintel
#

5.1

#

heh

lethal helm
#

maybe we will get nav mesh 2.0 some day

young lintel
#

It seems like the error messages are inconsistent with how I'm resizing it, as though it's using some kind of cached values somewhere

lethal helm
#

it's a real resource hog

young lintel
#

It sure is

uneven cloud
#

It's not based on size of area, but on amount of memory.

young lintel
#

I wish I were smarter, I'd build my own nav mesh, with blackjack and hookers.

#

Yeah, I only have 32gb of ram

#

I guess it's time to upgrade

#

"Dear, I need to buy a computer with 128gb of memory. For, reasons."

uneven cloud
#

You can increase the cell size or remove areas where they shouldn't go with modifier volumes.

young lintel
#

Does that reduce the total ram needed to calculate it?

#

(modifier volumes?)

uneven cloud
#

It's not that you don't have enough ram, it's that they hard coded a max size for the nav mesh.

young lintel
#

It seems like the max size would be larger than 64 square km

#

I mean I know that's not small, but

#

It's not large compared to some of the massive terrains they've showed off

lethal helm
#

they are called nav modifier volumes

uneven cloud
#

It's not area size, it's memory size.

lethal helm
#

for example unpleasent terrain you can just toss a null nav modifier on it

#

no more navigation there

young lintel
#

Right but does adding those reduce the total memory needed to calculate the whole nav mesh?

uneven cloud
#

It reduces the amount of memory needed to hold the nav data.

young lintel
#

Hmm

lethal helm
#

less nav data less juice

young lintel
#

I'll look into that, it can't hurt, at least

#

Thanks

#

Kind of a double edged sword, though, my player pawns are AI controlled, so

#

If I eliminate nav mesh it means the player can't walk there either

prisma lake
#

64 SQ km is big for navmesh, I imagine too big

#

Increasing cell size will help but will reduce accuracy

dusk pewter
#

@misty gale @crystal hatch It works in 5.1
I am going to try a fresh 4.27.3 custom project and see if something is amiss, probably tomorrow

dusk pewter
#

hah and now my engine is broken, goshdarn it

misty gale
#

Well thats the right kinda progress atleast!

crystal hatch
crystal hatch
crystal hatch
# lapis grotto Wowzers. And they call this production ready?

It's usable and by "production ready" we mean "it's here to stay, the API won't be changed overnight, and what will change will get deprecated and have a clear update path". It doesn't mean "it's all it will ever be" which is good because we have a ton of more features in mind.

little hull
#

Which one is more optimized EQS or Get random point navigable radius?

#

This is eqs way to roam

#

And this is alternative. Which one should I use in game that contains lots of ai's in open world?

crystal hatch
timid condor
#

Anyone come across a bug where an AI seemingly ignores its target location's Z-value in all move-to nodes?

In my project there is a landscape the AI moves on but also a cave system below the landscape where the AI is supposed to traverse in certain situations. I'm very specifically telling my AI to move to a location in the caves (at about -9000 Z-value) but it will always move to that location above ground (about -5000 Z-value) with the same XY values as the desired location. What's very annoying is that movement always succeeds even though it's clearly 5k units off. I know for a fact I'm inputting the correct values, because if the AI is already in the caves it will go to the correct location. It should also be noted that it 100% is able to reach it via the nav mesh, as my current solution has been to force it to move to authored points gradually, which lets it get to that location but moving directly there (skipping everything in-between) does not. I'm looking to move it directly there as my current solution has a lot of problems

I'm wondering if Z is ignored in AI movement if X/Y is close enough?

night forge
#

Anyone experienced with Behavioural Trees in C++?

unborn jungle
night forge
#

My decorator won't self abort if value is changed :/

crystal hatch
night forge
#

Works in BPs

crystal hatch
unborn jungle
#

UE4 (4.27). Regular level streaming- a persistent level that is empty essentially (just a skybox) that loads in small levels at runtime

#

Only 1 is ever loaded at a time but it seems to always freshly create the navmesh even if I had built it before playing in the editor

crystal hatch
# night forge Works in BPs

have you tried looking at other native "self aborting" decorators? Or at the BP-implementable decorator's native base class to check how it's set up?

night forge
crystal hatch
crystal hatch
# unborn jungle Only 1 is ever loaded at a time but it seems to always freshly create the navmes...

the navmesh instances that come from sublevels are discarded, by default. You could try setting NavigationSystem's bShouldDiscardSubLevelNavData to false (via ini file or project settings). If there's only ever one at a time it might work. You'll also probably need bAutoSpawnMissingNavData = false, set this via Navigation System Config in World Settings for your persistent map. And see where it gets you.

unborn jungle
#

Huge thanks, really appreciate that!

#

I'll try these tips out

#

Would be great to help the runtime cost as currently I just hold a loading screen until the OnNavigationGenerationComplete delegate fires

#

But it could be about 10x faster if it only had to do the minor dynamic corrections and could be generated offline per sublevel

rich veldt
#

hi, i'm having a hard time conceptualizing how to use the behavior tree for behavior that would be multi-step. like, "go to this location. once that's done do this. then do this."
my move to task is asynchronous, it immediately returns success and the task doesn't tick. movement to the location requested is then handled in the controller's tick. but for this particular behavior i want to wait while moving then continue through the next part of the behavior.
so i was sort of conceptualizing it by having a "holding" part of the tree to hold up the behavior there when the AI is moving, and when the AI stops moving to continue through the tasks. is this achievable?

#

i mean is this an achievable flow of logic in the behavior tree, my move to functionality and changing of the blackboard condition bMoving works perfectly fine. assuming that bMoving is always correct, it's true immediately after calling the CustomMoveTo task and is set to false as soon as the AI reaches its desired location

crystal hatch
rich veldt
#

in that case do i tick in the task to just check if bMoving is false and if so then return success?

#

or i suppose i could make a new custom task which ticks and doesn't Finish/return until bMoving (or whatever bb key i want) = false (or whatever condition i want) huh...

#

🀯

#

ill call it WaitUntil lol

crystal hatch
rich veldt
#

umm...function? like..inside the custom move to task?
my own function lol

#

my ai's movement input/input consumption is all custom and ran from the controller's tick. so asking what "function" i use for it is kinda vague.

crystal hatch
rich veldt
#

it's adapted. but the base ai moveto function itself no i am not using it.

#

i just use character movement component and pathfinding

crystal hatch
#

so it sounds like your systems is missing notifies on "movement finished" that you could be waiting for in your BT move task, that would gate the return of Success

rich veldt
#

nah

#

thanks though! figured it out like 10 messages ago πŸ˜›