#gameplay-ai

1 messages Β· Page 49 of 1

pallid mica
#

That post is from 2014

#

:/

#

The UDN answer I can't really share, but it basically says that the "Getting stuck" and "Running into walls" of larger Agents on smaller NavMeshes is expected

#

And that one should not have too many too different agent radius, but rather try to group them and stick to 2-3 NavMeshes

#

It doesn't says if the AgentRadius should be the smallest or largest of the group

#

But the largest makes more sense

feral bluff
#

thanks, it looks like it would be much faster to make separate queries for separate teams

misty wharf
# pallid mica But the largest makes more sense

Interesting, thanks for sharing... Yeah sounds like maybe the approach with modifiers that you could attempt to generate during mesh generation would be the only realistic approach here πŸ€”

#

...or a third party navigation solution but I guess that depends on your budget

feral bluff
#

I tried apply tag to actor but got false when try to check this tag, am I doing something wrong?

feral bluff
misty wharf
#

iirc with the ability system component you have to use Add Loose Tag or whatever it was called. Also #gameplay-ability-system

feral bluff
#

although this doesn’t work either, you should probably try applying tags using an effect

misty wharf
#

Really πŸ€” I'm pretty sure I've used add loose tags on the comp and it has worked

sage ridge
#

You sir are a hero, thank you for typing this! in the space of a day, I saw the debug tools and have solved all my issues πŸ™‚ πŸ™‚ πŸ™

sage ridge
#

Deepest apologies!

stiff gale
#

How do I manually call a function so that AI use sight to detect. If I place my 4 AI NPC two in each team to fight with each other. After each team member get killed, team a and team b leftovers don't detect each other. If I place them in roam which triggeres hearing and sight senses then they fight again. But in idle they don't detect after fighting

misty wharf
#

What is this "leftovers" and "idle" you speak about?

#

What's the difference between those and the ones that do work?

mortal bay
#

Are there ways to organize behavioral trees more effectively? Such as encapsulating one section of the tree so it can appear as one node, rather than having the whole tree be shown

harsh storm
#

Run Behavior Tree node

#

So make that group its own BT

civic canyon
#

How do i differentiate between a player leaving the sight radius of an AI vs entering the sight radius of an AI? using AI perception with chaos vehicles and I need a car to break when a player is in front, but then accelerate back up once the player has moved out of the way

crude harness
#

Why does a trigger box with all ignored and "Query Only" can block the Sight Sense of my AI Controller?
Is it a known bug ? (I'm with Unreal 4.26)

misty wharf
#

Are you sure this is the cause it's getting blocked?

crude harness
#

If I change "Query Only" to "No collision", the perception works

misty wharf
#

πŸ€”

crude harness
misty wharf
#

Does it have any other primitive components besides this one?

crude harness
#

Ha maybe... I tried to reduce the issue to its simplest form, this is just a Trigger Box (the default one) with custom collision to ignore everything, and a Default Pawn with a AI Perception Component.
But the pawn has many things on it. If I use a "simple sphere pawn with sight stimuli" it works

civic canyon
#

I have a chaos vehicles car following a spline, but I need it to slow down during a turn and then speed up again. What is the best way of doing this?

misty wharf
#

I'd try having it look further ahead on the spline as it goes and slow down if it determines it needs to turn beyond a certain amount

#

I think the Game AI Pro books have some sections on car AI so maybe that's worth looking at also

uneven cloud
#

I did type out an answer yesterday.

uneven cloud
misty wharf
#

Well I mean maybe some third party system would allow what he wanted to do with it out of the box was mostly the point :)

pallid mica
#

I think another approach could be implementing an alternative FindPath function that does actually forward the AgentRadius to the dtNavMesh and filter cells via that.
But that's just a theory of mine.

pallid mica
misty wharf
#

Well I mean if you were to have it autogenerate the modifiers that would work for dynamic meshes also wouldn't it?

pallid mica
#

Yeah I see it now. They also say the Radius during pathing would increase cost. Which I could see, but it can't be THAT big of a cost change

harsh storm
#

(I read pretty much everything Luthage says - she is so knowledgable & helpful πŸ˜…)

pallid mica
#

Like, directly add the flag during generation, no additional mods

misty wharf
#

Ah yeah that's basically what I meant :)

pallid mica
#

Yeah but the recompute is apparently pretty expensive

#

The person I talked to only pulled that off cause they have a static, baked navmesh

#

With the amount of stuff that can go on in a game, I don't see how adding a simple float check to the query would break anything

#

Like, it's not free, but how bad can it be

#

Probably depends on how bad it is to get the data from the poly

#

We decided on the grouping stuff now anyway and probably won't further touch the topic.
Still good to discuss it once in a while to learn the limits of the existing navigation.

harsh storm
#

From what I've learned from Luthage, stock navigation leaves much to be desired; havok's stuff is where the hotness is.

uneven cloud
harsh storm
#

(But stock navigation works well enough)

pallid mica
#

The NavMeshes are recomputed when the game loads the level (on that project) and having 2 already takes a few seconds to build for a given island. They spawn randomized structures, buildings and more at the start. Adding more NavMeshes would just make that wrose

uneven cloud
#

Havok doesn't support dynamic runtime generation though.

pallid mica
#

Yeah players can place new buildings where the NavMesh has to again rebuild

#

The only downside to the grouping is that anything between NavMesh X and NavMesh X + 1 now has to walk through gaps as large as X + 1 AgentRadius

#

Solves the "getting stuck" part ,but not necessarily logical for a player to see a smaller creature walk through a big gap

uneven cloud
#

Yep. Which makes sense. You don't want them going where they might not fit.

pallid mica
#

Right, but that's what we had, also partially due to Epic's comment on the NavMesh agent radius

#

Which says to use the radius of the SMALLEST agent that traverses the navmesh

uneven cloud
#

You don't want that. You want your buckets to make sense.

pallid mica
#

If I group let's say 6 Characters with the following numbers:

30, 35, 40
180, 200, 220

In two groups, Epics comment suggest that the Numbers would be 30 and 180 for 2 NavMeshes

#

But that's total nonsense

#

That causes 35 to 220 to use the 180 one

#

And 200, as well as 220 to get stuck

#

Cause they still path through 180 corridors

#

Such as shitty comment (unless I misunderstand the comment)

#

So we now set them to 40 and 220

#

And that works fine

uneven cloud
#

On P2, we had 3. So small, med and large. I don't remember the exact numbers, but we use the largest radius of each bucket

pallid mica
#

In The Ascent we had 2

#

The 3rd one would have been too much

#

I wanted a third one to spawn loot on :D

uneven cloud
#

Did you use navigation streaming?

pallid mica
#

Idk anymore. That's 4.26+ or whatever the version was

#

And we had to ship for the older console generations

#

I also didn't set that up. I only knew about it cause I wanted another NavMesh with more precision

#

I know that RAM was a problem, cause they took too much

#

At least in return for what the 3rd one was used

uneven cloud
#

Same with P2. We had to use navigation streaming to ship

pallid mica
#

I can't say if we used that or not. Simply don't know

#

I know we had a pretty annoying thing going on with a navigation ping

#

That was supposed to show you where to go

#

Which was added last minute

#

And we had levels unloaded with no navmesh available to path the ping along

#

I think they added invisible meshes to allow pathing of that ping

#

But that was probably just a last minute make it work solution

uneven cloud
#

Sounds like you did use navigation streaming.

pallid mica
#

The Ascent was quite huge, idk how that compares to P2

obsidian igloo
#

how would you guys find the nearest point on the navmesh using a point that is not on the navmesh? like here? my chase AI stop moving when the the player is not standing directly on the nav mesh. ive tried using project point on to navmesh but it doesnt seem very consistent

uneven cloud
#

Depends on what you mean by huge

pallid mica
#

We had 3 or 4 tiers that were their own persistent levels and that lots and lots of areas in one tier that were all streaming levels

pallid mica
#

So you were able to run for quite a while, go to different towns and what not,

#

Even had a train system iirc to bridge some of the travel time

#

I haven't played P2 so I can't compare

pallid mica
uneven cloud
uneven cloud
obsidian igloo
pallid mica
#

That sounds kinda strange

uneven cloud
pallid mica
#

Like, I get that the point might simply project to something you didn't expect

#

But that's kind all

obsidian igloo
pallid mica
#

If you have a point that is next to the stairs/ramp, in the air, above the floor.
And you have an extent that can reach the navmesh on the floor and the navmesh on the stairs/ramp, then yeah, it can find either

uneven cloud
#

That's why I recommend the EQS. You can do tests to get a smarter location.

pallid mica
#

But shooting off to a location not even close is strange

#

Yeah I mean, EQS can generate a few points, from which some of them will be garbage, others will be where you think they will be and you can filter on more stuff than just that

#

And then pick the "best" one

#

As you can also score them

#

Not sure how often you would want to execute that query

#

But I guess some sort of low tick service could do that for you

#

Been a while since I touched Behavior Trees

uneven cloud
#

A service is how we do it. With the EQS being time sliced, it doesn't explode perf

obsidian igloo
# uneven cloud That's why I recommend the EQS. You can do tests to get a smarter location.

curious of your EQS method though, I dont want to run a huge EQS constantly for tracking but if the chase target for the eqs is beyond the extents of its query distance like in this draw over, that would still make AI stop moving no? I suppose I could do a stepped test and grow the EQS if the AI cant find a reasonable route but im not sure if thats a good way to go lol

obsidian igloo
pallid mica
#

RIP

uneven cloud
pallid mica
#

I'm so happy I don't have to touch StateTree anymore atm

#

I had my fair share of time with it with Mass

#

Running traditional AI via it is the very last thing I will ever do

uneven cloud
pallid mica
#

Hm, I would need to check. The slicing would need to happen inside of each individual test

#

Not running the next test if the previous one took too long is way simpler

#

Maybe you just don't have expensive tests

uneven cloud
#

Even if we don't use expensive tests, never going over 2ms would be impossible.

#

I believe the change is in how the iterator works, but it's been a while since I dug into it.

nimble smelt
#

Is there a way to wire up blackboard key variables in a pawn? Or do you just need to call it with the key name?

upbeat hamlet
#

Referencing an older reply πŸ™‚
I can't make this work, I tried lowering the rotation rate, but my enemy character is still snapping to the new direction instantly when turning around.
Am I missing anything else?

uneven cloud
nimble smelt
#

BP

upbeat hamlet
uneven cloud
nimble smelt
#

Tragic!

uneven cloud
upbeat hamlet
uneven cloud
stiff gale
#

How do i trigger sight sense manually?

#

Something like provokenoiseevent

mortal bay
#

I'm trying to call "rotate to face BB entry" to face another character. For my humanoid character, it doesn't work. The character doesn't rotate. For my wolf character, it does work. Does anyone know any possible reasons for this? I verified that what they're rotating towards is valid. Also, the "move to" node works for both.

inner zephyr
uneven cloud
uneven cloud
mortal bay
uneven cloud
mortal bay
#

Visual logger - the AI debugger or?

uneven cloud
#

Also when is that code being called?

mortal bay
#

In the character's initializer

uneven cloud
#

The visual logger is a tool in tools/debug.

#

What is the character's initializer?

mortal bay
#

I just changed something and it worked. Let me check something quick, and I'll get back to you with what it was

uneven cloud
#

If you mean the constructor, what you set it as in the BP will stomp those.

mortal bay
#

But thanks for the help -- I removed those unnecessary movement component changes

#

Yup. That was the problem.

#

the blueprint settings overriding what I set in the constructor. Sorry -- using terminology from another language

uneven cloud
#

Yeah you have to wait to set things like that until after the BP is loaded. I prefer using pre initialize components.

mortal bay
#

I don't love that though, because I have a lot of blueprint classes based on the C++ class, and I don't want to be worrying about the settings in each

Better to set the value in BeginPlay?

#

Got it.

uneven cloud
mortal bay
#

Oh, nice. I'll take a look through that

uneven cloud
#

"Post construction" is right after the BPs have run their construction scripts. So anytime after, you don't have to worry about BP settings stomping anything or you can use a variable that is set in BP.

#

I prefer using pre and post initialize components. Just to limit the number of functions.

nimble smelt
#

Okay I've got this pretty basic Behavior tree, and the problem is the "waiting" mode.

Basically the goal is, if the AI doesn't have a target, run the patrol sequence for 10s then enter waiting mode. Simple! The problem is, entering waiting mode just set's the controller's mode to waiting, so that finishes instantly, so the behavior tree moves on, which makes it instantly switch BACK to patrol mode again

#

How do I make a condition such that it STAYS in waiting mode?

uneven cloud
nimble smelt
#

So it just tells the controller to stop moving the pawn basically

#

Movement is kinda automatic on these things, they're either chasing or patrolling so far, waiting mode is new

uneven cloud
#

That's a really bad way to architect it, but if that really the route that you want to take, the task should not instantly return. It should stay in the task until the waiting mode has finished.

#

There's literally a BT task to wait, so I don't understand why you need this extra waiting mode.

nimble smelt
#

For a time, though. The waiting mode NEVER finishes, it can only be interrupted.

#

I see what you mean about the architecture though, i know movement is normally a task. The thing is, what I'm trying to avoid is a pawn that moves to a waypoint, stops, finds a new waypoint, and starts moving again. That's why I have the wayfinding here, and the movement just on tick

uneven cloud
nimble smelt
#

that's exactly the problem with them actually! I want the pawn to always stay in motion (unless waiting) while simply updating the target location

uneven cloud
#

The movement should never be on tick.

nimble smelt
#

It HAS to be on tick, how else would you get smooth motion?

#

I'm not using any AI movement component for this. There's no value in doing so, because I'm writing my own pathfinding. (I've actually tried the approach in a previous AI of doing custom pathfinding but with a simple movement component, and it was way more trouble than it was worth)

uneven cloud
#

It doesn't HAVE to be on tick. How you get smooth movement is to turn on Use acceleration for paths on the movement component and tune the acceleration and declaration rate. Then use a service to update the target.

nimble smelt
#

Sure but the movement component is using tick internally obviously. I'm just doing that in the pawn instead because I'll never use this movement system for a different pawn

#

I think the root of the problem is that this system has no way to conceptualize a move as something that takes a certain amount of time. It's either not moving, or it's just moving, continuously, with a destination that updates constantly

nimble smelt
#

I mean internally the AI movement component has to be doing this same thing, right? When you say "move to location" it stores that target location, but then it also flips some internal boolean that enables its on-tick movement function.

#

Okay, more basic question: is it guarnateed that ReceiveExecuteAI gets called before ReceiveAITick? Like can I use it to set up some vars I'll need on the tick?

nimble smelt
#

Okay, updated, still not working. The problem now is that it gets stuck in that infinite wait, even though the condition on the parent node is no longer true!

#

See, that blackboard value IS set but it just stops checking it! Frustrating.

stiff gale
# uneven cloud You don't.

My NPC stop detecting each other after they kill some from the other teams. If debug, I can see the sphere on both of them but they stand in front of them in idle state. If I change them from idle to roam then they detect again.

uneven cloud
nimble smelt
#

So I fixed that last issue by switching to a conditional loop, but this one is less simple. You can literally see the check is failing, but it stays stuck in this node

uneven cloud
uneven cloud
nimble smelt
#

I just found observer aborts actually! But.... it's not an option for this one?

uneven cloud
nimble smelt
#

Yeah, I moved that condition to the parent node and it's working fine now. Weird!

uneven cloud
#

I don't understand why you have a blackboard decorator under a simple parallel

nimble smelt
#

I don't anymore, at least not directly.

#

The decorator on the wait is just to skip the wait in the case that a waypoint could not be found, the wayfinding system is intentionally chaotic so the odds are decent the next tick it'll work

uneven cloud
#

Like with that one, why do you have a blackboard key for movement goal is set? That's a sequence so if the task before it is setting the movement goal, if it succeeds then the next task is run. If it fails it's not. So having a decorator is redundant

nimble smelt
#

Redundancy is resilience! πŸ˜„

uneven cloud
#

No, it makes things confusing. Use the BT functionality.

nimble smelt
#

The honest answer is there's a lot of redundancy in this code right now because i'm in the process of moving from a quick, hacking POC where this was all in one pawn, to an actual BT powering the logic

uneven cloud
#

And it's a waste of a BB key

nimble smelt
#

No the BB key is needed either way, the move node uses it

uneven cloud
#

All that sequence functionality should just move to a service anyway.

#

Makes it much clearer and removes the need for a simple parallel

nimble smelt
#

Probably eventually, but right now it ain't hurtin' nobody there.

uneven cloud
#

It hurts me!

nimble smelt
#

haha you have no idea the extent of my crimes

uneven cloud
#

Apparently so

nimble smelt
#

Anyways I've been hesitant to make that a service because I'm doing allllmost the same set of steps in a different place, but not quite.

#

Plus the pursuit sequence isn't done yet either, it's gonna have a "check distance -> Attack" branch too

#

PLUS I dunno how I'd do the fast retry on failure if it was a service

uneven cloud
#

Well if it's almost doing the same thing it can be a service with options exposed.

nimble smelt
#

The other reason I'm hesitant is that UpdateMovementTarget is the computationally expensive part of all this, that's when it does the pathfinding, so I like that I can do other checks before running that each time

uneven cloud
uneven cloud
nimble smelt
#

(The check is also kind of gross code so I like having it in a separate task that just works and i dont have to think about it)

uneven cloud
nimble smelt
#

It's like 3 functions lol

uneven cloud
#

It can still be 3 functions.

alpine rover
#

my ai controllers of my hostile enemies aren't recieving a behaviour tree

#

they have the red aicon

silent hamlet
sudden citrus
#

Is there a way to make an optionally bound input property on a State Tree node? It seems like that's what happens for all subobjects of nodes, but properties of nodes themselves will be either required to be bound (using the Input category) or constant

misty wharf
#

Have you tried using Parameter as category?

sudden citrus
#

Ah, yeah it's either that, or leaving category empty works too (it's the default behaviour). The problem is that instanced properties will either not be bindable (when using the Instanced specifier), or not display properly (when not using the Instanced specifier)

#

but that's a different issue entirely that I managed to forget about

#

(and the property in question is an instanced subobject)

misty wharf
#

Oh, yeah I never tried instanced in state tree tasks πŸ€”

sudden citrus
#

sorry clarified my original comment

#

The big picture is: I made a task to execute a Gameplay Behaviour (from the AI behaviours plugin)

sudden citrus
#

I'll dig into the binding extension, maybe it has a problem with instanced props.

sudden citrus
#

It seems like the required property flag CPF_PersistentInstance is not present in my UProperty when inspected by the binding extension, weird

#

not a problem to solve today probably

fallow hound
#

hi all, I think I've noticed that when my character capsule is large enough, the actors location is far enough away from the navmesh that pathing queries fail, is there a way to ensure pathing is checked from the bottom of capsule not the center?

#

making a new context that reports location as location - capsule height seemed to help

#

so maybe the moveto tree task does project, but eqs pathexist doesnt?

mortal bay
#

I'm working on an AIController for NPCs in my game. I would like the NPCs to be friendly towards a player in general, but if the player attacks one of the NPCs, all of them should see the player as an enemy. After certain actions in the game take place, the player should be seen as friendly again.

My current approach is to override GetTeamAttitudeTowards in the NPC's AIController and check a list that tracks the current enemies to the NPCs, seeing if the player is in the list. Does anyone have other tips for accomplishing this, or think I'm going about it wrong? I'm curious because the friendlies/enemies/neutrals system seems complicated

nimble smelt
#

Is there a way to have a BT Service fast-retry in the case of failure? Like if normally it runs every 1s, but if it fails I want it to try again next tick?

misty wharf
#

I actually have a somewhat similar implementation in one of my projects where if the player attacks civilians makes the police faction hostile towards the player via a similar mechanism

mortal bay
uneven cloud
uneven cloud
nimble smelt
#

Is there a decent blueprint tutorial for team affiliations? I need a solution for something like that but with a preference toward the simplest possible solution, I don't need any concept of attitude as anything but a boolean. Attack on sight or ignore entirely are the only options I need. I don't even need a way for anything to change affiliation.

misty wharf
#

You can't implement it in blueprints

#

Or, rather, you can't implement the builtin system in BP's. Of course you can build a custom system if you want

nimble smelt
#

Oh good. I actually prefer to build custom from scratch but it's so rarely the right call.

analog mural
#

Not very important, but do you guys specify AI values that are used in tasks and services like attack range, speed, etc. in the BT or in the AI character?

misty wharf
#

Depends. If it's defined in the character it can vary on a per actor basis, in BT you'd need to have separate BT's if the values need to be different

uneven cloud
nimble smelt
#

That's okay, I mostly only interact with the existing AI systems via wrappers anyways

soft sun
#

@nimble smelt are you wanting to use the generic team interface for perception? i just did this last weekend so i could help

nimble smelt
soft sun
#

Why not? its very simple to do in c++, and then just inherit from that class if thats all you need, i can show you if you want

nimble smelt
#

Basically because kludging shit together in BP is fun, and setting up Visual Studio and the C++ build system is pain

soft sun
#

ah okay, I will say it is veryyyyy easy

#

if you care this is how i set it up, it is exposed to blueprints and i set the teams there

nimble smelt
#

We choose do these things not because they are easy, but because they are entertaining πŸ˜„

soft sun
#

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

#pragma once

#include "CoreMinimal.h"
#include "AIController.h"
#include "AIC_Human.generated.h"

/**
*
*/
UCLASS()
class ETERNALANGUISH_API AAIC_Human : public AAIController
{
GENERATED_BODY()

public:
AAIC_Human();

virtual ETeamAttitude::Type GetTeamAttitudeTowards(const AActor& Other) const override;

UFUNCTION(BlueprintCallable, Category= "Team")
virtual FGenericTeamId GetGenericTeamId() const override;

UFUNCTION()
void OnTargetPerceptionUpdated_Delegate(AActor* Actor, FAIStimulus Stimulus);

UPROPERTY(VisibleAnywhere, Category = AI)
TObjectPtr<UAIPerceptionComponent> AIPerceptionComponent = nullptr;
TObjectPtr<class UAISenseConfig_Sight> AISenseConfigSight = nullptr;
TObjectPtr<class UAISenseConfig_Hearing> AISenseConfigHearing = nullptr;

protected:
virtual void BeginPlay() override;

void DefineBlackboardNeedKeys();


UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= "Team")
FGenericTeamId TeamId;

};`

#

so just 3 lines

nimble smelt
#

I think when I say I don't touch C++ people think I dislike C++ or don't know it, when really it's just I don't want to maintain a workspace that can build those solutions because I've tried that and it's awful

soft sun
#

ah that makes sense! sorry if i got the wrong impression

#

I used to be real scared of it, so i try to encourage :3

nimble smelt
#

I mean, I haven't written C++ in years either, but I'd happily relearn it if it wasn't so painful to work with comparted to BPs

soft sun
#

I have a really hard time mixing the two together, i still have some gaps to fill for sure

#

it gets me all frustrated lol

nimble smelt
#

The ability of blueprints as a system to just GO, just RUN every time, the second you want them to, with no builds no setup no config barely even taking a second to compile, that's something C++ just can't seem to manage, and it keeps me away.

misty wharf
#

Tbh I don't find C++ particularly painful to work with. You press a button and it compiles. That's pretty simple lol

soft sun
#

Thats definitely nice. Though I will say using rider, and a beefy pc and i just recompile and the project loads reallly fast

nimble smelt
#

I still maintained the workspace best I could, but every time I touched it I basically lost a day to setup and debugging again. That cycle repeated like 3-4 times.

#

I built a new computer a couple months ago and I haven't yet had reason to setup a dev environment for C++ on the new one. And I aim to maintain that state of things as long as I can

soft sun
#

haha good luck!

misty wharf
#

Frankly if you are serious about gamedev you're just handicapping yourself by not using C++ at all

soft sun
#

I sort of get tired of all the little buttons in the blueprints and the interface, at least in code we can go to definition and stuff

#

i feel like i always miss a magic check box

#

but it comes with the territory

nimble smelt
#

If I'm handicapping myself, that just makes it fair for everyone else πŸ˜„

soft sun
#

haha thats the spirit

misty wharf
#

lol

soft sun
#

I feel like unreal c++ is really toned down as well

#

like ive only done javascript at work and it wasnt too bad

#

of a transition

nimble smelt
#

That's the other thing, even if you KNOW C++ you kinda have to learn "Unreal C++" as a different thing

uneven cloud
#

C++ without memory management makes it super easy

soft sun
#

not really man

#

if you know code its not that bad

#

yaknow what i mean

#

i just get scared when i see pointers but i havent had any crashes yet

misty wharf
#

It just has a few macros you use to do a bunch of UE things

uneven cloud
nimble smelt
#

I THINK that's all of em

misty wharf
#

My list of languages is so long I don't know if I remember them all lol

soft sun
#

If you are a reader, the AI for unreal 4 book has c++ examples for every single project in the book, i read it twice its so good.

nimble smelt
#

I'd rather spend a day coding than an hour reading πŸ˜›

soft sun
#

great for just learning c++ in general for unreal

misty wharf
#

C++ ain't that high in my list of languages I'd like to use but I don't particularly mind it in UE at least

#

I think I'd still rank it above Java just barely lol

#

But below C# definitely

nimble smelt
#

Now that Kotlin exists there's literally no good reason to use Java.

soft sun
#

is verse still coming?

#

i dont really know why i would use it though

misty wharf
#

It is, it's available in UEFN already

soft sun
#

ohh cool!

misty wharf
#

It seems like a viable alternative to blueprints, I was hoping it would have better performance so it'd be more of a C++ alternative, but I heard it runs on the BP VM so I'm not so sure

soft sun
#

ahh, thats a good use case

#

that would leave blueprints to just animation stuff, honestly probably a nice workflow

nimble smelt
#

I think a lot of people are worried about the perf of blueprints but they've only ever heard it's worse in the abstract

misty wharf
#

Yeah most of the time it's entirely adequate

#

But I've definitely ran into a bunch of cases where it wasn't

soft sun
#

Yea i just dont liket the lines

#

it takes me forever to read a blueprint

misty wharf
#

and my projects are not exactly triple A either lol

soft sun
#

I think for AI it probably matters yea? like tasks should probably be in c++?

uneven cloud
soft sun
#

he brings it up in the book

misty wharf
soft sun
#

but its great for learning c++

misty wharf
#

If it only runs on occasion like a BT task typically does, it doesn't make that much of a difference

soft sun
#

ah that makese sense

misty wharf
#

If you have a lot of AI's running the task then you may start seeing a difference, but it's always the usual mantra: Profile first

nimble smelt
#

Most of the time your FPS is all down to render anyways

nimble smelt
misty wharf
#

That's not true actually

uneven cloud
misty wharf
#

Just having an empty tick event in BP has a cost

soft sun
#

Yes i read this recently

nimble smelt
#

True but it's VERY small

soft sun
#

Yes

misty wharf
#

Yeah, it's just one of those things that can add up

nimble smelt
#

Premature optimization is the enemy.

misty wharf
#

Apparently almost all my projects somehow have random things that add up and then I have to fix them

#

lol

soft sun
#

Its the first place the unreal devs look when supporting games, from what they said

nimble smelt
#

Every time I've had framerate troubles and profiled it, the answer was like one specific stupid thing I was doing. It's never "oh no I shouldn't have used blueprints" it's "Oh, turns out I shouldn't apply radial damage on tick"

soft sun
#

Oh yea i agree with that

misty wharf
#

I've had a lot of issues with perf relating to NPC's because apparently my projects gravitate towards having a lot of them so even when they sit in the level idle waiting for the player to walk into them they incur an FPS cost :P

soft sun
#

Have you looked into the vertex animation stuff? it works realllly well

uneven cloud
misty wharf
#

True

#

One "weird" BT perf issue I had was that the BT search was pretty high. Turns out that if you have a BT which just keeps hammering the same instantly finishing node that is expensive

#

Replace it with a Wait node so it doesn't repeatedly keep hammering it and oh the performance is now much better :P

uneven cloud
#

Yep

soft sun
#

Thats a good tip

misty wharf
#

It shows up in Unreal Insights as "BT search" or something like that in case you run into it :)

#

It's basically the time it takes for it to find a node to execute

soft sun
#

Basic question, if you define a component in c++ and then inherit that class with a blueprint, is the execution of that component still in c++?

uneven cloud
#

Depends on the function.

soft sun
#

I was reading how the character movement component is really heavy, and wondering if that helps at all

uneven cloud
#

If it's overriden in BP, then it's not

misty wharf
#

Simply having your function be BlueprintNativeEvent incurs a cost when it gets called, even if it isn't implemented in blueprints at all

soft sun
#

oh interesting

misty wharf
#

Compared to a "regular" C++-only function call

uneven cloud
#

That's because it needs to look up to see if it's been overriden

misty wharf
#

Yeah

soft sun
#

man that website is rad

uneven cloud
#

The biggest cost issue with BP is ref chains.

soft sun
#

Like dependencies?

#

Or like object references or something?

uneven cloud
#

Any hard reference. If you have a BP that hard references anything in data, the size of that BP in memory now includes that reference.

#

BP inheritance causes hidden hard references. Casting to any BP in BP causes a hard reference.

misty wharf
#

working on my editor plugin I noticed a hitch in some cases when a certain BP was being referenced... it was just an item with one graphic on it, or so I thought

#

Turns out the BP graph happened to cast something to another class which then pulled in a huge chain of stuff :P

#

It's a bit annoying you can't query for info on the BP inheritance chain and stuff without having the whole thing in memory, wish you could just load up the metadata or something

#

I did hear about some dark magic called "parsing the uasset file" but I didn't dare go there yet lol

soft sun
#

Oh lord that sounds fun

#

That would be like blueprint reflection basically right?

#

I may be using that term wrong

misty wharf
#

Something like that

soft sun
#

Whats the max AI you have gotten in a your games at once?

#

we should have an AI drag race haha

#

that would be fun

uneven cloud
#

I've been able to have > 300

soft sun
#

Oh my like full actors????

uneven cloud
#

Yes

soft sun
#

Thats a lot, I was testing last night and I squealed out at like 100

#

frames drop harddd

#

Any big tips for that kind of thing?

nimble smelt
#

Profile.

uneven cloud
#

It takes being good at profiling and optimization

nimble smelt
#

You don't know what's slowing you down until you profile.

soft sun
#

too right

uneven cloud
#

I also write good AI code.

misty wharf
#

Ez tip: Don't use CharacterMovementController and most of your woes disappear

#

:P

soft sun
#

LOL

uneven cloud
#

I use the character movement component just fine.

soft sun
#

maybe we will get lucky and and AI will make A* even better

#

Do you have any strategies or you just profile profile profile?

misty wharf
#

You have to manage CMC pretty carefully if you want 300 AI's using it because even if they just stand around it incurs costs already

uneven cloud
#

Unlikely to happen. LLMs aren't AI

#

You can optimize the CMC. Especially the find floor functionality.

#

Using nav walking instead of walking is a very easy way to optimize the CMC.

soft sun
#

now thats a tip i can use

uneven cloud
#

Instead of a full capsule sweep for find floor, it projects to the nav mesh.

misty wharf
#

Yeah navwalking helps but this is also part of "careful" because if for whatever reason it momentarily thinks it can't navwalk, it reverts back to regular walking

soft sun
#

whats the trade off?

#

there usually is one

misty wharf
#

It literally walks on your navmesh so if the mesh is janky then the movement is also janky

soft sun
#

Did you havea resource to this? i'm not finding much besides the findfloor function

#

ah okay

misty wharf
#

you can just change the default grounded movement mode or whatever it was called to NavWalking

soft sun
#

Ah okay

#

sweet ty

uneven cloud
#

You still need to profile early and often.

soft sun
#

Using events is super helpful too right? like delegates and stuff?

#

so we arent on tick

uneven cloud
#

It depends

wide lily
#

Hello, maybe a simple question but I got an AI that I want to jump whenever it detects an obstacle in front of it. I have set it up using a triggerbox in front of the AI, as soon as the triggerbox hits something it jumps. I tried to mess around with the collision settings of a cube, if I use the collision preset "overlap all", the ai jumps in time, but the cube doesn't have collision. I got query and physics collision enabled though. Does anyone have a clue how I solve this?

wide lily
nimble smelt
#

Okay wanna run a plan by someone else before I do it. This pawn I'm working on attacks by basically jumping at the player and exploding if it hits. A timeless classic. If it misses, it goes back into AI mode and takes another try.
My plan right now is to have the "jump" actually destroy the actor entirely and just spawn a projectile with the same model. If it hits something other than another pawn, destroy the projectile and respawn the pawn. That way I don't have to deal with writing code for the pawn to actually "jump", and I can isolate all the on-hit functionality.
Is that all... sane? Any pitfalls I'm not thinking of?

misty wharf
#

Why not just use the projectile logic on the pawn to begin with?

#

Seems like a rather elaborate system to avoid doing that

nimble smelt
#

Two reasons, one the pawn has a some stuff that it just DOES every tick, that I'd have to turn off. I'd also have to make sure the AI tree had a state for "flying through air" and could resume function after. It's a lot of things to pause and resume

#

The other reason is, a pawn either has the "projectile movement" component or doesn't, right? It seems odd to have something move as a projectile momentarily then not again

#

On a higher level, there's basically nothing about its function as a pawn that I need when it's a projectile, and nothing about it's function as a projectile that I need when it's a pawn

#

They share a mesh, that's pretty much it

upbeat hamlet
#

Hey guys, I'm having a couple of issues with my walking robot spider thingies.

  1. I want them to keep a distance from rocks. If they're too close my procedural control rig animation will put their legs onto the rocks like on the image.
    I tried increasing the capsule collision in their character bp, but that seems to mess up pathfinding with EQS. They can't find a valid location anymore.
    I also tried to increase their agent radius, but that doesn't seem to do anything. How can I make them keep a distance from rocks and other stuff?
  2. I'm not sure how to set up their collision in general.
    If I run them over with my vehicle, they'll just walk over it like in the screenshot.
    I'm actually not even sure what kind of options I have regarding how to handle running them over.
    Like, add a larger sphere collision and on overlap something let them evade or something like that? But what if it still happens?
    As a simple workaround solution, I tried adding a larger block collision but that again messes up pathfinding.
misty wharf
#

Replacing it with a projectile and then respawning it would probably work but just seems kinda complicated for something like this :D but ymmv I guess

#

Also you can spawn a projectile movement comp on it at runtime for this purpose and then delete it, or just keep it but inactive

nimble smelt
#

I guess I don't get how it's complicated, it's like 2 function calls isn't it? Spawn projectile, destroy actor then spawn actor, destroy projectile.

misty wharf
#

Although unless it has some very specific movement requirements, the projectile movement stuff is pretty trivial to implement yourself also I think

#

Well sure, but you need to set the projectile up so it goes into the correct direction, and then when respawning the AI needs to go back into the appropriate state it was in before

#

Spawning actors is not also super performant but if you're not planning on doing a lot of this all the time it probably isn't going to matter

soft sun
#

@uneven cloud How hard was it getting that many actors moving around at once?

#

Did you happen to have a demo?

uneven cloud
soft sun
#

What all were they doing if I might ask?

uneven cloud
#

They were doing quite a lot. It was a test for a AAA game. We decided from a design perspective that we didn't want that many, but it was possible from a technical standpoint.

median socket
#

First time I heard of this but it sounds like a neat optimisation!

#

I would maybe imagine not... I'll try it later!

misty wharf
#

It should handle proxies yes

median socket
#

hottt

soft sun
#

Is navlink proxy fast?

misty wharf
#

As opposed to what?

soft sun
#

I thought there was another way to do it

#

I guess that was a dumb question

misty wharf
#

Well at least I'm not aware of other ways of doing what navlinks do

nimble smelt
#

How do I pause behavior tree execution in a blueprint?

#

or can it be done from a pawn or controller

#

Actually scratch that, better question: How can I notify a behavior tree task that the task is done?

#

When this thing goes into projectile mode, I want it to fly until it hits something, so I'm going to need to wait somewhere for a collision event.

median socket
#

A task waits until FinishExecute is called within it, unless I misunderstand your question.

nimble smelt
misty wharf
nimble smelt
#

So pawn dispatches event, BT task registers for it, event in BT task calls FinishExecute? That works for me!

misty wharf
#

Yep

mortal bay
uneven cloud
daring locust
#

I'm trying to make a branch of sort, to determinate whether the enemy should do a melee or ranged attack based on distance, but I'm having some issues with the right-most branch not executing. Anybody knows what's the proper way to do that? (Play sound task is there just so I know it executes)

misty wharf
#

If it's intended to execute only one of those, then you want to use a selector for the part that chooses the branch

#

A sequence node will abort if one of its children fails, so if the first condition doesn't succeed, this causes an abort of the entire sequence

#

If you instead place a Selector so that the sequence has your find distance and selector, and the selector contains the two blackboard conditioned ones, then I think it should work as you wanted

inner zephyr
#

Has anyone ever had the issue that AI doesn't do what it is supposed to do but when you turn on visual logger it runs fine? This is so weird

misty wharf
#

I've had some issues like that in the past with some other things where debugging causes it to behave differently, those are always fun

#

also known as a heisenbug

#

I would try to add some logging/printing into the logic itself

daring locust
daring locust
tawdry mulch
#

Using EQS is there a way I can filter out the circle points that arent against the wall like the others? Im using the circle generator because its the only one that puts the point against a wall like a point of cover. If there is a better way, let me know

tawdry mulch
#

making the minimum radius just below the circle radius seems to filter out anything thats not being blocked by a wall. Seems to be ok for what I want

misty wharf
#

That sounds like a decent way to do it. You might need a custom generator otherwise

stray widget
#

Finally!! I started to get a hang of the EQS systemπŸ˜‚πŸ˜‚!!! DANG!!

upbeat hamlet
#

why is it, that when I increase the capsule size of the character pawn, eqs generates no valid pathfinding points anymore?

dense owl
hallow abyss
#

Hey guys, trying to set up some enemy AI, pretty basic just attacks you no patrol. Issue I'm having is, two can't attack me at the same time? One just stops and de-aggros once the other attacks me... Any ideas what I'm doing wrong?

open swift
#

what's the recommended way to abort a move to order? does StopMovement in the CMC just cancel pathfinding and movement input? I don't want to zero out velocity or anything like that in case i'm knocking an AI back or throwing it in the air or something (this is from Blueprints, in C++ it seems fairly straightforward as you can tell the pathfollowing component to stop)

mortal bay
#

Where is a good place to set the FGenericTeamId of the various characters?

uneven cloud
uneven cloud
uneven cloud
open swift
#

AI Move To bp node

#

was trying to make a task that does a MoveTo then when i get close enough i EQS query for a specific spot and do a move to a location

#

so that i dont have to query all the time when im far away, may not matter though

uneven cloud
open swift
#

alright thanks

uneven cloud
sudden stag
#

in this node tree. if the cooldown decorator returns false, i expect the Selector to keep trying to execute the same node until it succeeds, but instead it falls back to the sequencer above that leads it to reach the BadConditionMet node. is there another way to handle this?
i just want it so the Selector would keep trying to execute the BTT_MeleeEnemy without falling back

mortal bay
uneven cloud
uneven cloud
sudden stag
#

im taking about the selector btw. not sure if i made that clear πŸ˜…

uneven cloud
sudden stag
#

so when the decorator disallows the execution of the node, it forces the selector to fallback?

#

oh root is the start of the execution πŸ€¦β€β™‚οΈ sorry im dumb πŸ˜…

uneven cloud
sudden stag
#

but what you said made things so much clearer now. thanks a lot!

uneven cloud
sudden stag
uneven cloud
#

It says if all children fail, the selector fails. When a sequence or selector fails, it doesn't keep trying nodes. It restarts the tree.

sudden stag
#

yep now i understand that. it was a skill issue on my part πŸ˜†

cyan sigil
#

Hi. I want to be able to give my AI character a stat change while they are within a particular branch of my AI tree. Is doing so through a Service the best way?

harsh storm
#

It's a solid way, yeah

#

I forget the exact method names, something like OnBecomeRelevant and OnCeaseRelevant.

rustic aspen
#

Hello, this may be a dumb question but I can't find an answer anywhere through research. I am new to Unreal and I am working on a pawn that moves towards the player when they overlap. The problem I am getting is that everytime I go to playtest, I get a red message saying that the NavMesh needs to be rebuilt. I've tried tweaking the project settings a few different ways and nothing seems to be working. If I'm in the wrong channel please let me know. Thanks in advance!

cyan sigil
misty wharf
#

Oh man is there finally going to be a videogame of the fantastic movie Twins?

final drift
#

hello guys, how i can limit axis for my ai character, i try to make it move only right and left ,smth like moving wall, how can i do it?

hazy arrow
final drift
hazy arrow
final drift
hazy arrow
#

If you really need to use only AI then the easier way would be to make the navmesh small so that it can only go left or right

Alternatively, there is nav filter that you can use and i believe there was some setting for limiting movement

However, to me it doesn’t sound you need ai navmesh, rather something custom. You could use interpolations to move left and right and make your own bt tasks to make them go where you want to

final drift
misty gale
#

Moving along a spline sounds valid

urban lake
#

Hi there πŸ‘‹πŸ»

I'm setting up some Navmesh bounds but in some areas I will need to update it on events. Anyone know why the Navmesh modifier updates in editor but when I do the same thing in blueprint, nothing changes?

hazy arrow
urban lake
lime jolt
#

Has anyone used the cooldown Decorator in the Behavior Tree? Seems like it starts on CD when you start playing in the editor (which is what i want), while it starts off CD in a packaged build. it's weird.

misty wharf
#

Really? πŸ€”

#

I always thought it was weird it starts in cooldown, but does it really behave differently in packaged?

#

That seems like it would make the decorator completely useless almost because it makes testing any logic problematic

lime jolt
#

Yeah it really is weird. I wouldn't know what else is different, besides the game being packaged. In Editor everything's fine. The AI has some long cooldowns, about 180 seconds, but when I try it in the packaged build he executes that node right away and only goes on cooldown after that.

#

which is... quite annoying in a boss fight.. because the enemy fires all abilities immediately xD

rustic aspen
oak bridge
#

You didnt change cell size or any other setting right? Because as I know (not much experience in ai) , since it happened once to me, it was that my setting were wrong (maybe too costly, idk but it somehow gave problems), did you try removing all the navmesh and add it back?
Also if you show the navigation do you see it actually green on the floor?

rustic aspen
#

I adjusted the default cell height to allow the navmesh to work over curbs. I am seeing green on the floor when I show navigation. I'll give deleting and adding a new navmesh to see if that will help.

oak bridge
#

So i didnt even fix it

dim lynx
#

hi

#

why nav link doesn't

#

launch character

#

but printing

#

it looks like the character is trying, maybe he's jumping slightly somewhere, but I don't know

rustic aspen
dense owl
#

Oops I forgot where I was for a sec there πŸ˜…

dim lynx
#

what is the best way to get AI to open doors? my guess is Nav Link but I could be wrong, I generally tried with this and the AI ​​can't get through the door

dense owl
open swift
#

i know this is a bit counterintuitive, but can you disable ticking on a service? I just wanted to use one to respond to events while the subtree is running but I have delegates i can bind to and don't actually need to check on tick

misty wharf
#

Fairly sure it's possible in C++ services but I'm not sure if that option exists anywhere on BP based services

#

You could try setting the tick interval to -1 and see if that does it, or if not just some really large number

open swift
#

in BP i think setting tick interval <0 just fires every frame

#

ill see what i can find on the c++ side of things

mortal bay
#

If I have a UPerceptionComponent that's set to only perceive enemies, and a character becomes an enemy after already being within range of the UPerceptionComponent, how should I make the UPerceptionComponent notice them?

lyric flint
obtuse igloo
#

Hi everyone! I'm trying to have my Fish AI only navigate through a river but want to know if there's a way to have the navmesh act like a spline and generate that way? That way I don't have the fish navigating outside the river and onto the grass when I put an entire navmesh box over it. If not I'll probably see what I can do with the EQS and have the fish detect splines with a tag stating it's water. Any suggestions appreciated ^_^

misty wharf
#

If by "act like a spline" you mean generate along a spline-like path, there's no builtin way to do that. You could potentially create your own logic to generate it like that, but I suspect that would be rather complicated

obtuse igloo
#

oooff i'll figure out a workaround with EQS then, thank you!!

dense owl
#

I mean if you’re using a spline you could just have them follow that. Unless this is supposed to be COD Ghosts πŸ˜€

undone heron
#

is there something i can do to make AI prioritze certain parts of the navmesh for traversal?

#

For context, players can build roads, which the ai should then prioritze to get to their desired location, but if there's no roads available they should still be able to get to their destination

undone heron
#

Thanks, exactly what I was looking for!

proud flume
#

LogAIPerception: Warning: UAIPerceptionComponent::OnRegister: Perception Component is being registered with BP_MobAgentBase_C_3, they are designed to work with AAIControllers!

bitter wyvern
#

Is there a way to access the coordinates on a navmesh? I want to get a valid position to spawn an enemy. Is this a way to do this?

misty wharf
misty wharf
mortal bay
#

Something I'm confused about - say I have a character who is neutral towards 3 actors that are perceiving it. The character does something that makes itself an enemy of those 3 actors. Is there a best practice for updating their perception system to recognize this team change?

bitter wyvern
misty wharf
#

Yes, the name is something like get navigable point within radius :)

misty wharf
obtuse igloo
fickle scroll
#

Pretty new to BT, is there a way to make a selector pick randomly?

#

I assume a BTD with an output that selects random int or something like that? But i got no idea how to use that variable and make it proceed to a random sequence in its branch.

dense owl
#

Selectors go from left to right and stop at whatever succeeds first

harsh storm
#

Have to make a new composite node

#

At least I think that's what they're called. Can't remember exactly

dense owl
#

Aren’t those EQS nodes?

fickle scroll
dense owl
#

A sequence goes from left to right through every node/branch

#

Selector stops at first success

fickle scroll
#

So how do you get a random sequence in a batch?

mortal bay
#

If I attach a USphereComponent to a character and call GetOverlappingActors, will it automatically ignore self?

dense owl
dense owl
fickle scroll
dense owl
#

Might be better to just have the attack in the BT and decide which type of attack happens outside of it. Like using GAS to determine which ability will happen

proud flume
#

I'm having a little trouble determining how much complexity should be on the BT/BB side vs. the controller side. As an example I'm setting up my AI to handle multiple players at once, with logic for determining which player to target. My instinct is to do this on the controller side

#

And then manage targets in tick and assign the best current target as a BB value

#

But is this sort of thing better kept entirely in the BT? I suppose you could maybe do it with the decorators and such

dense owl
proud flume
#

I've peeked into that but it seems like it queries for targets every time? Is there some way to hold or work with just known targets at the moment? Thinkge

dense owl
proud flume
#

What event to use for when a target is acquired then? thinkPeepo

dense owl
#

it might work fine for your use case, test and find out. For me, I had to use EQS -> Composite Node -> Get Perceived Actors generator, because having multiple targets confused tf out of the perception update function and having to filter through the targets manually would've involved countless hours of work that's already done on the EQS side for you

uneven cloud
#

Why are you doing this?

#

There should be a function to update the stimulus source. You might need to unregister and reregister. It should be in the perception system, not the perception component

#

Forget actor doesn't do what you probably think it does. The sight sense caches off the targets based on team, so you need to update that for each listener.

#

The targets should certainly not be doing anything to the listener's perception component.

#

If the listener's team gets updated, there is a function for that.

#

The listener is the one doing the perceiving. The source is the one being perceived.

The team is not cached. The potential targets are cached. It's an optimization. Instead of going through all of the potential targets to check the team every update, it only goes through the targets they can perceive.

#

Correct

#

When a listener perceives a source, it can remember that it had perceived it. Forget Actor clears that memory.

#

You don't want to disable the caching. You can either call UpdateListener for every listener. Or see if there is an UpdateSource function that does the same thing. Or unregister and reregister the source. All of which should be done via the perception system and NOT the perception component.

#

Did you miss any of the times I said that it should be done on the perception system and NOT on the component?

#

At no point in time did I say to unregister a listener. I said to unregister and reregister a SOURCE

#

Unregistering a SOURCE removes it from any listener's cache. Registering a SOURCE adds it to any listener's cache.

dense owl
#

there's also source πŸ˜„

proud flume
#

So with MoveTo you can't set the acceptable radius dynamically, it's a fixed value for every user of the tree? So I made a task to do it using MoveToActor, and I noticed this Allow Strafe business

#

How do you utilize that? How do you tell ai to strafe? Thinkge

dense owl
#

By checking the box πŸ˜€

#

It’s mainly made for dealing with collisions afaik

open swift
#

can you do inheritance with blackboards in blueprint? not seeing the option to use my existing blackboard as a parent class in the editor

manic spoke
#

Does anybody have experience with working with hundreds of AI NPCs? I feel like the more I add, the "slower" they react to my player. It almost feels like their perception isn't being updated fast enough because there are too many NPCs. But it's not very consistent. Any thoughts?

open swift
# dense owl Doubt it? What's the use case

Having a parent blackboard with a set of variables that basically every NPC wants (target, a few combat components, etc.), and then the ability to inherit from it to add other keys for individual blackboards. its basically just copy/pasting but faster i guess

#

would make it easy if i decide i want every npc to have a key for their current target or their health level to add it to everyone at once instead of every different blackboard needing it

open swift
#

interesting

#

also not sure how i missed that

dense owl
#

I'd forgotten it was there tbh

open swift
#

was trying to find blackboard as a base class in the "create new blueprint class" wizard lol

dense owl
#

yeah it doesn't have a Create child class context item either

dense owl
open swift
#

yeah

#

if you pick that one it just inherits from whatever the base blueprint bb is

#

there's probably some optimization magic or something that prevents them from letting you do that

dense owl
#

same result tho (assigning parent BB that is)

open swift
#

for sure

obtuse igloo
proud flume
#

Ah, set focus Hmmge

dire fable
#

Hi guys ! I want my AI to dash attack the player when the AI is in range of the player (500cm) and has cooldown. Otherwise, the AI must move towards the player. But if the following behavior tree, the AI only dash when it has reached the player location. The "Is at location" decorator doesn't abort the current "Move to" task. How can I do this behavior ?
(For the exemple, I removed the cooldown condition)

#

(+ in reality, I have other abilities on the left of the tree with more conditions (cooldown, range, blackboard values...)

median socket
#

There are settings to adjust the abort behaviour on decorators, I seem to recall?

#

I could be wrong, haven't touched AI in a while.

dire fable
median socket
#

I see. But if the MoveTo node is set to track the actor (not just the position it was in when the node began), doesn't it abort on its own when it reaches the target radius?

#

That has been my experience with it, I'm pretty sure.

dire fable
#

the dash attack can be triggered if the player and the AI have less than 500cm. The move To target radius is ~20cm. If the AI is at 800cm, the AI move towars the play, then, when the distance is less than 500cm, the AI must trigger his dash attack

near flame
#

hey guys,this setup works fine but there is one thing i want to add then ai does not see the player after lets say 3 sec,he continues to roam around.Cuz now he follows me infinite after he sees me

dire fable
near flame
#

yeah ,in the first sequence

#

i dont set it back,where and how do i?

dire fable
#

Don't use Pawn Sensing component and use AIPerception instead

#

You will have callbacks when no pawn are in line of sight

near flame
#

i added ai perception and removed pawn sensing,but how can i debug it ?i tried with ' key in game with numpad 1,2,3,4 keys but that does not work

dire fable
#

play, select your AI in the Outliner, then you can press ' key

#

normally, the gameplay debugger debugs the AI in center of the screen, but sometimes you can't control the camera so I do this by selection the AI in the outliner

near flame
#

yeah still does not help

#

i tried more times

#

is there another way?

dire fable
near flame
#

none of the modes work,i followed all your instructions

dire fable
#

do you have this on top of your screen (when you play, after pressing ' and 5) ?

#

if yes, by selecting your AI character (that have a AIPerception component), you should see debug

near flame
#

its there but its gray all the time

dire fable
#

for me its 5 because I have Abilities en 3

#

ok, for you its 4

#

press 4 then Perception should be green

near flame
#

i tried 0,1,2,3,4,5 on laptop,on keyboard,selected and deselected character

#

i mean ai

dire fable
#

and 4:Perpcetion was green ?

near flame
#

grey

dire fable
#

enable it by pressing 4

near flame
#

this are the settings

dire fable
#

you must have

#

and not

near flame
#

dude,no matter i am pressing the perception or no its always grey

#

grey

dire fable
#

it's not a UE related issue so, maybe your keyboard is broken or you don't have focus on the play window idk

#

I don't know, I just add an AIPerception comp, start playing and I can see debug... I didn't setup anything else

near flame
#

the key does not work

#

i cheched it now in this chat

#

the whole numpad

dire fable
#

πŸ€”

near flame
#

solved it

undone heron
#

how can i spawn a navmodifier volume along a spline at runtime?

near flame
#

turned off this option in mouse settings

#

and which one do i need the forgotten and what else?

#

@dire fable

dire fable
#

Not sure if this is the best implementation but it works

near flame
#

i will try with stimulus now

dire fable
#

and don't forget to link this node to Self

near flame
dire fable
#

Self or Both depending on the behavior

near flame
#

oh man ,tried a lot of variants,maybe im doing something wrong?both are self aborted, one set and another not set with the same blackboard key .And here are the events inside the enemy ai ,the key name is spelled propperly cuz i copied it.controller has reference to self

pallid mica
#

How does one handle Swimming AIs, that are above the NavMesh (due to it building below the surface)?
Or is the "below the surface" already the problem? Currently facing a problem where the QueryExtent is not high enough for an AI that is in the water to find the starting poly.

near flame
#

i made it huh

#

this is what it looks like

#

and here is the behaviour tree

#

i didnt use the bool

#

just the character target-actor type

pallid mica
misty wharf
#

Interesting, good to know that's also possible

nimble smelt
#

Do I need to do any cleanup for an AI-controlled pawn when I kill the actor, or can I just DestroyActor and assume the controller and behavior tree and any ongoing tasks and all that crap will just be gracefully closed out?

proud flume
#

How do I get my EQS query to run in a loop and repeatedly update its target without interfering with other actions the BT is taking?

#

I have an EQS to locate a position furthest from player that has no LOS to player

#

Then the AI runs to that spot

#

It works really well but if the player is pursuing it won't update until it finishes moving to its current target spot

#

I want it to update some regular period of time, I tried a wait with parallel but that causes a stutter

#

I tried a few different configurations and couldn't get one that was closer than this. This is almost perfect except the stutter ruins it

#

There's a pause when it cancels the MoveTo while it waits for the EQS query

#

I need the Query to continue infinitely πŸ€”

#

Another way to put this is "How do I make move to more flexible?"

#

Move To is frustratingly basic for something so important

#

You can't even set Acceptance Radius dynamically madge

#

Oh hmm you can run eqs queries in bp Thinkge

#

Could have a separate timer from controller that loops the query and updates the target hiding spot every X seconds

#

And BT just looks at the spot and goes hmm

#

Is that the only way though?

#

Feels a little clunky

#

This is in a 1second timer btw

#

Could prob do 2 seconds fine

#

Kinda feels... wrong. Like I should be doing this in BT Hmmge

uneven cloud
uneven cloud
uneven cloud
near flame
#

its all fine,it works now,i fixed the numpad

uneven cloud
uneven cloud
near flame
#

what the heck is this? this half of the foliage from landscape dissapears when opening another level and then this level

uneven cloud
proud flume
#

First emote is to indicate "Hmm that's a new term" and second one is to indicate "I am now reading the docs I found thanks to your use of term" heh

#

I'm not getting quite the same behavior with a service that fires every second vs. the way I had it before Thinkge

uneven cloud
#

You do understand that pepe the frog is hate symbols, right?

proud flume
#

Hmm yeah with this setup it seems like it doesn't stay in the Move To long enough for the EQS to get a result

#

If I put a wait, then it works thinkingimpoppably

mighty imp
#

Does anyone have advice on where to learn on pathing. I see alot of patrolling that follows one path but what I want is a lane. If the AI is in X position it follows that X position the full way around said path.

A point in the right direction would be greatly appreciated!

potent loom
# mighty imp Does anyone have advice on where to learn on pathing. I see alot of patrolling ...

the path is a spline constructed from a set of points and each point is interpolated to form the curve. Using the spline normal, you can "inflate" the 1D spline by using the normal to find the left/right vectors, then just add 1/2 the width your want the road to be. This gets a little janky if the points are far apart, but it's a fairly easy way to get a road. You'll run into the typical issues that inflating a spline like this might make you choose some unpathable points. You can directly convert a path into a spline like this using a spline component:

    SplineComponent->ClearSplinePoints();
    for (const auto& Point : ResultingPath->GetPathPoints())
    {
        SplineComponent->AddSplinePoint(Point, ESplineCoordinateSpace::World, false);
        DrawDebugSphere(ControlledCharacter->GetWorld(), Point, 8.f, 8, FColor::Red, false, 5.f);
    }
    SplineComponent->UpdateSpline();

they have a param to visualize what it looks like with width, but you need to actually implement width pathing yourself.

Then to move you'd do something like

    while(true)
    {
        const auto ClosestSplinePoint = SplineComponent->FindLocationClosestToWorldLocation(ControlledCharacter->GetActorLocation(), ESplineCoordinateSpace::World);
        const auto SplineDirection = SplineComponent->FindDirectionClosestToWorldLocation(ClosestSplinePoint, ESplineCoordinateSpace::World);

                //Get spline normal
                //Take spline point and add a random (-width/2, width/2) to it
                //Find direction to new point
    
        ControlledCharacter->AddMovementInput(Direction);
        const float DistanceToDest = (ClosestSplinePoint - Dest).Length();
        if(DistanceToDest <= AcceptanceRadius) {
            co_return;
        }
        co_await std::suspend_always{};
    }
mighty imp
#

ok ty ill try my best to study this and look up stuff

#

appreciate you ❀️

undone heron
proud flume
#

When Move To is interrupted by itself (i.e. blackboard decorator sees that MoveToLocation vector has changed), there's a "stutter", is this impossible to avoid? hmm

#

Like even if the movetolocation is in the same direction

#

There's a momentary slowing of the pawn

#

My thought is to use MoveTo targeting an Actor, and move the actor around, but that seems sort of extreme

#

Since MoveTo can track an actor as it moves, but not a vector as it changes

#

Like if I want a pawn to continuously flee from the player by EQS'ing up a best spot to run to, and it needs to update that best spot over time as the player chases

#

Every time the spot is updated the AI stops/starts

#

I'm sure it'd work if I used an actor as the target and just updated its location instead of updating the bb value thinkingimpoppably

dense owl
proud flume
#

I don't know Clueless

dense owl
#

Those are settings in the CMC but prly not if you don’t know

proud flume
#

I haven't seen that anywhere. Is that on the CMC for the Pawn or?

#

Ah

dense owl
#

Also, are you calling stop movement before a new move is issued?

proud flume
#

Without this it will complete a move before it notices that the move target changed

#

Also, without this, there is still a 'stutter' when it completes a path, prior to starting its new path

#

Like it takes >1 frames to transition from one move command to the other hmm

dense owl
#

I mean your EQS is set to tick every 1s

proud flume
#

Yeah. It updates the target location every 1s. Which interrupts the move with a new move. Which cause a stop/start instead of just smoothly switching to the new target

dense owl
#

You can use visual logger to see exactly what happens in that time

proud flume
#

I don't think it's a bug I think it's just expected behavior, no?

#

MoveTo can't seamlessly transition to another MoveTo, there's a frame of delay or so

#

Is what I'm gathering hmm

#

So if you want to have a pawn that moves away from something by continuously selecting new points ahead as it goes, and you don't want it to stutter every time the target updates, you need to use an Actor or a custom MoveTo task hmm

#

Found this thinkingimpoppably

proud flume
#

Moving a waypoint actor around works pretty well hmm

open swift
#

if i have multiple decorators on a node, how does aborting work? does it abort lower priority only when all decorators abort, or only one?

#

like if i have two decorators on the same node both set to abort lower priority for example

uneven cloud
open swift
#

is there a way to abort only if both are true? composite decorators look like they work the same way but it wasnt super clear

uneven cloud
open swift
#

thanks

ornate oasis
#

Has anyone experienced receiving a nullptr in BTTasks when trying to get the pawn owner from the aicontroller? I am really confused as my tasks previously worked before

misty wharf
#

Are you running your BT from On Possess or from Begin Play?

ornate oasis
#

I tried running it from both and seem to get the same results

#

I mean, like switching between them not running it twice in both

silent hamlet
#

run it from On Possess ad show your BT if you can

#

and the task

ornate oasis
#

Sure :)

#

So I am just testing a bt task to find a random location in radius of the pawn

#

It seems to be running but the debug console is showing that the aipawn isnt found

#

This is the task being run: ```EBTNodeResult::Type UMyBTTask_FindRandomLocationCPP::ExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory)
{
// Need reference to AI Controller
AAIController* AIController = OwnerComp.GetAIOwner();
//APawn* AIPawn = AIController->GetPawn();
AActor* AIActor = AIController->GetOwner();

if (!AIActor)
{
    UE_LOG(LogTemp, Warning, TEXT("THIS DOES NOT WORK"));
    return EBTNodeResult::Failed;
}

// Get AI location
FVector Origin = AIActor->GetActorLocation();

// Nav mesh stuff
UNavigationSystemV1* NavSystem = UNavigationSystemV1::GetCurrent(AIActor->GetWorld());
FNavLocation RandomLocation;

// If both are valid then assign blackboard 
if (IsValid(NavSystem) && NavSystem->GetRandomPointInNavigableRadius(Origin, SearchRadius, RandomLocation))
{
    AIController->GetBlackboardComponent()->SetValueAsVector(BlackboardKey.SelectedKeyName, RandomLocation.Location);
}

FinishLatentTask(OwnerComp, EBTNodeResult::Succeeded);
return EBTNodeResult::Succeeded;
//return EBTNodeResult::Type();

}```

#

I tried getting the pawn and actor -- both don't seem to work

#

If I go straight from ownercomp.getowner to get the actor it does seem to work though. But I am curious why this code that has previously worked before doesn't

misty wharf
#

GetOwner is wrong for starters. This returns the owning actor which is different

#

And is quite likely to be null unless you've manually set it to something when spawning the controller

#

GetPawn() is what should work

ornate oasis
#

ah okay

#

is there any other details that might help with this problem

#

I will post my controller in case I am missing something there:

misty wharf
#

Hard to say, from the BT screenshot it looks like the pawn is being set because it's set into the SelfActor prop on the BB correctly

ornate oasis
#
AAlienAIController::AAlienAIController()
{
    BehaviourTreeComponent = CreateDefaultSubobject<UBehaviorTreeComponent>(TEXT("BehaviourTreeComponent"));
    BlackboardComponent = CreateDefaultSubobject<UBlackboardComponent>(TEXT("BlackboardComponent"));
}

void AAlienAIController::BeginPlay()
{
    Super::BeginPlay();
}

void AAlienAIController::OnPossess(APawn* InPawn)
{
    Super::OnPossess(InPawn);
    if (IsValid(BehaviourTree))
    {
        RunBehaviorTree(BehaviourTree);
        BehaviourTreeComponent->StartTree(*BehaviourTree);
    }

    if (IsValid(Blackboard) && IsValid(BehaviourTree))
    {
        Blackboard->InitializeBlackboard(*(BehaviourTree->GetBlackboardAsset()));
    }
}
#

haha... it is now suddenly working...

misty wharf
#

Are you hotreloading by any chance

ornate oasis
#

is that the same as live coding?

#

I did live coding then a full rebuild deleting binaries and such

#

for whatever reason, changing it just now back to get the pawn has seemed to work but I have no clue why

misty wharf
#

Livecoding is different and better, but it's possible if you were livecoding that it wasn't reloading the nodes correctly

#

Usually LC works if you are modifying function bodies (except constructors), but it's still possible that it may affect some things like this

ornate oasis
#

I see, thanks for your help

lyric flint
#

Do folks have any thoughts on WP navmesh (it's still labeled experimental)? Specifically, is it stable enough to build a game around?

silent hamlet
# ornate oasis I see, thanks for your help

sorry I asked for details and then got sucked into work forgetting to answer. I see you found some support anyway. Your sequence is correct, OnPossess you run the BT and in any task you should have a valid reference to AIController where you can call GetPawn. Hopefully you fixed this for good

raven nacelle
#

Quick question. Detour Controller does not allow moveTo to work. The reasons?

harsh storm
#

Why do you think it doesn't?

#

You might be at the limit of agents allowed. You can change that number in your project settings.

proud flume
#

My... how... hmm my AI is firing OnTargetPerceptionUpdated when it sees other copies of itself... even though it does not have a stimuli provider component at all

#

How is that possible HUH

#

what da fuk

#

I'm so confused right now Hmmge

#
Epic Developer Community Forums

Testing with AI Perception system, it looks to me, like the AI Perception Stimuli Source Component just is not needed at all. I found this playing with Noise - it simply works with only having an AI Perception Component on the receiving side with configured senses. All actors making noise do not need the Stimuli Source at all. Found this threa...

#

It also completely ignores team settings on the AI Perception Component wtff

misty wharf
#

@proud flume pawns are automatically registered as sources by default

proud flume
#

Yeah they mention the config setting to disable that in the link there

#

Thanks for the link though Okay looks like lots of useful stuff in here

torpid rampart
#

Hey so I have lots of AI related questions so if someone is willing to just PM me I would love that lol. I dont wanna flood the chat here with all my lack of knowledge πŸ˜†

harsh storm
#

Go through the course that is first in the pinned list.

torpid rampart
#

Oh okay cool didn't even know that was a thing. I will do that! Thanks lol

nimble smelt
#

Does IsAtLocation not work with an actor target? I'm like an inch from this thing but it's still evaluating false, even though it IS targetting the player pawn

uneven cloud
nimble smelt
#

Nah, pretty small. Root component is a sphere collider with radius 30, and it mostly all fits inside that

nimble smelt
#

NM that's my problem, I'm dispatching the task finished event too early somehow

fickle vault
#

Question: Is it possible to create an AI bot thing that moves, attack and all that shit, all without using NavMesh? And without building my own nav system?

NavMesh feels to limiting, with the navigation only as big as you make the nav mesh. Is there something more adaptive?

lyric flint
#

It's hard to argue for or against a feeling that something is limiting. You should have specific requirements for your navigation that guide your evaluation. But you have options:

  1. Use nav mesh (probably try this first and switch when you have to)
  2. Stream in nav mesh
  3. Use nav invokers
uneven cloud
# fickle vault Question: Is it possible to create an AI bot thing that moves, attack and all th...

How are your AI bots going to avoid obstacles? The point of a navigation system is so that an NPC can effectively navigate around the game world without running into things. How does an AI know there is a wall there to avoid? Well... There are several options for that, but a nav mesh has been proven to be inexpensive enough to run for a number of agents as well as have a high fidelity of actually looking intelligent.

When you say adaptive, it leads me to think about how we used steering behaviors prior to nav meshes. It was done by having probes that extend out and then use forces to push them out of the way. While this worked OK, they never really seemed to have a purpose. They'd run at a wall and then just miss it.

#

All a nav mesh really is is a graph of points that an NPC can be at without colliding with the world geometry. Because it's a graph, the points are connected together if they can be traversed without running into anything. So really it's just a simplified version of the map that the NPC uses to traverse without running into shit.

#

A nav mesh allows the NPC to come up with a plan. A path from point A to B. Typically this is done by using an algorithm called A*, which builds a path using that graph of points to cheaply find the shortest path using a heuristic.

However, using something like a steering behavior you can't build a path. You point it in the direction of point B and hope it can figure it's way there. In open space, this can work fine. In some cases using BOIDS (a steering behavior modeled on birds flocking) you actually want that, specifically for wildlife. In a more complicated world it looks like absolute garbage.

fickle vault
#

By adaptive, I mean I can take the code and put it into another project and it would still work without needung any prior setup

uneven cloud
#

Another project outside of UE?

fickle vault
#

another ue project

uneven cloud
#

Another UE project will still have the built in navigation system.

fickle vault
#

Like, I wouldn't have to set up a new navmesh. I can just port the files into another project, start the project and be able to use it straight away

harsh storm
#

...

#

That is like...the easiest part of the entire process

uneven cloud
#

That you could make a tool to set up if you want to.

fickle vault
#

what do you mean?

fickle vault
harsh storm
#

You drag n' drop, then just scale like crazy for the most part

#

Unless you're doing WP stuff. Idk about that. I don't do WP type games

fickle vault
#

It's still tedious, so if there is another option where I don't have to set up a navmesh everytime i have a new world or project, I'll take it

uneven cloud
#

WP is still drag and drop, scale and then follow the instructions.

fickle vault
#

WP?

#

world partition?

uneven cloud
#

World partition

#

They made setting up navigation so incredibly simple and yet people still complain.

harsh storm
#

The only thing I'd like is a navmesh painting tool. Instead of doing the nav filters

#

So I can fine tune stuff a bit easier

uneven cloud
#

On one project I made a tool to paint nav links. It didn't take that long.

harsh storm
#

That sounds neat

#

I haven't delved much into tooling yet to be completely honest.

#

I would want to be able to paint the navmesh in as well most likely.

#

So use automatic to do the map, then fine tune with the paint tool.

#

First step is figuring out how to even paint anything, lol

uneven cloud
#

That might be possible.

harsh storm
uneven cloud
#

Painting is definitely possible. I'd start by looking at the foliage tool.

uneven cloud
harsh storm
#

That's cool

#

I think it'd be kind of neat if we could have a nav link area - so as long as the agent was in the area, they could traverse to the other side.

#

Or maybe that's too niche

#

Because in order for my agents to cross a bridge, I ended up setting up like 3 nav links that allowed them to cross it.

uneven cloud
#

It also had some other options for editing, but I don't remember them. It only took a few days to make and that was like 2018.

harsh storm
#

The circles are the nav links - rectangle is the bridge

#

Works well enough

uneven cloud
harsh storm
#

Just when I was doing it, was like, "man - it'd be nice to have this as an area"

uneven cloud
#

That's how Havok's version of links work. It's so much easier.

harsh storm
#

Struck again by the budget of indie 😭

#

@uneven cloud Does Havok's AI sdk integrate quite seamlessly with UE?

uneven cloud
#

I'm not a big fan of how it's set up, but I also don't have to worry about it too much. They have a UE team that I can ask for things from. Support is top notch though.

rough finch
#

I'm trying to use StateTrees, I am having is I have a task that i'm trying to delay the task finishing. It delays the print string as shown however it continues to the next tree. Any idea on why?

glad elm
#

Hey, Unreal noob here. Would anyone be able to tell me how I access this when creating my own task for Behavior Trees?

uneven cloud
glad elm
uneven cloud
azure sluice
#

Is there currently a way tell the BT to hop back / restart from a given node? I know BTs are essentially DAGs but I’m wondering if it’s possible to restart an entire tree at a given node index somehow?

#

I’m trying to use BTs for dialogue and it works really well, the only gripe I have is that sometimes it would be nice to have a β€œback” option in the dialogue which currently isn’t something I found how to do.

dense owl
#

What a travesty, Mieszko would be rolling in his virtual grave

celest python
#

Dialogues for BT never works really well

azure sluice
#

The acyclic nature of it?

#

To be fair it’s early enough that I can just scrap it and do it all in bp using a data structure. It was just a novel idea that worked out well for me

celest python
#

Its rather about BTs specialize in prioritization

azure sluice
#

Well.. it worked out cause they’re simple.

celest python
#

Just use flowgraph

#

Its free on github

#

MIT license

azure sluice
#

Hmm never knew this existed. Gonna definitely check it out. Thanks

celest python
#

Good luck

azure sluice
celest python
#

No

azure sluice
#

I'm trying to keep stuff simple for the first game. So even if its a little janky, it might be fine. I am tempted to try FG.. I just hope that it will be easy to adapt to a dialogue system. Cause frankly what mine is supposed to do is quite simplistic. Just cyclic (if possible) talking, and firing off trigger events on certain choices being selected

celest python
#

You can just work with arrays too, then

#

No need for external tools

azure sluice
#

Well, the other idea I had was to have my dialogue in a structured data format that represents a graph. Somewhat like:

DIALOGUENODE
id: 0
text: "some dialogue"
choices:
  CH
    next_dialogue_id: 1
    prev_dialogue_id: None
    text: "I am a choice"
  ...
...
#

Something along those lines albeit this is simplified. But the idea is that a single BP could iterate over the dialogue nodes and choice nodes and construct a UI which adheres to this "prev/next" and event behavior. Something like that

#

Could be JSON, could be something else. Idm

#

I guess the trick here would be how you tie blueprint events to the dialogue and so on..

#

Damn.. It's kinda annoying cause the BT thing got me like 98% of the way there. I got it to display dialogue, assign quests and even have predicate responses where some dialogue options show up based on absence or presence of quests/objectives/variables in the game instance

#

The only real issue I had is the inability to restart the BT at a given node so you dont have to finish the whole dialogue tree and start the npc interaction again

#

:/

celest python
#

easy to adapt and writing a custom data format which implies a custom parser too doesnt match though πŸ˜„

#

avoid BT though

azure sluice
#

Yeah I am trying to do a quick prototype of what I described above atm to see if it's viable

#

if not ill grab a third party system

#

Thanks for the help

#

I might have a way to do this with a component bp and an interface but we shall see

median socket
#

Is there a way to conditionally filter out a Smart Nav Link based on a specific instance of an agent?

#

Example: I have a door that is locked, and some agents carry the key. I only want them to attempt to path through the nav link if they know they can successfully unlock it (has the key).

#

Otherwise they would attempt to path around it.

misty wharf
#

Not 100% sure but have you tried giving the link a certain nav area class?

#

I haven't tried it myself but if you were to give it an area class such as "locked" and set up your nav logic so that you have a nav query filter that excludes "locked", then the npc's would avoid the locked door

median socket
#

Hm, no -- now that you mention it, I notice you can select which class it will represent when disabled.

#

I haven't touched nav classes that much, but it feels like a good place to start looking!

#

Makes a lot of sense, thanks!

misty wharf
#

also you may need to set the navigation generation thing in project settings to "dynamic modifiers" or whatever it was called if you want to change the locked state at runtime

#

at least if this approach works

median socket
#

Ah right, I'll keep that in mind.

ornate oasis
median socket
#

I had hoped there would be some overridable function or something to dynamically resolve the cost when an agent does pathing... Maybe there is in C++?

#
// NavigationQueryFilter.h

    /** if set, filter will not be cached by navigation data and can be configured per Querier */
    uint32 bInstantiateForQuerier : 1;

    /** if set to true GetSimpleFilterForAgent will be called when determining the actual filter class to be used */
    uint32 bIsMetaFilter : 1;

    /** helper functions for adding area overrides */
    NAVIGATIONSYSTEM_API void AddTravelCostOverride(TSubclassOf<UNavArea> AreaClass, float TravelCost);
    NAVIGATIONSYSTEM_API void AddEnteringCostOverride(TSubclassOf<UNavArea> AreaClass, float EnteringCost);
    NAVIGATIONSYSTEM_API void AddExcludedArea(TSubclassOf<UNavArea> AreaClass);

    /** find index of area data */
    NAVIGATIONSYSTEM_API int32 FindAreaOverride(TSubclassOf<UNavArea> AreaClass) const;
    
    /** setup filter for given navigation data, use to create custom filters */
    NAVIGATIONSYSTEM_API virtual void InitializeFilter(const ANavigationData& NavData, const UObject* Querier, FNavigationQueryFilter& Filter) const;

    virtual TSubclassOf<UNavigationQueryFilter> GetSimpleFilterForAgent(const UObject& Querier) const { return nullptr; }
#

Some of these seem promising!

misty wharf
median socket
misty wharf
#

Yeah if you have multiple different kinds of keys having one filter per key type might not be the best, but I think there might be some way to have them be configured more dynamically also

median socket
#

I have tag-based keys, so very many indeed...

#

But it seems like the functions I posted above might let me do what I want in C++. I'm just a little scared!

#

But I'm sure it's fine.

misty wharf
#

Haha :)

#

If you figure out a solution for it I'd appreciate it if you can ping me - I might need to do something like this in the future so curious to know how it could be done

median socket
#

I'll be sure to!

cold surge
#

Hey Guys,
What is your take and advise on Openworlds and Navmeshes?
I have a rather large open world. and I tried Static Navmeshes (atm I'm building my paths according to the docs with WP)

But I also see alot of people talk about Dynamic Navmeshes and Nav Invokers. However I have never been able to get Dynamic Navmeshes to work fluidly.
If you have a rather large forest scene or whatever. It is in my experience undoable. It hitches like crazy.
I have tried turning off Navigation affecting on almost everything, but it keeps being trash.
I have an 8K Landscape. and every dunamic calculation/drawing of the NAvmesh just breaks everything.

I also experience NAv tick time hitches just being in the editor.. It's so annoying. I just can't find one conclusive answer or setup tutorial anywhere..

Are there any good tutorials out there that go in detail or what am I missing?
Cause all Dynamic tutorials use the default Open World map that empty AF so it doesn't feel realistic..

median socket
#

That dynamic navmesh is almost always better.

cold surge
median socket
#

I believe the idea is to have the navmesh dynamically generate for all loaded tiles of an open world map.

#

Whereas nav invokers just keep generating continuously.

#

Honestly, I'm the wrong person to tell you these things! There are more knowledgeable people in this channel for this topic :)

cold surge
misty wharf
#

The other thing to look for I think is "navigation streaming" - I don't know how that works, but that's another thing I recall coming up whenever people ask about level streaming and such with regards to navigation

median socket
#

Yes, indeed, I remember hearing that too. I wonder if the thing is to have the navmesh already exist in the streaming levels, and the "dynamic" aspect is only that it patches them into the rest of the navmesh when loaded.

cold surge
#

It's been building for a over an hour now already though.. πŸ˜…

median socket
#

I can see it taking a while.

#

shudders in memories of baking light

sudden stag
#

Hi! i have this state tree task where it sets the PatrolPoint struct to some value (img1). i've made sure to mark it as output and everything.
now i expected this to actually change the patrolPoint parameter (img2) but in the move to task the struct is zero initialized (img3)

misty wharf
#

I'm not entirely sure if I understand correctly - but you need to actually bind the input parameter to the output parameter of the other task

sudden stag
sudden stag
#

yeah well maybe it didnt πŸ˜…
so i just set the out FPatrolPoint to in. i thought that would give me a reference to the parameter so i can change it however. still the same issue

#

are parameters mutable? if so, how can i do that?

misty wharf
#

Category=Input or Category=Parameter should allow binding them iirc

pure creek
#

hi i want little help with this i want a thing like 4 enimes of the same blueprint placed in a level waiting and two attacking if the first two died the others can attack can someone plz help me

uneven cloud
sudden stag
#

it doesnt show up when i use it. or does it automagically bind to the parameter list?

harsh storm
#

It automagically does

misty wharf
#

Nothing happens automatically

harsh storm
#

(If I'm following the issue correctly)

misty wharf
#

The only thing that will bind automatically is the Context category stuff

#

I have to admit I'm not quite following what's going on :D

uneven cloud
harsh storm
#

Please have patience

sudden stag
misty wharf
#

Right - so you mark that into the Output category in the task that produces the value

pure creek
misty wharf
#

And in the task which you want to use it in, create a variable in the Input category, and you can bind it to the value from the other task if it's set up correctly

#

(correctly=the task with output is either a global task, or in a parent state of the task that wants to use it)

uneven cloud
sudden stag
uneven cloud
sudden stag
pure creek