#gameplay-ai

1 messages · Page 56 of 1

gentle widget
#

It gets stuck in the "Move To Location" state

#

It works all of once, it just never exits the state

misty wharf
#

Are you sure the move to target location task actually finishes at some point?

gentle widget
#

Uh

#

Hm... actually it might not be

#

I'll past the task code, opening IDE right now.

#

90% sure I'm doing something wrong cause it doesn't work lol

#
{
    FMoveToTargetLocation_InstanceData InstanceData = Context.GetInstanceData<FMoveToTargetLocation_InstanceData>(*this);

    if (AEnemy_AIController* Controller= InstanceData.Enemy_AIController)
    {
        if (APawn* Pawn = Controller->GetPawn())
        {
            UAIBlueprintHelperLibrary::SimpleMoveToLocation(Controller, InstanceData.Location);

            /*
            if (Pawn->GetActorLocation() == InstanceData.Location)
            {
                const FStateTreeTransitionResult TransitionResult;
                ExitState(Context, TransitionResult);
            }
            */
            return EStateTreeRunStatus::Running;
            
        }
    }
    
    return EStateTreeRunStatus::Failed;
}```
#

I commented out a test case for exit state because that didn't work either.

#

I'm guessing I might need to change that return from Running to Succeeded? I thought that would also make it stop executing though

#

Oh and move it into the scope for that if statement checking locations

floral compass
#

I do not use the Tick function so I don't know for sure, but at least the "EnterState" will keep you in that state if you return "Running".
Anything else will immediately move to the next state (or whatever you have set up)

gentle widget
#

For the movement logic, EnterState was not working. The AI Actor wouldn't move at all

#

I had to use Tick to get it to actually move

floral compass
#

I mean

#

Override the EnterState and return Running

misty wharf
#

Success and Failure will end the state

floral compass
#

And do the MoveTo on tick

gentle widget
#

Oh I see

floral compass
#

Also there are some bools you might wanna check

gentle widget
#
{
    FMoveToTargetLocation_InstanceData InstanceData = Context.GetInstanceData<FMoveToTargetLocation_InstanceData>(*this);

    if (AEnemy_AIController* Controller= InstanceData.Enemy_AIController)
    {
        if (APawn* Pawn = Controller->GetPawn())
        {
            UAIBlueprintHelperLibrary::SimpleMoveToLocation(Controller, InstanceData.Location);

            if (Pawn->GetActorLocation() == InstanceData.Location)
            {
                return EStateTreeRunStatus::Succeeded;
            }

            return EStateTreeRunStatus::Running;
        }
    }
    return EStateTreeRunStatus::Failed;
}```
floral compass
#
    /**
     * If set to true, the task will receive EnterState/ExitState even if the state was previously active.
     * Generally this should be true for action type tasks, like playing animation,
     * and false on state like tasks like claiming a resource that is expected to be acquired on child states.
     * Default value is true. */
    uint8 bShouldStateChangeOnReselect : 1;

    /** If set to true, Tick() is called. Not ticking implies no property copy. Default true. */
    uint8 bShouldCallTick : 1;
    /** If set to true, Tick() is called only when there are events. No effect if bShouldCallTickState is true. Not ticking implies no property copy. Default false. */
    uint8 bShouldCallTickOnlyOnEvents : 1;

    /** If set to true, copy the values of bound properties before calling Tick(). Default true. */
    uint8 bShouldCopyBoundPropertiesOnTick : 1;
    /** If set to true, copy the values of bound properties before calling ExitState(). Default true. */
    uint8 bShouldCopyBoundPropertiesOnExitState : 1;

    /** If set to true, TriggerTransitions() is called during transition handling. Default false. */
    uint8 bShouldAffectTransitions : 1;

    /** True if the node is Enabled (i.e. not explicitly disabled in the asset). */
    UPROPERTY()
    uint8 bTaskEnabled : 1;
gentle widget
#

Refactored to this and it still doesn't work so I'll try some more

misty wharf
#

You could also just use the delegate-based moves instead of SimpleMoveTo

#

If you make a UObject-based ST instance data, you can bind delegates to it

gentle widget
#

Is there a built in movement delegate you're referring to or would I just make my own on the actor class?

misty wharf
#

look at how stuff like AITask_MoveTo are implemented

fathom dome
#

Could anyone here share some links that expand on how to read visual logger info?

#

what I'm finding is leaving me very... wanting

misty wharf
#

the vlog stuff is kinda contextual, you have to read what it says and understand it

#

bit difficult to say exactly what everything you might see can mean since there's a lot of different systems that log into it

#

but in general, yellow=warning, red=error

fathom dome
#

I see

#

the single lines

#

that's just a tick of logging right?

gentle widget
#

Also the vlogger is like a timeline, you scrub through it. Something I didn't realize when I first started using it lol

misty wharf
#

Yeah the vertical lines in the vlog timeline are the points in time when something was logged

fathom dome
#

ok

#

when it comes to Ai, like the move to node

#

it will tick multiple times saying something like "moving directly to goal"

#

is this telling me that it just picked up a new instance of attempting to move

#

or just the same instance over time?

#

does that question make sense?

misty wharf
#

if it logs that a lot it kinda sounds like it might be restarting the move again as a result of a new move request

#

but I recall if a new request comes in, it should say something about it and aborting the previous request also

fathom dome
#

ah ok then if that's the case it may be the same call

#

this is what i'm trying to interpret

#

specifically the top line which is all blue ticks (the second line is an actor outside of the navmesh so fails every time)

#

this last segment to actor visual thing

#

is that where the actor wants to be or where it is?

#

or is it the red arrow?

misty wharf
#

I think the red arrow is where the moving actor was at the time

fathom dome
#

ok

#

that makes sense

misty wharf
#

You should be able to see it if you look at the different logs when it's moving, the red should move with it then

fathom dome
#

ok that makes sense

#

I'll try to do that

#

I'm also trying to figure out how to see the target its moving to

#

is there a button to see these visuals as its logging?

#

instead of just as snapshots?

misty wharf
#

iirc the gameplay debugger has a navigation category which shows the navigation stuff as it occurs

#

' should open that one when you are in PIE

#

if it doesn't enablegdt in console opens it

fathom dome
#

ah yeah

#

i guess I was trying to see it after though

#

but that's ok

#

neoexcidious gave me some advice but i'm not really sure how to execute on it

#

I think I need to understand these tools better

#

ok after looking close at how the behaviour tree runs I don't think it is having issues of overwriting ongoing tasks

uneven cloud
#

I actually got an interesting recruitment email from id that I was considering before the last round of Microsoft layoffs. Glad I didn't pursue it.

#

You want to block pathfinding. How you do that depends on if you are using C++ or not.

#

Well you are using pathfinding which is constrained to the ground.

uneven cloud
uneven cloud
dire fable
#

because movement can be blocked, but the AI can still attack or rotate

uneven cloud
dire fable
#

do we have a method to pause path following ?

uneven cloud
dire fable
gusty maple
#

I'm calling Ai MoveTo every tick, is this bad for performance? Should I just use add velocity for basic enemies?

#

Im talking 50-100 running at once

dense owl
#

There are optimizations you can make if your perf suffers

gusty maple
#

Is there an alternative to AI MoveTo that doesnt bug out with launch character?

#

wait nvm

tawdry zephyr
#

Hey @crystal hatch I can't DM you since the server changes. You put me onto a good contact for the animation stuff and we got fixes in for 5.4.

I'm using the Mutable plugin in production and the initialization path is undocumented and broken. I've made a plugin that handles initialization but a lot of this should probably be incorporated into the base plugin. The plugin works with all net modes. I've made a few PRs too since you literally can't initialize in a sane manner without it.

I do have UDN access but we don't use Mutable for work so probably better not to use it for that.

Could you pass along my plugin to see if they want to use it as a resource for fixing or improving Mutable?
Links:

https://github.com/Vaei/MutableExtension
https://github.com/EpicGames/UnrealEngine/pull/11859
https://github.com/EpicGames/UnrealEngine/pull/11864
https://github.com/EpicGames/UnrealEngine/pull/11870
undone stream
uncut rune
#

Is it ok generally to use 1 blackboard for all different kind of characters and different behavior trees? Or should I create own bb for each even if they share some keys, but other characters don't use them and use others?

gentle widget
gentle widget
misty wharf
#

You would need to make your instancedata an Uobject and then bind to that

#

there's some builtin ST tasks which do this

floral compass
gentle widget
#

Finally, got it -almost- working.

#

Basically rewrote the StateTreeMoveToTask to do it, albeit a slightly simpler version.

#

Just kidding, I broke it again 😄

uneven cloud
uneven cloud
dim lynx
#

hi, how can I take the point where the AI ​​goes without setting it in a variable?

#

is this even possible?

uncut rune
#

Anyone has time to brainstorm idea with me ? 😄 Sorry for bad pictures I'm not artist. I'm trying to create behavior tree for ranged unit that when commanded to attack, will go to attack range and attack. After thinking a little, I think I have to use EQS to make that and I would just make the ''location to move'' based on furthest distance from the enemy and the shortest path to that point from my unit. Is this correct approach?

frigid plinth
#

can yall help me with a problem im having.... I have a mesh as the floor and its all one mesh but the NPC can only walk on one side????? I have 2 nav meshes for both sides so i have no clue on to why They can attack but they dont walk on the one side but they can on the other

misty wharf
uneven cloud
uneven cloud
deep grove
lament bramble
#

Hi, how to make an AI that can walk on walls and ceilings. I want to create an AI spider. Thank for your help

dense owl
#

Good question. Not sure if you can do this with anything built-in

floral compass
#

I wonder if you could change the direction of the navmesh internally somehow? Surely it's doing a floor trace/scan downwards somewhere, no?

dense owl
#

I guess, but normal navigation is tied into the CMC/PMC so not sure how deep you’d have to go to achieve this

floral compass
#

True, down is the assumption across the entire nav system.
But for a spider (assuming no obstacles on the walls) you could do something manual with BP instead maybe?

dense owl
#

The old smoke and mirrors can work, depending on how contained the scenario is

uncut rune
# misty wharf If you are using pathfinding you could just have it move to the enemy and if it ...

Would you mind telling a little bit more details? Do I still use EQS for that or it's something else? Currently I have behavior tree that when clicked it moves to target and then attacks, but even if someone has attack range, it will move 100cm from the target.. im looking for a way to stop it in inteligent way at the range of target and at the same time don't make it always run to max range when clicked to attack.

floral compass
dense owl
#

Not 180?

floral compass
#

For ceiling 180 yup

#

So duplicate the room 5 times, for each wall and ceiling. I'm sure this has no performance hit at all...

misty wharf
uncut rune
#

If I want to change the circle radius based on what is unitRange, i have to run task before that query to set that?

#

I think I found it

#

will this make the value as UnitRange blackboard key?

uncut rune
#

ok I made it work ! 😄

signal island
#

Guys im making a utility system, do you guys know any reference doc of the system in unreal?

misty wharf
#

You probably should ask the author of the plugin

#

First time I see that kind of thing

misty wharf
#

AI Controllers don't have a "parent" character... I assume you want the character the controller is possessing, which you can do via GetPawn and then cast it

static pagoda
#

hey does anyone have an idea what i need to do so the character can step up on this Stage? I tried adjusting the Cell Height, Agent Max Step Height and Max Slope and nothing seems to work for me, the collissions for this object are complex so they shouldnt be the problem

prisma sun
#

Hey,
I have a bug when using AIController with FloatingPawnMovement, I don't have this bug when using DetourAICrowdController

When I do a MoveTo, the Pawn is going up and not staying on the floor.
Capsule collision is set to BlockAll, setting it to no Collision does not change anything.
Mesh collision to no Collision

Anyone having an idea on why it could happen or how to fix it ?

uncut rune
prisma sun
uncut rune
#

Why you don't want to use Detour btw?

prisma sun
uncut rune
#

which may be something with normal AIController just not properly avoiding other units

#

meanwhile Detour just does everything better if you have ''crowd''

#

I see you are doing something like rts, then you might want to use Detour AI anyway

prisma sun
#

Also every component is having "actor can step on it" to false

dense owl
#

If you were using chars I’d say also increase the capsule radius so they can avoid each other better but yeah

uncut rune
prisma sun
uncut rune
#

Also you can check Acceptance radius to be bigger to like 100 so they will eventually stop before reaching ''exact'' location, but I guess you have it done.

prisma sun
uneven cloud
uneven cloud
uneven cloud
prisma sun
uneven cloud
prisma sun
uneven cloud
#

Detour crowd changes the path so that they aren't going to the exact same location.

#

Having them move to another actor means that they are all trying to go to the same location, that other actor's location.

prisma sun
fleet coral
#

Hey, I have pawns that have variable step heights. They can have it increase/decrease dynamically.

I baked my navmesh with the max step height possible in the game, and now my agents don't treat steps that are within that max range, but above their individual current step height, as an obstacle. Leads them to get stuck in those steps, continuing to apply movement as if the path is clear but they can't step over the obstacle.

Any solutions to something like this? I'd ideally want them to treat steps above their current step height as obstacles.

uneven cloud
uneven cloud
fleet coral
uneven cloud
#

You shouldn't make a lot of them, because each one creates a new nav mesh.

fleet coral
uneven cloud
fleet coral
uneven cloud
fleet coral
#

In theory then, I could setup 2 different agents with 2 step heights, and then if I modify step height dynamically it could select another navmesh to use?

fleet coral
tough ermine
#

questions for ai controller and getting an ai enemy, i got a smash bros like fighting platformer, so all the characters are made, my question is how should i get the ai to work, there are no nav mesh bounds as its a sprite based game and is made based of paper 2d is there a way I can write code into the controller to identify which actions the character to take or should i write bp into the character or what

uneven cloud
#

You need to store that animation somewhere and then have a way to get it. There are many ways you can do that.

uneven cloud
tough ermine
#

well thats the problem, i dont use a nav mesh

#

so im trying to work around that

harsh storm
#

There is more to the AI systems than just the navmesh

dense owl
#
  1. IGenericTeamInterface
  2. Detection by affiliation
    Tutorial over.
misty wharf
copper grotto
#

I'm curious how many people use blueprints vs c++ for ai setup? I started with using blueprints for ai as it seemed fairly easy, but I wonder if it quickly becomes a bit overbearing given all the different components of it (i.e. blackboard, behavior tree, ai controller, etc).

floral compass
#

Don't think there's a clear cut answer, it always depends on the circumstances and context

#

Also all those components exist in c++ too

copper grotto
floral compass
#

I doubt doing it in c++ will magically fix it

#

Have to figure out what's wrong with it

copper grotto
#

Well yea I know that I just am wondering if it might be easier for me to figure it out that way. Debugging in blueprints always feels clunky to me. I can't for the life of me figure out where the problem is. All my googling is showing me what I'm already doing. All of my debugging is showing as all correct up until it's... not. lol. And no idea why.

floral compass
#

My approach would be to first unpossess from the player controller, then possess from the AI controller

#

You can debug the blueprint function in C++ too

copper grotto
#

You have to unpossess first???

floral compass
#

I'd think so

#

Since the player pawn is being possessed by the player controller

copper grotto
#

Well shit, that might be the problem. I thought when you called Possess it would just put whatever you're trying to make possess it in control. I'll try that. Would be fantastic if it's that simple, if not a little frustrating that I've been pulling my hair out on this issue. lol.

floral compass
#

Never make assumptions, need to be pragmatic about it.

#

Never is a strong word, but you get what I mean 😄

copper grotto
#

lol yea. Well, that didn't seem to work right off the bat, but it gives me some ideas of new things to try at least.

floral compass
#

Also I don't think AI controller starts its logic automatically on possess, you might have to manually start it.
But that would be the next step after successfully possessing

copper grotto
#

Yea I've got that stuff in there to run the behavior tree. but for whatever reason the unpossess and possess doesn't seem to be working. I put print strings after each execution node here and each time it's still displaying the BP_ThirdPersonController. I've gotta be doing something wrong but I don't know what?

floral compass
#

First off I'd get the controller from the player character instead of calling "GetPlayerController"

#

That would at least assure that you're trying to unpossess the correct controller

#

Next you can check if your player character is actually being unpossessed by debugging their "Unpossessed" event

#

Also your "Third Person Character Ref" variable doesn't seem to actually have any value. At least not from the screenshot alone.

#

Since you're doing a "Get Actor of class" I assume you'd have to set that into the var first

copper grotto
#

Ah ok now we're getting somewhere. Ok so let me ask you if you don't mind, why did the GetPlayerController not work? My understanding was that Player Index 0 should always be the player if it's a single player game. To my knowledge, I don't have any other player controllers in the game (if I do maybe that's a problem to investigate) so why wouldn't that work the same as getting the controller from the player character?

copper grotto
floral compass
floral compass
copper grotto
#

no, i'm passing the BP_ThirdPersonCharacter into the InPawn.

floral compass
#

Controller should go into the Target pin

#

Oh ok!

#

That's your player pawn, right?

copper grotto
#

Correct

floral compass
#

Then why do GetActorOfClass if you already have it?

copper grotto
#

The GetActorOfClass is getting the ai controller, not the player character.

floral compass
#

Ooh, gotcha. It only says "Player Chara-" so I thought it's the player pawn

copper grotto
#

And maybe that's the problem? maybe i'm getting the ai controller in a way that's incorrect? I see one in the outliner though and i assume that's the one I want to get, right?

floral compass
#

I mean

#

Is the AI controller spawned in the level?

#

If you haven't spawned it then you can't get it

copper grotto
#

Yea it is there, I've looked to verify that it's there (in the outliner) and I've also debugged the return from that isValid to ensure that whats getting returned from there is the ai controller.

floral compass
#

And that AI controller is not possessing anything else right?

copper grotto
#

uuum it shouldn't be. is there a way to debug that?

floral compass
#

I guess gameplay debugger? Backtick is the hotkey for it I think

copper grotto
floral compass
#

Looks like it to me!

#

Again, you'll have better info if you debug your character's "Possessed" event

copper grotto
#

Yea that appears to show the ai controller. so, that's working but I'm still getting "none" when trying to get my blackboard.

floral compass
#

How and when are you getting the blackboard?

copper grotto
#

In the BP_ThirdPersonCharacter, I have a custom event that gets triggered after the controller is switched. On that event, I have a GetBlackboard node that takes a Target which I've tried several different ways of passing in the target. I've tried GetController, GetPlayerController, GetAIController. None of them seems to work.

floral compass
#

Have you tried this event in your character BP?

#

And then getting the blackboard from that controller?

copper grotto
#

No, but I suppose that makes more sense than how I'm doing it now. I'll try that. I gotta run real quick but will be back to this in a bit. Thanks a ton for your help!

wraith charm
#

Does anyone have any cool resources for how to think about NavMesh when working in large open-worlds? Both regarding dynamic generation (such as with the NavMesh invokers) but also NavLinkers, and just general landscape construction to make the process less painful?

misty wharf
#

The builtin systems for this are unfortunately not implementable in bp. You would need to make some custom system which for example casts the detected actor and looks at a variable on it to determine whether it's friendly or not

#

It depends on what the problem is really

#

When it sees an enemy you probably would want to assign it to a variable and have it keep chasing that one instead of choosing a new one to chase when it perceives another

lyric flint
#

I can't get AIPerception hearing to work

#

Hearing config is added to the senses

#

with a 3000 range

#

The pawn that makes the noise has both "AIPerceptionStimuliSource", and "PawnNoiseEmitter" components.

#

What am I missing?

floral compass
lyric flint
#

All are set to true

#

Doesn't work.

#

OnTargetPerceptionUpdated I hooked up a simple print string, to check if hearing triggers at all. It doesn't. So it's not like a complex system where somewhere along the way something goes wrong.

#

The most primitive possible setup.

#

Sight triggers, hearing doesn't

#

The N definitely works, checked with print string.

#

But hearing doesn't trigger.

#

Also tried the same nodes hooked up to an event on character jumping, because I thought that N input making the noise might be the issue. The event works, the hearing still doesn't.

distant pollen
#

Can someone explain to me the Difference between these two nodes?

#

Just one is a Function and one is a Variable?

obtuse igloo
#

Anyone know how to or have resourceful links on creating a Utility AI behavior tree? For example having the selector nodes switch task actions based on the Utility Score of the AI?

misty wharf
#

If you want it to stop when sight is lost, check the successfully sensed value on the stimulus. This will be false when sight is lost to something, so you can use this to remove the active target or choose a new target from the other perceived enemies (you can use get perceived actors to get a list)

misty wharf
misty wharf
obtuse igloo
light void
#

Here for advice on what would be the clean way to do it: I hae a building with multiple rooms and I need NPC to wander from room to room. Most rooms will have a default "wandering" inside but for some I'd like something more specialized.
Would it be better to swap their behavior tree when they enter a room? Have one BT for wandering outside, one for wandering in room and one for acting in rooms?
Or is there something more appropriate to do?

misty wharf
#

Seems entirely up to you. You could for example use smart objects in the room and have it use a behavior tree on the SO or something, or use gameplay behaviors instead of BTs, or not even use smart objects

uneven cloud
uneven cloud
copper grotto
#

That AI controller wire does not go into the unpossess node if that's what you're thinking. I just hadn't taken the time yet to clean up the wires, so it's straight across, I noticed after the screen shot that it might look confusing.

uneven cloud
uneven cloud
floral compass
#

Some redirectors would help :p

uneven cloud
#

Ugh. I hate BP.

copper grotto
#

I tend to use both bp and c++, but ai is fairly new to me so I'm trying to get used to a bit. I'm sure at some point I'll move to c++, but it's a lot to take in all at once.

uneven cloud
#

Run behavior tree should also not happen outside of the AI controller. It should be done in the AI controller's possess function.

copper grotto
#

That is the ai controller.

uneven cloud
uneven cloud
simple wagon
#

Heya folks, I feel like a dummy but I'm trying to follow: https://dev.epicgames.com/documentation/en-us/unreal-engine/behavior-tree-in-unreal-engine---quick-start-guide .

I finished it, and ... nothing really works aha! Watching my BT, it tries to find a random position, triggers a moveto, but the value stored for PatrolLocation is null everytime. Breakpointing to look at the value being assigned, screenshot shows that the Key struct seems to be trying to assign EnemyActor key type, not PatrolLocation key type.

In the tutorial it simply says "Promote the key off of Set Blackboard Value as Vector, and rename it". That doesn't appear to be enough to actually have this BTT tell the BB what key to assign? I simply named a variable, and I don't see a way to tell it what key type to choose unless I go through constructing a Key struct fully. Is the tutorial simply wrong here or have I overlooked something?

#

Thanks rubber duckies haha. If I instead do this and construct my own key struct then it works as intended.
I'll read through again but it sure seems like the tutorial is missing this?

misty wharf
simple wagon
#

Thank you

misty wharf
#

I don't think it'll autograb anything so if it got some value to it by default it was a coincidence lol

simple wagon
misty wharf
#

Oh really, it didn't use to do that at least I'm fairly sure

uneven cloud
simple wagon
uneven cloud
#

Then it sounds like you have a nav mesh problem.

uneven cloud
simple wagon
#

True

#

although it does continuously say best practices through it which gives the impression that it is trying to be : P

foggy moth
#

I have a GameplayAbility that i'm using to drive a MoveTo task - and at any given point I need to PAUSE this movement... for certain cinematic effects, which afterwards I'll be resuming movement on the cinematic completed.

I cannot use CMC->StopMovementImmediately() - because this will trigger this MoveTO() task OnMoveFinished() branch :/

Any other solutions out there? I've been searching at all forms of AIController, CharacterMovementComponent, even pausing/cancelling the GA ... but none of these methods are working :/

dense owl
#

If bCinematicInterruption -> MoveTo previous goal

foggy moth
# dense owl What’s wrong with the move finished triggering ?

because in all honesty i want to cancel this ability - but i'm having the HARDEST time of doing this....

Its a turn based strategy game.

Logic:
1: MoveTo (as seen above)
2: Overlap enemy sphere (detection)
3: Play cutscene on overlap, pausing movement (desired) OR cancelling ability as i'm caching the destination that hte player SHOULD go to...
4: OnCutsceneFinished - resume movement OR do a new MoveTo ability with the destination from teh cached location.

dense owl
#

The movement part can be easily resumed with another move order

foggy moth
#

been there - tried it. i'll work with Khaos - because hes got a doc that says how to do this.. simply put my UGameplayABility* is NOT VALID (CDO) - which shouldnt be the case.

dense owl
#

There’s also time dilation or pause game

foggy moth
#

pause game - wont allow for cutscene to play no?

#

i should say ...

#

this is NOT a rendered cutscne

#

rather...

dense owl
#

I honestly don’t know. I know some things can be set to run while paused but idk about cinematics

foggy moth
#

camera switch to the enemy overlapped camera and play a AnimMontage + audio clip

#

so.... i dont think PauseGame will be a solution

dense owl
#

Fair enough

uneven cloud
foggy moth
uneven cloud
# foggy moth AI use gameplay abilities - yes?

That's not what I meant. It looks like you are trying to do the actual decision making in an ability.

The answer to your question is to lock the path following component while the cutscene is playing.

misty wharf
#

It works just fine. If it returns an empty array then the NPC isn't currently perceiving any other actors

stiff gale
#

Is there any new feature in UE5.4 that will reduce the cost of 100s of regular AI?

misty wharf
#

I don't think there's a magic bullet that will optimize your game for you

#

In order to determine how to reduce their cost you would first need to find out what part of the AI has the performance cost

#

just saying "AI" means very little in terms of what it could be (could be CMC, could be skeletal animations, could be perception, etc. etc.)

desert parcel
#

Hello guys im seeking help and advices from you. If anyone can give me a hand, tip , advice , information or anything please do .
I need to finish working on this project and i still dont know how.
I need to make an AI that learns from the player gameplay and then plays just like the player and i dont know how or where to start (im using ue5).
I have reduced my task it to just a bossfight to minimze the complexity of the project

floral compass
uneven cloud
#

Is the actor affecting the nav mesh? You can use the visual logger to see if it's failing to project the goal location.

desert parcel
uneven cloud
desert parcel
#

exactly what im doing 😭
im doing this for my engineering final study project

uneven cloud
#

I honestly wouldn't recommend it if you are looking to get into the industry. We don't use it for agent behavior, because it doesn't make fun player experiences.

There are 2 good GDC talks about it. One from killer instinct and another from Warframe.

uneven cloud
#

Your AI can't navigate to something not on the navmesh.

uneven cloud
desert parcel
obtuse dome
#

Is there a way to make Nav Link Proxies treated as 0 distance? I have a teleport door that NPCs can use, but having issues where if the distance between the NavLinkProxy start & end + distance from NPC to start is >the distance from the NPC to the end, it will walk the long way around rather than taking the instant teleport door

uneven cloud
#

That has absolutely nothing to do with it.

desert parcel
uneven cloud
uncut rune
#

What would be the best way to toogle ai senses on character? Like Imagine I can click A and S, and they will turn on and turn off, so:
if Ai can sense again, will get targets around it and attack
if Ai cannot sense, will lose targets and stop everything
and then again

Does AI Perception works on tick?

  1. Could I use boolean after AI to tell it if it senses or not?
  2. I also tried with this enabled node

So far I'm able to ''stop'' character, but I'm not able to enable it again so it will start looking around again (like if he is in range, he should get them imidiatelly).
I will keep trying but if anyone has hints what to use for this I would appreciate it.

#

Currently I'm testing so this is how it looks

#

keep in mind I'm changing it all the time as I work on it right now but if anyone can give me hints I will be thankfull

misty wharf
#

I would try to toggle the sense off and see if it causes on actor perception updated to trigger

#

If it does, then you could use that to update your logic (eg. when sense is disabled, it would probably lose sight and successfully sensed would be false)

#

But if toggling the sense doesn't trigger on actor perception updated, then I would just sort of fake it. Basically whenever you toggle it off, you would remove the current target it has or whatever and stop reacting to sense events. When you toggle it back on, you would check get perceived actors to see if you should update the target immediately, and again react to perception events as normal

#

Also I see you are using on percetion updated - I would generally suggest using on actor perception updated as it will trigger once per type of stimulus received for an actor, which is usually a lot easier to work with than the array

elder jay
#

isnt this updates only on "trigger"?
once your target is seen will remain seen until its not seen again?

misty wharf
#

Yeah this triggers once per sight / loss of sight. While something is actively being perceived, it does not trigger again for that particular actor until sight is lost

misty wharf
#

On Target Perception Updated is called when something becomes visible, or when it is no longer visible

#

And only on those occasions

#

If you need to do some logic while something is visible, then you would need to use Tick or a timer

#

(If you need to run it repeatedly like that)

uncut rune
harsh storm
#

Yes, The Target Perception Updated one

#

It's far more reliable than On Perception Updated

#

(At least in my experience)

floral compass
#

Also contains more info, no idea what you would even use "OnPerceptionUpdated" for aside from very simple logic? Also having to wrangle that array of actors seems like a pain

uncut rune
#

I think i miclicked it when I started building logic 😄

#

i will try some things

misty wharf
#

Yep target perception is what I meant :)

stone walrus
#

guys anyone can share me their door bp for ai that open door when player is seen and when not seen it moves to its location as usual

#

and i am not using behaviour tree

floral compass
#

I doubt anyone will have that for ya

stone walrus
#

can u give me good video for that i am making game like granny

#

so

#

specfically

#

door are main issue i am facing

elder jay
lament mortar
#

Problem: AI not moving in package/build game

The AI works fine in editor but when I pacakge the game, it does not move from its current location.
Does anyone know why that might be the case?
I am assuming this is to do with nav mash not being build? not sure.

stone walrus
#

all way till

#

end i have most of the trash

#

doors are the main issue

misty wharf
#

The solution depends on how you want it to work

#

The simplest solution is to have the door open automatically based on an overlap

uncut rune
#

I came up with something and just want to ''write it out loud'', so you can analize with me if you want. For now, I think toogling sense isn't the best, because it seems a little bit complicated, because for example, let's say I have 5 enemies around me, I sense them all, and they are probably put in the array in some kind of order. Now, let's say I switch my character to ''fake not sense anything'', let's say in these 10seconds, enemies regrouped and the one with index 0, that was the target, is the most far away. If I turn back sense on, it should ''recalculate'' and find the closest target, at least this would make it more organic, than if it sudenly went for that guy in the back. Possible fix? When sense back on, check array, get distance to every target and choose the lowest one + check first if the old target is still in the sense area?

2nd solution I'm thinking is to have states of my unit like:
Stop , Hold, Attack and these would be linked to the behavior that it should be doing while in that state. So like in Stop, I would have only Wait 5s looped.
In the Hold, I would have task that checks if are there any sensed enemies? Wait 0.5s and check again and loop, if enemy is found, it would go and attack, with addition, that when first enemy was sensed, i save current position, and if the distance from ''starting position'' is let's say over 2000, then it should not chase anymore or just simply, lose target? what would happen if the target came back, it should find it again, gets complicated a bit
and while in Attack, it would just have sequence that if any target is in the sense area, go attack it and chase it to death, and if dead, check targets around and just continue find targets and kill them (in the sense range?).

Any flaws?

floral compass
#

Probably some, but I can't get what you're saying easily into my head xD

uncut rune
#

more or less, i'm prototyping and i will watch some video to check if it makes any sense xD

#

just making notes

misty wharf
#

I would suggest just trying to implement it and seeing how it behaves

#

Sometimes the behavior is better to actually see in action at least when it comes to gauging whether it behaves in the way that works well in the game

quaint wedge
#

Hey, I can see that 5.4 includes updates for the NavMesh generation.
Does anyone know if it includes some changes related to NavMesh streaming ?
Or on-demand tiles generation ?
(As far as our problems go in 5.2, we're using world composition, Level streaming, with ModifiersOnly NavMesh generation which randomly doesn't generate the NavMesh properly in streamed sub levels)

#

We chose not to use Dynamic generation for performance reasons.
Requesting periodic NavMesh updates would be a way to go, but we never managed to make it work.

uncut rune
#

oh god, my engine bugged and wasn't printing anything and I was looking for mistake in code while everything was fine.. just needed to reset it ugh xD

uncut rune
#

What would I have to put or change to make AttackTarget be set to none, when it leaves the IsInChasingRange? Or maybe I should put AttackTarget not set on the WaitForTarget, and execute node IsInChasingRange to clear AttackTarget when it's true or false. I will try. xd

simple wagon
#

Cross posting in case someone here has run into this #animation message

Basically my animation blueprints are not firing properly when the controllers are controlled by an AI Behavior Tree. The ABP never seems to understand that the controller is moving or rotating, it never fires its sequences to even check anything. It's like the ABP doesn't exist, although Idle is firing the whole time.

simple wagon
#

(figured out some of it, by default it seems the CMC will not get acceleration data from the MoveTo function used here, have to enable Use Acceleration for Paths. This does not fix the rotation issue though)

uneven cloud
#

Did you just remove the collision? If so, that's a hack and not a solution.

simple wagon
#

Solved mine, #animation message for posterity in case someone searches for it in the future haha.

uneven cloud
uneven cloud
simple wagon
#

The CMC won't have a valid acceleration unless the value "Use Acceleration for Paths" is checked?

misty wharf
#

Correct

uneven cloud
#

Because the CMC doesn't use acceleration for paths unless it's checked.

#

Which is completely different than what you said. That it doesn't get the acceleration. You might think it's not an important distinction, but it is.

simple wagon
#

Thanks for helping me understand, I think I don't understand enough of the underlying systems. So "use acceleration" to me sounds like I have a variable called acceleration, and I am going to use it, for a path system.
But I actually don't have a variable at all until I check that box

#

it's null

#

I'm sure a large part of this is "For paths" I don't fully get the implications of. I assume paths along a navmesh

uneven cloud
#

There are 2 solutions to that problem. 1. Turn on use acceleration for paths or 2. Use velocity in the anim bp. The first one does change how things work, which might not be ideal for every project.

simple wagon
#

I've solved the problem

#

I'm just trying to understand why that button solves it

uneven cloud
#

The CMC doesn't use acceleration for following a path without it turned on. I'm not sure how to make you understand that.

#

Do you understand what acceleration is?

simple wagon
#

I think you're not understanding my question, so, that's okay I'm gonna move on. Thank you though

uncut rune
#

If you want to tell me alternative I will be happy to take feedback, but any examples?

#

so far I made Hold like this and attack, which can be switched with A and S key

uncut rune
#

I just called it States but it's more like Commands, I don't understand what is the real problem I should study

uncut rune
uneven cloud
uncut rune
# uneven cloud It's not a video

I don't believe this works in my case because I need to connect commands with behaviors. It's not computer ai thing that will get blocked, but units should do what players tell them, and nothing else.

floral compass
#

I wonder since so many people post pseudo-state-machine behavior trees here:
What would be an appropriate, beginner-friendly model to handle a set of complex behaviors with behavior trees (since they already exist in UE) that does not result in a huge mega-tree?

#

I mean

#

Surely you would have to at least split your BT up into multiple smaller trees, right?

uneven cloud
#

What people don't seem to understand is that forcing it into a FSM actually causes the huge mega trees

uncut rune
#

So what instead? Make custom events and put logic in there because of that? or what

floral compass
#

Well true. But that's something you only know if you know.

#

Wonder if there's something inherent to BTs that makes people go "oh yeah let's put some states in here"

uncut rune
#

like you are saying it's bad, but you won't tell example (even simple) how to do it other way

floral compass
#

Aside from bad youtube tutorials lol

uneven cloud
#

It's not inherent to BTs. It's the tutorials.

#

The main problem is that people have a hard time understanding the flow of a BT. Another problem is that they tend to completely over think it, instead of starting with the simplest version.

#

Yet another problem is that there isn't one way to do anything, but that's what everyone is looking for.

floral compass
#

Especially so with AI it seems!
How could you then reinforce the fact that priority is key instead of arbitrary transitions across the whole tree?

#

The latter being what I assume to be the motivation behind shoehorning states in

uneven cloud
#

People want arbitrary transitions across the whole tree.

#

Which is fine, make a FSM. It shouldn't take more than a day.

floral compass
#

In other words: At some point the way a BT flows might not be the right tool and you need to switch tools, right?

uneven cloud
#

Yes

floral compass
#

Well there you have it @uncut rune 😄

#

Thanks for the insights

uncut rune
uneven cloud
#

You can also use the state tree if you want

uncut rune
#

Ok I will check out state trees

grim tartan
#

Is there any way to learn why a Move To Location or Actor, or AI Move To might be failing/ aborting?
Some like in-depth logging?

Currently fighting an issues.
Nav mesh exists, I can move to other nearby points, but not that specific point

uneven cloud
#

I use a utility/ BT hybrid, because I need some things that the BT doesn't work for.

harsh storm
#

Just because UE offers it, doesn't mean you have to use it

#

Realistically, if you only have a handful of states - FSM's are more than adequate

grim tartan
#

I'm not familar with that?
Context?

harsh storm
#

It's the tool to debug why the movement failed

floral compass
harsh storm
#

I didn't say to use StateTrees

uneven cloud
harsh storm
#

I have my FSM right smack dab in one of my units. I don't do anything fancy. Because I don't need anything fancy.

obtuse igloo
#

Hey all! I've been trying to install this plugin but it's not working (probably not compatible with 5.3?) https://github.com/kamrann/BTUtilityPlugin?tab=readme-ov-file#readme

Are there any other sources or ways I can set up my behavior tree to simulate Utility AI? For example the selector would calculate utlity with each selection then execute based on the score of an action?

GitHub

Extension to engine behavior tree system, adding utility-based selection nodes - Plugin version - kamrann/BTUtilityPlugin

grim tartan
uneven cloud
uneven cloud
harsh storm
obtuse igloo
#

I'll have to do a work around for the way i wanna do the AI then 🤔

uneven cloud
grim tartan
#

Weird.
Says it fails to project to a nav mesh, but I'm staring at the nav mesh all around.

obtuse igloo
#

I have it set up in blueprints where it works and selects actions based on calculating a score, but would like to put the core logic into behavior trees (selecting what task to perform)

uneven cloud
obtuse igloo
uneven cloud
obtuse igloo
#

so you just create multiple BTs for each action?

#

i think ill try that out 👀

uneven cloud
grim tartan
uneven cloud
grim tartan
#

It does not move.
Its just static

uneven cloud
#

You either need to not block the navmesh or find a location on the nav mesh that is close to the actor. For the 2nd one, I recommend using the EQS.

#

Or you can calculate it yourself using math and project location to navigation function.

grim tartan
#

I thought this would've helped for the 2nd possibility.

I may need to use EQS then, never touched it.
Brand new to AI in general

uneven cloud
#

Random is not a good way to do it. You'll get points on the other side of the actor, which makes the AI look dumb.

grim tartan
#

Its better then my AI actually being dumb right now. 😛
But, also didn't work

uneven cloud
#

It doesn't work because the origin is not on the nav mesh

#

The EQS generates a bunch of points around a location, can filter out any not on the nav mesh (projection) and run tests to find the best one.

grim tartan
#

I assume EQS is performant?
It does say its experimental, and not to use. 😛

uneven cloud
#

It's been experimental since at least 2016.

#

Yes, the EQS is performant. It's time sliced so it only does so much work each frame.

grim tartan
#

Guess its time to learn EQS, and AI stuff. 😛

uneven cloud
floral compass
#

I do something similar but so far always switched out the whole tree

grim tartan
uneven cloud
floral compass
#

I'll know what to look out for in case of bugs tho!

uneven cloud
#

I shipped one game doing a full switch out. It was fine, but I found that the dynamic subtree just worked better.

floral compass
#

Can you inject trees into subtrees?

uneven cloud
#

Oh! The biggest reason is because you have to set all BB keys.

floral compass
#

Ah, true I do that every time

uneven cloud
floral compass
#

Nesting subtrees at depth >2 I guess

uneven cloud
floral compass
#

Okay good to know 👍

obtuse igloo
uneven cloud
obtuse igloo
#

OOHH SUB TREES of course dfkfdjgkfj

#

gotcha, i'll keep that noted then! Thank you lots

uneven cloud
#

Run behavior dynamic is a node that runs a subtree that is set dynamically at runtime

undone heron
#

For some reason the AI are moving to completely different locations than the given transform. If I draw a debug sphere on the transform it shows the exact place I want them to go, yet they don't. It doesn't fail either, it goes to the On Success with a movement result "Success"

#

Any ideas why?

misty wharf
#

Hard to say, I would try using the visual logger to see what's going on with the path and navigation

#

It's possible that your goal location is not directly navigable and it ends up projecting the point into a weird location for some reason... can't really think of much else

undone heron
misty wharf
#

It's under Tools->Debug

#

Press the start button on the vlog window, then run PIE and it should show stuff for you

undone heron
#

Thanks 🙏

uncut rune
#

Evaluators in ST are kinda like services or eqs in bt?

coral mesa
#

i could be dumb but whats the basic needed for StateTree to work?

#

like where to add components exactly?

floral compass
#

There's a StateTreeComponent which you would add to your AIController if your intention is to use it for AI. Then you configure the StateTree asset on that component. Just make sure that the asset has "StateTreeComponent" schema selected.

#

Also make sure you have no other BrainComponent on your AI Controller, otherwise you'll have to resolve it yourself

open swift
#

When you guys have a melee enemy pursuing the player, and are using EQS to determine where to stand, how often do you re-run the query? Every frame? On an interval? Only when the previous position is no longer valid (the player moved a certain distance)?

misty wharf
#

Every frame is probably not a good choice because the query might not resolve in a single frame always

#

But in general it sounds like this depends entirely on how you need it to function. For example what is the point of querying for a new position often if you're not going to move into it?

uncut rune
#

Why there is so little about state trees on youtube 😦

#

just 1 example from epic's officials that is repeated across 4 tutorials xD

misty wharf
#

Too new system and it's complicated to understand unless you dig through the code which the average UE youtuber doesn't seem to do much

uncut rune
misty wharf
#

Huh?

uncut rune
#

That you have to manually tell the task to finish because it will get bugged

#

so you create fake Succesful thing

misty wharf
#

I have no idea what you are talking about lol

rustic pond
#

hello, I have pathfinding problem that causes AI controlled pawns to get stuck almost always in this particular layout
so basically pawn #2 tries to reach its destination but is blocked by prop on the one side, and pawn #1 on the other side
RVO is enabled on both with 140cm radius, navmesh settings are pure default
can something be done about this?

narrow mason
#

It may just be my first unreal engine blog post 😂. It's a bit complicated to get into, but quite easy once you understand it

uncut rune
floral compass
uncut rune
#

this is something inside State Trees?

#

how do I contact from playercontroller to there

floral compass
#
    UFUNCTION(BlueprintCallable, Category = "Gameplay|StateTree")
    void SendStateTreeEvent(const FStateTreeEvent& Event);

This function

narrow mason
#

What melon said

uncut rune
#

wait I have to use C++ for state trees, fuck me

floral compass
#

Nope

#

BlueprintCallable

#

It triggers event transitions such as this

uncut rune
#

do you mean there is node for this?

#

tat I can use in playercontroller

floral compass
#

BlueprintCallable means there is a node yes

uncut rune
#

ohh xD

floral compass
#

Even if you don't know C++ it's always useful to have a look at a component's header file just to see what else it can do

uncut rune
#

How do you structure folders in project for that? Like AI > StateTrees/BehaviorTrees ?

floral compass
#

However you prefer

#

Has no bearing on how things function

misty wharf
#

There's two schools of thought for it in general

  1. Organize by type
  2. Organize by relationship
#

by type just means you'd have something like AI / BehaviorTrees and all your BTs go there

uncut rune
#

For now I had like AI > BehaviorTrees, Tasks, Decorators, EQS

misty wharf
#

by relationship means you'd have something like NPCs / NPCGuy which would contain all kinds of assets related to this particular npc

uncut rune
#

not sure where to put StateTrees 😄

#

well its the least problem, ill figure it out

#

btw can I fully translate something like this to StateTree and not have anything in behavior tree or I will have to divide this a bit?

floral compass
#

No problem

uncut rune
#

so I fully can use StateTree and forget about behavior trees?

floral compass
#

Depends. Pick the right tool for the job

#

Some people use both

#

Some neither

#

BTs are more flexible at the moment. But if you don't need such flexibility it's not going to influence your choice

#

Also StateTrees are quite buggy when you dig deep into property bindings, but otherwise work

misty wharf
#

I would advise trying to build something in STs first before committing to moving anything to it

floral compass
#

For simple things it's really no problem!

misty wharf
#

As far as I know there's only one kinda annoying bug with the prop bindings

floral compass
#

Also supposedly will be fixed by 5.5

misty wharf
#

But it has a ~reasonably easy workaround

narrow mason
misty wharf
#

It won't let you access nested properties unless it's the context object

#

Eg. SomeActor.SomeProp won't work

#

The workaround is to make a task which takes SomeActor and pulls SomeProp from it, then you can bind to the task's output

uncut rune
#

I'm trying to make first thing in state trees for testing and learning, since I don't need the actor to be character or even have aicontroller, i could maybe use StateTree for something like Tower?

misty wharf
#

Yes, I think even UE's own docs show state tree used for some moving target thing

uncut rune
#

i feel like soon I will transition all my blueprints into state trees and the game will be only statetrees lol

narrow mason
floral compass
narrow mason
#

Oohh. This is quite a number of bugs. For BP structs, I think you have to create a custom schema that accepts UUserDefinedStruct

#

I'll tread carefully and limit my use of bound data for now

misty wharf
#

BP structs should generally be avoided anyway

harsh storm
#

I just avoid the plugin altogether. Wasn't a fan of having to recreate my ST when it would bug out.

#

Not too terribly difficult to write a FSM either

narrow mason
#

Now that I think of it, it did bug out on me once. I had to delete some states. Something with serializing a previous version of the tree and running that instead

uncut rune
#

ohh, wait do I create individual statetree of every state?

narrow mason
#

Nope

uncut rune
#

I thought I would put like Attack, Stop, Hold, in 1 state, but it turns out it's all alone?

narrow mason
#

These sound like states that you'd have in a single state tree. Each state then has a bunch of tasks.

#

You don't necessarily create a new state tree for Attack, Stop, Hold

uncut rune
#

oh ok

floral compass
#

And I'm too dumb and lazy to implement anything that approximates the comfort of property binding in a custom FSM

narrow mason
#

Yeah, the custom UI is quite convenient. Although I think there's a lot of indirection with objects. The entire setup could be made a lot more simpler

#

Too many proxy types and containers within containers

floral compass
#

And also you just can't bind UFUNCTIONS like you can with property access nodes in the Anim BP
Which really sucks because now all the variables that your ST needs have to be cached somewhere instead of just being able to call a function to get them..

calm knot
#

is there a way to bake recast in midair?

uncut rune
#

About the bug I was talking before, Is it still bugged that these nodes doesn't trigger Succesfull in the tasks?

#

and you have to go around

#

by creating branch in Tick ?

misty wharf
#

🤔

#

If it's a latent task then I could see it potentially working that way

#

But if it isn't then it seems like it shouldn't need to be set up like that and returning from EnterState other than running should end the task

shadow sapphire
#

Is there a max number of navmesh volumes you can have on one level?
Is it better to have multiple navmesh volumes over only the specific playable areas, or one large volume covering everything?

keen crow
#

Rather a theoretical question. How does one implement stealth based on environment illumination using UE's built-in sight sense without manually placing volumes everywhere which denote how bright this piece of map is? 🤔 I mean so I can handle the situation when my NPC sees someone in a restricted area, I have my custom logic to build up the detection meter, but how do I take into consideration how illuminated the threat is?

uncut rune
light void
#

What is the default cost of the NavMesh?

floral hound
#

Is there a way to receive an event when bot reach any point of navlink?

uncut rune
#

@uneven cloud just wanted to thank you for pointing me to StateTrees, I started to understand them a little bit more and seems like it's gonna be much easier and more flexible to do what I want with them, also thanks @floral compass and @misty wharf for notes, very usefull

uncut rune
#

Hmm, did they changed something in 5.3 + ? I'm trying to override function in the task, and it gives me event instead of function?

#

Shouldn't I have it like this?

misty wharf
#

There's been some changes to ST's in 5.3 I think, so it's certainly possible that changed

uncut rune
#

Okay

#

So How do I call now return node with the succesfull or running or failed?

#

I changed event to the Function

#

but I'm not able to edit Return Node like in tutorial

#

Does it mean that you don't have to specify right now that it finished?

#

Just when the whole event finishes it counts as done

misty wharf
#

If it gives you an event by default when overriding it then it means you can't really return any value from it directly

#

I recall you might have to call Finish Task when you want to finish it

#

this can be done from EnterState or from Tick or such as well

light void
#

I always have doubts, is the AIcontroller and the blackboard different for each AI, or is it the same for every AI?

misty wharf
#

One controller is spawned for each pawn and one blackboard is created per controller

#

Blackboard properties can be configured to be shared across all instances of the blackboard in its settings, but other than that they are not shared

uncut rune
#

and now it's this one

#

so this will either fire Sucess of on Failed

misty wharf
#

Yeah

#

You can't really finish the task with any other state anyway so I think this makes sense

#

If you want to keep the task running, you just don't call finish

uncut rune
#

Okay... so this is it. Finish task will lead to On State Succeeded or Failed

#

and what about State Completed?

misty wharf
#

Completed is either success or failure

uncut rune
#

Oh, okaaaay

misty wharf
#

I guess it's mostly a convenience feature so you don't have to configure the same settings for both success and failure if you want them both to result in the same transition

uncut rune
#

So I would basically call it like Event Start > Finish Task and then EventOnCompleted and add logic here? 😄

misty wharf
#

I don't know why you would need to add logic to event on completed unless you need to do some kind of cleanup but yes

coral mesa
#

Alright I wanna make a simple state tree with custom function. Basically would be something like

  1. Check if Player is valid
  2. If Valid then go to player
  3. If close enough to player then attack otherwise move close to player again
  4. If dead then go to Idle
#

dunno where to look for to make something like this

misty wharf
#

Look at the state tree docs, it shows how to set up a state tree with some tasks and things in it

coral mesa
#

Saw only this

#

didn't saw API or indepth talk about making custom states and more details about how to use it

#

it does say something but im mostly confused on this one

uncut rune
vivid drift
#

is it expected behavior that Finish Execute does not end execution of a task immediately? Like, calling it in a for loop does not break the for loop?

misty wharf
#

Yes, nodes cannot just exit out of the code with the exception of the return node when you are in a function

#

Nodes are effectively just function calls as you might have in C++ or other languages, so they have no capacity to exit the calling function. The Return node in case of BP functions is the equivalent of the return keyword, so it has this capability in that particular case

vivid drift
#

alright thanks

coral mesa
#
USTRUCT(DisplayName="DoTask")
struct EXAMPLE_API FSTT_DoTask : public FStateTreeTaskCommonBase
{
    GENERATED_BODY()
 
    using FInstanceDataType = FMyInstanceData;
 
    virtual EStateTreeRunStatus EnterState(FStateTreeExecutionContext& Context, const FStateTreeTransitionResult& Transition) const override;
    
    virtual const UStruct* GetInstanceDataType() const override { return FInstanceDataType::StaticStruct(); }
};

Saw this from your page @misty wharf didn't got this part about GetInstanceDataType. Why exactly you require that anyway?

misty wharf
#

It's just required for it to work

#

If you use instance data in your task

floral compass
#

Allows you to get data like this:

const UStruct* FSTTask_StateConfig::GetInstanceDataType() const
{
    return FSTTask_StateConfigData::StaticStruct();
}

EStateTreeRunStatus FSTTask_StateConfig::EnterState(FStateTreeExecutionContext& Context, const FStateTreeTransitionResult& Transition) const
{
    Context.GetInstanceData<FSTTask_StateConfigData>(*this).Enter();
    return EStateTreeRunStatus::Running;
}

void FSTTask_StateConfig::ExitState(FStateTreeExecutionContext& Context, const FStateTreeTransitionResult& Transition) const
{
    Context.GetInstanceData<FSTTask_StateConfigData>(*this).Exit();
}
coral mesa
#

what data FSTTask_StateConfigData should contain @floral compass ?

harsh storm
#

Whatever data you want that pertains to the task

misty wharf
#

It's probably worth noting that the Enter and Exit things in there are custom functions in the StateConfigData struct and are not something that's built in - the instance data is just a custom struct that you define yourself

coral mesa
floral compass
# coral mesa what data `FSTTask_StateConfigData` should contain <@1156839693833490482> ?

In my case it looks like

USTRUCT()
struct MUGENTEMP_API FSTTask_StateConfigData
{
    GENERATED_BODY()

    UPROPERTY(EditAnywhere, Category="Parameter")
    UAbilitySystemComponent* AbilitySystemComponent;

    UPROPERTY(EditAnywhere, Category="Parameter")
    UAnimInstance* AnimInstance;

    UPROPERTY(EditAnywhere, Category="Parameter")
    TArray<FStateTreeStateConfig> Configs;

    TArray<FGameplayAbilitySpecHandle> AbilityHandles;
    TArray<FActiveGameplayEffectHandle> EffectHandles;

    void Enter();
    void Exit();
};
#

No such rule no

light void
#

Does it still require C++ to put characters in teams? For perception of Ally, neutral and enemy?

misty wharf
#

Yes

#

At least for the builtin detection for it

analog mural
#

I have this issue with my AI where they stop detecting the player. This seems to only happen when I spawn them with SpawnActor. AI placed in the level functions fine. I printed successfully sensed in the bp and it's not false unless the player gets out of range. Yet the bt says that HasTargetActor is false.

coral mesa
#
#include "CoreMinimal.h"
#include "StateTreeTaskBase.h"
#include "SOM_StateTreeMoveToTask.generated.h"

//USTRUCT()
//struct FMyInstanceData
//{
//    GENERATED_BODY()
//
//        UPROPERTY(EditAnywhere, Category = Input)
//        int32 Foo = 0;
//};

UCLASS()
class UMyInstanceData : public UObject
{
    GENERATED_BODY()
};

USTRUCT(DisplayName = "SOM_StateTreeMoveToTask")
struct ALSV4_CPP_API FSOM_StateTreeMoveToTask : public FStateTreeTaskCommonBase
{
    GENERATED_BODY()

    virtual EStateTreeRunStatus EnterState(FStateTreeExecutionContext& Context, const FStateTreeTransitionResult& Transition) const override;

    virtual const UStruct* GetInstanceDataType() const override { return UMyInstanceData::StaticStruct(); }
};

Why this code results in error @misty wharf ? Am I doing something wrong here?

misty wharf
#

You are using a UObject, they don't have a StaticStruct member. Use StaticClass instead

#

If you want to use a UObject based instancedata, there's a builtin task or two that use it as well, check those for more examples of how it's used

cinder crag
#

Hello AI's Does state trees have debugging tools ?

misty wharf
#

It has a debugger in one of the menus when you have an ST asset open, and it logs into visual logger

shy hare
#

hey devs , please help , this ai should chase u and attack when he is close to the player but somethimes it is tryying to move but stuck at some points with some objects , u can see how he stops movement and jitter a bit (he is trying to move but can't ), as an example 0:17 or 0:41
why is that happening and how i can fix it? can EQS be a solution may be?

harsh storm
#

Looks more like nav agent properties aren't set up to support the larger character

#

Search for agent properties from Luthage in this channel. She talks about it from time to time.

shy hare
harsh storm
#

You go to the search box of Discord, do From: Luthage and then search agent properties

primal vigil
#

guys this is how my behaviour tree looks, is it not wrong ? it is blicking and idk why I think it should be just white and not blick or?

#

oh on video its not as visible but on my screen its blicking af

floral compass
light void
#

I kinda need NPC to walk on these. Any easy solution?

floral compass
#

Just a guess, not sure about it

dense owl
#

More than one problem there I think

#

You would also probably need to add supported agents and lower the agent radius, if you want the navmesh to encompass the whole width of the escalator

light void
dense owl
#

Capsule component does also come into play if it’s a char

#

I believe Luthage said capsule radius has to be at least 2 higher than the nav agent radius but I could be mistaken

light void
#

If I give an interface as a base class for a blackboard key, does it mean any class that inherit the interface?

floral compass
desert parcel
#

After installing Learning agent plugin and restarting UE5.4 it stucks here loading python script plugin at 75% any idea guys ?

light void
#

I got the BP interest spot
Which is inherited by the BPI InterestSpot
Move target in the Blackboard is a Bp_Interest Spot
I have a task with the variable InterestSpot which is exposed
But the Task in the behavior tree does not see the Move Target in the blackboard. Did I miss something?

floral compass
light void
#

Move target is a BP interest spot and I'm trying to pass it to the BTT_Handle_InterestSpot Task. The other tasks I created managed to pass a blackboard key without issues simply by adding it as a variable for the task. But here it doesn't work.

#

Move target is setup when a character is created.

floral compass
#

Yeah but I can't see "MoveTarget" being used anywhere in those screenshots.

#

So I'm wondering how you're trying to access it, cause I can't see any reference to it.

light void
#

In the AI Controller, I add it. To then be Passed by the blackboard to the Task

floral compass
#

Because all I see is the variable "Interest Spot" in your task which does not seem to be populated ever

#

What I would expect is something like

light void
#

That's the issue I'm trying to figure out why Behavior tree doesn't see "MoveTarget" as a valid value for "Interest spot"

floral compass
#

How do you expect "MoveTarget" and "Interest Spot" to be connected?

#

Those are 2 different "variables"

#

Not connected in any way according to your screenshots

#

Interest Spot, at least from your screenshots, is always empty

#

Btw don't copy paste the example I posted, there is a better way to access blackboard variables than "Make Literal Name"

steel patio
#

When i add a character with a custom orientation to a level, if it has an AI Controller (even a default one), the pawn get its orientation reset when i play the level. How can i avoid that ?

light void
floral compass
shy hare
#

hey there guys , is there a way to make so that some AIs use one navmesh other AIs uses another navmesh? i got big and small ais

flat sand
#

Maybe a weird question but how do you organize your blackboard values(using blueprints)? Like if I want to access a blackboard value I have to use a name. I was thinking of a way to mitigate this because using names seems kinda problematic, especially if you wanted to make a change for whatever reason

floral compass
flat sand
#

ohh okay

#

thanks i'll look into that

flat sand
#

oh wait I think you meant something c++ related

floral compass
#

Sorry I did use the wrong name though, you're right

flat sand
#

ahh I see yeah it happens haha thank you

#

🫡

golden orbit
#

Hi, why my RecaastNavMesh reset it's parametrs? Like Agent radius and Height

#

And every time it recalculates, will it do so in build version?

misty wharf
#

Did you configure the settings from project settings or directly on the recast navmesh actor?

golden orbit
#

Directly

misty wharf
#

Yeah do it from project settings. The settings on the actor are configured from there when the navmesh gets regenerated

golden orbit
#

Ah, i see

#

Thanks!

#

Btw, can i bake them somehow?

#

Like to generate them only one time

misty wharf
#

I recall there should be a setting somewhere which prevents it from being regenerated automatically in the editor

#

Meaning when you want to regenerate it you need to go through the Build menu to do it

golden orbit
#

Okey, i ill check, thanks!

misty wharf
#

They do get baked in that sense though so it won't regenerate in packaged games, unless you turn on runtime navmesh generation

golden orbit
#

Thanks again!

dire jungle
#

With EQS, is there a way to make a line of points to the left and right of an actor only (without front and back), so basically a grid that only extends to the sides, if that makes sense?

misty wharf
#

With a custom generator sure, not sure if there's a builtin one

dire jungle
#

yeah i was looking at the built in ones, they all seem to have some kind of radius

#

i guess i gotta look into making customs, thanks for stirring me in the right direction

misty wharf
#

If you use C++ you can check the code for the builtin generators, you can probably pretty much just copypaste one and modify how it generates the points

#

I'm not sure if it's possible in BPs at all

light void
#

https://www.youtube.com/watch?v=vUy-UIEHqFA
I was checking this video, which uses an experimental plugin (GameplayBehaviorSmartObjects). Of course the video ignores it, since the video is about that plugin, but should I avoid it and give up on that tutorial? Is there somewhere I can check the feedback on that plugin and see if many people got troubles with it?

misty wharf
#

I use GameplayBehaviorSmartObjects in my project and it works fine

#

It doesn't do a whole lot as far as I can tell, basically you just get a GameplayBehavior class which you can use to create logic for how something uses the smart object

#

Since you're just working with standard blueprint stuff I wouldn't worry about it too much. If for whatever reason you need to replace it with something else, it should be reasonably straightforward

light void
#

It's weird. I know it should be safe, but the simple fact it told me to be careful stops me dead in my tracks :p

bright timber
#

Is this still the same in 5.4?

https://forums.unrealengine.com/t/ai-perception-sight-only-traces-to-middle-of-actor-capsule/875516

I'm in the same situation, need enemies to be able to detect the player if their head is poking above a crate but it seems they need to see the origin point of the player before they react ... would prefer to use the stimulus system but will default to a cone trace if I have to!

Epic Developer Community Forums

Hi all! There is a problem with AI perception Sight which simply uses the target actor location to trace and see if the target actor is visible or not. The AI trace “origin” itself can be modified in the character blueprint by simply going to the Camera (?!) section of the character BP and modifying the Base Eyes Height. Which is great, since ...

misty wharf
coral mesa
#

I always wondered what does EPathFollowingResult means?

#

Does it refer to finding the path and returning it? Or actually moving the Actor?

uneven cloud
uneven cloud
uneven cloud
foggy moth
#

I need to abort this selector from the blackboard BOOLEAN value - but its still executing it... what is the logic here?

#

my boolean values are false - is there a more appropriate way to handle this?

dense owl
#

Set means it holds a value other than nullptr

#

Iirc there’s a Boolean decorator you can use instead

lyric flint
#

@uneven cloud You mentioned awhile back defining custom EQS / Blackboard code for selecting abilities. I imagine you set up a custom Blackboard key type -- if it's not too prying, did you also edit EQS so it could return something other than an Actor or FVector?

uneven cloud
light void
uneven cloud
light void
uneven cloud
light void
coral mesa
#

how do you make navigation agent

#

without touching the actor system?

#

Like making it for something like Mass/Other ECS solution?

uneven cloud
coral mesa
uneven cloud
coral mesa
uneven cloud
dense owl
misty wharf
#

Ugh, I'm trying to come up with a formula for calculating "item desirability" for my game and it's such a pain in the ass 🤦‍♀️

#

I guess it's basically similar to a utility score but trying to think of good ways of incorporating all the factors into it so they work in a way that does what I want is so complicated

#

Need to have like a "base score", eg. does the AI want the item at all to begin with, another score for outside factors that can affect it, and a situational score based on where the item actually is... and then it needs to also take into account the price of them item and whether it's considered to be too high

#

...and ideally this should also be slightly chance-based so that it's not a guarantee that the AI will always want it

#

oh yeah and there's also items of different types that could satisfy this score by different amounts

floral compass
# misty wharf I guess it's basically similar to a utility score but trying to think of good wa...

I am entirely ignorant on the matter, but is it so that the more utility calculations you do the less "control" you have?
Since you're setting up fuzzy rules it's gonna get increasingly harder to get desired outcomes the more variables you have.

If so personally I'd probably try to keep the number of variables as low as possible. Otherwise my brain would explode trying to reason about all the possible combinations.

misty wharf
#

Yeah that's true, however the things listed here are generally something that would be part of the gameplay considerations the player would do to get some result they want... Eg. an advertising campaign or such is an outside factor the player could trigger, and placing drinks into a cooler would make the AI more likely to want to purchase it as opposed to it just sitting on a shelf

#

But there is certainly a possibility that maybe these things make it very complicated for no reason and the player agency from these things could be implemented in some other fashion into the system

light void
#

If I have a building with multiple floors, is there any particular reasons to split it in multiple navmeshes volumes? Or should I just keep it all on a single one?

misty wharf
#

As far as I can tell you'd mostly want multiple volumes if you have parts of the map where you don't want a navmesh generated

#

So by using multiple you can shape the area where it generates better or such

#

Or other design reasons, eg. maybe it just makes it easier to work with a volume for each area of your map as opposed to one ginormous one

oblique basin
misty wharf
#

Yeah I'll probably need to do that, currently I'm mostly playing around with ideas in spreadsheets to see how adjusting the values with different formulas affects the result

oblique basin
#

That's a good idea. Creating a control group.

#

We made an attack target system that took in 37 data points

#

Perhaps a little on the excessive side

misty wharf
#

:D

#

Yeah that sounds like a lot

#

In my fps project making the AI more complicated in that regard had a tendency of making the behavior worse for the type of more straightforward shooter it is

oblique basin
#

I read a study once on player reaction to various AI approaches to decision-making. They programmed about 10 different strategies from "target the least health" to "closest to me" to "random". 1) the players were terrible at inferring what the strategy was (the go-to was that the AI was somehow cheating). 2) the strategy deemed "most fun" was the random one. Take from that what you will.

misty wharf
#

lol, yeah there's always something like that... but I think it largely depends on the type of game. For something where the goal is to just let you shoot a bunch of guys and give you like a power fantasy thing you probably don't want the AI to be trying to be super smart, but in something more "tactical" in feel it would make sense for the AI to be like that

floral compass
full oyster
#

Hi we're using a dynamic navmesh with navigation invokers on a map with world partition enabled. (UE5.3.2)
I keep getting warnings that meshes add an oversized dirty area and I have no idea why that happens or how to fix it without ignoring those obstacles in navmesh generation. Most of them aren't even very big

#

LogNavigationDirtyArea: Warning: (navmesh: RecastNavMesh-Default) Added an oversized dirty area | Tiles marked: 1 | Source object = StaticMeshComponent /Memory/UEDPIE_0_M0ZDOAAVNOC97P5GS7W72J6FD3.Worldmap:PersistentLevel.sm_Prop_185.StaticMeshComponent0 | Potential comp owner = StaticMeshActor

#

this is doubly interesting to me because almost all of the actors referenced aren't even close to the invoker range, it seems it's just whenever world partition loads or unloads tiles it throws warnings no matter if they affect the current navmesh area

misty wharf
#

I think crowd avoidance should work with any kind of pawn

#

maybe

#

Yeah not 100% sure - but I think if you use the crowd avoidance controller, and implement the crowd agent functionality so that it works correctly with your pawn type, it seems like it should work

misty wharf
#

C++

#

I would try it first with the crowd avoidance controller and see what it does with a non-character pawn

signal island
#

im having this bug messege using StateTreeAIComponent on cpp, LNK2019: unresolved external symbol "private: static class UClass * __cdecl UStateTreeAIComponent::GetPrivateStaticClass(void)" (?GetPrivateStaticClass@UStateTreeAIComponent@@CAPEAVUClass@@XZ) referenced in function "public: __cdecl ASpyAIController::ASpyAIController(void)" (??0ASpyAIController@@QEAA@XZ)

#

i added the module and all

floral compass
#

You need both

            "StateTreeModule",
            "GameplayStateTreeModule",
signal island
#

i tried to put on character and aicontroller but doesnt compile

floral compass
#

Did you refresh project files?
Other than that I have no idea :/

coral mesa
#

alright how exactly you pass actor data to state tree?

#

like I want to ref my player on state tree

floral compass
#

By using an evaluator

#

Or if you have the player stored in a variable somewhere you can property bind to it

coral mesa
floral compass
#

Doesn't have to be on the state tree, can be anywhere

coral mesa
#

any good example?

#

like some sorta code?

floral compass
#

The AIController's PerceptionComponent could be one such place. It entirely depends on your use case and how you're getting the player.

#

Also whether you only have 1 player or multiple

coral mesa
#

just 1 player. Regardless i mean I am not seeing good ways to pass stuffs onto state tree. Atleast from what I know of...

floral compass
#

Evaluators and property binding. The latter being a very comfortable way to get anything into your StateTree.

coral mesa
#

basically just get something on runtime

floral compass
#

Here's an example for an evaluator

#

And here's how you use property binding to access anything your evaluator spits out

#

Bit buggy atm since you can't access nested properties, but that should be fixed by 5.5

coral mesa
uneven cloud
misty wharf
#

Yeah I mean that's the gist of it but you have to determine how they modify it :)

#

I think I figured out a not terrible method of determining whether the AI thinks the item is fairly priced or not so at least that's something lol

#

Although now that I mentioned it, it occurs to me it would probably work better if that's a separate check all things considered 🤔

uneven cloud
#

RVO is in the CMC. Detour crowd is not.

misty wharf
#

But the problem with it is also partially that the level of how desirable the item is could potentially be used to allow for a higher price to be charged.... so you can probably see why this is annoying and complicated

uneven cloud
#

RVO and detour crowd are 2 different avoidance implantations. They are completely separate, but both do avoidance, just in different ways.

floral compass
uneven cloud
#

No. You should use one or the other. Detour crowd should work fine with a pawn.

old plover
misty wharf
open swift
#

does the "abort lower priority" option work for a branch in a dynamic subtree to cancel a lower priority branch in the overarching tree that's running that subtree?

#

like if i have a sequence or selector, where the leftmost option is "Run Behavior Tree Dynamic" and a branch in that tree is set to abort lower prio

dense owl
open swift
#

even branches to the right of the dynamic tree task?

dense owl
#

Not in regards to the run BT task itself but your decorator would have to be on the Run Behavior Tree task

#

Outside the subtree

open swift
#

hmm

#

im trying to make ability selection a dynamic subtree, so that the general flow of "use ability -> move to position -> cast ability" is on behavior tree that everyone uses, and the different ai just have different ability selection subtrees, but im having trouble with implementing a system where some ability selections should override the current running ability but others shouldnt (and should just wait until the next time we run the tree to select a new ability)

#

just having trouble figuring out how to let some branches abort the main tree but others not

old plover
# misty wharf Have a variable like CurrentTarget in your class, assign the target that's perce...

Thanks, I was trying to avoid an Event tick, since in my detection I calculate illumination values and it is a bit costly, I was thinking of having a reference of the sphere that appears in the debug view, that way I can make calculations etc when the sphere changes position. That way along with the auto success range from last seen location it would update within the view range, but not on every tick. Any idea if the sphere is accessible in BP or c++?

uneven cloud
open swift
#

i was writing it in c++ but i found that the ability priority system i was writing i was just remaking a behavior tree.

#

so i figured i would just make it a little tree dedicated to only ability selection

#

and just run that as a dynamic tree within my generic combat tree

uneven cloud
uneven cloud
open swift
#

i mean i have to make ability selection for each different ai regardless, why is it worse to make it a behavior tree than to make a stack ranking of abilities with different requirements (which end up jsut being decorators by another name) for each one?

uneven cloud
#

Why would you need to make an ability selection for each AI?

open swift
#

because they all have different abilities and different requirements to use them

uneven cloud
#

So?

#

It doesn't make sense to hard code that in the AI, when the different abilities can do that just fine.

analog mural
open swift
# uneven cloud It doesn't make sense to hard code that in the AI, when the different abilities ...

what do you mean? when i say ability selection for the ai, i mean the priority list for each ai for what abilities they should use. Like if I have 2 enemies that both use some generic "Arcane Blast" spell, they don't necessarily both want to use it in the same scenarios and at the same priority level. One of them might have other higher priority abilities and only use it as a last resort, while the other just uses it occasionally and has some melee abilities if it gets too close to its target. For boss enemies they might also only want to use it in specific phases. All of that kind of logic seemed like it would make sense to write as its own priority list, but when i started writing the priority list, it essentially just turned into "if this condition and this condition are met, use ability 1, if this condition is met instead, use ability 2" etc. which just ends up basically being a selector node with a bunch of decorators on the various branches, is it not?

light void
#

Alright, first time working with Navlinks here. I have an escalator. I want NPCs to only go 1 way in it, so I created a navModifierVolume on the elevator itself to remove the default navmesh that was built on it, added a Navlink that went from bottom to top, making sure Left was at the bottm and Right at the top. I set the Link on Left to right. I kinda expected the AI to just walk straight "toward" the Right link and thus scale the escalator, but it didn't. The AI stopped, not sure of what to do.
What am I missing?

misty wharf
#

Just having the link just tells the AI "go here to get there" but how that happens is up to the smart link to implement

light void
misty wharf
#

🤔

#

Which video is that?

light void
#

https://youtu.be/iu7cjp1Gg7U?si=rTt8XI9KO4WBW1Cx&t=77
Granted it was UE4 and the ground is flat, but the dude has no navmesh in between, just places two links, and the AI start going through.

Use Nav Link Proxies to control the flow of traffic, jumping up and down from ledges and across chasms, and collecting power ups for bigger jumps. Create both basic Nav Links and Smart Links and use them for different types of jumps.

Follow Along:
00:00 - Controlling the flow of traffic
02:34 - Jumping down to a lower ledge
03:11 - Jumping up t...

▶ Play video
misty wharf
#

Where does that walk through the navlink? I see it jumping but that's been programmed into the navlink

#

Wait it was right in the start was it? lol

light void
#

At exactly eh timing the video should start (about 1.17).

#

Is it because the two spots have the same elevation?

misty wharf
#

Are you using the navlink proxy like he does or a custom link like later? 🤔

#

I definitely recall the proxy not really doing anything but maybe I'm mixing it up with a custom smart link

light void
#

I believe a Navlink Proxy

#

Now, I don't really mind, I setup a system where the NPC "Walks" straight toward the direction of the other link for a bit, wait for a bit then resume (while it may be unclean, it'll ensure the AI will start moving again if it gets stuck) but I expected it to...

misty wharf
#

heh

#

yeah I mean I don't think anything's really changed with the navlink stuff since UE4 so it seems like it should work like it does in the video in that case

light void
#

Alright, at least I'm reassured it's not just me seemingly not being able to follow a 40 second explanation.

#

Worst part: It was working without the link and the Bound volume to remove the Navmesh :p But they could also go down. And it's supposed to be one way.

misty wharf
#

Well you might want to do it via a custom smart link anyway right? Cause you can have the AI actually step on the escalator, do a lil animation, etc. instead of just walking it down

#

Oh I see you just posted about this on the ue subreddit lol

light void
misty wharf
#

Yeah I'm kinda curious also 🤔 It seems strange it would behave differently like that

odd violet
#

Hello, don't know if anyone can help figure out how to get around this, I've been trying to create a small isometric game, with two player-controlled characters, one of them was going to have the ability to knock down destructible barriers. I've created a geometry collection for this door and added an Anchor field at the top, but after despawning the fractures the navmesh doesn't rebuild correctly, giving inconsistent behaviour when trying to go through it.

I've been looking into the RecastNavMesh class to understand how the navmesh building occurs, is there anything in this that can help me get a more reliable result? Thanks to anyone who's willing to land a hand in this 😄

misty wharf
#

I would try disabling can affect navigation on the destructible part

#

And/or set it up such that it generates a nav area which blocks the other character from navigating through it and only allows the correct one

#

Although it seems if you have runtime generation enabled for the navmesh it should regenerate

odd violet
odd violet
misty wharf
#

Yeah if you turn off the affect navigation from the mesh it will allow it to generate the navmesh under it

odd violet
#

Oh wait, the collision with the door and the Character capsule collider would stop the character from moving though..

#

I'll try it right now

#

It seems to have worked although the character keeps trying to walk through the intact door and playing the walking animation. 🤔

misty wharf
#

Yeah it depends on how you want it to work. If it bumps into it you could have it stop movement, or set it up with a different nav area so that it won't even try

odd violet
misty wharf
#

I would just do it with the wall piece itself

#

So you'd have f.ex. a collison box in the wall piece actor which is set to use a nav area that makes it impossible to navigate through it, and you hook up the events from when the wall gets destroyed to adjust the nav area to a navigable one again

odd violet
#

hook up the events from when the wall gets destroyed
Is this a chaos event I can bind code to from the geometry collection actor?

misty wharf
#

I have no idea but I would assume there must be some way to do it

#

If it doesn't have an event to tell you when it happens, then you could probably just trigger it simultaneously when you destroy it

light void
#

If anyone has any idea why this doesn't work, I'm all ears. I tried more complex ones as well, to no avail. I got two of them, one simple and another smart. Both are configured left to right, left being downstair. Just for trials, the smarter one has a function that makes them jump rather than move toward.
I'm also interested if anyone has a way to check if the AI at least tries to path with it. Thanks

odd violet
open swift
#

any way to debug a behavior tree being run by the "run behavior tree" or "run behavior tree dynamic" nodes? if i open the asset while the game is running it just says "no matching actors found" even though the main tree is running and is on the branch where i'm running a subtree

gray minnow
#

Is there any way to edit the parameters of AI Perception (Sight) at runtime with Blueprints? Like increase the radius if a stimulus is detected or enable/disable the perception when needed ?

open swift
misty wharf
misty wharf
#

Although you can enable/disable, just not tweak the individual settings

open swift
misty wharf
#

I wouldn't trust anything ChatGPT says but this seems plausible if it isn't working

open swift
#

i havent really found any other answers, but the chatgpt answer lines up with what i'm seeing 🤷‍♂️

misty wharf
#

I would try placing the Run subtree node outside of the parallel... if it works, then it seems the parallel is the issue

#

And yeah ChatGPT is occasionally correct but I would treat it as "assume it could be wrong, so verify its claims yourself to be sure" lol

open swift
#

yeah if i move the node outside of parallel and into a regular sequence it works

#

:/

#

bummer

#

dunno why i can't wrap my head around how to get the system i want working with behavior trees, its been months of trying to make something work, failing, and then just doing something else until I get to the point where I need AI in the game to test what i've been working on

misty wharf
#

What are you trying to make it do?

#

I've still not found any use for parallel in any of my projects :P

open swift
#

the way i want the ai to work is basically: each enemy has a priority list of "combat choices" which are just made up of an ability to use, an EQS query to run to get a move to location BEFORE using the ability, and an EQS query to run to get a move to location DURING the ability usage. both of the queries are optional, so if they aren't set for a choice, then the enemy just defaults back to some default movement logic. so basically Select Ability -> Pre-CastEQS -> Move -> During-Cast EQS -> Move/Use Ability (parallel) -> Restart

I wanted to run the ability selection in parallel so that I could mark certain choices as "high priority" which means if they become available while I'm doing a lower priority choice they just abort the whole sequence, while other choices won't do that and will just be chosen later. this seemed to me like I should just use the built in observer aborts stuff that decorators have, so i would just make the ability selection for each enemy a subtree that gets injected into the generic "use ability -> move -> etc." tree that everyone uses

#

luthage said this is a bad idea but i'm not sure how you get around doing either that or just writing the same logic but without a behavior tree, which seems silly since the ability priority functions like a selector node with a bunch of decorated branches that can abort or not (to me)

#

i've used this example before, but I would like to be able to write enemy ability selection like a wow priority list, where the same ability can be in multiple places with different conditions

floral compass
floral compass
#

Oh right that was you

#

Hope you still despair a little :p

misty wharf
#

As long as it isn't in my codebase it's not a problem alex

misty wharf
open swift
#

maybe, i dont really want to select abilities on an interval though, i only want to select when i'm finished with the previous ability OR a "high-priority" ability becomes available and wants to interrupt the current ability

misty wharf
#

How would the high priority ability become available unless you're checking whether it's valid on some interval or such?

open swift
#

well ideally i would just have some delegate fire off so i don't have to check stuff on an interval or every frame

#

(if im not just going to use decorators on branches)

misty wharf
#

Right, well I mean the service could just listen for those delegates, or you could use something to update the BB which causes some decorator to trip

open swift
#

maybe, i think im just dumb but at this point i feel like it would be easier to just write the whole thing in c++ than try to contort what I'm trying to make to fit the behavior tree architecture that i apparently just don't understand

misty wharf
#

heh

devout axle
#

Hey guys. Any idea why RVO avoidance is not working with my npcs?

rugged cloak
#

Hello guys, I'm making a simple AI system with the PawnSensing. The issue is that, when the player go out from the Perphal vision angle, the AI instantly stops to chase the player, freezing completely on its local position. So how can I fix that? How can I avoid this? Could somebody help me please?

latent cradle
#

hi there, i m trying to make basic example with state trees in ue 5.4, and i canot get to work move to premade task, in debug alway says fail to move to, but dont know why, i tried, put vector or target actor both the same problem

gray minnow
# rugged cloak

Remove the sequence and place the delay and what follows after the AI Move to, basic out exec

gray minnow
# rugged cloak Something like this?

Yep ! Think about setting up your speed too, but that's how I did it, and it works, when I'm not detected anymore, my enemy goes back to patrolling

rugged cloak
gray minnow
rugged cloak
#

Ok wait no

gray minnow
#

then why do you need to remember the last location?

rugged cloak
#

I make you a video

gray minnow
#

to have it walk there before going back to patrol ?

rugged cloak
#

to show it

rugged cloak
#

Here we are sorry

#

This is what happen

#

When i go behind the pawn visual cone, it behave like lagging and then restart to move in a random location

light void
#

I think I finally figured something about my Navlinks. I managed to get it to work. The important part is the thin black arrow. Here I have the navlink set to Both ways, it works. They can go up AND down without too much troubles.

#

If I set Left to right, it works, they can go up without troubles.

#

If I set right to left, the arrow disappear (and does not appear on the other side) and the link does not work. For some reason, the game cannot understand it. It feels like something prevents the arrow from being created.

#

I'm starting to think that the issue is collision. The game probably tries to generate the arrow as the path of "the jump" and realize that there is something in the way and does not generate it.

rugged cloak
tulip shard
#

Hey guys, so I am trying to make an enemy move continually towards the player, I do this but rapdily firing off ai move to calls and this works fine as long as the enemy can reach the player. One problem I'm having is that as soon as the player is in a place where the ai can't reach, even just on top of a tiny rock, the ai will stop moving. I'd rather them still keep moving towards the player even if they can't reach them. I could probably brute force this with some logic that makes them go straight in the player's direction if the ai move to fails or something, but I just wanted to know if there's a way to do this with ai move to or some other node instead? Thanks in advance for the help!

hasty basin
#

pulling my hair out a little here. I have an AI state machine, as below. for whatever reason, it never begins running. it's assigned to the AIController, as I'd expect from that class (i.e. the AI specific state machine class) and set to start automatically. but it just never does.

docs are naturally missing for the component, but figured I'd see if anyone here knows what's what.

uneven cloud
uneven cloud
uneven cloud
stray bobcat
#

Hi All - I've got a problem where I'm using AI Move To function in a behavior task but when I switch to another behavior task the AI still keeps moving to the original Move To destination from the previous task even though it's aborted and is no longer running. Any ideas why the AI Move To is still functioning after the task has been aborted and how I can fix? Thanks!

stray bobcat
# dense owl how are you aborting it?

In my AI Controller. If my player is too close and in sight the AI should switch to a new branch "RangeAttack". When playing, it shows that the tree correctly switches to the new branch, but the AI is still moving to the desination of the old branch ("Return"). Here's the screenshot of my "Return" condition which has the Move To function in. Am I aborting it properly or should I do something else?

dense owl
#

there's also a BT MoveTo task but afaik you can't change the acceptance radius dynamically, out of the box

stray bobcat
stray bobcat
floral compass
rugged cloak
dense owl
devout axle
#

Hey guys. Any idea why RVO avoidance is not working with my npcs? I don't know what to try anymore, they keep bumping into each other and they get stuck. I can't get on with my game with the npcs like this

brittle lynx
#

Make them pass through each other and get on with the more important parts of the game. You can go back to this later.

light void
#

I'm now looking at having NPC interact with objects in the world. Sit in chairs, inspect stuff in shops, etc. Tutorial I've seen is about smart objects, but I've seen that it's still in beta. Is it safe enough?

#

I also saw the option of using components, but I am not sure of the limitations.

obtuse igloo
#

Hi guys! I'm trying to set up a smart object bed that my ai can use to sleep in but I'm unsure how I would implement the gameplay behavior of the object to add energy to the ai as they use it (ai is constantly getting energy replenishment from the bed as they use it)

Anyone have any ideas as to how I can structure this?

potent loom
devout axle
#

Hey guys. Any idea why RVO avoidance is not working with my npcs? I don't know what to try anymore, they keep bumping into each other and they get stuck. I can't get on with my game with the npcs like this

undone heron
#

My AI is walking through the landscape like this. I'm using floating pawn movement

#

how can I fix this?

#

and they also like to float

floral compass
#

My first guess would be to not use floating pawn movement? Why was there a need for it?

undone heron
#

floating pawn is a lot cheaper

floral compass
#

Not sure how to help there. I think the floating pawn movement is working as expected there afaik.

undone heron
#

is there another way to deal with optimization while using charactermovement?

#

when having loads of AI

misty wharf
#

But to make floating pawns stop floating, you would have to implement some kind of mechanic on them that "grounds" them, eg. keeps track of where the ground below them is and makes sure they stick to it

vivid basalt
#

Hi, my AI NPC perception has this issue, if my player roll quickly into a cover, the AI perception lost sight and then gain sight again, and stuck in a move to loop. But if i move into cover at regular speed, the AI can lose sight normally. Has anyone encountered this problem??