#gameplay-ai

1 messages ยท Page 11 of 1

tawny raven
#

I thought so too but it both has ups and downsides

#

The navmesh modifier is a way less intrusive method in my view - the "tool" that would generate the area mesh for this modifier actor would just be a separate step, and the modifier itself would work like any other modifier does after that - making it a clean separation and also not requiring you to adjust anything in the ways you generate your navmesh (maybe you also already have a navmesh generated and dont wanna switch it out)

#

Whereas a custom generator means you need to adjust things in the world and project settings, throw your old navmesh and nav boundaries out, set the settings again and generate the whole thing just to see if it does what you want it to do

#

As a user i would much prefer a tool that just "spits out" an area geometry for my modifier - this means i can also manually edit it afterwards

#

But as a developer i right now am just trying to see if ANYTHING works ๐Ÿ˜›

#

What keeps me away from the navmesh modifiers is that you end up having two generators (navmesh itself + this area mesh generator) in the end and both will need parameters etc :/

#

More parameters just mean more headache and conflicts

#

I will check some algos for turning texture to mesh ๐Ÿ˜ฎ then i think about the problem again

wary ivy
#

you'd essentially do some sort of triangulation and then convert that to the volume

tawny raven
#

Yes, thats what i m looking for, basically a binary cutoff at some user-defined threshold that decides where the edge between inside and outside should be based on pixel values, then need to place these vertices at the right height and extrude up and down with some predefined value to ensure it doesnt miss the navmesh

#

But of course the polygon would have to be smoothed etc

#

Might be a quite costy algorithm after all

#

Heh i just realized i did these algorithms already at uni 8 years ago, marching cubes etc

wary ivy
#

yea the hardest part is translating that into whatever UE does ๐Ÿ˜„

tawny raven
#

I did some research now and marching cubes/squares seems to be the standard still :/

#

I m a bit scared to run into a timesink here with this, this was just supposed to be a nice-to-have for my prototype haha

#

@wary ivy in which case would you want to feed a custom texture into a nav mesh modifier? From what I have seen - and from what I personally want - the most common demand is to use the painted landscape layers which are also just textures

wary ivy
#

I just prefer decoupled systems

#

that way you aren't marrying the end user to use landscape layers

tawny raven
#

i think once the landscape layers work, adding a texture as input is not a big deal

wary ivy
#

instead they could just generate the navmesh modifier volumes with whatever texture they want and use whatever kind of texturing technique for landscape

tawny raven
#

yea, true

wary ivy
#

because some people use single layer "auto materials" and what not

tawny raven
#

Good points, thanks

tranquil oar
#

Hi guys how is possible I did not publish it in here
๐Ÿ˜ฑ
https://youtu.be/69coRSn80u0

Dream for Unreal 5 is a new and exciting Stable Diffusion plugin for Unreal 5.
This short video will show you how to down load, install and start using the dream plugin to begin creating your own fantasy creations.

Discord: https://discord.gg/jxWBwY8r5c

Dependencies location:
C:\Program Files\Epic Games\UE_5.0\Engine\Binaries\ThirdParty\Pytho...

โ–ถ Play video
ocean wren
#

Hmm, two unreal engine bundles on Humble this week

uneven cloud
#

If the nav mesh is navigable and it's just the drawing that is clipping, you can just adjust the drawing.

tawny raven
plush cargo
#

is there a way i could set up StateTree so i only need to cast to the actor once

#

i feel when i do a cast for every task that wants to change on actor, i am doing something wrong

harsh storm
#

Just don't cast?

#

ST's get bound to a specific type of class anyway

#

Then in your tasks, you'd just have a variable of that type

#

And you just bind it in the details panel for the task

plush cargo
#

right

harsh storm
#

Now - obviously, this ties the task to THAT specific type of enemy.

plush cargo
#

my variable types was set to actor

harsh storm
#

So it reduces the reusability of the task itself.

plush cargo
#

its ok player and enemy is the same

#

and every humanoid

harsh storm
#

If you want it to be more reusable, you are just going to have to cast.

plush cargo
#

just a misunderstanding you sorted it out

#

variable type was not set

plush cargo
#

whats the advantage of using BT or ST over simply writing a state machine in blueprint?

keen crow
#

c++?

plush cargo
#

its a serious question btw

#

everything i imagine i want to do with an AI i can visualise in BP

tawny raven
#

I am not the best person to answer this maybe but I was waiting for StateTrees to be out of Beta and want to start using them soon and I like using BPs a lot for many things and my expectation towards StateTrees is that they give a more organized structure and flow for an AI's decision-making than a BP could give

uneven cloud
#

State trees appear to be a hybrid, but I haven't dug into them much as they are still currently in a very rough state.

tawny raven
#

I would not present BTs as "only good", there is no silver bullet for AI, BTs also have disadvantages and can get messy and costy

plush cargo
#

hmmm ok

tawny raven
#

In any case I would rather use a ST or BT for AI than a pure BP because the BP in itself has no structure for this sort of flow so you most probably end up modelling something like a state machine or behavior tree inside it to tackle your AI problem

plush cargo
#

yeah its mostly how new ST is that is difficult for me atm. dont want to waste my time in BT.

tawny raven
#

Do you mean it is difficult because it is not fully finished or lacking tutorials or what do you mean?

uneven cloud
#

There is no "correct" architecture to use. It's entirely dependent on what your game and team needs are. I use a Utility/BT hybrid, because that's what the game needs. I wouldn't recommend it for a more scripted experience, because you will be fighting the system the entire time.

plush cargo
harsh storm
#

I think the docs do a pretty solid job at getting you up to speed personally.

plush cargo
#

so in a way im also new to AI, atleast the scale of it. Which leads me to chosing StateTree because its newest, so i can grow into it.

harsh storm
#

I think your issue is more that you're new to UE in general.

plush cargo
#

im stupid

harsh storm
#

My advice would be to use what is stable and learn the engine before venturing off to the new shiny stuff.

plush cargo
#

thanks

#

there is so much in my design that will be tuned against AI so i want it early, atleast a version i can expand on as i learn more.

tawny raven
#

How is StateTree not stable? it is officially out of Beta.

#

The better question is, to follow up on what @uneven cloud said with which i fully agree: is the ST the best tool for the job?

#

That is less a question of which tool is easier to get into than the which tool fulfills the requirements of the job better

harsh storm
keen crow
#

can (should) i store TOptional or FVariant in NodeMemory? I have a decorator to set a value (single) to blackboard fields of different types (I choose types by a custom enum) and I want to reset previous BB value in OnCeaseRelevant but I don't want to declare a struct like

struct FSetBlackboardValueMemory
{
  EMyBlackboardKeyType MyBlackboardKeyType;
  bool bWasSet;
  float InitialFloatValue;
  int InitialIntValue;
  FName InitialNameValue;
  FString InitialStringValue;
  FVector InitialVectorValue;
}

instead I'd like it to be simply

struct FSetBlackboardValueMemory
{
  FVariant InitialValue;
  bool bWasSet;
}

so is using FVariants/FOptionals good idea here?

crystal hatch
# keen crow can (should) i store TOptional or FVariant in NodeMemory? I have a decorator to ...

Only PODs are really safe to be used in BT node memory. BT instance memory is one big pool for all nodes, allocated at once, initialized with zeros, and that's it, no constructors are being called. The memory for individual nodes are just reinterpretations of memory offsets.

With this in mind you can work around it to a degree by having a flag in your memory that would (due to how the memory is initialized) be initially '0' and when detected you could manually initialize the things that need that. I say "to a degree" because there's no way I can see to "fake" destruction - the whole memory pool is released at once, no destructors are being called for individual memory "cells" (because BT instance memory doesn't even have that concept), so you risk memory leaks.

plain wasp
#

I made a AI Sense Stimuli in my player.

I added AI Perception component to my AI.

I set the configuration to hearing and did all settings everyone online said to do.

I have all Sense update nodes going and a noise being made every second and not a single update fires on the AI despite the player certifiably making it through the "Report Noise Made" function

#

Like AI perception seemingly looks like it was given up on by the UE devs considering unsupported/broken it is. Soght worms. Somehow hearing had an entirely different system. Like, what tf was dynamic about that to the ue devs that did AI perception? Like pawn sensing was better.....

#

Like pawn sense was as straight as hello world after trying to figure out a simple task in AI Perception.

#

like, i am confused what is wrong with hearing.

#

i mainly want to use hearing since using sight wouldn't make sense mentally for a mob with no eyes

keen crow
keen crow
# plain wasp

what's under the Senses Config > AS Hearing Config?

plain wasp
plain wasp
crystal hatch
keen crow
crystal hatch
dawn schooner
#

I'm doing some research about pathfinding and navmesh prior to writing the code for my Mass Entities to do pathfinding (the paths are requested per-battalion, not per unit, so it should be relatively cheap). I've been looking at the AIController, CMC and Pathfinding Component source code to get an idea of how Unreal implements all of this on top of Recast/Detour. Is there anything else I should study/read, any resources, to get a better understanding on the topic?
I'd be also interested in async pathfinding requests (so that the current frame is not overloaded when multiple requests are made simultaneously) and multithreaded requests (if supported at all).

forest tundra
#

I want to spawn a character with a behiover tree in C++, what should I use?

crystal hatch
celest python
#

it works like this:
A* from nav geometry
string pulling (post processing the path)
move request
path following follows the path segment

#

instead of calling move to, if you do async path finding and call requestmove on pathfollowing comp you can move FVectors with async pathfinding too

dawn schooner
plush cargo
#

My prototype is First Person Melee
Humanoid enemies will range from zombies to overpowered knight types
To mention a few specifics i have in mind:
Unarmed and look for weapon or run away
Block on incoming attacks
Separate aggressive and opportunist action

is this best done in ST or BT? Or can it just as well be made with BP?
I am new to UE so either way it will be a challenge either way

#

thankful for any speculation and i can elaborate if needed

celest python
#

pathfollowingcomp just sends direction to movement component

#

towards next FVector index in the array

young lintel
plush cargo
#

yeah but

#

at what point does a particlar solution become relevant

young lintel
#

When it works for your game

plush cargo
#

ok

#

that doesnt help me

young lintel
#

The issue being if you make the whole system in blueprints to discover that it dumps your CPU performance

plush cargo
#

im asking from the perspective of someone new to UE

#

and i gave a small summary on some particulars

harsh storm
#

As Luthage pretty much said before - it dependsโ„ข๏ธ

#

It is really dependent on you.

#

That's just how a lot of gamedev is

#

What works for one project, might not work for another.

#

In your description - either tool will work fine.

plush cargo
#

ok then

#

i'll keep grinding on statetree because the system im thinking about sounds driven by states and substates

young lintel
#

State tree is probably the best of both worlds, it's just an experimental engine feature so it could change

plush cargo
#

i figured it was almost ready

young lintel
#

ยฏ_(ใƒ„)_/ยฏ

dawn schooner
celest python
#

optimization

#

and afaik compatibility of recast navmesh

dawn schooner
#

will test both, profile, and see what works better in context

#

thanks a lot!!! ๐Ÿ™‚

young lintel
#

What is the feature called in games where the geometry between the camera and player gets hidden or removed? Project Zomboid or The Sims come to mind as examples

#

I'm trying to figure out how I can implement this but I have no idea what to search for

harsh storm
#

Wall occlusion is what I typically call it.

young lintel
#

Well, right, but searching for occlusion doesn't produce much in this context

harsh storm
#

So add "wall" in front of it

#

Occlusion masking is another way I've heard it described

young lintel
#

Oh, sorry

harsh storm
#

"How to make walls hide like in Diablo" - works too

young lintel
#

Thought I was in general

harsh storm
#

If you're the marketplace buying type

#

ยฏ_(ใƒ„)_/ยฏ

young lintel
#

I mean, I'm not unwilling to consider it... that does look pretty good

harsh storm
plush cargo
#

i seem to have hit something

#

my new AI controller with AI perception doesnt register stimulus

#

sight perception and stimuli doesnt generate any updates

#

i can see the debug info about the perception but adding moving stimulis into the area of sense does not do anything

misty gale
plush cargo
#

again i had missed to check friendly/neutral in the ai perception

#

wasted time on that

autumn sluice
#

Hey, quick question: I have AI Characters that are using MoveToLocation. One AI was fine, but 16 AI causes the CharacterMovementComponents to take (combined) 50ms ish to complete each frame. Does anyone know how I should be moving these AI so they're not destroying frames? I'm going to need more than 16 of them in the long run.

celest python
#

0.5ms only, though I only have 50 pawns

plush cargo
#

with statetree, how could i design a pulse/clock/timer i can use to get periodical updates?

autumn sluice
#

I don't know if it's "right" but it works

plush cargo
autumn sluice
plush cargo
#

oh

#

i havent looked at it like that yet

#

thanks

autumn sluice
#

I've had what appear to be a lot of bugs with StateTree tasks completing properly so I've had to use Events for several things

plush cargo
#

yea i noticed that states arent progressing without some debug overrides if empty

#

and such

autumn sluice
#

Yea I had the same issues. I have a StateTree helper component I made that has a function that sends the StateTree an event. It has solved most of my issues, and I've found having a helper component suuuuper useful for async tasks that need input/output between state siblings

plush cargo
#

yeah i havent been able to make intricate statetrees yet

#

still dipping my toes into it

#

for now i will just use an integer increment for clock

autumn sluice
#

I absolutely hated using BehaviorTree, so I'll do just about anything to get off of it. While there's still basically 0 documentation for it, I much prefer how StateTree is laid out and I find it a lot more intuitive to use than BT

plush cargo
#

im almost in the same situation

#

i didnt think the little i learned about BT made me able to approach AI in plain english as much as i want

misty gale
dawn schooner
autumn sluice
#

I assume this is very high

dawn schooner
#

I'm seeing a capsule and sphere component underneath, what are they doing?

autumn sluice
#

Capsule is their collision, the sphere just triggers some distance items when the player enters it

dawn schooner
autumn sluice
#

Hmm...Let me look at the code for that, I generally don't cast but maybe I messed something up

dawn schooner
#

sorry wrong word

#

I mean Spheretrace

autumn sluice
# dawn schooner sorry wrong word

Man... That sphere is just doing OnOverlap events with a pretty simple check but I guess that's enough to cause the issue. I'll have to figure out another way to handle the logic in that overlap

dawn schooner
#

Async traces are also a bit faster and multithreaded iirc so that could bring an improvement as well

#

Have you tried to deactivate the sphere completely and see what performance looks like? Just to be 100% sure that's the cause

autumn sluice
# dawn schooner A big sphere cast on tick is very expensive. I'd look just in case if you can se...

Literally the only thing this sphere does (it's massive) is check if the player is in range and activate the nameplate/healthbar/statusbar. I disabled the sphere entirely and performance only dropped 10ish frames instead of 30 frames this time. I haven't looked at it thought insights yet but it it was definitely the bulk of the issue. I THOUGHT the OnOverlap was cheap, but I'll just have to adjust it

dawn schooner
#

It's not cheap at all

#

Also if those enemies are not many, you can just check the distance to the player manually (via vector maths) and you won't need the spheres at all

autumn sluice
#

Is there a better way to determine when the player is in range? I'm going to stop using this immediately. Maybe I'll just move it to a timer

dawn schooner
#

Querying spatial structures makes sense to reduce complexity of checks for many agents

#

If you are just checking the range from enemies (AIs ?) to a single player, just do your own distance check based on actor positions. Even if you do it every frame it will be infinitely cheaper

autumn sluice
#

I can do that instead I think. I only have four players so it's not the end of the world I don't think

dawn schooner
#

That's gonna be a nanoseconds operation

autumn sluice
#

It's an easy fix, too. I don't even need it every frame, just every few

#

Yea just popped open insights, now the largest cost are the two skeletal systems that I'm using (long story, but they're going to be replaced soon). Thanks for the help!

dawn schooner
forest tundra
#

Is it more logical to write with ai c++ or bp?

celest python
#

use whichever makes sense

plush cargo
#

any tips on how to approach a melee AI that challenges a first person perspective

#

design wise

#

im already getting a conflict with a rotate towards location and move to location

#

the latter snaps

#

if i am unclear let me rephrase

#

what UE nodes are useful for making an actor move to and around a specific object or location

dawn schooner
#

Is it possible to query a single point in a navmesh to see if it is navigable.or not?

#

Also, do navmesh queries take height into account?

celest python
#

box extent is your radius

#

if it returns false it is not navigable

#

though it doesnt account partial paths etc etc

#

just checks if there is navmesh there

dawn schooner
celest python
#

you must access a uobject to do it

#

so its not 100% thread safe

#

but also 1k of navmesh projections are only expensive as calling a single BP function

#

(based on vblanco...)

#

in theory its just a fancy trace

dawn schooner
#

I only need to do a few per frame

misty gale
misty gale
dawn schooner
misty gale
#

Hm. Im sure someone has told sphere traces are incredibly cheap due to basically just checking vs radius

celest python
#

DistSquared is one of the most cheap things you can do

misty gale
#

PointsNear is even cheaper

#

By a magnitude

#

Not precise tho

celest python
#

hmm, i dont think so

misty gale
#

My tests says so

#

4.27

celest python
#

cant beat that argument, though cant get convinced without testing my own too

misty gale
#

Fair enough

#

I should provide my data, but i dont store it anywhere logical ๐Ÿ˜…

#

Id have to retest to provide anything

dawn schooner
dawn schooner
misty gale
#

Not gonna start a big argument, but im not sure theres a big diff between a 3d sweep and checking vs radius

#

Anyhow ill take your word for it

celest python
#

any branch should be more expensive than math operations

misty gale
#

Gimme a minute

dawn schooner
#

It's like a linetrace, but bigger due to the sphere shape

celest python
#

They are pretty close to each other on gcc but distsquared slightly has less instructions

dawn schooner
misty gale
#

not that big diff

#

~10%

celest python
#

Use stopwatch and profile in shipping btw

celest python
dawn schooner
celest python
#

oh god.. i just switched to MSVC on godbolt and instruction count went to triple

dawn schooner
#

My original point was that Sphere traces are much more expensive than anything that just compares two points

misty gale
naive peak
#

Is this a good way to handle the different senses that are detected?
It works well for me, but wondering if its the proper way

sturdy iron
#

Hello, what are the solutions for

UAIPerceptionComponent + UAISenseConfig_Sight

not recognizing a player moving in a vertical direction for example running through a set of stairs
It just loses sight and my system kind of allows the AI to only move to a target only if it sees it

celest python
#

Just had chance to check StateTree..

god damn that data binding system is awesome... ๐Ÿ˜Œ

plush cargo
misty gale
#

Could be an actor that just attach itself to target and applies a steady world rotation

plush cargo
#

i did a lot of that in 2D for camera related positioning

misty gale
#

Yeah exactly

#

I guess it would be a 2 component actor, a scene root and a scene targetlocation which is offset from the root

#

Perhaps it doesnt even attach, it just follows with some movement speed

#

Was the first thing that came to mind atleast

plush cargo
#

not a bad idea

#

but at this point with my little knowledge i have nothing to compare it with

#

im still a bit confused about how to move without changing look direction

#

for an AI character

misty gale
#

It was to provide two different directions basically , one look direction, and a separate move direction

#

Which ofc could just be two direction vectors

plush cargo
#

aye i get that

#

i just ment the toolbox of UE functions

#

what im confused about i mean

forest tundra
#

do you know a video that shows how to spam pawn ai for c++

plush cargo
#

so having dabbled in StateTree i have a question

#

a couple of questions

#

is it common practice to treat state tasks as aynchonous events ?

#

should i write most of my actions on my AI actor and use state tasks to execute these actions ?

#

if so, how should i make callbacks to the state tree?

ocean wren
plush cargo
harsh storm
harsh storm
plush cargo
harsh storm
#

Couldn't say why without digging into it. But even in BT/BP, people run into issues with using that node. So it could very well just be a setup issue. And I don't have the time to dig into it.

plush cargo
#

i see

#

Ok

#

this somewhat points me into a direction i can use

plush cargo
#

im truly looking forward to StateTree knowledge

solid snow
#

hey guys I am quite new to BT. and I am running into this issue.
I set two decorators,
IF Player can't see the enemy -> go to random location
IF Player can see the enemy-> find a place where to hide
The 'PlayerCanSeeTheEnemy' bool works fine but when returning TRUE nothing happens. The Player should look for a place where to hide but he doesn't and it stays stuck, no movement. In the BT the Root is highlighted yellow.
Weird fact is that if I remove the condition both task and EQS query works fine. Can someone help me with this? Thank you guys!

uneven cloud
solid snow
autumn sluice
#

I was using Navigation Invokers, but it turns out that AI cannot move to locations outside their invoker range...which becomes pretty useless when I need AI to move decent distances

versed maple
plush cargo
#

but it also worked just casting to an event on the actor

#

i guess its very versatile

versed maple
#

Yes, I'm from the anti-interface club but if you have a bipedal soldier, a creature, a drone and a tank. It's hard to come up with a hierarchy of AIController and characters that works for everyone.

harsh storm
celest python
#

i still couldnt understand how we are suppose to access owner actor from tasks/conditions

#

i guess its strictly meant to be used with the data bindings

#

I was thinking about a UCLASS generator with yaml until i realize this

#

but for example for a move to task, it feels weird to not have an "owner" to move

plush cargo
#

this worked fine

#

i have an evaluator on tick that gets various values every nth times

#

like perception data and so on

young lintel
#

Alright, I admit I have no understanding of how this is supposed to work, but does anyone have any hints about why this isn't doing what I want it to?
(If "IsPlayerControlled" returns true I basically want the behavior tree not to run at all)

plush cargo
#

its funny

#

my attack method is flipping a variable from checked to unchecked

#

i have a task that flip to checked in a task. no task tht flips it back

#

yet the AI attacks

young lintel
#

Yeah.. if I delete this connector between Root and Selector, my AI still runs the whole behavior tree

#

But without any of the handy debugging information

#

They're becoming self aware

#

Your AI just wants to kill, mine just wants to wander

plush cargo
#

๐Ÿ˜„

#

its just...

#

as if the variable on the character is addressed via a task, it somehow gets flipped back because reasons.

#

but its not consistent either

young lintel
#

I guess need to just tell the AI Controller to stop or start thinking whenever I toggle this

#

I was hoping for a more intelligent solution allowing it to make its own choice, so it would still run certain things even when under player control, like responding to attack or starvation problems

harsh storm
#

Obviously it should be a child of actor

celest python
#

Does it automatically detect and bind the context actor in the schema?

harsh storm
#

You still have to manually bind it.

#

But it actually shows up if it is in the Context category

celest python
#

Ah, alright

harsh storm
#

"Enemy Actor" is the variable inside of the STT_Destroy task.

uneven cloud
young lintel
#

No, the player is independent of the characters in the game, they can merely choose to give orders to them

#

The AIController should, ideally, still be responsible for what the character does after you tell it to do something

#

That isn't how it currently works, but that is how I would like it to work

#

Currently I have blueprints that control moving to things and interacting with them when the player gives a command

#

But the autonomous AI will need to be capable of all of the same interactions so it feels like unnecessary work to have to create the behaviors in two places

#

Think of like... The Sims, I guess

#

For a very loose comparison

#

I was hoping I could have the player tell the character to, for example, mine a rock, just by adjusting some values in the blackboard, while still giving the AI autonomy over how it accomplishes that task

#

However I was also hoping to be able to block certain sections of the behavior tree if the player is actively assigning tasks

#

So like if the character is starving to death it would override the order to mine a rock in order to solve the starvation problem before continuing to mine

#

But it wouldn't just start wandering around like a non-controlled character

verbal shore
#

Sounds like you could make use of utility scoring system. Afaik there is no built-in functionality for that but you can build your own solution or look at Github or marketplace

young lintel
#

Well, yeah... but in the meantime it would be good if I could just lock out sections of the behavior tree, lol

#

I guess I could run a task in every single sequence that fails if the player is controlling

#

But it seems like decorators should be capable of this if I was using them correctly

verbal shore
#

Your execution was wrong in the picture above

#

You can use decorators for that

#

Let me check one of my behavior trees

young lintel
#

Oh I have to move it down lower

verbal shore
#

You have to have selector above

young lintel
#

I guess that makes sense

verbal shore
#

Like in the picture. Also if you don't want to do anything if the player is controlling, put wait or some task there even though there is nothing going to happen

young lintel
#

Well, ideally, I'm going to add some behaviors that will be the sorts of behaviors a player could assign

verbal shore
#

I had some troubles before so that's how I do it.

#

Yeah, then there would be no problem at all

young lintel
#

Cool, thanks

celest python
#

I feel good because StateTree exists and it looks like almost a perfect tool for general purpose usage
I feel bad because StateTree exists and it abstracts away around 5k lines of code I wrote to handle what StateTree could do easily in editor pensive

harsh storm
celest python
#

thats surprising

harsh storm
#

Not really. The scene tree easily leads to this kind of design ๐Ÿ˜…

#

As a matter of fact - that's the most common way people create state machines in Godot-land

#

Not a 100% replica of ST mind you, but the rough idea.

celest python
#

hmm

#

it really feels alien to think outside of the UE scope

harsh storm
#

Is this your first engine?

celest python
#

yeah

harsh storm
#

Ahh - makes sense.

celest python
#

one year ago when I first learned about ECS it was also another shock of my life

harsh storm
#

Fancy for loops

celest python
shadow furnace
#

there ya go fps go up

ocean wren
#

I don't suppose anyone here has a lot of experience with NLP do they?

keen crow
#

How would one make an AI to approach a player/location maneuvering (i.e. strafing left and right while still approaching target) ? So far I only have an idea of running eqs query in a service on a move to to reevaluate next point with providing players LoS and locations in EQS contexts for EQS tests but idk... intuitively I feel like this is wrong

ocean wren
#

EQS is definitely the right way to do it

#

the squeenix guys used that and just did a series of concentric circles as target points for their "waiting in a queue to attack" agents

#

so they use EQS to generate points around the target.. then the strafing comes from simply spinning those EQS locations by animating the heading for the generator

#

They had some sidestepping logic so that they faced the target and then stepped left/right if the EQS point was far enough away for a sidestep

plush cargo
#

how can i treat a state as enter dosomething and exit on condition

#

as opposed to enter dosomething and exit

random ridge
#

hi, my behaviour tree moveto is failing, but AI Move to in the BP is working

plush cargo
#

usually my problem, target actor var doesnt contain anything

random ridge
plush cargo
#

use debug

random ridge
#

it's set and valid, it needs to pass the BT check

#

which debug?

plush cargo
#

print debug

#

from the moveto task

boreal tundra
#

Hello, do you know why since I've changed the model for my enemy he became dumb af? He can't come down the stairs, if you go behind a sofa standing he can't see you

random ridge
#

not sure how to debug in behaviour tree? seems like I cant add comments etc

boreal tundra
#

with the previous model he wasn't like that

plush cargo
#

compare them

plush cargo
#

because i dont think moveto throws any error if the target is none

random ridge
#

well, it has to be, the previous node Blackboard: TargetPlayer is set checks it

#

when the AI cant see the player, it runs the left branch, when they see them, it runs right right branch, the TargetPlayer var becomes set & valid, and then I move to it

#

if I print out the value in BP it returns the player character

#

the moveto function just fails, but it works in bp

#

ok weird, its working now after refreshing a BP didnt change anything ;s

plush cargo
#

anyone know if parent transition is the first above

#

or back to root ?

faint fox
#

any idea how to figure out which node aborts a task in bht?

autumn sluice
ocean wren
autumn sluice
#

Anyone know the intended way to have AI move over large distances in World Partition? I was using Navigation Invokers but when I give the AI a location outside of their invoker range they just won't execute it. I was trying to get the navmesh to use Tile Pool Sizes but my IsWorldPartitionedNavMesh is grayed out and I cannot seem to get it to activate. Not sure what setting is missing as I have all the documentation settings correct.

celest python
harsh storm
#

@celest python You still messin' with ST's?

celest python
#

yeah currently trying to inherit from FStateTreeConditionCommonBase

harsh storm
#

One thing that I am not sure about the usefulness of is the evalutators. I know what they're for but like...you can just get the same information in the given task.

#

Any thoughts?

celest python
#

Was just thinking about it ten minutes ago, but I dont have any certain ideas too yet

#

I guess its suppose to update the parameters of the schema directly

#

rather than local task parameters

harsh storm
#

Hmm - does the entire state tree rerun after a "Tree Succeeded" call?

#

So after a state transitions to Tree Succeeded - does it reevaluate all that stuff again?

celest python
#

afaik yes

harsh storm
#

I guess an evaluator can be looked at like some kind of service from BT. But for the entire state tree.

celest python
#

yeah, gotta check city sample to completely understand - but its ~100gb

vale pawn
#

Is there a way to call the same sequence from multiple places?

#

in a blackboard

#

or group a bunch of tasks together to make one task that I can use in multiple places around my blackboard?

harsh storm
#

And now - seemingly randomly, the "TreeStart" event isn't being called on the evaluator ๐Ÿค”

wind surge
#

I made a basic ai like this, but when a horde of enemies follow me, they always make a line and it looks silly, what can I do to make it more horde-like and not a line?

keen crow
#

Is sight perception supposed to refresh visual targets after expiration? I'm experiencing something weird - I'm standing right in front of an enemy and after sight sense lifetime perception component doesn't return any valid stimuli source, but inside of it perceptual data there is still a visual stimuli of the player character, but is is expired with like 250ms overdue

celest python
#

if you wanna join

ocean wren
#

I don't think its actually going to be the next scripting language.. at least I hope not ๐Ÿ™‚

#

Anyone tried doing any compute shaders for AI with Unreal?

keen crow
#

or try just deriving your AI controller from ACrowdFollowingAIController

uneven cloud
ocean wren
#

+1 for EQS

wind surge
#

Thanks for replys, Ill check the EQS

keen crow
#

can I manually refresh expired sense stimuli? For sight in particular

ocean wren
#

why would you refresh it if its expired?

keen crow
#

it seems that registered sight stimulis are not expected to be refreshed because of the sense's notify type

ocean wren
#

Hmm, it should update the sense stimuli automatically while you've got it in vision.. are you sure something isn't blocking it?

ocean wren
#

Been a while since I played with it, but I never had any issues with it needing refreshing or anything to my memory.. I guess you'll have to single step it and figure out whats happening

#

if i remember right, it has a timer since last sensed and just resets that every time it was successfully sensed

#

well, not a timer, an elapsed value

#

sense timeout or some such

desert moat
#

Anyone every had an AI skip a task only once trying to get my AI to walk to a location then return but the return task keeps getting skipped on the first loop so the location becomes offset

#

You can see it here, the first loop it'll play but the Move To Player Check Return plays too fast compared to the other loops where it plays normally and functions normally

#

So I think my AI Move To is failing on the first loop, after setting up a print to the failed node I can see it printing only on the first loop anyone know what could cause this?

ocean wren
#

What is it you're trying to do? that looks like a very weird sequence

#

The reason youre node is succeeding is because its going to targetlocation, but you're already at target location

#

I assume you meant to go back to guard location?

#

but either way, you should refactor that.. so that its just a lower priority to return to guard post and then allow higher priority if there's a threat or a patrol to do that takes over the priority.. that way you'll always go back to guard post if nothing more important happens

#

so use a selector instead of a sequence

vale pawn
#

How would I re-create the "Wait" task that's given to you in the Behavior tree?

verbal shore
vale pawn
#

Hmmm

#

I'm trying to figure out how I can prevent a custom task from moving on until it's done

verbal shore
#

I will send an example in a sec

vale pawn
#

Cool, thanks

verbal shore
vale pawn
#

Is there a way I can do it when I don't know how long it will take?

#

Like the Move To task?

#

where it moves on once the AI reaches its destination

verbal shore
#

You can finish task whenever you want by using finish execute node

#

You can do something like this for example:

vale pawn
#

I see

#

thank you

verbal shore
#

you're welcome ๐Ÿ™‚

vale pawn
#

I'm having another issue

#

with 2 Move To tasks in a sequence

#

and it does one but not the other

verbal shore
#

Can you send a screenshot?

vale pawn
#

sure

#

So I get the two locations in services

#

then move to the first one

#

then the second one

verbal shore
vale pawn
#

and it should just repeat that

verbal shore
#

You're using selector, you need to use sequence instead

vale pawn
#

lmao dang it

#

Thank you so much

verbal shore
#

haha no problem!

desert moat
uneven cloud
neat marsh
#

How do you get pawns to block navigation for other pawns but not themselveS?

#

I have setup dynamic navmesh generation etc. but having the pawns affect the navmesh underneath themselves leads to them twitching as they can't figure out the start point

#

Is there something to make them stick to a path for longer before abandoning it?

uneven cloud
neat marsh
lyric flint
#

https://www.youtube.com/watch?v=zIDqJ9qDm9w&ab_channel=ReidsChannel
hello i tried to follow this tutorial and everything works, i wanted to add a behavior where npc will roam randomly
so i added this script but it doesn't seem to work. is there a better way for it?

Support the channel through donations. Crypto accepted!
PayPal: https://paypal.me/reidschannel?locale.x=en_US
Patreon: https://www.patreon.com/reidschannel
Bitcoin: 1JFwWHr4X6uAeoZadukzqKjzFBj3Qjy7Sk
Ethereum: 0x2B2Bc108F1Cc0fF899959dEF3226637787d8C3dE
Dogecoin: DNQ33YnhpWoTBokBNVkZP5ub8KTLkpyjpv

Join our community discord!
Discord: https://dis...

โ–ถ Play video
neat marsh
#

I'm now using crowd avoidance which is working great, I realised it respects some of the RVO avoidance settings like mask group which makes it great for my needs!

#

But now I have an issue where setting the group to avoid at runtime is ignored, I assume it gets registered or something. Anyone know how to change it?

#

Using all 3 nodes to triple check even though I should be alright with the ignore node:

crystal hatch
plush cargo
#

any recommended AI assets ?

#

im thinking AI might bee too big to make for me

lyric flint
crystal hatch
lyric flint
forest tundra
#

how do i create behivor tree class in c++

crystal hatch
forest tundra
#

UPROPERTY(EditDefaultsOnly)
TSubclassOf<UBehaviorTree> BehaviorTree;

#

in .h

#

and

#

UAIBlueprintHelperLibrary::SpawnAIFromClass(GetWorld(),SpawnClass.Get(), BehaviorTree ,Location,Rotation,false,nullptr);

#

in .cpp

#

BehaviorTree tree gives error

#

what is the problem

crystal hatch
# forest tundra BehaviorTree tree gives error

then you say you get an error it's always a good idea to paste the specific error you get from the compiler. But in this specific case it's easy to guess. Check UAIBlueprintHelperLibrary::SpawnAIFromClass's signature and it will become obvious. But I also believe that' pretty much what the compiler tells you.

#

in short: TSubclassOf<UBehaviorTree> is not the same as UBehaviorTree*

forest tundra
#

it worked

#

I wasted my hourssweeney_activate

plush cargo
#

does focus only work in a BT task ?

desert moat
crystal hatch
crystal hatch
plush cargo
#

but judging from your answer i didnt try hard enough

#

and from my very limited experience the only other time i used it, was in a BT

#

bad question i kno i kno

crystal hatch
plush cargo
#

oh ok

#

i hadnt thought of that

#

@crystal hatch while i have you here i need to ask, how can i enter a statetree state and not exit until i want it to exit?

crystal hatch
plush cargo
#

gotcha ๐Ÿ™‚

forest tundra
#

I want to spawn ai

#

Behavior tree not working when spawn as actor

#

how can i make it work

echo lark
#

@crystal hatch Why is SmartObjectSubsystem only creted on authority ? (not clients) ?

crystal hatch
echo lark
#

okay thanks, was mostly wondering about Players and predicting interactions ;

verbal shore
forest tundra
terse panther
#

hey there, can someone tell me how can i change the rotation here?, i tried to put a custom query of both type, points and actor, But the result is save for every type of actor/vector value . For the default one (EvnQueryContext_Querier) its taking the forward vector of the pawn. but i want to generate behind the pawn i.e. forward vector * -1. Any idea how can i do this?

marsh pasture
#

is there a blackboard present per AI spawned

#

or would 10 AI use "Spawned" in Blackboards

ocean wren
#

See those dropdowns? those relate to query context objects.. so make your own

keen escarp
#

Hey, i would like to check if enemy is facing the player or is atleast almost facing the player.. I think i need to get enemy's forward vector and characters location and use DOT-product..Buuut I'm having problem implementing this to work on blueprint, could someone guide me how would u do this kind of functionality

terse panther
ocean wren
#

You might want to make it only work on the horizontal plane...

#

There's actually a blueprint node that has this functionality if I recall?

celest python
#

Creating new FStateTreeConditionCommonBases was more wonky than I imagined

#

I dont want to think about the boilerplate written behind the scenes to make it work

harsh storm
#

That's a shame. It looked pretty straightforward to create a new task at least. I only glanced at it.

celest python
#

there must be some very hell of a reflection system magic happening

#

to optimize it to moon

#

for example you manually put

    UPROPERTY(EditAnywhere, Category = Parameter)
    bool bInvert = false;

to everywhere

#

base class doesnt have it

#

and you must have this constructor

    explicit FStateTreeCondition_AngleFromLocation(const EStateTreeCompare InInverts)
        : bInvert(InInverts == EStateTreeCompare::Invert)
    {
    }
#

and declare another struct to put your data

#

etc etc

harsh storm
#

Sounds like another use case for BP ๐Ÿคฃ

celest python
#

this one probably cant be done in BP

#

this is to expose things to data binding system

harsh storm
#

Oh - I thought you were just doing custom enter conditions

celest python
#

I'm creating that Compare X thingies

#

finally managed to make it appear

#

i guess that "bind" dropdown menus dont appear magically in BP

#

if it is, fml

celest python
harsh storm
#

Definitely can do in BP

harsh storm
#

So uhhh - look at what the BPBase does and copy that ๐Ÿ˜…

celest python
#

it doesnt seem to do anything, but my R# doesnt work at StateTreeModule

harsh storm
#

I think there is a setting you have to flip for it to work on the engine module/plugin stuff. Rider doesn't index that stuff for me either.

celest python
#

oh yeah i didnt enable that on r#

#

thanks

#

oh...

#

things just make sense

#

i was wondering why StateTree has a linker

#

to handle that BP data binding

#

and custom c++ boilerplate stuff i mentioned

#

so its not possible to copy what BP base class is doing

#

because BP classes are handled internally

#

and probably it boils down into state tree compilation process

#

oof

#

here comes yaml parser then

keen crow
#

remind me does a BT which is ran in Run Behavior task has to have the same blackboard asset as the invoking BT?

ocean wren
#

Hmm, what class does that Bind expose? that a delegate?

#

I need to have a bind-able entry in a list of matches for an NLP system

#

wondering how to make the UI bindable... basically a list of token strings and types with a matcher method and some method to build if a match is made

#

guess I'll give statetree a look

keen crow
#

ok another question. is it possible to set FBlackboardKeySelector anywhere outside of BTs? For example in some data asset?

celest python
#

anim graphs also has the same functionality but you can also bind function calls if signature matches

uneven cloud
main hollow
#

in ue4, is there a way to have nested dynamic behavior subtrees? for example, the parent BT has a Set Behavior Dynamic node where you add a behavior tree which also has a SetBehavior Dynamic node with a different tag?

#

I tried setting a behavior corresponding to the tag within and it fails

#

it doesnt look beyond the existing nodes on the parent BT for that tag as far as I can tell

keen crow
# main hollow in ue4, is there a way to have nested dynamic behavior subtrees? for example, th...

there is, but it's weird. the thing is when you call SetDynamicBehavior, the UBehaviorTreeComponent (or something inside of it) searches for BTTask_RunBehaviorDynamic only in loaded trees in tree stack. So what I ended up with is create my custom Run behavior dynamic derivative that re-injects dynamic behaviors after starting the next dynamic subtree. To optimize it a little bit I also created my own UBehaviorTreeComponent that allows to set dynamic behavior for trees starting from some index in tree stack

main hollow
#

ohh.. I will have to look into overriding some of these then ๐Ÿ˜… At first, I thought it is a matter of delay or something coz I was trying to set the internal BT as soon as I added the external one.. so I tried adding with 5 secs just to test.. but no.. it wasnt that ๐Ÿ˜†

main hollow
haughty coral
#

A logic should run when BT branch is entered and left. What is better choice? Service or Decorator?

keen crow
haughty coral
#

Good, thanks. I was wondering is there is any standard for it but there is probably none.

celest python
#

Question for StateTree - if mieszko or mikko ever see this:
Are there any plans for integrating binding "getter functions" to data bindings on ST? like how anim graph does it

celest python
celest python
#

oh no.. you also have to write that linker stuff for tasks too pensive

#

but good news is you have something like TStateTreeExternalDataHandle

celest python
#
        InstanceData.AbilityEndDelegateHandle = ASC->OnAbilityEnded.AddWeakLambda(Actor, [this, Actor, &Context] // @todo this is extremely dangerous.... 
        {
            InstanceDataType& InstanceData = Context.GetInstanceData<InstanceDataType>(*this);
            InstanceData.bAbilityIsRunning = false;
            UAbilitySystemComponent* ASC = GetAbilitySystemComponent(Actor);
            if (ensure(IsValid(ASC)))
            {
                ASC->OnAbilityEnded.Remove(InstanceData.AbilityEndDelegateHandle);
            }
        });

I made something like this in EnterState to hack the const correctness in statetree Evil_Patrick

cant wait to deal with ambigious bugs this will produce because of &Context

celest python
#

i guess at some extent instance data type also gets to manage things like this to avoid const limit on core functions

terse panther
#

hey there, any idea how can i rotate the arc direction of the EQS, i tried which multiple vector values for the direction context by making custom querycontext , but none of them are working. I want to generate the donut in semi circle behind the AI, like in the image its generating in the front, but i want it at the back.

celest python
#

@harsh storm just fyi - i was looking at source code.. which seems to be not updated properly for 5.1

#

we dont need that boilerplate I've shown

#

its easy as creating two structs and declaring data properties on one and override relevant functions on another to create tasks or conditions

harsh storm
#

Yeah - I saw that siliex set you straight ๐Ÿ˜…

#

(Why is he so darn good ๐Ÿ˜ญ)

celest python
#

hehe, he also spent at least a few hours ๐Ÿ˜„

#

there was a small phase he was asking "wtf" questions about ST at #cpp and twitter

harsh storm
#

Are you actually trying to use STs for your zombies?

celest python
#

yep

#

like, for anything

#

game director, zombies, boss fights, boss fight managers

harsh storm
#

Alright - cool. I like BTs, A LOT - but screw it. We're making zombie games together, but separately. I'll switch to using it just 'cause ๐Ÿ˜…

celest python
#

yes

harsh storm
#

๐Ÿคฉ

celest python
harsh storm
celest python
#

yeah, though i use gas in a weird way.. mostly to benefit from it's replication features lazily

#

the way how UE evolved in a year caused me a lot of trouble.. i went through ~7 heavy refactorings because of my learning progress and new features

lethal helm
#

how come the left task isn't executing?

#

I've set the decorator to abort lower priority and the decorator is passing. I'm watching the breakpoints on the task and it isn't even trying to execute so it's not like it's just instantly failing

harsh storm
#

@celest python Can you link me what you read for your ticketing system? It sounds kind of interesting for knowledge bank. Might use it for my game as well, though I also might not even need it.

median socket
#

Hence the "abort" -- it only aborts what is relevant and running, it doesn't monitor all conditions on idle branches; just pulls back when a relevant decorator is no longer valid

#

I could be wrong though

lethal helm
#

that doesn't sound right

#

that would make behavior trees worthless

median socket
#

Hm, maybe you're right

lethal helm
#

the left decorator is set to abort self and abort lower priority and it even highlights the right node as a lower priority abort target

median socket
#

Yeah, that makes sense, sorry

#

Then I have no clue

#

What composite are they connected to?

#

Actually, I guess that doesn't matter if you've monitored it

lethal helm
median socket
#

Are there more nodes to the left with lower priority abort decorators?

lethal helm
#

yes but they aren't firing

median socket
#

I found this, not sure if it's relevant to you

#

If there are multiple nodes that are all set to abort โ€œLower Priorityโ€ (or โ€œBothโ€), they will all have to be satisfied before the lower priority tree will be aborted. That way, you wonโ€™t have to worry about separate value changes repeatedly aborting your lower priority tasks when the higher priority task canโ€™t actually execute.

lethal helm
#

it's not. that just means if I had three decorators it wouldn't abort the lower priority task until all three pass

plush cargo
#

anyone figured out how to stick to a statetree state yet?

median socket
#

Well, I doubt I can help you; hope you figure it out

lethal helm
#

my debugger appears to be lying

#

task_followspline is being executed but it's not being executed

#

end me. it was being pissy because I was using a timer in my task

#

switching that logic to a one second tick on the task itself fixed the problem

#

probably some horrible async deamon leaking up the abstraction layers

slow bobcat
#

I have a question about a problem with nav modifiers I haven't noticed before (I'm impressed that I didn't tbh).
Turns out that, if you have a mesh, let say a box, and you add a nav modifier component to it, the collision calculated for it is by doing some short of parent-wrapping-collision. The problem is that, when rotating the box, this happens (image).
Is there a way to make the nav modifier tight to the box so it only cuts from the nav the section intersecting the nav-mesh and the collision?
Maybe something we can override in the engine?
We happen to have lots of assets that are re-used all over the place and this is becoming tedious to fix by level designers.
Tagging @crystal hatch since he probably knows the most about this.

crystal hatch
slow bobcat
#

Hey! Thanks for taking the time to answer.
Do you mean like this?

#

our designers where looking for something more like this

crystal hatch
slow bobcat
#

Can you mess around with collision settings, like using ComplexAsSimple and such?
We can definitely try and see what happens.

What your designers want is impossible. Think about AI agents wanting to go underneath the thing.
This is a good point. I was already wondering myself how to solve it and, well... it's solved the way the system works already

Thanks a lot. This gives me enough to give them a reasonable "no can do".
Cheers

#

I guess I could do some dark magic to calculate the position, rotation and size of a nav modifier volume to get something like this

crystal hatch
slow bobcat
#

yeah, not all cases are problematic but... enough to put time in it.
We get cases like this too

#

which are currently solved by hand

crystal hatch
slow bobcat
#

oh yeah, that's another story...
Can't wait for ML to solve this shit for me XD

#

thanks again. Much appreciated.

indigo rain
#

If you want to kill an ai (i.e. shoot the pawn), is it best practice to cast to the pawn and do something at that level or then get it's controller and do something at that level?

#

Or do you go a further level and do something to the blackboard specifically?

#

I was just thinking something like play animation, spawn object dead at the location, destroy original actor might be less taxing, but could have issues?
So maybe going into I am dead on the blackboard and make a dead state where it plays I am dead then stays on the ground post animation..... It's been a long minute since I did anything with AI and I'm helping a friend on his jam project.

crystal hatch
indigo rain
harsh storm
crystal hatch
young lintel
#

When using navigation invokers, are there any commonly accepted solutions for being able to provide them a target location on the other side of a very large landscape and allowing them to eventually navigate there?

#

I have some pretty severe limitations with a pre-baked navmesh and I'd love to use invokers but my AI needs to be able to travel long distances between points, I thought about making road splines they can follow in between pathfinding I was just curious if there was some already accepted solution to this type of problem

uneven cloud
young lintel
#

Navigating across a large landscape, from one side to the other. Assigning an AI character a target location on the other side of the landscape even with a fully generated navmesh often results in them making lots of wrong turns, backtracking, and eventually getting stuck in a place that doesn't connect

#

I have a design goal of simulating small groups of traders walking from one side of the map to the other, which I could probably fake with some effort but I also need to be able to allow a player to follow them if they choose to

#

Which doesn't really work if the whole trade caravan navigates into a ravine and gets stuck trying to walk up a cliff

#

I'm not against using splines for roads that AI could follow for longer distance journeys like that but I wanted to do my due diligence researching that type of solution before I start implementing it

#

As it is, my goals of a large terrain have been reduced down to 2x2km because of limitations in navmesh complexity

#

I don't know, I'm new to Unreal so I don't really know what my expectations should be

#

I'm sure there's probably things I can do to improve the way I'm using the navmesh I'm just not sure what those are

#

I'm not currently using invokers at all

#

I was looking at Kythera AI to maybe try to solve thee problems but I'd hate to buy it and discover it doesn't solve these problems, lol

celest python
#

its.. damn expensive probably

#

I'd say ensure hiring somebody/somebodies for your specific goal wont be cheaper than Kythera AI if you are going to buy it

young lintel
#

Yeah I've asked for some pricing information from them but haven't heard back yet

#

Hiring people is never really cheaper, if its a contract you might spend less initially but any problems will have you paying them again

#

It could give you a better solution, perhaps

#

At least better tailored to your specific application

sleek hull
young lintel
#

It's singleplayer but every character in the world is AI

sleek hull
#

oh interesting. How many characters are there?

young lintel
#

It's not densely populated, but eventually there will probably be something like a couple of hundred

#

Probably on the high end

#

Most of them aren't wandering the earth, they'll be hanging around towns, gathering resources, and fighting

sleek hull
young lintel
#

The prototype will probably only be a couple of dozen unless I can get the world size larger without breaking everything

#

Well, the navmesh doesn't even like to generate with good precision on anything larger than a few square KM

#

And when it does, if I actually set an AI controller to navigate from one side to the other, the pathfinding gets severely confused

sleek hull
young lintel
#

You can change the tile sizes and cell sizes of the navmesh, but it's a trade off

#

You can make larger cells at the expense of precision

#

But then you have AI that can't get closer than like two meters to an obstacle because the navmesh isn't precise enough

sleek hull
#

Why don't you just create an invisible lower poly mesh that has the same topology as the mesh you are trying to create the navmesh for and use that instead?

#

Like you can take your terrain or something and make it a quarter of the verticies or something

young lintel
#

I mean my terrain is already effectively 2 meter resolution just to try and stretch everything enough

sleek hull
#

oh yh it may not work then. Do you have a picture of the terrain or something?

young lintel
#

I mean, it's pretty basic

#

Like I said it's just prototype stuff, imagine a 2km x 2km square landscape

#

With some hills and valleys

sleek hull
#

ok

young lintel
#

village A on one side, village B on the other, if you have AI at village A, and tell them to Move To a location at Village B, they walk in the general direction for a while, until they find an obstacle, then they might turn around when they realize they've followed a bad path, or they might just stop

#

Or they might walk back and forth until the AI just gives up

sleek hull
#

Is this the default unreal engine navmesh/ai system you are using?

young lintel
#

yeah

sleek hull
#

wow that sucks. I don't think issues like that happen in unity.

#

can you adjust your geometry to make it easier for them?

#

or is that too much

young lintel
#

I mean, maybe but the landscape is already more open than I want it to be

sleek hull
#

no i mean you can make a set of specific paths

young lintel
#

I would be fine with defining ideal paths between major points of interest if necessary

sleek hull
#

or you can code out your own ai system

young lintel
#

But they need to be convoluted

#

It's never just a straight line

#

I mean, yeah I'm not really talented enough to be writing my own AI solution

sleek hull
#

for example you have groups of empty transforms pointing in the paths you want your ai to take

#

and your ai can pick them at random and add some noise to it's path

young lintel
#

I could possibly fudge something like that

#

Hopefully Kythera's licensing isn't insane

#

I would love to find a more robust solution that would allow for a larger world size, anyway

#

The long journey is a lot less intimidating if it's only 2 km

sleek hull
#

it looks like it is free for noncommercial use

young lintel
#

Yeah, this will be commercial though, heh

sleek hull
#

but they take royalties for commercial

young lintel
#

I asked them for a trial, anyway

sleek hull
#

that's insane imo

young lintel
#

I mean you're paying Unreal royalties, too

sleek hull
#

royalty seems like a lot for just an ai engine

young lintel
#

And Steam, for that matter

#

or Epic, if you go that way

sleek hull
#

oh yh i guess but that seems like a lot imo

#

do you prefer royalty or flat fee

young lintel
#

I prefer being able to make a game rather than not

#

I mean I could make a little arena shooter without buying middleware but it wouldn't be very interesting

#

If they can provide a solution that enables me to make the game I have in my head, it might be worth paying them a few percent

#

We'll see what they ask for

#

I'd prefer if it was all just open source

#

But, shit in one hand, and prefer in the other, and see which one fills up faster, as they say

sleek hull
#

yh

#

can you code at all or do you just use unreal blueprints.

young lintel
#

I mean, I'm capable of coding, I'm just using blueprints for now until I have a better understanding of the engine

#

I'm a full stack python web developer at my day job, so I'm fine with writing code if I need to

#

C++ isn't my favorite but I can muddle through

sleek hull
#

oh ok i understand. yh I was just asking because I think the AI you are trying to make doesn't seem that difficult to develop yourself as opposed to some of the other game AI applications I've been researching.

young lintel
#

No, it's probably not

#

I mean I could probably come up with a solution just in blueprints with some work

#

I was hoping there was best practices, or common solutions, for these sorts of problems

#

You'd think with all the hype about the huge terrains you can make in Unreal that the AI would be capable of using them

#

It's unfortunate

sleek hull
#

How much of a performance hit is there with your AI enabled if any?

young lintel
#

I mean its too early on to know

#

And I can obviously disable characters if they're far enough from the player, but if the navigation system isn't even capable of generating a usable path across the map, that is kind of a deal breaker

#

I don't know I think I probably just need to fiddle with navmesh settings, this seems like too serious a limitation to be intended behavior and not just my own bad implementation

sleek hull
#

yh another problem though is that it isn't reliable. even if it were to work there are chances your ai can get stuck once in a while

young lintel
#

I can handle once in a while

#

I can send monsters after stuck AI

sleek hull
#

ok

young lintel
#

But if none of the AI are capable of not getting stuck it's an issue

#

I'm sure I could run splines across the map between towns, tag the nodes appropriately, and have AI just find the nearest spline to their destination and follow it

#

If I put roads in the landscape along those paths, it works out okay, but, I would prefer more flexibility

sleek hull
young lintel
#

Yeah

#

If it comes down to it I can reduce the scope a lot by just making the AI not travel across the map, leaving the player characters as the only agents capable of doing it, but, that does detract from the experience I'm going for

#

trade caravans, roving bandit gangs, migrating monsters

#

Looks like Mercuna could be another option, they have an indie license for $2k

sleek hull
#

2k a year?

young lintel
#

It looks like a flat $2k

#

For development budgets under $500k, we offer licences with limited support for ยฃ4,000 for Mercuna AI Navigation, or ยฃ2,000 for either 3D or Ground Navigation.

#

Since I'm just looking for ground navigation

dawn schooner
#

Is it possible to get the navigation's mesh "width" from a given nav point?

I know that the navmesh can seek different paths by radius, so I guess that it has some way to query the width of a path.

My use case would be the following: I do pathfinding per battalion, and there is a small number (5-15) of units per battalion, which move in formation. The problem is that the formation positions are unaware of their surroundings, causing units to try to walk through walls if the position overlaps, let's say, a wall or corridor. So being able to tweak the formation per PathPoint would be great.

young lintel
#

Might be better to make each unit do its own pathfinding while attempting to stay at a given offset from the leader

#

It would look a lot more natural too

sleek hull
#

Can you manually edit the navmesh or no?

young lintel
#

You could certainly do some line traces or sphere traces from the path point to make sure there's room on each side at any given point

#

I'm not sure the navigation system exposes enough of its guts to be able to determine any sort of "width" of a selected path

#

Well, you could get to it, deep in the bowels of C++

#

But it's probably non-trivial

dawn schooner
dawn schooner
young lintel
#

I don't think you can use his little code snippets but this might give you some hints

#

Honestly use creative traces and working from that sounds like a more time efficient solution, but I'm not an expert, haha

dawn schooner
young lintel
#

Yeah I stumbled over it earlier today, it's not really a solution to anything but it does give some pretty good insight into how it's all put together

dawn schooner
#

bcs then I can adapt the formation in advance, instead of querying frequently the outer formation spots to see if there is navmesh there or not

young lintel
#

Yeah

dawn schooner
#

although I'm thinking that I can do it somewhat

young lintel
#

Wonder if it's as simple as just exposing a variable

dawn schooner
young lintel
#

๐Ÿ˜

#

I got the evaluation version of Mercuna, but their evaluation plugin package doesn't have Linux binaries

#

smh

young lintel
#

Welp, Mercuna gets better results than stock unreal navigation but it still can't find a path beyond a certain length

#

Like... Less than a kilometer

#

Not really worth paying a couple thousand dollars for if I still have to hack together my own pathfinding solution

sleek hull
#

what do they mean by kilometer? can't you just scale up/down your meshes to deal with that problem. or adjust their own unit system?

young lintel
#

No

#

They don't say anything about the limitation but I was just testing it on my prototype map and it works great but only up to a certain distance, if you try to find a path beyond a certain length it just doesn't

#

My characters are already at 0.5 scale in my effort to get around the limitations of unreal nav mesh

#

I guess I wait for Kythera to send me an evaluation package to see if they do any better

#

Well now...

lethal helm
#

don't exactly need a nav mesh precise to the foot when your dealing with a km of distance

young lintel
#

The AI still needs to be capable of walking through doorways

lethal helm
#

ooooh thats a nasty problem

#

you want high detail level and long distance?

young lintel
#

Yeah

lethal helm
#

how about two navmeshes?

young lintel
#

Perhaps

#

That actually might work but I'm not really sure how to switch a character back and forth between them at will

lethal helm
#

c++ fun

young lintel
#

Merkuna might be capable of that, actually

lethal helm
#

ultimately it's just querying a path from the correct nav mesh then following it

#

the tricky part is figuring out which function you need to override to change that

young lintel
#

lol, yeah

lethal helm
#

the navigation system has alot of abstraction so actually finding shit sucks

young lintel
#

The other parts are tricky too, I'm like, two months into Unreal at this point

#

The documentation, what little there is, is not good

lethal helm
#

has anyone tried to implement target dependent modifiers for the ai sight sense?

young lintel
#

As an alternative solution to my pathfinding problem I'm thinking of something like, each of my villages has a zone already, what if I add spline components to each one and hand build a spline that describes the road route from each town zone to each other town zone, when an AI is in a town and wants to go to another one, they can find the spline component they need, find the node nearest to their location, then just MoveToLocation each node in the spline...

#

I guess I could use actual road splines too, two birds with one stone

lethal helm
#

yep thats pretty easy

young lintel
#

It only addresses the need for AI in towns, though, doesn't help any that are outside of towns but that might be alright

lethal helm
#

the ones outside towns should navigate to the nearest road if they want to go to a town

#

heres a simple spline following task

young lintel
#

That looks great but it's compressed too much to read, haha

young lintel
#

I was thinking one-way splines but yeah I guess I could give each spline component a "beginning" and "end" town zone, so the AI can decide whether to ascend or descend the index keys

lethal helm
#

in your case you would want to use "move directly to" instead of moveto

young lintel
#

Well, no I think it will work, the nodes in the splines will be close enough that the normal AI pathfinding should work fine

lethal helm
#

true but the spline in your case already guarantees a successful path

#

so might as well save some cpu juice

young lintel
#

Yeah... I still want them to be able to be interruptable but still be capable of returning to the same route

lethal helm
#

kick them off the spline when they are interrupted

young lintel
#

I will probably need to build this in a behavior tree

lethal helm
#

well yeah

#

thats a behavior tree task up there

#

if (splinevalid) do -> task_followspline

#

as something lower priority then combat

young lintel
#

Yeah, cool this shouldn't be unpossible

#

Thanks

harsh storm
#

@celest python Question with ST. How do you get it to mingle with perception? To me, it seems like ST is designed to be on the actor itself, instead of controller. And the perception is ideally on AIController.

celest python
#

i never worked with default perception system before, but i'd go with the way of having perception related things on tasks actually...

#

because it lets me enable/disable perception utils per task

harsh storm
#

๐Ÿค”

celest python
#

but its not feasible to refactor

#

so other way around would be having an evaluator update the perception and evaluator can update schema parameters

harsh storm
#

The perception stuff is a component that goes on controller or actor. So how would you get it working on a task?

#

Traditionally - the perception stuff would just update the variables in the BB

celest python
#

without knowing the internals of the perception api: making perception component a parameter in schema is actually a good idea.. you can take perception comp as "in" parameter from tasks and evaluate there. though you would probably replace BB with a custom data object

#

maybe something like UPerceptionMemory

#

this is also lets you run multiple perception comps btw.. some advanced AIs require multiple ones based on the design -- out of context

harsh storm
#

It's wild to me that you've spent a year on AI and haven't even touched the perception stuff ๐Ÿ˜…

#

It's like...one of the coolest parts of the AI toolset imo.

celest python
#

my game is an arcade twin stick shooter

#

every AI is on the screen

#

though I wrote a custom perception system.. a lightweight one for a client

#

i was trying to mock what Alien Isolation did exactly

#

and how perception interops with BB wasnt my taste (for that specific AI), I wanted a custom structure between systems

harsh storm
#

@celest python Figured out another way. Using gameplay events. When the perception is updated, can send the state tree a gameplay event with certain gameplay tags. Perception.TargetAcquired or w/e. And then use that as transition conditions.

#

I didn't really understand how it would work by making the perception component as an in param to the schema. 'Nor could I actually figure out how to pass it in BP land.

harsh storm
#

Well - that at least lets me trigger the state change. Not sure how to actually do anything with the payload data though ๐Ÿค”

#

Just need to figure out a way to pass the actor that triggered the perception event. I could put it as a bound variable in the context actor, but I'd prefer not.

celest python
harsh storm
#

My smol brain can't wrap my head around that idea. Because it is a component that lives on an actor. Then when one of the senses gets triggered, it broadcasts a delegate, which of course you can subscribe to. So, trying to get that into the task itself - not really sure how.

#

Can't seem to pass the component reference through the schema either.

#

I just...need to figure out a way to pass that actor that triggered the perception delegate. I don't like my first idea of binding to an actor variable on the context actor.

harsh storm
#

And of course - now it did. Shame.

#

Sorry for the double pings ๐Ÿ˜…

keen crow
#

I have a situation when I need to run some sequence under a selector indefinitely while blackboard condition is sattisfied. Which is better in terms of performance: create a simple parallel and put "finish with result in progress" as the main task and run my sequence in background or create a sequence with a loop decorator? The latter would require me to have 2 sequences: one with the blackboard condition and the other with the loop decorator and it looks a bit uglier compared to the first approach

keen crow
celest python
#

just like Keep It Simple Stupid method coffee is also proven to increase the productivity green_tick

manic karma
keen crow
#

does KISS imply that I shouldn't ever bother about performance on early stages of development? I was just wondering which way is better if any of them is

harsh storm
#

Do what is simple and works

#

And definitely don't pre optimize

#

It's a massive waste of time

celest python
#

BTs execution flow is extremely optimized for you anyway

#

you only get to care about context of your BT nodes

harsh storm
#

I still need to figure out how to have the State Tree actually do something with the payload you send through an event.

nimble perch
#

Hey guys, there is there a way to make specific actors block specific AI navigation path?

#

so AI 1 can move through Actor 1, but AI 2 will have to pathfind around it

boreal tundra
#

Hello guys, do you know why my navmesh disappeared from stairs randomly and I didn't touch nothing !?

plush cargo
#

what is the stuff called for whatever makes AI avoid other AI ?

haughty coral
#

@crystal hatch @lyric flint

I wrote down also a short feedback on ST. You probably know about all of these points but I wanted to write it down anyway in case it is at least a little bit helpful. I hope you don't mind.

- Live view of ST execution when debugging. This is not really missing unless something goes wrong and you need to understand what is going wrong.

- Being able to understand ST just by looking at its tree. (?) conditions are a mystery unless you select every single state, expand menus and understand the task and the condition. BTs are very good in this because the flow is defined by the BT architecture, so there is no need to understand transitions. Additionally, BTs display all the info like node names, descriptions, keys, values on the nodes, so you most of the time can understand whole behavior just by looking at the graph. Maybe ST could have some expanded view which is less condensed and displays more details.

- If I understand correctly there is no out of box solution for having event-based execution just like BTs had observer stuff, so transitions checking variables need to execute in some interval. For some stuff it is of course possible to use events.

- It still suffers from exponential growth. If you have a multiple states at the same level, you need to define transitions for all of them and maybe add a transition to the new state from every other state. This is probably too crazy of an idea but I wonder if it would make sense for ST to support BT like Abort behavior for entry conditions of states. So when some entry condition succeeds, it can abort lower priority states. I believe that would help with the exponential growth.

- Setting EQS context is a bit more difficult from ST as there is no single place from where both thing could get data easily. In BTs you usually use Context which gives you something from the blackboard. But this is more shortcoming of EQS than ST.
#
- It can be unclear which task supports Succeed/Fail and which tasks are running indefinitely. You need to understand it in order to build and understand ST properly.

- BlueprintBase of BT uses events. BlueprintBase of ST uses functions. Because of that it is complicated to use latent nodes or event-graph only stuff. I created my own blueprint base derived from the default one but the task picker is not displaying it. I assume there is a hardcoded list of parent classes in the ST module's details customization.

- When having a bindings access to multiple instances of the same task, it is unclear from which task the binding is. I would like to have just multiple instances of the task named MoveTo but I can't because otherwise I am not able to understand which is which as both show up in bindings just as MoveTo.VariableName. Maybe it would be better as StateName.MoveTo.VariableName? 

---------
On the other side, it feels like it is really well done. The property binding is great, it feels robust and the API is nice. Perfect base for the future development. For now I will probably use BT for the core of my AI and ST maybe for smaller subparts or other stuff which requires general state machine. Missing debugger is probably most critical point together with the readability. I learned it after I got back to it after 2 weeks pause :D
#

This is the BT I converted and tested it with

boreal tundra
#

Can someone help me with my ai ? It became stupid af all of a sudden

#

lol

boreal tundra
#

Do you know how to make my AI go around obstacles?

young lintel
#

Your questions are not specific enough for anyone to be able to answer them.

boreal tundra
#

Okay sorry I was waiting for someone to have interest and then explain better.. Anyway, I need my AI to chase me and it does.. now I need him to avoid obstacles and go around them in case there's one since when I go down the stairs faster than him he just stands there menancingly and watches me

uneven cloud
uneven cloud
boreal tundra
uneven cloud
boreal tundra
#

he gets stuck like a chicken

uneven cloud
#

The visual logger will help to determine if it's a pathing problem or a character movement problem.

boreal tundra
#

The visual logger spams "can see" " cannot see" continuosly

uneven cloud
#

Turn off all categories that aren't navigation related.

boreal tundra
#

No

#

actually

#

he can see me

#

he just remain in chase

#

pursuin

boreal tundra
#

it didn't used to before

uneven cloud
nimble perch
#

is a nav obstacle modifier not really an obstacle?

nimble perch
#

Meaning, if the target is there, it can go to it

uneven cloud
boreal tundra
#

now ? lol

uneven cloud
uneven cloud
# boreal tundra now ? lol

If you uncheck the categories that don't say navigation, you can walk through the timeline to see how it navigates. It will also draw the paths in the viewport.

boreal tundra
#

i guess AI Navigation

uneven cloud
#

For navigation, I keep both of them on. I always forget which one does what.

nimble perch
#

i am using a filter and modifier to make an ai avoid a specific area class that my modifiers use

#

but, this will still go to it if no other option exists

uneven cloud
nimble perch
#

oh I see!

boreal tundra
#

The visual logger says that the killer was in chase

#

and could see me

#

as the gameplay debugger said already

nimble perch
#

weird

#

that still makes the same behavior

boreal tundra
#

which problem did I fix with this thing? That the killer doesn't go around obstacles during chase as I already knew ?

uneven cloud
boreal tundra
#

Bingo

#

We are close to the culprit Detective

uneven cloud
#

Looks like the pillar isn't affecting navigation.

boreal tundra
uneven cloud
boreal tundra
#

I've tick "Can affect navigation" to yes but the chicken still stands there

boreal tundra
uneven cloud
boreal tundra
boreal tundra
#

Yes

#

Collision Block All

#

I tried to set Can Character Step to No

#

but still doesn't work

boreal tundra
#

๐Ÿ˜ฉ

ocean wren
#

You have to debug it... look at what the log is saying, what the visual logger is saying.. it will likely tell you whats wrong

boreal tundra
#

...

unborn jungle
#

Is it possible to extend the range at which a nav link proxy reaches?

#

It seems after a fairly short distance, the secondary darker green arrow stops getting created