#gameplay-ai

1 messages · Page 10 of 1

crystal hatch
#

all I'm saying for the last 10 messages is that you can make it better and definitely more efficient than "ticking an empty task waiting for the movement to finish" 😛

rich veldt
#

"waiting for in your bt move task" is there some other "wait" method im missing other than ticking on a branch (gate) here?

#

empty task or not

#

is that not what you're suggesting happens here?

rich veldt
#

what?

#

i am likely just misunderstanding how tasks are fired/handled

#

are you suggesting i bind to an event/dispatch notify in the task?

median socket
#

Tasks live for the entire duration of the Behaviour tree, so you can subscribe to an event within your task and wait for that

rich veldt
#

thank you that's much more clear.

#

i assumed erroneously without a tick event in the task, the task just dies after it's been handled, with or without a Finish node

median socket
#

I'm not entirely sure of the exact lifetime, but I am quite certain the tasks live on as long as the tree does!

#

Even if you've finished with FinishExecute, in fact

rich veldt
#

ohh wait actually? does this mean i can finish with success immediately and let the tree continue running, but before that if i sub'd to the controller's GoalReached event it would still get called?

#

not exactly the use i have in mind obviously but good to know what is and isnt possible with task "lifetime"

rich veldt
crystal hatch
median socket
#

I only see FinishAbort and FinishExecute in BP

crystal hatch
#

for the record, no Tick implementation required

median socket
#

Gotcha. And I assume it's not a good idea to keep doing Task logic after either of those, even if it's possible?

#

Since I noticed it would keep running events and such inside the task... but it felt hacky.

crystal hatch
median socket
#

Noted!

#

It definitely felt like it was against the principles of behaviour trees.

crystal hatch
#

yeah, plus asking for debugging hell it that logic caused issues. If only the active branch is making changes it's easier to narrow down what's causing issues.

dusk pewter
#

@crystal hatch @misty gale
Just to update you, i migrated the entire project to 5.1 and the nav is still not working.
In a new blank 5.1 project it does work so somewhere somehow something broke.
I am attempting to migrate the project to see if it can be restored

dusk pewter
#

@crystal hatch @misty gale
Migrated assets in 5.1 new project works... so something failed in the initial project. Will turn off plugins one at a time to see if something is amiss

dusk pewter
#

actually

#

let me package it

#

lol

#

it works in PIE

median socket
#

Is there anyone familiar with Smart Objects around? In particular, for 5.1.

crystal hatch
#

depends on what you want to know 😄

median socket
#

They've changed how the definitions work and I can't wrap my head around it.

#

Okay, a sec!

#

It's this, honestly

#

In a smart object there's a slot for gameplay behaviour definitions

#

Before we upgraded, that accepted GameplayBehaviour

#

But now it seems to only accept USmartObjectBehaviorDefinition

#

And I don't know how to create one!

#

Their docs are outdated.

#

"The API is consistent compared to UE 5.0, which allows for backwards compatibility when migrating projects."

Yeah right :(

crystal hatch
#

enable GameplayBehaviorSmartObjects plugin and use use that as the behavior "class", then you can use any GameplayBehaviorConfig you want

median socket
#

Right, hang on!

#

Where do you define the config, if not inside the definition?

#

The panel for reference

#

OH!

#

The arrow!!

#

Ah, you're a lifesaver!

#

Thank you! And dang, that's much nicer than doing a custom definition for all of our SO:s

#

We probably took the stupid route even before 5.1!

crystal hatch
#

we're still working on the UX side 🙂

median socket
#

Ah, you're an Unreal dev?

#

Well, Smart Objects kick ass even if they're a bit hard to navigate!

#

It was such a blast to get so much life in our scene with such (relative) ease

crystal hatch
#

and it's only getting easier! 😄

median socket
#

Looking forward to it!

haughty coral
#

Speaking of SO, what would be your personal opinion on something like this? Do you think it is a good idea? :D

median socket
#

Spontaneously, I feel like finding cover would be better suited for EQS

haughty coral
#

I don’t think so if you want them to be persistent, contain cover specific data and query them quickly from many agents

#

I would still use EQS to filter them but the generator would return pregenerated covers as the initial set

median socket
#

Ah, right

#

I'm sure it would be fine having tons of SO:s!

#

Spawning them dynamically I can't utter a single word about so I'll refrain!

#

Where can I bind to the OnSlotInvalidatedDelegate?

#

C++ only? I can't seem to find it neither in the AIController or NPC.

crystal hatch
median socket
#

Gotcha, thanks!

dusk pewter
#

I found it

#

wow

#

what a bug

#

In the engine settings

#

[/Script/NavigationSystem.RecastNavMesh]
bAutoDestroyWhenNoNavigation=False
bCanBeMainNavData=False

#

when you set this to false once, it never goes to true if you reset it

#

regardless of what it shows

#

in 5.1, i can reset it

real arrow
median socket
#

I saw the contextual animation SO definition in the City Sample and got:

#

a) Excited for how powerful it seemed

#

b) terrified

misty gale
dusk pewter
#

I tried with new project settings transplant

#

and then went back

#

then did an analysis line by line

misty gale
#

So its a 4.27 bug? Are you gonna stick with 5.1 or do soucce edit to fix it ?

dusk pewter
#

for some reason the package is also 100 mb smaller

misty gale
#

Every 100mb counts!

median socket
#

I feel like I'm still missing something with Smart Objects, so apologies for the barrage of questions!

#

I'd like something like this for my NPC:s:

#

Where I can control from my BT when they enter and exit SO:s -- i.e. the TargetSmartObject task would hold until they've entered an SO successfully

#

Then they remain there until I call LeaveSmartObject.

#

This node makes it easy to enter a smart object, and using it makes the avatar call the OnTriggeredCharacter event in the behaviour

#

So it's easy to ENTER a SO, but I'm struggling with forcing them to exit.

#

There doesn't seem to be an opposite to the UseClaimedGameplayBehaviourSmartObject function.

#

The StopGameplayBehaviour BT Task stops the behaviour (and calls the OnFinishedCharacter event) but doesn't release the SO.

#

But simply Releasing the SO doesn't call the OnFinishedCharacter event in the behaviour!

#

The reason I'm struggling is that the documentation for SO:s seems to focus on Behaviours that themselves define how long they persist (i.e. they call EndBehavior after a montage finishes). I'd like to get this right the first time, so I don't have to re-write too much! I'm sure I could do some hacky thing with Messages or C++, but if there's a "correct" way for things like this, that'd be ideal.

hearty niche
#

Is it a good idea to divide my AI states into separate BTs. I was thinking of keeping one for each state like patrol, combat, etc. I heard someone say switching BTs are expensive. I plan to keep the blackboard same. I would thus have to do less exception handling to get my AI to the respective states.

night forge
#

Anyone know of good resource on how to set up a BT in C++ and not in editor?

median socket
hearty niche
#

So will parent tree logic run when subtrees are working? Currently I swap out trees from the controller

#

I wanted to keep it modular and take which tree I want to run on the pawn

median socket
#

I haven't used subtrees extensively, but I believe the flow will be more or less identical to just having the subtree nodes be part of the parent tree?

#

I.e., the RunBehavior node can be thought to "expand" into the nodes that it consists of.

#

So execution enters the subtree, and while it's working in there, the parent tree is holding on the RunBehavior node.

#

There is also RunBehaviorDynamic, which will allow you to swap the tree at runtime, but that will incur the cost of creating the tree (when it first runs, I presume?)

hearty niche
#

The problem with the subtrees is that they get hard coded which is my main confusion. I could hand over a separate tree to a junior and they could work on it quarantined for a specific state instead of altering the parent tree. If I just run them as is

median socket
#

But that should be possible with subtrees?

#

Since they allow you to refer to another tree entirely

hearty niche
#

I store what tree to run on the pawn. The controller grabs it via interface

#

Easier to manage junior does not even need to touch the controller or the parent tree

median socket
#

Regardless of how you do it, I would think the main consideration would be this:

#

Building a BT is costly because it needs to construct every node and decorator, which requires memory allocation -- so if you destroy the tree for your state when you switch, that cost will be incurred every time you do. If you let it live, perhaps by having it as a subtree, then the overall memory usage will increase, as will the cost of initially creating the tree -- but you won't incur a significant cost for switching states.

#

Since everyone has a lot of RAM nowadays, I don't think the memory usage of a large tree should be a problem. And if you have one large tree, the cost of creation will most likely be done on level entry, so you can have a loading screen and avoid little hitches at runtime.

#

I'm thinking something like this, with Observer abort pulling execution back whenever the state changes?

#

Then your junior should still be able to work on each state independently without having to consider the main tree too much.

#

But perhaps that's too simple for your use cases. If you need to pull the trees by message, then perhaps RunBehaviorDynamic would accomplish it. Then you could have the trees as blackboard entries, and update them at runtime. Then I would assume they incur a construction cost when first run, or when set, but never again after that?

#

I haven't had need for dynamic trees, personally, so I don't know the exact mechanics behind them.

#

I believe this is a valid way to assign a dynamic subtree from the AIC, identified by tag: so you could create some game tags for the different states and then push the subtrees that way.

crystal hatch
night forge
#

That seems to be exactly what I needed ❤️

#

Also, your advice on looking into source code was spot on, the previous issue got fixed 😄

crystal hatch
#

Code is the ultimate documentation!

median socket
#

I think I might condense my previous question down to this: is it misguided to attempt to use Smart Objects non-blocking?

#

I.e: sit down on a bench (claim & use), play a looping sit montage -- let BT logic continue, do some more things in the tree -- and then get back up (release and end) based on some condition (having seen the player, for instance)

crystal hatch
median socket
#

Hm, I see. Well, those parts I might be able to fill in just by combining the best bits of StopGameplayBehavior and Release into a custom BTTask

#

We had a system working before, but it went through the Pawn in a way that grossed me out a bit -- because it was a little tricky to find a good spot to anchor the logic where all the puzzle pieces were accessible (claim handle AND current behavior).

#

I'm sure it'll be fine!

#

Thank you for the reply! There's not a lot stopping us from doing what we want, I mainly wanted to know if there was a design pattern in place for something like it already, so I don't re-invent the wheel.

#

(although I'm sort of coming to terms with the fact that Unreal holds so many little secrets that you're bound to re-invent a buncha wheels during a game)

crystal hatch
median socket
#

Haha, plus the constant desire of the game dev to get started before being fully read-up!

median socket
#

The "36 things you don't know" video that made rounds certainly helped.

#

(oh gosh the sequencer camera blending!)

hearty niche
#

Ah yes another Unity deserter 😆

Respect++

orchid badge
#

Hey guys im really new to unreal engine 5 its been a month and i finally got to the ai part of my campaign fps game but i cant find a single tut or template with a ai with a gun and stuff

#

so can i make dude like this for my game

plush cargo
#

any new statetree learning resources yet?

plush cargo
uneven cloud
dusty tinsel
#

hey folks i am so new to this but i would love to make an Ai that tries to run from me instead of chase me! i want to make a game where im the killer chasing after people

lunar quiver
#

Are nested ai BT a thing where depending on an enemy type if its a melee or shooter focused enemy it uses the right BT accordingly like making a master Enemy where I can just pull from

median socket
sacred shale
#

does anyone know if Environment Query System is going to get out of experimental soon or is it commonly used in shipped projects?

median socket
#

You could certainly make a big tree with subtrees for each type of enemy, then select the correct one at runtime -- but it would increase the overhead for each enemy a bit

#

The only advantage to doing it that way seems to me to be that you could change the type of an enemy very dynamically.

dusk pewter
#

and I'm back with another weird problem in UE5!
My nav mesh volume is present in some levels and it works in some but not others. In the ones that work, the preview shows the overlay. In the ones that do not, no such preview. I tried to delete it and put it back, no dice. I tried creating a new level and copying it over, didn't work. I tried copying the level as well and that did not work. I tried rebuilding it but that also did not work.
So how can a nav work on some levels but not others??

#

ok, solved

#

apparently the mesh did not have primitive collisions and that is a requirement now in 5.0

uneven cloud
uneven cloud
uneven cloud
lapis grotto
lethal helm
#

whats the difference between left and right?

uneven cloud
# lethal helm

I believe that the pathing grid only projects onto the nav mesh and does not check if a path exists. I only use donuts, so not 100% on that.

solar pebble
#

Gonna be starting some simple enemy AI for my game. I'm hesitant between diving into behavior or state trees. Any recommendation?

harsh storm
#

I'd say BTs because there is more material for them currently.

solar pebble
#

I'd certainly be on my own with state trees.

lethal helm
#

behavior trees with c++ is nice

#

kinda becomes just a glorified debugging tool since I put the vast majority of logic inside tasks instead of the BT

brisk tinsel
#

I have a problem that i dont know if it has a solution.
I asked already in #blueprint and we didnt find a solution. Was told to try asking here in the #gameplay-ai .
Im trying to change the Root Collision size of an actor and make it navigate through the nav mesh with this new size.
Meaning it should be able to go around obstacles and not collide against them right?
But its not. Increasing the size of the of the root collision, apparently doesnt affect the way the navigation is calculated, making the mesh calculate the path as if it was still a small capsule.
That will cause it to overlap or collide against obstacles when trying to go around them.
So what can i do to fix this problem? Is all navigation in unreal made for actors of only one size? So we cant navigate properly with actors of bigger size?

https://streamable.com/6yeczt

dusk pewter
#

in UE4 you used to be able to make objects and actors into obstacles to avoid at all costs. In 5.0 and 5.1, this feature seemingly disappeared? how can I make an actor/mesh avoidable at all costs other than height?

#

i had to put a collider that collided with vehicles (for some reason) to block that off but it still had a navigable area. I want this to not be navigable at all

terse stratus
#

Could someone help me with understanding nav meshes? Is the nav mesh generated affected by any particular characters movement capabilities? and if so, which character?
For some reason on my level the navmesh isn't generating paths on top of blocks, does anyone know how to fix this?

terse stratus
#

turns out the fix for the above was just that the box was too small for a path to be generated on top 👍

#

would still appreciate it if someone helped me with the understanding of nav meshes as I asked above

uneven cloud
uneven cloud
dull spruce
#

I want an ai to be teleported randomly to a pre defined location that is closest to the player. So it would check which pre defined position is closest and move the ai there when told to.
Does anyone have any idea how I could implement this idea?

harsh storm
#

I would say do the simplest solution first and then iterate from there. Break it down into steps.

#
  1. Place locations
  2. Check for closet location to the player
  3. SetActorLocation at that location
dull spruce
#

do you know how to check for the closest location

harsh storm
#

Yeah

neat summit
brisk tinsel
# uneven cloud In the project settings there are navigation settings. In there you will find a...

Oh so there is hope. Thank you. I just create an agent and it fixed it. Though there's an issue that might not have a solution.
Is that i have characters of different sizes.
Is it possible to make the agent change according to the character size you are using?
Because so far i was only able to fix the issue by changing the Default Agent in the World Settings.
Would be nice if i could change it at runtime. So if im moving a dinossaur i make the agent the bigger one. Where if im moving a cat, i make the agent a smaller one. Is this possible somehow?

#

Or maybe it needs a Nav Mesh for each agent?

#

There must be a way?

uneven cloud
brisk tinsel
#

Like, as it is now its only applied to all of them

uneven cloud
brisk tinsel
uneven cloud
#

You're welcome. Multiple nav meshes get created when you have multiple supported agent settings, so there is a memory cost. I have in the past been fine with small, med and large ones. Grouping them works really well.

brisk tinsel
#

i see

#

So a lot of Supported Agents its bad for performance

brisk tinsel
grand halo
#

I need help from someone regarding tags.
So my AI relies on tags to identify targets.
Can i just use one find node to write [Survivors, Tamed Creatures , Herbivores] ?
Or do i need multiple nodes?

terse stratus
#

I need some help debugging my game. I have an AI moving to a random reachable location for the patrol. I generated the navmesh and it looks fine.
The function that returns a random reachable locations is unable to find such a point for some reason. Could someone help?

#

The AI logic works perfectly fine on another starter map so I have to assume its the static meshes in this map that are causing this, but I can't figure out how to fix it

#

infact if I say put a huge plane above my level and put the player and enemy characters on it, it works completely fine. So, it has to be an issue with the floor assets I'm using being not navigable even though the navmesh appears green on them. Does anyone know a fix for this?

terse stratus
#

the moveTo calls on the AI also end up failing

dusk pewter
dusk pewter
#

i mean actual static mesh collision

#

open the static mesh

#

@terse stratus

#

this

#

if not, add it

uneven cloud
crystal hatch
random topaz
#

has anyone used state tree's for general ai (not mass specifically)

bleak plaza
#

my ai isn't moving my character, i've assigned it to the character as the controller and tested that the location generation task is running but the MoveDirectlyToward doesn't seem to do anything

crystal hatch
strong heath
#

Hello 👋
I wanted to ask if anyone knows how to specifically set the mechanic the AI uses to move around. Most tutorials operate around AI just being instantly turn and move, much like a character would while I would like my AI to behave in a less snappy way and more like a ship; in the meaning it moves only forward and has to turn left/right in order to actually change direction.

Most tutorials that achieve something similar mostly operate on already created in-engine cars so they aren't all too helpful. If anyone could at least point me in the right direction or tell me how that specific thing I am looking for is named, I would be grateful.

bleak plaza
#

why am i getting this error message?

crystal hatch
bleak plaza
#

tiny picture sliver at the top

#

there are 4 pictures

sudden stag
#

are you sure the AiController's attached to a pawn?

sudden stag
bleak plaza
sudden stag
#

select the last option

bleak plaza
#

that didn't change anything

sudden stag
#

how do you run the BT?

bleak plaza
#

i don't understand the question

#

sorry new to ai

#

ah behavior tree, got it

sudden stag
#

hmmmmm

bleak plaza
#

that's in my AI_Enemy_Master

sudden stag
#

oh! move that to the ai controller

bleak plaza
#

AI_Enemy_Master is of class AIController

sudden stag
#

oof sorry i missed that 😅

#

and what AI controller class does you Ai character use?

bleak plaza
sudden stag
#

huh. go to controller begin play and check if the controller pawn is valid

bleak plaza
#

i don't know how to do that

sudden stag
#

beginplay->get controller controlled pawn->isvalid--true-->print string

bleak plaza
sudden stag
#

controlled*

bleak plaza
#

it's valid

sudden stag
#

wait so the player is not valid?

sudden stag
bleak plaza
sudden stag
#

so the player is not valid? did you start PIE on simulate mode?

bleak plaza
#

both tests came back valid

#

and no i'm not simulating

sudden stag
#

@bleak plaza did you add the BB to you BT?

#

BB = black board. BT = behaviour tree

bleak plaza
sudden stag
#

yeah im lost

#

not sure what the issue is. sorry mate

bleak plaza
#

me too, i followed a tutorial exactly then went back over it two more times looking for something i missed

main talon
#

I have a king of the hill system set up and my ai goes to the nearest un-owned control point.
However if it is captured by another team member while the basic "move to" task is happening how can I get it to stop and look for a new point?
My first thought was a decorator, but I'm not sure if would be better to make a custom move to task

dusk pewter
#

@main talon in the move to method I believe there is a parameter to check at runtime if the destination is still valid and if it isn't to update or in your case make it fail

#

@bleak plaza @sudden stag
Where do you set your vars in the bb? You must set them to know what to do. If a var is missing or is not set up. It fails

uneven cloud
# bleak plaza why am i getting this error message?

The player isn't valid. This can happen if you placed the AI in the world. You should always check references before using them. Also I recommend that you try the AI with Blueprints course on the learning library. Whatever tutorial you are following is not good.

dusk pewter
#

You have to set them in pawn as well

bleak plaza
uneven cloud
bleak plaza
#

i also have this random location task that doesn't reference the player, it returns a value but the MoveDirectlyToward task does nothing

#

i used the debugger and can see the MoveDirectlyToward task is firing, but nothing happens

bleak plaza
bleak plaza
bleak iron
#

Hello AI friends, my blackboard nodes seem to run simultaneously if there is a delay in them.

For example, here are 2 different nodes:

BB1 - Cut tree, wait 5 seconds, go to lumberjack
BB2 - Enter house

The problem is, if I fire BB2 while he's waiting the 5 seconds, he'll start BB2 then finish BB1 when the 5 seconds is up.

#

Is there a way to ensure only one Blackboard node is active at a time?

simple abyss
#

Just a general question on AI programming. During combat I want the AI to change position to make it more difficult for the player to aim, I do an EQS query to find a new position for the AI with requirements like trace to player is valid, distance at least X meters etc, however, the EQS query does not check whether the target is on the path to the new point the whole time visible. This leads to the problematic result that the AI moves out of visibility of the player to reach the new flanking position. Any idea how to avoid that behaviour (maybe something like continous wayfinding?!) ?

north oriole
#

Very noob question. I have two types of enemies, one navmesh. I want to make some volumes obstacles for one enemy but not for the other type of enemy, how can i achieve this?

bleak iron
#

Not a noob question. I've been doing this 3 years and still haven't figured it out

#

You CAN make 2 navmeshes, and each type use one or the other

#

That's all I've found

north oriole
bronze birch
#

i think u just need to create different agent type for that enemy type

north oriole
gloomy storm
#

Hi, I'm using Motion Warping Plugin to have my Ai attacks End at desired location. However when the warp location is clipping or behind the wall it teleports my enemy to random locations. Does anyone know what might cause it? When using root motion from animation it works normally and Enemy stops at wall, only when motion warping is enabled then this stuff happens

uneven cloud
uneven cloud
north oriole
uneven cloud
north oriole
north oriole
normal tapir
#

Has anybody had success importing and attaching a navmesh to a movable actor? I know ways/plug-ins to export the data but not sure how to use in game.

sick kayak
#

Behaviour Trees are strange. Anyone know why execution might not leave a branch immediately upon the condition of that branch's Decoration changing? I have the Decoration's Notify Observer set to "On Value Change" and Observer Aborts set to "Self" and there is a Task that changes the value of the observed blackboard key in the same branch.

#

Trying to make a dragon take off.

#

This dragon:

#

I can see this branch execute 5 times in the same second in the Output log:

dusk pewter
#

@sick kayak does the task have a success and fail flag?

sick kayak
#

Yes both

#

Restarting the editor

#

Might be a bug

#

Didnt help

#

I think it must not be executing all nodes in the sequence successfully so it doesn't reach the node which sets a different value on the observed key, so it tries the branch multiple times until all nodes in the sequence succeed

#

I'll put a breakpoint on one of the other branches that it switches to and try to Step Backwards and see what is going on

#

Looks like a MoveTo failed. I don't get how that could fail. Its a really simple node.

#

And I have a nav mesh.

thorn radish
#

LogNavigation: Error: Navmesh bounds are too large! Limiting requested tiles count (5248800) to: (1048576) for RecastNavMesh

#

Any idea how to fix this?

sick kayak
#

Create multiple smaller nav mesh bounds volume around your map

#

slightly overlapping

thorn radish
#

I'm using a navigation invoker

sick kayak
#

Whats a nav invoker do?

thorn radish
#

well it limits the navmesh generation around the player so only nearby AI moves... this works fine except for that error warning message in the output log as the navmesh volume is pretty big, but it doesn't do anything, it's just there to tell where the nav invokers should work or not.

#

it does work, it just complains and I htink i'ts cutting the navmesh which isn't good

sick kayak
#

ah

thorn radish
#

there's probably an easier solution because it would be quite popular to do large navmeshes if they came up with invokers

#

oh i think i can increase tile size in recastnavmesh

dusk pewter
#

@sick kayak if it failed I means it found no point to move.

#

I have been having a lot of problems lately with BT moveto

#

Instead I use the ai BP node moveto

sick kayak
#

Yes I think that was a solution, thanks. I also found another issue where I was casting to the dragon's blueprint class within a BT task and then getting some variables out of it several times but sometimes it would fail to get all of them . Seems like storing a local reference immediately and using that instead of the pin from the Cast To node is better.

dusk pewter
#

@sick kayak really?! Interesting. I have been trying to use movement BT in mobile forever and for some reason it fails. I don't understand why at all...

obsidian bramble
#

Hi, I'm currently trying to figure out how to abort the default MoveTo task when it's in progress. So far I have tried referencing the UAITask_MoveTo and calling EndTask, as well as referencing the UBTTaskNode and calling WrappedAbortTask. Both stop the AI from moving, however any following move tasks then immediately succeed, causing the AI to basically freeze in place. I saw this comment in the OnBlackboardValueChange function of "BTTask_MoveTo.cpp": // don't abort move if using AI tasks - it will mess things up

That would explain the strange behavior of subsequent MoveToTasks after aborting. Ultimately does this mean I would have to write my own moveto task if I want to be able to abort the task while in progress?

Lastly I have also tried sending AIMessage_MoveFinished as failed, but without any observable effect.

dusk pewter
#

@obsidian bramble how about aborting the BT entirely and then restarting it?

obsidian bramble
#

I'll give it a shot.

dusk pewter
obsidian bramble
#

It looks like it's leading to the same issue in my case. The following MovementTask just gets stuck in succeeding immediately forever, but thanks for the suggestion. I'll double-check the logic just for my sanity. If it turns out it was a mistake on my part, I'll update you.

alpine rover
#

kind of a vague question but could anyone help me optimise this? bipedal enemy that runs around and goes through a shooting sequence where it stands still and fires 3 bullets at the player before running away again. i've had some problems with the enemy working properly and was just wondering if there's a smarter way to go about this

neat summit
# alpine rover kind of a vague question but could anyone help me optimise this? bipedal enemy t...

For a ranged AI, I'm not sure I'd use the "TargetActor" as a location target. Instead, the first branch for me would be something like:

  1. Do I have a target? (your 2nd decorator there)
  2. If so, pick a firing location from EQS in a proper location where I can shoot
  3. Toggle focus and move to that location, then fire 3 times
  4. Repeat 2, while I have a target.

Then the 2nd branch would only be triggered if you don't have a target (since you are running the in a selector). So you can just keep wandering EQS locations , moving there and probably waiting at the end, before moving again.

alpine rover
#

will give this a try! thank you so much

obsidian bramble
#

@dusk pewter Alright, so unsurprisingly the mistake was on my part. There was a problem with the location getting fed into the second movement task. Stopping and restarting the BT did work, but in my case it does cause the AI to stop for a moment. I'm using EndTask now that seems to work fine, so far.

crystal hatch
crystal hatch
obsidian bramble
crystal hatch
patent hornet
#

There is a technique where you spawn a MoveTargetActor, give the AI a command outside the BT to MoveToActor with Tracking enabled, then when you want to stop you just teleport the MoveTargetActor to the AI's position

#

makes for far less headache with the BTs

#

you also don't have to handle animations breaking for a frame when you change target location

bleak plaza
#

i can't figure out what is going on here, the MoveDirectlyToward is firing but the character never moves and the Wait never fires, why is the sequence not running all the way through? (TargetLocation does contain valid coords)

bleak plaza
crystal hatch
# bleak plaza

If you read the contents of what you've posted you'll notice the movement has failed, which matches what your gif shows. This usually means the AI's or goal location is not on navmesh, but you're using non-navigation movement, so you might be using a movement component incompatible with AITask_MoveTo (like FlyingMovementComponent I believe, not sure, been a while). Need more detail on your setup.

bleak plaza
#

it's a paper2d character using walking movement, the coords are only changing in X by about 100 units, the area is just flat ground, no obstacles

crystal hatch
bleak plaza
#

not that i can see

crystal hatch
bleak plaza
#

i only know blueprints

crystal hatch
#

are you sure X is the right axis to use in this case? I've never used Paper2D, but when you use 'Front' view in the editor Y and Z are the right axii

bleak plaza
#

when i move the player i use X for left/right and Z for up/down

#

Y is always 0

crystal hatch
#

just for shit and giggles give it a try 😉

#

what you're doing for the player might be in local space

bleak plaza
#

i used to use non-AI movement for my enemy, they moved in X, i removed that and switched to AI to learn AI

keen crow
#

anyone knows any good open source UE AI BT plugins like say BTUtility? 🤔

celest python
#

BTUtility didnt work for me this year btw, fyi

#

i was hoping to set up a quick utility system with BT nodes with it but it did nothing when I run the tree etc

keen crow
celest python
#

it was around May when I tested it, probably I wont need it anymore, but also binding delegates in ctor cause serialization errors

#

so if its a default behavior of plugin I suggest to move it to somewhere else

north oriole
#

what happens if multiple navmesh modifiers overlap?who prevails?

patent hornet
#

the one with higher cost iirc

crystal hatch
ancient wedge
#

Does using multiple supported agents work with navigation invokers? Seems the AI have a hard time picking which one to use

north oriole
crystal hatch
north oriole
supple plaza
#

Is there a working example or tutorial for StateTree anywhere? I don't want to use BehaviourTree for this one. I'll be making a typical enemy that chases you, and gives up after a while.

I've done the BT version and want to replicate it using StateTree

thanks for any assistance

harsh storm
#

Surprisingly UE actually has a doc for the StateTree online. Works well enough.

supple plaza
#

Gave it a brief read - no concrete example like the AI agent although it mentions the suitability for using one. I would guess it communicates to a regular BP I set up for that purpose?

#

That kind of connectivity and architecting is what I need to learn, basically how does ST work with the rest?

harsh storm
#

Well - when I checked it out in 5.1, it expects you to tie an actor to it. Then when you are in situations where you need the actor, it is already passed to you.

#

You can also bind to stuff directly in that class

#

So, when you're setting up the evaluators and what not, you can bind directly to variables in the class that you marked this StateTree is for (as an example)

#

So there is no concept of the blackboard really

supple plaza
#

The BP would be the blackboard I guess. Thanks, this has all been really helpful, I was imagining the StateTree not tied to an actor

#

Right, that could be pretty cool. Apparently, StateTrees are evaluated really efficiently

quick bobcat
#

Is there a way so make a custom shaped field of view for AI perception sight? For example, using a box and seeing anything in that box?

#

I know you can make a simpler version of perception by detecting things in the box, but I would like to make use of the features of AI perception

dusk pewter
#

@quick bobcat use dot product

ivory cove
#

any ideas why the nav mesh won't complete on any of my stairs?

cold trout
#

needs an extra step by the looks of it

#

too steep

wary ivy
#

yea those stairs would fail an inspection too 😛

keen crow
#

why are blackboards are opened instead of behavior trees when I restart the editor? how do I fix this? 🤔 UE 5.03

crystal hatch
# ivory cove any ideas why the nav mesh won't complete on any of my stairs?

The first step of the stairs looks too high. To confirm that's the case you can increase AgentMaxStepHeight in RecastNavMesh's nav generation properties and see if it fixes the issue. Then you'll need to decide whether to keep the change (which could result in navmesh being where AI won't be able to reach) or lower the staircase.
But it's also possible it's due to your navmesh's voxelization resolution. I can imagine it happening easily if the stairs are not axis-aligned. Reduce RecastNavMesh.CellSize and see if it fixes the issue.

terse panther
#

hey there everyone, can we make custom shape navmesh?
i tried to edit the geometry box and change the actor type but the results are not what i expected

ancient wedge
#

Has anyone managed to find this in EQS?

Or am I misunderstanding it? I was expecting there to be a test already defined for Smart Objects 😄

crystal hatch
ocean wren
terse panther
dusk pewter
quick bobcat
# dusk pewter <@118458924281233413> use dot product

So for ai perception, when you configure sight you can set an fov and a range for the sight and that creates a sort of cone where it can see things. What I am wondering if there is a way to change that cone into something like a box or any other custom shape

dusk pewter
#

If you want a cone, using the dot product you can get the angle of importance and a specific range will result in a cone

#

if you want a cube, you can use a two pronged method to check within 2 dot products with range

quick bobcat
#

Hmm yeah I know I can do it manually. I was hoping to just be able to change the shape and area that ai perception can see in so that I can use the functionality it already has, but if I can't do that I guess I will have to do it that way. Which isn't too much of an issue, but I think ai perception is really cool

sacred shale
#

does anyone know a way to distinguish AI Perception senses on On Target Perception Updated? I want to have different behaviors between the enemy seeing the player and enemy hearing the player

#

I have the hearing and sight senses but it seems like the only distinction I can give is the tag that provides when I report a noise event

autumn sluice
#

Hey, I'm tinkering around with StateTree to try and become a little more familiar and it looks like states can subscribe to events? Does anyone know how to send an event with a tag to a StateTree state?

I cannot seem to find any documentation surrounding how to use this

quick bobcat
sacred shale
#

unless it's get sense class for stimulus

quick bobcat
sacred shale
#

yeah no worries, just figured that out lol

#

thanks

#

whats with the lizard lol

uneven cloud
dusk pewter
#

@uneven cloud in my experience it is more of a hassle than simply doing math and outputting a boolean

quick bobcat
sacred shale
ocean wren
sudden citrus
#

I want to draw a 2D tree (similar to a behavior tree) in screen space within a gameplay debugger panel. Does anyone have good first suggestions on how to achieve that easily? Any libraries worth integrating or should I actually just figure out how to space out a tree myself

pine comet
#

Are animation notifies not expected to work on a montage when it is played via the "Play Animation" task in a behaviour tree?

sudden citrus
#

this looks really good, thank you!

keen crow
#

Do consequent eqs tests include filtered out EQS items? like say I have 2 consequent tests: trace and distance. trace test filters out 100 out of 200 items, will distance test have all 200 items or only 100 which haven't been filtered out?

Also how do (can) I distribute EQS test calculation over few consequent ticks? Right now I'm about to have an EQS test that can have around 500 line traces inside of it and fire frequently in some occasions and I feel like that can be too much for one tick

fathom sun
#

How can I make an AI that uses CMC rotate in place? The AI rotation is determined by movement, not by the controller direction.
I have an AI that should move towards a player, and then attack, but if after the AI reaches the player, and the latter moves around it (very closely, just to be inside Acceptance Radius) just to be behind, it won't be able to hit the player with attacks that are in front of the AI.
I thought about making a custom C++ BTTask that will rotate the AI, but I found no functions in CMC for it.

keen crow
fathom sun
#

I have never heard of it

keen crow
#

it might work fine unless you have disabled bOrientRotationToMovement in CMC (or maybe some other flags like bUseControllerRotationYaw on character IIRC). just put this service on the composite where your AI starts approaching its target

fathom sun
#

I haven't disabled bOrientRotationToMovement, it's active, while anything related to rotation on the controller is disabled. I'll try it, thanks 😄

#

@keen crow By trying to add the service to my composite, I have found that for some reason the only available blackboard key is SelfActor, but my blackboard contains other objects as well. Am I supposed to specify the target to rotate towards in there or not?

keen crow
fathom sun
keen crow
#

here, open the dropdown and set it to AActor

fathom sun
#

Ah, yeah, just found out, didn't know about this feature, thanks 😄

sudden citrus
#

Bear in mind that agents will prioritise their next pathing point as default focus while moving. To make absolutely sure there is a higher priority, Gameplay Focus, which you can set through blueprint by calling "Set Focus" on the controller. You can make your own decorator with it.

fathom sun
#

Now I can select it in there, but I still need to check whether it's the thing that I'm looking for

fathom sun
sudden citrus
#

cool, just keep this in mind for when you want it to strafe around the player 🙂

fathom sun
#

Uhh, after setting the target as the blackboard key on the service it doesn't seem to work as supposed, the AI rotates very slowly to the target, which is probably caused by the MoveTo BTTask. To give more information: the attack and movement related part is on screenshot. The AI is able to attack only when the target is in front of it.
Edit: After moving the service to the MoveTo node it still doesn't work.

keen crow
fathom sun
#

It's already 360

keen crow
#

try playing with Use Controller Desired Rotation and other rotation flags. I remember that they can effect rotation in different cases, but I don't remember right combinations in each case

fathom sun
#

After reading a little bit more about the service, I have understood that it changes what's returned by GetFocusActor on AIController (or maybe just Controller). I suppose that after the service has taken place, the controlled should rotate, and if CMC Use Controller Desired Rotation is set to true, then this rotation will take place on the pawn as well. The problem, however, is that the controller doesn't rotate. 😄

keen crow
#

or maybe the problem is actually the default focus priority. I usually forget about this service and always implement my own where I set the focus priority to Gameplay 🤔

fathom sun
#

I didn't really hear about focus priority, what's that about?

#

After investigating a little bit further, I have found out that the AIController has a FocusInformation with an array of priorities, which has only 1 item on my runtime, thus I think it's not about priorities 😄

crystal hatch
fathom sun
#

I have found out that the service did it work perfectly, the only issue was that the controller didn't rotate, and by looking at some controller parameters I've found out that Set Control Rotation from Pawn Orientation was checked preventing it to rotate towards the focus actor set by the service. Now it does work perfectly, thank you for helping 😄

potent stone
#

My "Ai Move To" node is working only if I use "Add Movement Input" in an "event tick".. is it normal ?

#

I guess I won't use NavMesh since it's weird..

sacred shale
#

is it possible to set a behavior tree service's interval using a blackboard key?

uneven cloud
tough nexus
#

Hello do someone knows how i can make an ai actor through blueprint task move to an Niagara location?

potent stone
uneven cloud
potent stone
#

The visual logger is telling me that

uneven cloud
potent stone
#

When I try to move what ?

#

This Visual Logger is from when the "AI Move To" node is executed

#

I have multiple "RecastNavMesh" in my Level I don't know why

#

Maybe this is the problem?

ocean wren
#

it says you don't have a path.. which usually means you don't have a path

potent stone
#

But I have a path, and a "Nav Mesh Bounds Volume"

#

And the NavMesh is green on the floor so..

ocean wren
#

does the path render on your agent?

potent stone
#

How can I know that ?

ocean wren
#

select the agent, it should draw the path in the visual logger

potent stone
#

The agent is the "NavMeshBoundsVolume" ? or the "RecastNavMesh" ?

ocean wren
#

the thing thats meant to be moving

potent stone
#

No nothing is rendered I can only see the green floor

#

Oh wait my Actor does not have "Gravity" maybe ?

ocean wren
#

yeah, you definitely don't have a path.. its probably failing.. check the log files and usually there's an error

potent stone
#

When I "play" and try to move the Actor up, it does not go down

crystal hatch
#

I strongly suggest you very closely follow some AI-focused UE4 or UE5 tutorials. You clearly miss some very basic information. Way too much to explain in a discord chat.

potent stone
#

It's ok sorry it was the "Gravity Scale"

#

It was to "0" :/ very sorry

fathom sun
#

Is it possible to overlap two modifying nav volumes? I have a general nav mod volume on in a place, and there are different objects that modify the navmesh by adding some cost as well, but for some reason they don't work when the volume is overlapping with them

autumn sluice
#

Does anyone know how StateTreeSendEvent works exactly? I've tried calling it within a task in a StateTree and it does not appear to trigger the On State trigger in StateTree. I can't seem to find any information on it, what its target is, what context I can call it in, etc. Just trying to tinker with StateTree to see what it can do.

deep minnow
#

Hey! Did anyone had any success with setting up this IAUS plugin https://github.com/ProjectBorealis/IAUS I tried setting it up both on 4.27 and 5.1 and failed, seems that the Evaulator never runs till the composite node gets selected which never does because it needs the evaluator to actually set scores on the behaviours 😅

GitHub

Infinite axis utility system in UE4 Behavior Trees - GitHub - ProjectBorealis/IAUS: Infinite axis utility system in UE4 Behavior Trees

sacred shale
#

should i be attaching an AI perception component to the character or the controller? I so far have it tied to the character but is there a benefit to it being on the ai controller?

outer bear
#

Once I spawn in a certain number of ai controlled enemy pawns (about 50 it seems), in the ai of pawns created after reaching this threshold Move To no longer functions
They still run their behavior trees, but calling Move To will do nothing even though there is a clear path to the target
The problem persists even after destroying the existing 50 pawns, and spawning in new pawns

#

Any idea what is causing this?

#

_ _
Turning up the setting for crowd manager max agents seems to fix this
but I still don't understand exactly why the problem persisted after destroying the existing pawns (bringing the number back to 1)

rotund harbor
#

My enemies were fine when I first made them, but now that I have them in my level environment they've decided to not move or rotate at all. I've got my navmesh volume, their chase player task is running and they follow the rest of their AI (attacks and whatnot) like normal. The character movement component values hasn't changes since they were working. Any guesses where else I could look?
Let me specify that they move and turn using a simple move to location in their behavior tree

uneven cloud
sacred shale
#

thanks!

#

i'm trying to access the owner using get controlled pawn but it doesn't seem to be working :/

uneven cloud
sacred shale
#

tried get owner too

#

in BP

sacred shale
#

from my AI Controller blueprint

#

since I want to call an event on my BP_Enemy class but both Get Owner and Get Controlled Pawn seem to return null

uneven cloud
#

When are you trying to get the pawn? Get Owner won't work.

sacred shale
#

On Target Perception Updated

#

I had the AI Perception component on my Character but I realized it seems to be Unreal standard after reading the documentation to put it on the controller instead

sacred shale
#

exact same settings too

#

never mind, had to ensure that friendlies, enemies, and neutrals were all ticked

graceful schooner
#

Anyone have an idea how to add an enemy to a Lyra Team?

rich veldt
#

hello. just curious, but outside of just making a whole new task and copying the logic from the multiple tasks together into one, is there something i can do for behavior tree organization in the way of combining a branch of sequenced tasks together? sort of like in blueprints collapsing to function or another graph etc.

#

perhaps in a way that would then allow me to use that section of the bt/that branch elsewhere via just duplicating that single "node"

ocean wren
#

Glad someone put up the Nucl.ai stuff up

wary ivy
#

I had membership access to nucl.ai stuff and then the fucking site just went offline

#

massive rip off

keen crow
rich veldt
keen crow
#

Is it possible to add my own option to Run Mode without getting into the engine code? I'd like to have a parametrized option like pick single best option of some "intelligence" variable which takes value from 0.f to 1.f. Or is my best option to fork the run eqs BTTask and BTService, force Run Mode "All matching" and then manually sorting and picking best item?

keen crow
#

or yet another dumb idea - parametrize scoring factors on scoring tests, make intelligence a BB float field and provide it as parameters in EQS BT nodes

crystal hatch
# wary ivy massive rip off

I bet you haven't read the eula 😛 nucl.ai was up as long as it was possible without active maintenance. We're all worse for it no longer being there, but as long as it was it brought AI community value.

fathom sun
#

How can I make a bunch of AI character move inside a corridor in a natural way? I want them to not move just along the cheapest path, but in a kind of good looking way.

ocean wren
#

what do you mean by good looking?

fathom sun
#

I mean in a natural way, not just in a one straight line

ocean wren
#

got an example?

fathom sun
#

Nope, I don't. What I mean is that I want that the AI will spread out in the corridor, just to fill it up

ocean wren
#

use a steering force then.. simple seperation would do that

#

not exactly "realistic" though

fathom sun
#

Uhh, I guess that's not it. I was looking for something for a hour or so, and the closest thing that I have found so far are the splines, but the thing that I'm trying to achieve would require creating many splines or do something fancy with one spline.

ocean wren
#

its hard to tell what it is you want

fathom sun
#

Lemme explain a little bit more. I'm creating a tower defense game, and the problem that I'm struggling with is the AI movement along a path. The pawns turn the edges sharply, if there're many of them, they'll walk into each other trying to follow the cheapest path etc

ocean wren
#

What we've done in the past is take the string pulled path points and perturb them with a vector away from the edges so that you don't follow a perfect string path

#

that and use the detour crowd controller so it has some local avoidance sampling

#

and turned off the capsule so that collisions aren't rigid

fathom sun
#

How would I do these things? I'm not really experienced with AI 😅

ocean wren
#

You wouldn't.. its easy enough to do, but you need to use the C++ code really

#

the path you get from the FindPath functions.. so you can modify the path points

#

detour crowd just requires a different controller and default initialization

#

Not something I'd recommend trying for your first AI implementation

fathom sun
#

kk, thanks 😄

tawny raven
#

Is there a way to make the navmesh that is generated always fully connected (from a defined point), i.e. there are no polygons that are disjoint from the rest of the mesh, remvoing those?

keen crow
tawny raven
keen crow
#

by default navmesh disjoints are handles by nav link proxies (simple and custom) but you'd have to place them all over the navmesh. i personally don't like it

tawny raven
keen crow
tawny raven
tawny raven
#

/me puts QA hat on

dusty spear
#

ChatGPT knows a lot about unreal 😄

#

thats pretty dope

north oriole
#

does setting the cost of a nav_area to 340282346638528859811704183484516925440,0 make it null?i notice that extending nav_area_null it has that cost by default. Is it like that just as a marker or is it actually that value that make areas not viable by characters?

brittle lynx
north oriole
#

Do games usually have multiple navmeshes or do they just use nav_areas and filters to deal with enemies having different pathfinding?

brittle lynx
#

Just configure multiple entries for different types of character in SupportedAgents in the project settings. The right navmeshes will be auto-generated in all levels with a navmeshboundsvolume

north oriole
brittle lynx
#

If you're sure that the characters will always remain the same size (e.g., humans with different permissions of where they can go, as opposed to different types of monsters that just happen to have the same capsule size at the moment), then I'd use filters.

#

If you want to be able to plop down a volume that says that only certain types of characters can go there, you can just make a subclass of UNavAreaMeta_SwitchByAgent and assign different actual nav areas for different agent types. So if you have a NavModifierVolume with this custom NavAreaMeta, it will paint NavArea_Null on navmeshes of some characters, and NavArea_Default to navmeshes of others. Either way you need to add distinct character types to SupportedAgents, which means they each get a separate navmesh.

north oriole
brittle lynx
north oriole
brittle lynx
#

Adding a supported agent means adding a new navmesh. So whenever something moves, dynamic navmesh generation will have to update all the navmeshes, so the more supported agents, the more navmeshes, and the longer that takes.

#

If not for dynamic generation, I wouldn't expect much of a performance cost increase though.

north oriole
#

Thanks again though, great help🙏

fresh ridge
#

Any ideas on why my service is not ticking?

#

Do I have to use receive tick ai or receive activation ai?

soft mantle
#

This is freaking insane, in 6 months you will probably get any type of 3D model from there

lyric flint
#

I have a question about using navlinks to connect disparate nav meshes. I have a "cliff" and when I run off as the player, I want the AI to follow me off. This works fine if I tell the AI to jump once it reaches the nav link. However, I would like them to just run off the cliff as a player would. I have tried adding a World Offset, but the character butts up against the ledge and is not pushed off.

I'm not sure if this is an AI issue or a CharacterMovementComponent issue (I am using ALS), but I would appreciate any insight!

crystal hatch
# fresh ridge Any ideas on why my service is not ticking?

If Target is not set the whole tree won't run.
I suggest reshuffling the tree. The ROOT node is not an actual node in the BT, it's there just to provide a place to indicate a blackboard asset, so I suggest adding an actual root selector node, and then add a "fallback wait" task that would get hit whenever none of the tree has the right behavior for the given world state.

keen crow
#

How do I make OnBecomeRelevant and OnCeaseRelevant executed on decorators? I've set the flags bNotifyBecomeRelevant and bNotifyCeaseRelevant to true in constructor but the methods are still not fired. For example built in decorator BTDecorator_CompareBBEntries have those methods overriden but they also don't get executed

keen crow
#

nevermind, figured it out. You have to set abort mode to self/both to make it work

tawny raven
# keen crow try kicking max step angle and height to the sky in project settings-navmesh or ...

The step size put to a very high value indeed solved the issue of having gaps. Now however I wonder how I can add costs to the navmesh at generation time. I want to apply a cost that increases exponentially based on some steepness metric or roughness. I know there are Modifier Volumes but i dont want to place those on my gigantic terrain. I want to derive it by the navmesh steepness or the terrain mesh itself. What's the best place to insert code for such a cost calculation for the navmesh polygons?

keen crow
#

but anyway my guess would be to calculate height difference and/or navmesh poly normal (wether it's looking more upside or rather parallel to XY plane) and then perhaps assign some "weight value". but then again, I'm not sure how is navmesh generated for steep surfaces - is it a single huge polygon or is it a sequence of uniformly small polygons

tawny raven
#

hmm ok thanks

#

rolling my own solution is not really acceptable because of the amount of work needed to fully integrate that, i d rather prefer to modify what exists

#

The odd thing is, i see a lot of posts about this but no solutions

keen crow
#

probably because using built-in nav mesh for walking for flying AIs is not the best idea

tawny raven
#

it is not about flying!

#

it is about navmesh costs

keen crow
#

well, hovering?

#

I mean why would you need to eliminate navmesh cuts?

tawny raven
#

it is not a problem anymore

#

My problem now is that i want to assign a cost to the navmesh based on e.g. landscape, so it could be painted on

keen crow
#

ah, ok

tawny raven
#

Use navModifiers to set cost for specific volumes (actors) - i can’t afford to place volumes on every slope fragments of a landscape manually.

that's my problem too

#

I can go deep into code, i just need to find out if this is feasible and whether it has been done, before i dive into it

ocean wren
#

Yes its feasible, because you can calculate the cost of traversal from one navmesh edge to another, although personally I'd probably make a different solution using some form of heirarchical pathfinder

tawny raven
#

There is a EPathFindingMode for regular and hierarchical in UE, i just stepped through and noticed it uses "Regular" in my case, which i assume is the default. How would switching to "Hierarchical" help? or do you mean i should roll a custom solution? For me the current solution works fine, all i need is these weights for the navmesh

#

you can calculate the cost of traversal from one navmesh edge to anothe
hm so rather than baking the costs into the navmesh you mean the solution is to let the pathfinding functionality query the costs in a custom way. I am checking where I could insert this

tawny raven
#

Looks like dtQueryFilter is needed for this but this is deep down in detour 😮 In UE it is taken in as FRecastQueryFilter retrieved from FNavigationQueryFilter::GetImplementation() which is taken from FPathFindingQuery::QueryFilter which is taken from AIController::BuildPathfindingQuery via a FAIMoveRequest, which in my case is created in AAIController::MoveToLocation which uses DefaultNavigationFilterClass of type UNavigationQueryFilter so i guess i need to make a custom UNavigationQueryFilter and set the class as DefaultNavigationFilterClass in my AIController(s)

tawny raven
#

Another finding: UNavigationQueryFilter uses FNavigationQueryFilter and all of those operate solely on an array of FNavigationFilterArea so the weights can not be on edges or nodes specifically, but only on areas, which i guess are the navmesh polygons

crystal hatch
tawny raven
#

Ok so polys can share areas

#

and then areas can be interpreted differently by nav agent to determine a cost for an area

crystal hatch
#

areaAndtype is where the NavAreas get encoded. Every area has a defined cost, but using a virtual filter you can essentially do what ever you want.

unborn jungle
#

Is there a way to allow for AI to freely drop from ledges (higher navmesh to lower navmesh) without hand placing loads of nav link proxies all over the place?

#

It can be a pain during level design when moving stuff around to realize you forgot about the nav link proxies and have to realign all of the start and end points once again. Though maybe this is just how it's done and the goal is to place as few as possible while accommodating all possible ledge drops?

#

Also in general do you place many separate NavLinkProxy actors per level or just one actor and then make many point links?

ocean wren
#

Anyone remember what you use to make a parameter an input param on a blueprint callable function? is it ref or some such?

#

UPARAM(ref) ahaha...

tawny raven
#

what would be the best way to assign areas for the dtpolys during navmesh generation?
i found out that status = dtBuildTileCachePolyMesh(&GenNavAllocator, &BuildContext, *GenerationContext.ContourSet, *GenerationContext.PolyMesh); is where it sets the areas field of the dtTileCachePolyMesh which are then used to set the areas to be encoded into the dtPoly.areaAndtype
dtBuildTileCachePolyMesh()seems to use the area value from dtTileCacheContourSet, which is supplied via GenerationContext.ContourSet, which seems to have its area set by GenerationContext.Layer

#

this is like an onion

#

and now i got to the point where one of the onion's layers is literally called "layer"

tawny raven
#

Ok so the FRecastTileGenerator sets up the layers and applies the areas to them. Basically this handles the NavModifierVolume

#

I wonder if i can make a custom UNavArea and use that to define areas dynamically based on my landscape terrain's layers

plush cargo
#

has there been any recent addition to statetree knowledge?

#

ah there is a quick start now

tawny raven
#

Ok i now believe that my idea of "painting" areas based on landscape values is not feasible, there is no interface whatsoever for that. So my new idea is to create a custom navmeshmodifier that i somehow trigger to be generated to create a volume for itself based on the landscape's values to encompass its supposed area

#

I suppose a single ANavModifierVolume could tackle all variances of areas at once in this way

lethal helm
# soft mantle https://www.youtube.com/watch?v=shy51E-MU8Y

whats even more insane is this
Prompt: find the point in array closest to A and furthest from B in unreal engine 5

#include "GameFramework/Actor.h"
#include "Math/Vector.h"

class AFindingPoint : public AActor
{
    GENERATED_BODY()

public:
    AFindingPoint()
    {
        // Define the array of points
        TArray<FVector> arr;
        arr.Add(FVector(1, 2, 0));
        arr.Add(FVector(3, 4, 0));
        arr.Add(FVector(5, 6, 0));

        // Define the points A and B
        FVector a(1, 2, 0);
        FVector b(3, 4, 0);

        // Initialize the point that is closest to A and furthest from B
        FVector point(0, 0, 0);
        float min_distance = FLT_MAX;
        float max_distance = 0;

        // Iterate through the array and find the point that is closest to A and furthest from B
        for (FVector p : arr)
        {
            // Calculate the distance between the point and A
            float dist_a = p.Distance(a);

            // Calculate the distance between the point and B
            float dist_b = p.DistanceSquared(b);

            // If the point is closer to A and further from B than the current point, update the point
            if (dist_a < min_distance && dist_b > max_distance)
            {
                point = p;
                min_distance = dist_a;
                max_distance = dist_b;
            }
        }

        // Print the point that is closest to A and furthest from B
        UE_LOG(LogTemp, Warning, TEXT("Point closest to A and furthest from B: (%f, %f, %f)"), point.X, point.Y, point.Z);
    }
};```
soft mantle
#

isn't this regular ant algo?

lethal helm
#

it's ai generated from the prompt

#

idk. I find it impressive that it knows how to use unreal 5 libs instead of just hitting me with a bunch of std stuff

soft mantle
#

oh yeah, I have been playing with ChatGPT and you can do quite impressive things

#

you can improve coding speed A LOT at the moment using it and in a few years it's probably going to need little to none supervision

#

I was looking at the code you posted and thinking "Maybe they found a faster way to figurate it out, like they did with matrix multiplication recently" xD

lethal helm
#

yeah though unless I feed it my entire repo I'm not sure it will be useful for figuring out how to get my various systems to play nice with each other

#

which is like 90% of my dayjob

soft mantle
#

at the moment I see it like a very advanced "Auto complete" and it can save a lot of time

lethal helm
#

great tool for adding missing mathy/algo funcs to my blueprint libs though

normal tapir
#

Anybody tried a navmesh transform technique like this? Hoping to not making something from scratch if possible. https://youtu.be/mZOZyCenz1E?t=952

In part three of my series looking at the AI of online pirate adventure game 'Sea of Thieves', I explain the AI behind the three boss enemies that exist in the open waters. The Megaladon, the Kraken and the Skeleton Ships - also known as Megan, Karen and Skevin - have their own unique AI systems and we hear first hand about their development fr...

▶ Play video
lethal helm
#

thats neat

lethal helm
#

then modify your character movemement component to query that navmesh

#

will probably be a PITA to hunt down all the funcs you need to override

#

but the concept is impressively simple

normal tapir
#

Yeah I think I can use the same@ones some plugins use

#

And override

#

Yeah if it’s just about changing what’s queried… maybe

lethal helm
#

it gets alot more complicated if you want it to be dynamic though

lethal helm
#

no like the mast falls down making part of the ship inacessible

normal tapir
#

Yeah I already have solution for slightly moving so I do want full moving

#

Oh yeah

#

Don’t care about that

lethal helm
#

🤷 would be cool though

normal tapir
#

Haha sure but getting this working on a FAST moving ship would@be enough

lethal helm
#

have to replicate the changes from the real ship to the "fake" ship so it's navmesh updates

#

for a fast ship might want to start with getting the characters to not jank out even without bringing AI in the equation

normal tapir
#

Yeah jank is the real issue so far

lethal helm
#

then you add replication and it makes things even worse

normal tapir
#

Haha yeah won’t be doing full multiplayer

#

Just want this to work on fast moving ships like it does on slow ones and stations https://twitter.com/SubtollD/status/1596513413710372864

Taking out a station turret using mag boots! Plus some other boarding shots. Big stuff WIP in Firmamentum! #screenshotsaturday #solodev #indiedev #gamedev #madewithunreal #gaming #indiegame #indiegamedev #indiegames #spacegame #UnrealEngine #voxel #scifi #scifiart #space

rich veldt
#

hi. my AI's behavior tree is running before my game has finished loading (so it's spotted my character through walls that haven't loaded in yet)
i have an event that's dispatched to tell actors when the game has finished loading and the AI controller subscribes to this, and I'm trying to call this once the game has finished loading in:

            BehaviorTreeComponent->StartTree(*AIPawn->BehaviorTree);```
but even without this codeblock the behavior tree seems to run automatically during beginplay. how can i delay the start of the behavior tree running until i'm ready for it? is there somewhere i can disable auto-activation?
#

ok, BrainComponent->StopLogic() on beginplay seemed to work

plush cargo
#

i am trying to make a state change based on float compare but it refuses to work

#

i have tried a boolstate, same thing.

#

oh it seemed to not work because there wasnt a task attached to idle

#

what was the demo with the statetree in it ?

supple plaza
#

I'm using BP and AIPerception but I can't change where the sensor is on the target. Any help please?

charred lava
plush cargo
#

im just doing this to figure it out

#

need a working example

plush cargo
charred lava
#

maybe it was just a stream where they demonstrated statetree. I definitely saw statetree being used in a Stack o bot scenario

plush cargo
#

yeah no stress

supple plaza
#

Question: if fully BP am I best off just using traces? I can't seem to control AIPerception's locations it works at

plush cargo
#

are we assuming StateTree is working with AI Perception?

supple plaza
#

I didn't have problems using StateTree, just problems in general with BP + AIPerception (I tested it with and without state tree)

plush cargo
#

i havent learned alot about ai perception. but i thought to remove the controller and assign perception to the actor.

#

throws warnings

#

"they are designed to work with AAIControllers!"

supple plaza
#

yeah but it works fine even so. It's just there appears to be no exposed functionality to change where you'd like to sense on the target actor. For example the head instead of the default chest

plush cargo
#

huh ok

supple plaza
#

I think it's a BP missing stuff issue

#

in C++ land it's probably fine

#

(I'm trying to avoid C++ as long as possible, I've coded since 1982 and want to fully grasp UE in a BP context first while learning it)

#

Also BP is less vulnerable to code changes/churn, it's a nice way to learn IMO

#

Re: StateTree, I did the epic documentation on it a few times until it clicked, and it's fine now. You can make little BP tasks to do what you want from within the statetree

#

But logic isn't really the problem atm for me

plush cargo
#

@supple plaza how would you handle things like movement and acting on senses?

#

with StateTree

harsh storm
#

Shouldn't be much different honestly. Senses are a separate system from state tree and BTs

#

They simply give you information about what is going on in the world around the agent

#

In a BT setup - you update a blackboard's values.
In a ST setup - you just update variables directly on your agent and the ST is binded to those.

plush cargo
#

Yeah so i would still use senses to manage some aspects

supple plaza
#

the Tasks are just tiny blueprints you make that can share the data etc

plush cargo
#

ok

#

I think a better question is this. With StateTree, is the aicontroller still the acting brain?

supple plaza
#

no, it's just the body

#

it's the thing that acts out stuff

#

move here, run this code etc etc

#

ST is the brain, the BP that has the ST component is the storage and general stuff

#

https://docs.unrealengine.com/5.1/en-US/statetree-quick-start-guide/

I followed this a few times. I had to do it a few times because it's not written that clearly, and easy to miss bits. Instead of a block moving along a spline, I used an actor based off the third person demo, with its camera deleted etc. I set it's pawn to AIController.

The state tree is then added to it as a new component and they talk / work fine

Quickstart guide on using the StateTree system in Unreal Engine.

plush cargo
#

i see

supple plaza
#

It's worth noting that all of this still works with detour and even AIPerception, just those are really optional

plush cargo
#

yeah im done the quickstart twice

#

detour ?

supple plaza
#

the AIController for RVO navigation (so agents avoid each other as well) - same stuff really

plush cargo
#

i see

supple plaza
#

basically that can be changed later

plush cargo
#

but for a generic purpose AI study i want an actor, an ai controller, statetree, AI perception...?

supple plaza
#

really though it all begins with a simple actor/pawn like the third person BP. I copy that, and then add my StateTree to it in the components with +

and the guide I linked has the details, works the same if its a BP for that or a cube, still talk the same in the BP <> ST

plush cargo
#

And yeah i finished the quick start on my current enemy template bp just fine.

supple plaza
#

it's a bit confusing at first but I feel practise will sort it out, and it's a lot less files and messing around than behaviour trees (which imo suck a bit - I was surprised to see them still used in Lyra)

plush cargo
#

mostly for me its a confusion on these anatomical aspects of it

supple plaza
#

Right now I'm not using State trees or anything, just plain BP for the AI as I want to get to grips with the other parts UE offers like AIPerception (I'm not new to doing AI myself in Unity or other engines with traces etc).

So far though AIPerception seems like it's not very useful without using a proxy object or C++ to modify where casts begin and end... kind of essential really

#

I read around a bit.. seems epic stopped work on the BP part prematurely

plush cargo
#

i managed to make ai perception give me a closest desirable object

#

out of all sensed

supple plaza
#

Interesting, I usually use BP to do that (I actually have one that uses closest point on line so I can do target switching, better object selection etc)

plush cargo
#

yeah i wanted to approach my AI with 2 basic states. Armed and Unarmed. Unarmed would have it look for an object that can be a weapon, go to it and equip, enabling the armed state.

#

I found this extremely cumbersome in BT

#

But what i am looking for is to get an AI that is expanding on its states so i am hoping StateTree is the goto. It already looks promising but i just need to figure out the rest of it.

plush cargo
harsh storm
#

My main experience with the senses stuff is sight and you can definitely configure the range and all that.

plush cargo
#

actually it seems to me that i would want the AI controller to hold the statetree comonent here

supple plaza
#

Yet you never had problems with there on the target the sight works? using ' then a number pad number (reconfigurable) will display a lot of debug info

plush cargo
#

yeah that is pretty annoying

supple plaza
#

you can see it stop sensing if you're too close to a wall

harsh storm
#

Nope. Never had a problem with sight

supple plaza
#

cos the raycast clips it

plush cargo
#

took me half a day to figure out the numpad was key

supple plaza
#

Yep you can rebind those though (I have a TKL keyboard so no numpad hehe)

plush cargo
#

🤌

harsh storm
#

I think the senses system is one of the nice things about doing AI in UE personally.

#

But I also just like the tools in general.

#

I don't have many complaints honestly.

plush cargo
#

i have a more philosophical AI question

#

in a melee setting

#

how could an AI strafe if i dont want to lock AI to player

supple plaza
# harsh storm I don't have many complaints honestly.

I honestly don't think you've encountered the shortcomings of the AIPerception system yet though due to probably the nature of your game's design. It has some glaring omissions in BP land which are available for tweaking in C++

harsh storm
#

Meh - I just don't find the things problematic personally. I've done various games with it as well.

#

And w/e is lacking in BP, just use C++ honestly. UE is designed to use BP & C++ together.

#

Trying to go too heavy on one or the other is going to be painful regardless.

supple plaza
#

I agree! I just want to delay moving to C++ which I'm familiar with - while I really get to grips with BP and all that which I am unfamiliar with. Epic staff and joe wintergreen also recommended I begin with BP as it teaches the general landscape / architecture as well

#

It's been a surprising journey though - I expected the BP approach to be cumbersome and slower than coding, but in a lot of cases, if used right - it is actually quicker, once you know how!

#

(to develop in, not execute)#

solid halo
#

probably been asked, and answered before, but with the documentation of unreal being what it is, its just easier to ask here:
is it possible to add a new thing to perceive in the AI perception system? like for example if I wanted an AI to know when there is a disturbance in the "the force" could that be possible, or am I limited to sound, touch, sight, and smell? (is smell even available haha?)
and if so do you know of anything other than the god awful unreal documentation that I can learn how to implement it?
I really appreciate the help.

harsh storm
#

You can create new custom senses. C++ though.

solid halo
#

thats 100% fine. no problem with C++ just looking to know if its possible and a direction to figure it out. lol

harsh storm
#

Examine the current senses to see how they are setup and then imitate that.

solid halo
#

good idea

plush cargo
#

if i add StateTree to ai controller ue crashes when pulling up the debug view

#

i will assume the statethree is for the actor 😄

harsh storm
#

Didn't happen to me when I was messing with it when 5.1 first released. Post the crash and the code in question

plush cargo
#

im testing different configs

#

not a code to link per se

#

i seem to have stumbled on something that has put some of my asset in a bad digestive location

#

yeah its fixed now it seemed to have become a problem somewhere while linking and unlinking statetree on ai and actor

plush cargo
#

adding a sensor to ai controller, adding stimuli to item.

#

what else is required for the debugger to show stimuli

#

trying to figure out why my almost identical setup is not showing sensor stimuli in overlay

sleek hull
#

has anybody tried building ai based on neural networks. does unreal have a solution for this?

plush cargo
#

i had to enable neutrals and friendlies

#

i dislike these small checkboxes that just seem to be a launch checklist for no reason

tender vault
inner zephyr
#

looks like there is another plugin called "ML Adapter". Did anyone tried that out?

crystal hatch
celest python
#

Rider was in love with that plugin that it keep including it randomly during EAP a while ago 😂

normal tapir
#

Would it be hard to have characters move along or within a threshold of a spline only? I am thinking through ways to have local “navigation” and really don’t need much—I just want to make them look like they’re walking on a fast moving ship. Anybody know if a character would still animate if I make some custom moveto that only follows a spline to their target?

#

Moving any actor along a spline seems pretty easy so the big question is will a character with skeleton use the right animations…

#

Even without a legit navmesh

plush cargo
#

where would i put movement and which method for move in a StateTree context ?

celest python
#

and build your spline on top of the created path along navigation

#

or just follow the spline and add movement input with direction

#

both would work easily and characters would animate assuming you are using CharacterMovementComponent

plush cargo
#

next day same question

#

is there a UE demo project with StateTree in it ?

lyric flint
#

Hi everyone, I wonder how to add detecting player flashlight by ai perception, any idea?

lyric flint
#

I have all behavior tree for sight and hearing but I wonder if it's possible to detect player spot light without adding cone that will simulate light

plush cargo
#

but you want reaction on the light?

#

is there nothing in sensory update information you can get about the simuli source ?

lyric flint
#

yes, i want ai to detect player when he point light at them

plush cargo
#

i dont know if the light volume or whatever its called can be identified in itself

#

but it seems simple enough to just add a collider to it that is aprox the same

lyric flint
#

i thought about it, the problem is that this collision will go through walls in tight spaces, so player could be spotted through walls

plush cargo
#

just make it thin

#

oh wait i get you

#

it just becomes extra corner cases to manage

lyric flint
#

thanks for help, I will try this approach

plush cargo
#

i would start with a thin detectable collision ponting in the light direction. then i would activate/deactivate it if it collides with environment

#

and see where that takes me

high summit
#

how to solve this?. Navmesh is not filled on entire area

plush cargo
#

i've gotten this far. This makes the AI move to player always.

#

where would i introduce that AI has reached a player?

crystal hatch
high summit
#

what mean by acceptance radius in AI move function?

plush cargo
#

distance it will stop move at

#

how can i get sensory data into StateTree

#

state tree exists on AI actor, ai perception exists on ai controller

sick kayak
#

On my Dedicated Server, I have these dragons flying around , landing, taking off and walking around. After a while they get stuck in the air (not flying or moving anymore). Any ideas why please? Here is a screenshot of one of them with SHOWDEBUG AI enabled. Not all the dragons. About half of them (2 out of 5). This screenshot shows they have no controller apparently. Maybe it dispossessed it after while?

crystal hatch
#

Actually I'm not really sure how SHOWDEBUG AI works, but I'd assume it shows "local" information, so the AI controller being null on the client is perfectly normal.

plush cargo
#

could and should i get AI perception updates in StateTree tasks or evaluators ?

plush cargo
#

any tips on getting ai perception into state tree?

plush cargo
#

is it just me or cant an AI controller be used as a context actor for StateTree

real dock
#

I'm having some difficulty with AI Nav Agent Radius, looking for some advice.

I'm using default Lyra characters moving around a procedurally generated world.

The issue is some of the generated corridors are too narrow, and the agent thinks it can traverse it, but in reality it gets stuck. See screenshot for an example.

I modified Project Settings > Navigation Mesh > Agent Radius, but this seems to have no effect. I've also tried explicitly modifying the Agent Radius in the generated RecastNavMesh-Default actor in the Level, which works temporarily and then is always reset to the default 35 when the nav mesh is rebuilt, which happens every time I regenerate the world.

Looking through the code it seems like the size of any given Character's Agent Radius is computed at runtime based on its collision cylinder? Do I just need to make that cylinder radius bigger and all problems related to this are solved?

Or is there some way I need to globally configure the Nav System to ignore these smaller corridors? (And if so, how?)

plush cargo
#

for now i will just assume statetree can be run on actors and smart objects

harsh storm
crystal hatch
harsh storm
#

So I can go in an cut off old stuff and make PRs 😅

crystal hatch
crystal hatch
harsh storm
#

I'll do it on a Friday without testing 😈

crystal hatch
harsh storm
#

First step is still that checkbox I mentioned before though. Just take forever to compile source 😭

#

I need an Epic loaner computer 🤣

crystal hatch
celest python
#

So _BlueprintBase classes will only have required things to have logic in BP, like being an instanced task etc

real dock
crystal hatch
celest python
#

Alright, another question: is there any reason why users are able to automatically resolve the keys? Is it for performance reasons or does it even matter whether all keys declared in the UCLASS get resolved automatically in the InitializeFromAsset?

harsh storm
celest python
crystal hatch
harsh storm
#

Just convince Santa Sweeny to gift me one. It's like 0.00000000000000000000000000000000000000000000001% of an hour of Fortnite monies 😅 (I say this in jest)

harsh storm
crystal hatch
#

think of it as time saver!

#

all those minutes sum up to weeks a year 😄

harsh storm
#

Not if you just don't compile the engine 🧠

celest python
#

TIL we could actually use static cast if we know the cdo type thingken
UBTTask_BlueprintBase* CDO = static_cast<UBTTask_BlueprintBase*>(GetClass()->GetDefaultObject());

crystal hatch
harsh storm
#

Overnight process for me

#

Probably takes like an hour & a half. Using an 8 core Ryzen

celest python
#

Takes around one hour for me with Ryzen 2600

harsh storm
#

3700 for me

celest python
#

4.27 was 45 minutes, 5.0 added 15 additional minutes

crystal hatch
harsh storm
#

omg - I want to see how fast @crystal hatch can compile Godot from source 🤣

#

That only takes me about 8 minutes.

crystal hatch
harsh storm
#

I figure'd as much. Just a thought experiment, lol

celest python
harsh storm
#

Personally, I enjoy reading UE's source.

#

It is pretty digestible if you ask me.

celest python
#

UE source code is amazing to read compared to other stuff I've seen

harsh storm
#

I really enjoy the lack of snake_case_everywhere though 😅

celest python
#

but anyway a question for you in #lounge

tawny raven
#

Is there any good way to modify the polygons in a ARecastNavMesh? I thought I can iterate all tiles, then iterate all polys and modify them but i m stuck with NavNodeRef and no way to modify the navnode it seems. I also cant find a system that does this, only the Generator seems to build data and then it is all pimpl'd and inaccessible

tawny raven
#

All i really want is to get access to those pimpls and squeeze them out, make those sweet dtPoly's ooze out of there

plush cargo
#

someone know anything about statetree?

#

trying to make a task to create a new random location

#

but it seems i cant create outputs from tasks

#

and evaluations seem to run once or at tick

haughty coral
uneven cloud
harsh storm
#

And you're saying 5950x is giving you about 10 minute build times?

plush cargo
#

does anyone know

#

how to get output from statetree tasks

#

and does anyone know if there is any demons including statetree?

uneven cloud
harsh storm
#

I just upgraded my CPU earlier this year too 😅

plush cargo
#

can you use the HW for statetree ?

autumn sluice
#

Has anyone messed around with SmartObjects much? The Smart Object Subsystem returns me a list of smart objects, but I can't seem to filter this list down further, or at least perhaps I do not understand. I'd like to get the smart object that matches my filter that is closes to my pawn, and has line of sight...but I can't seem to get their transforms without a Claim Handle?

#

Is there any way to get the Smart Object actor from a Subsystem Find Smart Objects return?

tawny raven
#

Which is probably also cleaner because i can then integrate all my changes into the regular flow of tile generation

tawny raven
#

I have to say tho it was fun to dig through all of the code to see how engine professionals integrate such a complex library as recast / detour

haughty coral
tawny raven
#

10 min is crazy fast

#

I think i need a new CPU after reading all of this. i was thinking of getting the 7950x, but i will wait 2 months and then reevaluate whats the best AMD cpu for price

uneven cloud
still shoal
#

Anyone have any ideas why my ai when it's running after me head on it sort of moving very fast side to side insted of straight at me

Also any tips or tutorials anyone would recommend on making a smarter AI

charred lava
charred lava
#

This EQS Item passed the "PathExist" Test and then the move to task failed because the point couldn't be projected onto the NavMesh.
Shouldn't the PathExist test if the Item is reachable? 😅 This seems to be wrong.

#

MoveTo settings

median socket
#

I can't for the life of me figure out what's drawing these blue boxes, but it's related to SmartObjects I think.

#

They're positioned everywhere where there's an SO.

#

Sorry if it's a stupid question, but I feel like I've turned off every possible AI debugging vis I found!

#

(that's in game mode, PIE)

crystal hatch
median socket
#

Gotcha. I'll try that (or the other that)!

#

Thank you!

plush cargo
#

any epic demos with statetree yet?

crystal hatch
plush cargo
#

ill keep throwing stuff on the wall and see what sticks

celest python
#

I'll try statetree this month

#

I have a feeling like it's either going to cause me to replace half of my AI systems or just barely use it

plush cargo
#

yeah

#

i keep thinking i should just write a basic AI placeholder in blueprint and wait for knowledge to drop.

#

i need AI now

#

but i dont want to do double work for when knowledge drops

celest python
#

I'd go with trying statetree, Mieszko and Mikko is already hanging out in the #gameplay-ai so it's a good time to ask questions if you encounter something weird

plush cargo
#

the weirdest thing i encountered is i have no clue how to work with it 🙂

#

but for real. Am i understanding it wrong or does ST tasks not have access to output

#

i tried creating a random location and go to that location as tasks but i dont know how to pass the new location from the previous task

#

i would be more confident if the statetree also an event graph

crystal hatch
harsh storm
#

I was messing with ST a little bit last night. Going through the docs quick start that is. I got to the task where you destroy the actor. It has you do 3 tasks in the dead state. Debug printing, then a delay, then the actual destruction of the actor. I decided to only use the destruction of the actor task. When doing so, it seemingly would not run the Exit State function. That is the one the docs want you to override.

Once I added the other two tasks though, it would work. So, not sure why that was behaving that way. From my understanding, it should've gotten to the dead state, went into the destroy task and then do its transition that I setup to automatically happen and Exit State should've been called. But it seemed to only be called when it had other tasks with it.

#

¯_(ツ)_/¯

tawny raven
#

World partitioning just unloaded my navmesh on startup (seriously wtf?) and i cant load it back in again, i tried loading the entire world in but it omits this, i tried restarting but it is the same. I cant edit its properties like this anymore. Bug? The navmesh is custom but i didnt even change anything yet on it (just overriding the classes)

plush cargo
#

Here. in statetwo output state the bind doesnt have access to the stateone task.

#

but if i have the task in the same state it becomes bindable

#

i guess this helps me now

#

😄

harsh storm
#

I believe it's like that by design. The tasks should have access to previous task stuff.
In the first screenshot, StateTwo is a different state from StateOne. So they wouldn't be active at the same time.

plush cargo
#

yeah

#

you see.. im at the level where i have no idea what im looking at.

#

despite reading the docs a couple of times.

crystal hatch
#

now you're that one step closer to the wisdom!

harsh storm
#

Just need to go slower then and practice more honestly. I found the docs to be quite helpful

plush cargo
#

yyp

#

its just that i have been confused about where to create definite change to be reflected in action. i went into this more with evaluators in mind than the tasks.

harsh storm
#

@crystal hatch btw - the ST editor's compile button doesn't follow the other compile button patterns! I have to hit compile and then save like some kind of savage. (It doesn't have the option to save on compile like in BP stuff)

plush cargo
#

were all savages on this glorious day

plush cargo
#

i wanted to create a random location goto loop

#

each state had a text, didnt loop

#

gave each state a delay, started looping

#

and something else is overriding the task text

#

states with task blueprints connected to them dont need a delay task

#

this logic continues by making a state into a group state. pieces starting to come together

autumn sluice
plush cargo
#

ok so now that i got a handle on making basic stuff in StateTree

#

what sort of tools do i need to make an AI move around as if they are an FPS controller

plush cargo
#

@crystal hatch is the statetree tasks and evaluators running on the actor

#

ie the scope starts with actor

#

ah nvm me i accidentally disabled context

tawny raven
plush cargo
#

so i want to uh

#

involve the senses

#

should i perhaps think of tasks like BT tasks?

tawny raven
harsh storm
#

I'd say yeah, look at them the same way. Just with a direct binding to the actor instead of going through the blackboard

plush cargo
#

i havent looked at conditions yet

#

this time i will try and make it all via tasks

harsh storm
#

It's how you'll go from state to state

plush cargo
#

oh

#

the way or one way to go from state to state

harsh storm
#

It's the transition stuff

#

That's how the ST goes from one state to another

#

Based on those transition rules.

plush cargo
#

oh

#

yeah i get it, i just havent made any st condition blueprints yet

harsh storm
#

Might not need to.

plush cargo
#

yup

harsh storm
#

It has a few conditions already.

plush cargo
#

my approach atm is to decide state by "enter condition" and just read a variable on actor

harsh storm
#

What I'm saying is you just update a variable, say, bHasTarget or w/e. Then some states are binding to that variable. When the variable is true, it transitions to a new state Chase Target.

#

So you just need to set up a transition rule really.

plush cargo
#

ya

#

i have questions but first i need to progress a bit

tawny raven
#

I need more detail on my navmesh when it comes to height-changes, how can i achieve this?

#

Basically i need around 2x of the current tesselation. I tried to play with the parameters but to no avail. The slope and step height is intentional like this because i dont want gaps in the navmesh. Ideas?

ocean wren
#

cellsize isn't it?

tawny raven
ocean wren
#

You went too low 🙂

tawny raven
#

Fonny

#

It also makes no difference if i take 10 or 15 cell size

ocean wren
#

Really? I'm pretty sure its cellsize

tawny raven
#

cell size works great when it comes to the overall edge of the navmesh or gaps

#

it tesselates a lot there

#

but what i m looking at is a tile that is fully covering a navmesh without gaps

wary ivy
#

change the simplification settings

ocean wren
#

Cellsize should be the overall size of a single chunk of the navmesh generation, so the tesselation size of the tile part? unless I'm thinking of another value.. but theres definitely a tesselation value I tweaked

wary ivy
#

change the max simplification error

#

make it smaller

tawny raven
wary ivy
#

yup

#

do you need the z axis to be at the same height?

#

it wouldn't change the topology of the navmesh

tawny raven
#

I ll play around a bit with these 2 settings, thanks. Btw these were also the ones i had put my bets on but at low cell size i got the crash i talked about early which permanently unloads my navmesh (bug!!)

tawny raven
#

same height as what, z-axis of what

wary ivy
#

I mean, why do you need more detail for height changes?

tawny raven
#

got it

wary ivy
#

isn't the navmesh just clipping through the terrain there? 🤔

tawny raven
#

Yes it is

wary ivy
#

meaning the whole landscape is navigable

tawny raven
#

I just want more polygons because i want to paint areas on the navmesh without navmesh modifier but by going from triangle to triangle

tawny raven
#

What i am doing is admittedly a bit of a hack, i dont want to place hundreds of navmesh modifiers or paint a complex geometry for the modifier to set my areas

#

I want to modify navmesh generation in a way i can pick up values from the landscape layers to determine areas

#

So for that i need higher tessellation by default, perfect would be a min edge length

#

I tried to make the tiles small but that makes generation real slow

#

I hope this makes it clearer what i m trying to do. Maybe I am approaching this from the wrong angle, then feel free to slap it into my face and lead me to the right direction 😛

wary ivy
#

yea I understand, I had the same issue earlier

#

some sort of plugin that could automatically place navmesh modifier volumes based on a texture would be nice

tawny raven
#

I am actually trying to make a plugin

#

IF it works 😛

wary ivy
#

😄

tawny raven
#

Hmmm

wary ivy
#

I suppose

tawny raven
#

So right now i m trying to just modify the generation of the navmesh itself and bake it right into the navmesh

#

But now that ithink about it again, maybe the modifiers would be the cleaner solution after all 😛

#

it is hard to say

wary ivy
#

the navmesh modifier volumes can be concave in UE 5 too

#

whereas in UE 4 they could only be convex

#

just a random observation

tawny raven
#

do you mean the other way around?

#

ah no

#

Yea

#

that definitely helps this case a lot

#

damn now i went all the route to make a custom navmesh generator and now you made me feel like the previous idea would have been the better one haha

wary ivy
#

yup. Actually the modifier volumes could be as complex as you wanted in UE 4 but they affected the navmesh as a convex hull that encompassed the whole volume

#

well imo the navmesh modifier volume placement via plugin sounds more hacky than just doing it properly in the navmesh 😄