#gameplay-ai

1 messages ยท Page 37 of 1

dawn schooner
#

I don't, those actors are rendered through Niagara anyway

#

but I don't remember if the position updates were multithreaded, lemme check

celest python
#

here's what I did:

  • MoveComponentImpl does the trace, returns it result immediately, saves the actual FTransform update request to array
  • On last tick group, a singleton loops them in ParalellFor
  • After parallel for finished, another GT loop happens to call render dirty
#

Didn't test, no idea if works. So I only implemented on code level not on practical level

dawn schooner
#

ahh well maybe you didn't profile then

#

xD

#

was very curious

celest python
#

I didnt even run the project after lol

#

I was just so bored and had to fill my mind with something

dawn schooner
#

LOL

#

Well I checked, and my transform updates are NOT multithreaded - mainly because the setup on Mass and the Niagara sync requires a single thread setup

#

so I didn't bother, performance was very good anyway

#

but it was significantly faster than the built in transform update

harsh storm
#

Imagine, just for a moment, Epic fixed the transform update ๐Ÿ™

harsh storm
#

World peace

dawn schooner
#

at least

#

I hope Epic product holders are reading this

harsh storm
#

Nah, they want to have a critical part of a game be slower than Godot

#

I've actually heard its more that so many things rely on the transform system to be done the way it currently is done.

#

I just don't think I've ever heard a good thing about the transform system of UE ๐Ÿ˜…

dawn schooner
celest python
#

when someone finally compete them on their precious โœจ metaverse โœจ fortnite and make their engine publicly available idk what they are going to do

harsh storm
wise sluice
#

Thanks!

maiden cargo
#

If this make a 20x increase in speed for moving objects, what's the catch and what does it breaks for it to work?

misty gale
dawn schooner
#

potentially I mostly copied and pasted vblanco's or megafunk's code snippets

celest python
#

Including collisions

dawn schooner
# misty gale I see

just in case it's useful:

void ARTSUnit::SetLocationAndRotationFromMass_Cheap(const FVector2D& InLocation2D, float InHeight, float InRotation)
{
    SCOPE_CYCLE_COUNTER(STAT_CheapTransform);
    UnitRootComponent->SetComponentToWorld(FTransform(
        FRotator(0, InRotation, 0),
        FVector(InLocation2D, InHeight),
        FVector::OneVector
        ));
    
    UnitRootComponent->UpdateBounds();
}
#

this one only updates root component, megafunk had one recursive function that updated all components from an actor iirc. I'd probably not make it recursive since I'm not sure if it hurts performance

maiden cargo
harsh storm
misty gale
#

Guess this is less worth it for me as i dont have components at all

misty gale
#

Sounds like thats the biggest benefit

celest python
#

it does run same expensive logic even when a scene component doesnt need it

harsh storm
misty gale
harsh storm
#

So you have absolutely nothing in the world?

#

No characters?

misty gale
#

Singular

harsh storm
#

No meshes?

celest python
#

FSceneProxy go brr

misty gale
#

A single ismc

#

That doesnt move

harsh storm
#

So your game is just a single ismc?

misty gale
#

Well, for moving "characters" , yes

harsh storm
#

What are you even making?

misty gale
#

I might have to add a few more, depending on how VAT resolves

#

Casual city builder

dawn schooner
harsh storm
misty gale
#

that's the plan, yes

#

i've tried swapping for hism, but it's far slower at the updates...

rare ruin
#

Mass is handling most of the agents as one ISM, what's the issue @harsh storm ?

#

Also you can turn agent that are close to you to actors

maiden cargo
harsh storm
rare ruin
#

Oh ok my bad, thought you was concerned about it

harsh storm
misty gale
#

probably just an uncommon approach

harsh storm
dawn schooner
#

Niagara ftw

harsh storm
misty gale
dawn schooner
#

for meshes than don't move ISM/HISM is fine

misty gale
#

wouldnt mass benefit from niagara ?

dawn schooner
#

they are independent systems

misty gale
#

Im at an acceptable limit currently tho, so im not gonna convert my system anytime soon

misty gale
dawn schooner
#

your game will run faster if moving static meshes are rendered through Niagara

#

but there are caveats

#

mainly lack of physics

#

we have to implement a new click-selection system because linetraces won't work on Niagara meshes

misty gale
#

how many actors are you aiming for ?

dawn schooner
#

also with Niagara LODs had to be implemented manually, although they'll change that soon (if not in 5.3, haven't checked)

dawn schooner
misty gale
#

wouldn't think you'd need niagara for that,

#

but it saves cpu time so

dawn schooner
#

goes more brrrrrr

rare ruin
#

I enabled collision on an ISM recently
I got 1000 agents moving with physics on each agent. It took me 2 ms to update all the physics objects

harsh storm
rare ruin
#

That's insanely high but i don't need that many ๐Ÿ‘€

dawn schooner
#

meanwhile our whole Niagara setup (which also draws minimap, fog of war, etc) takes 0.200ms

harsh storm
#

Goin' for that 2 FPS?

dawn schooner
#

sorry

#

maths

harsh storm
#

I was like, "I know GB said Niagara is slow, but jeebus" @dawn schooner

dawn schooner
#

Fx NO STONKS

harsh storm
#

But like everything is slow for what GB wants ๐Ÿ˜…

misty gale
#

< 1 mill is not acceptable

harsh storm
#

GB is just on a whole different planet

misty gale
#

I was thrilled when 20k moved lol

#

I expect the number to drop significantly once vat enters the room tho

dawn schooner
#

in my tests VAT vs no VAT barely made a difference

#

what did a difference was the quality of the meshes (vertex counts basically)

#

we really need LODing

misty gale
#

Thats promising

#

Hism brings lods but

dawn schooner
#

with aggressive LODing I've seen 100k meshes in Niagara

misty gale
#

The update time was like 4x

celest python
#

First one is the base capsule of ACharacter

#

other 9 is just visual only components, like niagara VFX, that doesnt require collision

#

if you move ACharacter, it will call MoveComponentImpl of root component, which is the capsule of ACharacter

#

it will run a very compherensive, accurate but also expensive logic to do factor collisions and sliding towards sides if you are continously moving to forward while getting blocked by things

#

then call MoveComponentImpl of its childs recursively

#

then other 9 visual only components also do the same

#

and waste CPU

#

vblanco trick solves the issue for other 9

misty gale
#

Sounds like it should be a bool in scenecomps

celest python
#

while you keep the main logic for only capsule

maiden cargo
#

Yes, I got that part but I wanted to know why it wasn't in the Engine already or with a PR?

celest python
#

There are a lot of things could be in the engine but doesnt, this is just one of them

dense owl
misty gale
#

Fortnite didnt need it :p

celest python
#

UE is being engineered towards Fortnite

#

also the reason why AI sucks in UE

#

they're so careless that they fund* paid solutions to get better so people can use them instead of AIModule

wise sluice
#

So StateTree and Mass are not made by Epรฎc ๐Ÿค” ?!

celest python
#

Mass is not an AI framework

#

StateTree is not replacement for AIModule too

wise sluice
#

MassAI sorry ๐Ÿ‘€

celest python
celest python
wise sluice
#

Not only

#

It also include MassNavigation and MassBehavior

#

To handle SmartObjects and ZoneGraph and any system that you could build around

harsh storm
celest python
#

*publicly available and real

harsh storm
#

That should go without saying

#

Obviously Frostbite or RE engine don't exist for us

#

The only engines that matter to us are ones that we can actually use

#

But make no mistake - I'd drop UE in a heartbeat if I was ever able to use RE engine

celest python
#

Its others being incompetent not that AIModule is arguably good enough tbh.. It just worksโ„ข๏ธ until it doesnt

#

but who am I shitpost

rare ruin
#

What parts of the AIModule are bad?

harsh storm
#

Well, Godot will never have an AIModule equivalent. Reduz is firmly against it (as are others)

#

"AI is so unique to games, we can't offer a generalized solution out of the box"

#

Not an exact quote mind you - but that's pretty much the sentiment

celest python
dawn schooner
#

@celest python that reminds me I should swap the StateTree actor components by another way to setup state trees with our units, that is quicker to tick, for now I just reduced tick frequency

#

btw I've been working with State Trees for a while and it's quite fine, probably I only use the basic stuff but no bugs so far

#

also probs I'm doing it wrong but it works so

celest python
# celest python Majority of it

Fun fact recently one of the ex-epic people at benui's server got puzzled by one of the AIModule's implementations too lol

harsh storm
#

The navigation stuff specifically

dawn schooner
#

lol

harsh storm
#

People like to rag on the AIModule - but I actually have very little issues with it.

#

Other than maybe how much indirection there seems to be.

celest python
#

did you even ever interact with AIModule though

harsh storm
#

I also don't do that complex of AI to be fair.

harsh storm
celest python
#

Extending

#

something different than inheriting from BTTask, building BT etc

harsh storm
#

Not really. Haven't had much of a need.

#

I haven't had to make a custom brain component for example

celest python
#

people rag because they go a bit more deeper through API than that

#

I almost never read/interact with low level stuff

#

I am still not comfortable

harsh storm
#

I do think the code itself is a bit hard to follow though. So that part is annoying.

#

But at the same time, I cut them some slack at least. Because it was one person doing all of the AI for a AAA company

#

And maybe some of those decisions made sense at the time

#

Not to mention them admiting that they were much younger and more foolish back then.

celest python
#

I think there was also a junior

#

Mieszko wasnt alone

#

zoombapup was saying blackboard made by a junior

harsh storm
#

Either way - its low amount of resources for a high expected output.

celest python
#

I never blame individuals anyway

#

I saw with my eyes that when individuals do 100x better than how they were when they are at Epic

#

ofc this depends on team or project but whatever

harsh storm
#

Part of the issue, I believe, is a lot of this stuff was built for a specific project and then tried to be retrofitted to be more generic but just never got done.

#

On top of...well Epic seemingly never actually just removing an API. Instead just indirection after indirection after indirection, etc...

#

UE's tech debt is 100% going to be their downfall imo.

wise sluice
#

Also retrocompatibility + Unreal is used by ton of ppl

Is that not easier to do something individually without care about other projects that could rely on it?

harsh storm
#

Oh, 100% they've already said they have to do some of this stuff because of contractual obligations.

celest python
#

when fortnite needs it desperately they're very comfortable with removing whole API though

wise sluice
#

Which one?

harsh storm
celest python
#

from what I can see - could be true or not - majority of the things are up to initiative of the teams

celest python
#

there isnt a gigabrain council deciding on things and keeping people off from doing things better

misty gale
#

I wanted to swap my ai setup for statetree for visuals and debugging etc but ..

celest python
#

if something gets broken Epic directly contacts you (this part is true)

#

so when the initiative doesnt come from fancy people teams dont refactor things for the better

#

especially since they are busy

#

and as we all already know fancy people at epic busy with fortnite

celest python
#

4.22

#

idk what it covers completely, but I know a few big projects affected heavily

#

they even told at some talk "we change things frequently, be in touch with us if you're a client"

wise sluice
#

I guess you have to do that at one point when you realize you made a misstake

#

It has been completely refactored not removed right?

celest python
#

I dont know, affected parts are not my area of interest so didnt care to check

#

but I assume like at least %80 of the API got wiped out and rewritten?

#

lol actually

#

they refactored one part of it again

#

and its awesome this time

#

FSceneProxy stuff

#

I was ranting about that thing a lot

#

its now both faster and easier to extend

rare ruin
#

I mean if that's good now, it's worth the pain no?

celest python
#

of course

#

this is what we want

misty wharf
#

I hope they make a sprite based fortnite

#

because my other project needs paper2d to be better

#

lol

harsh storm
#

Epic has never cared about 2D in the entire history of the company since UE1.

#

I know - I was there old_man_yells_at_unreal

#

Pretty sure I've played like every one of Epic's games, lol

celest python
#

I probably wasnt even a sperm when UE1 released

harsh storm
#

I was really into Starcraft when it was released.

rare ruin
#

Starcraft editor?

harsh storm
#

Nah - custom game modes.

uneven cloud
harsh storm
celest python
harsh storm
#

I agree with Luthage personally. But I've already stated that.

misty wharf
#

UE's AI stuff has worked pretty well for me tbh

#

It's obviously not perfect but I really don't want to build my own systems for this from scratch

#

I have more important things to do :P

harsh storm
#

I recall there was a point where people were complaining about BT all the time and I felt like zomg and I were the only ones who actually enjoyed it, lol

misty wharf
#

lol

misty gale
#

I avoid BT at all costs ๐Ÿ˜…

misty wharf
#

Yeah I've been pretty happy with BT's. I'm moving from a lot-of-small-nodes approach to a self-contained bigger nodes approach with it for my other project

#

For certain bits the state management and action selection etc. works better that way

harsh storm
#

Perception and EQS have also helped with doin' stuff easier as well.

celest python
#

There is no framework that all programmers agree its good or bad I think, not to mention usability of things relative based on your scope and habits

misty wharf
#

I'm messing around with StateTree in a smaller project now just to see... it's pretty good but it has a lot of weird little gotchas

#

And for supposedly being "general purpose" it seems rather difficult to run without being in a state tree component in an actor

celest python
#

One could argue my problems with UE AI is skill issue but then I saw better programmers than me also not enjoying it ๐Ÿ˜„

harsh storm
#

Maybe another skill issue? ๐Ÿ˜ˆ

misty wharf
#

I suspect if you know exactly what you want/need then you might be better off writing your own systems

#

I just want something that I can use as the basis for building stuff on top of so I don't have to deal with the low level stuff because the low level coding inevitably ends up taking so much time that I'd rather use building my game logic

uneven cloud
harsh storm
#

And user experience is super important.

#

I recall you talking about the experience of actually using Kythera - sounded like a big nope for me ๐Ÿ˜…

celest python
misty gale
#

Biggest issue with custom stuff

#

Atleast as solo/indie dev

celest python
#

It also crashes often when it's trying to update things from browser to UE assets

celest python
#

Amount of workarounds and lack of UX when developing something is what matters for me

harsh storm
#

Not to mention UE has some pretty cool debugging tools for AI especially!

celest python
#

Yeah visuallogger is pretty good

wise sluice
#

Mass Debugging tools are really awesome

uneven cloud
celest python
uneven cloud
celest python
#

I respect you disagree with me and I acknowledge your experience since I also refer you to people I discuss when they're stuck on something related with AI on UE but its bold to assume no one did better than UE or cant do better than UE tbh. Just because UE is best around its rivals doesn't mean UE is the best among all

unborn sphinx
#

Cost vs benefit vs time. UE ai systems win.

#

The time it would take to research another option alone, then negotiate licensing, or write from scratch. Unless you have a pro dev team, doesnโ€™t compute.

uneven cloud
celest python
uneven cloud
#

I don't like Mass, because the user experience of it is terrible. I had to rewrite smart objects, because the UX is also bad.

UE isn't perfect. Far from it. But if you try to fight it you'll just be putting yourself through a lot of pain.

dense owl
#

MieszkoZ would die ๐Ÿ˜€

celest python
#

I dont enjoy developing my games with Unreal AI, but I do nevertheless, its not like I have any option. But it sucks for me because I often find myself working around things instead of it could be supported at the first place. Like any other module UE's AI system has a solid base to extend upon, but from my experience compared to others in the engine AIModule is extremely unpleasant to work with. I also generally dislike the design principles of UE's BT, I dont find it encouraging me to be more modular on the front-end side, decouple my logic better etc. - not to mention I dislike reliance to AIController with passion. Turns out Mieszko also doesnt like this idea anymore

You might be finding those more pleasant to work with unlike me but I'm arguably a fresh programmer for AI world with no prior experience on other AI systems. so while being aware of the fact UE is pretty good compared to what we have around the industry, I am not into the idea of cheering upon how AIModule is better than others because obviously its also way more worse than others we dont see

uneven cloud
wise sluice
unborn sphinx
harsh storm
uneven cloud
wise sluice
#

Ah right, i was not aware of that, i am focusing on singleplayer game right now

#

Good to know

#

Did you see they are extending the logic to include player ? They will probably take that in account

uneven cloud
#

We spent more time trying to find a non intrusive way to make SO work for our needs, than the 2 weeks it took for me to rebuild it.

misty wharf
#

There's a couple of issues I had with SO's as well for my project

#

I was able to so far do without rewriting it and just hacking stuff on top - it would be easier if it was so locked down

#

For example if all SO slots are claimed, the smart object effectively no longer exists as far as querying for them is concerned

#

I couldn't think of a good way of allowing actors to queue for using an SO as a result of that

harsh storm
#

I haven't even looked at the SO system to be honest.

uneven cloud
#

We also needed more filtering for picking a SO and an interaction.

unborn sphinx
misty wharf
#

That probably depends on what features you need for it

#

You could probably emulate the gameplay behavior functionality quite well via using a gameplay ability on it instead

#

say the ability gets granted to the actor using it, and then activated

unborn sphinx
#

Yeah I am thinking typical use: workstations that can be "worked" at or benches to be sat on etc

unborn sphinx
#

Luthage wat did u do?

misty wharf
#

Unless you need to let the SO execute abilities or have effects applied upon it, I don't see why it would need an ASC

unborn sphinx
#

They will be critical for the simulated economy, they will produce economic outputs

wise sluice
unborn sphinx
#

so I figured I would need to track attributes, etc

misty wharf
#

Ah, yeah it can make sense if you find the attributes helpful

harsh storm
#

At the basic level, a SO is an object that tells the interacting actor what animation to play really. So at the most basic level, you just store the animation/montage on your SO and then when you interact with it, get that anim to play. Obviously this is a super basic implementation approach.

misty wharf
#

The other minor annoyance with the SO system is that it doesn't seem to support multiple behaviors in a nice way

unborn sphinx
#

Hmm I guess SO are not as complex as I thought they were and I could probably make somethign else work

misty wharf
#

So you basically need to have two smart object definitions if you need two different kinds of behaviors on the same object

misty wharf
#

In my case, I needed a behavior where an NPC is "browsing" objects on a shelf, and one behavior where the NPC picks up something from the shelf

unborn sphinx
#

that is so brutal that they have to be separate lmao

spring inlet
#

you could use different tags?

wise sluice
#

Ohhhhh i'm happy I fixed an issue with Mass ๐Ÿ˜„ I'll talk about that in #mass

misty gale
misty wharf
#

You could potentially use something for it but then you'd need to make your gameplay behavior somehow determine the action the NPC is trying to take, and I couldn't see any really good way of doing it at the time

#

I think they added some new functionality into SO's in 5.3 again so maybe there's something to help with it by now

uneven cloud
unborn sphinx
misty wharf
#

Seems to work ok

uneven cloud
unborn sphinx
#

So my guess is ur new version of SO is some actor that replicates its "in-use" flag?

#

and then grant abilities to users

#

I have a bit of time to think about this because my first playable will have only combat lmao... but I really really really have to focus on non-combat more because I am falling into that trap of just combat AI and nothing else god damnit

#

the whole point of this game is to discourage combat (while always providing it as an option so ur choice of non-combat truly means something)

uneven cloud
misty wharf
#

That might have been the issue I was having also :)

#

I don't have the project open atm but I vaguely recall that it wouldn't let you put two GameplayBehaviorSmartObjectWhatever things into it or something like that

#

Or some other problem in if you had two of them in there

uneven cloud
unborn sphinx
#

lmao shouldn't have told me that cause in a few months I'm gonna be in here trying to get this workin and I hope I do not annoy u

uneven cloud
#

A lot of what we did was improve the UX of it. That way designers can use it. So we have things like previewing an animation in the definition.

unborn sphinx
#

nice

dawn schooner
misty gale
#

What a shame

unborn sphinx
#

@royal mist is doing this. is he bein silly? what does that navigation grid point node thingy do?

royal mist
#

ya i still can't figure it out lol, it might be a bad idea. im not honestly sure what the solution is but idk unreal well enough

unborn sphinx
#

what does that node do tho? like

dense owl
#

Did you try navigating to native to see?

unborn sphinx
#

No that is not my screenshot and I am busy working on static mesh assets lmao just asking for him as revenge for throwing me under the bus

strange jackal
#

is it ok idea to make AI logic inside NPC event graph itsrlf just using enums ? ๐Ÿ˜€
(event tick->switch on enum (ai current state))

#

something like this, will this work for ai states?
or its a bad idea and i must use BehaviorTree with Blackboard ?

misty wharf
#

Yes that will work

#

BT's and such are optional. If you don't need them, don't use them

modest token
#

how do i make unreal engine handle a lot of ai characters like vermintide/darktide did?

daring locust
#

I want an enemy to return to it's roaming behaviour if the player dies. Can I completly reset the behavior tree somehow, so it starts from the very beggining?

misty wharf
misty wharf
modest token
misty wharf
#

You can probably do that with UE's normal stuff with some optimizations on character movement and such, but there is also #mass although I'm not really familiar with how it works

minor geyser
#

in smart object definition slots, where exactly is it looking for the "user tag"? is it looking on the pawn somewhere?

misty wharf
#

iirc on the pawn yes, through IGameplayTagAssetInterface, or possibly through IAbilitySystemInterface since the ASC also carries tags

minor geyser
#

for example on this slot, i only want pawns which have "1" as a tag to be able to use it, i am just not sure where i put the 1 for the smart object to find ๐Ÿ˜›

misty wharf
#

Looks like it's actually passed into the smart object system through the filter parameter, f.ex. on the Claim function

#

or the FindSots function since the Claim function looks like it's deprecated in 5.3

minor geyser
#

yeah i ran into claim being missing already ๐Ÿ˜› i only work with blueprints, hopefully i can access these user tags via that and not only through real code

misty wharf
#

Yeah from the looks of it the tags can be passed in as part of the smart object request as well in some cases

#

It looks to have a property called Filter, which contains a property UserTags

tiny elbow
#

Does anyone have any advice or resource for how to best approach organizing and managing multiple "Classes" of AI that share similar behavior?

For example, would be it be best if each class was it's own blueprint, or just make one blueprint that lets you select an enemy type and it changes the model shown and pulls its data from a Data Asset similarly to how I've some guns be coded.

ionic beacon
#

Can you make a 3d grid with EQS, like a 50x50x50 of points? Can only seem to find out how to do a generic x*y

#

Tempted to jsut manually generate a xyz grid of points but if EQS can do it id prefer that.

stark tangle
#

how to tell to a behavior tree in a service node immediately drop current task and go to left branch?
in my AiController i have an OnTargetPerceptionUpdated Event, which is set EnemySighted Key on a Blackboard
i have a left branch Attack logic, with Blacboard Condition Decorator EnemySighted and right branch Move-to-Waypoints logic with a Service node EnemySighted
but left Attack branch is run only when right branch is complete
pawns see enemy correctly, but dont drop move logic, they attack only after move is complete

misty wharf
misty wharf
misty wharf
misty wharf
#

5.1 removed the ability to have per-state evaluators
I was wondering why the docs keep referencing to state-specific evaluators but that didn't seem to exist anywhere :P

jagged frost
#

Could anyone point me in the right direction of making an AI that uses a physics based movement system? Using Addforce and a direction for movement, think Snooker/Pool or Golf. I have tried googling for good ways to do this but can't find one, I was thinking about making a system where it would launch 50 objects invisible to the player and pick the one closest to the goal but not sure if there is a better way.

misty wharf
#

What exactly is the problem you're having with it?

jagged frost
#

It's not really a problem, just struggling to find a good way to do it and wondering if someone could point me in the right direction or show me any good resources for it.

misty wharf
#

Well I'm not quite sure what the physics based movement has to do with it

#

So it kind of sounds like the issue here is something to do with the way it would move

#

(eg. the builtin MoveTo nodes don't support physics based movement and such)

#

because the AI itself (eg. decision making, choosing what to do, and so on) shouldn't really be affected by how it moves

keen crow
#

do BTs have some known problems with services under primary task in Simple Parallel node? For some reason in vislog I observe how my service gets
LogBehaviorTree (Verbose) Search node update[Remove]: BT_SWAT_Defend_Overhaul::Aim at[110] and it's missing later in the next vislog records

keen crow
#

ok nvm I just moved the service to the simple parallel and everything's working ok now

rough ginkgo
#

Looking for some material to help me with 3d ai using nav grids as patrol points, anyone know where I can find something

little swan
ember agate
#

What are the common causes when AIPerception sight does not work?
I have an ai and a character I play to test, Sight was working fine and the ai was detecting(Seeing) my character, But after adding detection by affiliation the ai stopped detecting(seeing) my character

Also the overridden function "GetTeamAttitudeTowards" does not get executed unless I uncheck "Detect Enemies" in the ai sense but "OnTargetPerceptionInfoUpdated" is still not executed

ember agate
#

In case anyone else runs into this, I was following a guide and added IAISightTargetInterface to my character without overriding CanBeSeenFrom

sand kettle
#

Hello! This is gonna be a bit long so bear with me. Would really appreciate some guidance!
I'm trying to make chasing feel more natural for my game so the enemies don't look like a swarm of ants. I made an EQS Query that tries to find a valid visible path close to the player. I also want the NPCs to stay at a distance from eachother so i'm trying to simulate some sort of influence map. I made a query context that gets all AI target MoveTo's, and I use that context in a distance check that filters the points close to the MoveTo's.
Right now it feels kind of janky. Its kinda decent when the enemies just try to chase you in a straight line on a flat surface because once they pick a target point, they try to stay close to it. I don't want them to look like they are strafing much in the chasing branch, but rather go to your general direction without taking too similar of a path
When they have to recalculate and the point becomes invalid they often move a lot and some try to go towards the same point until the query finally takes the current AI influence into account (see 1:50 in video). And some of them just stay still for way too long until they decide where to move (0:15). I think this is because the queries for chasing are run at relatively the same time in a BTService and for the influence to be taken properly into account, I think they have to finish in order. So an individual AI query has to finish before running the next one in some sort of manager.
Any thoughs? What else can I do to improve chasing and manage an influence system?
Video: https://youtu.be/711f2F1h09E?si=VwJiNsHUekk_WZ7t&t=11 (don't mind the snapping, gonna add directional animations soon)
EQS Query: https://gyazo.com/0b47f00f7d83f28da1c380c657c9abbe
Behavior tree: https://gyazo.com/74e1781c90a988b64c77fcdfd6096f9c
Testing pawn: https://gyazo.com/8cd7dca66f73733894e72ef9046b5a37

keen crow
#

Can anyone explain me what RestoreSubtree and StoreSubtree values are in UBTNode::InitializeMemory and UBTNode::Cleanup memory? To be more specific, how/why can it be that node memory is stored and restored upon leaving/reentering the subtree? I though that whenever subtree is left, all BTNodes that were being executed in that subtree are finished, aborted or whatever and hence node memory should not matter anymore and be purged, but right now I observe how in UBTNode::InitializeMemory when the InitType is RestoreSubtree the node memory still has non-zero values from previous executions ๐Ÿค”

P.S. while writing this question I've had a thought - could it be because of usage SimpleParallel BT node when one or both of the children (both primary node and background node) have Run Behavior node within them? I don't really know how BehaviorTreeComponent works in this case, maybe with simple parallel and 2 BTs it like begins to have two instance stacks and whatnot? ๐Ÿค”

dense owl
unborn sphinx
reef wharf
#

well that was annoying. Fiddled with the navigation project settings then it broke my maps navigation until i realised the recastnavmesh was broken. and it wouldn't be remade when inserting new nav mesh bounds. thought i was going mentally ill. but duplicating the map seemed to have fixed it

misty wharf
#

Worth trying to just delete the recastnavmesh actor and such, which contains the actual generated navigation data

reef wharf
#

yeah thats what i did

misty wharf
#

Interesting that that didn't fix it ๐Ÿค”

reef wharf
#

but then inserting a new nav mesh bounds wouldn't recreate it for whatever reason... i didnt know normal behaviour for it was to create both the navmehs bounfs and the recast

#

i had no clue why it didnt work and only found out when one post on unreal forums was saying it was supposed to

#

funni engine

misty wharf
#

Yeah having the navmesh bounds in there and then generating paths should recreate the recast actor

#

Sometimes it doesn't trigger the generation though so you may need to do it from the Build menu

reef wharf
#

where do i manually trigger navmesh build?

#

where is build menu?

misty wharf
reef wharf
#

i do remeber not seeing a navmesh be generated at all..

#

even tho auto build was on

#

ok ty

harsh storm
#

Not 100% sure why this fixed my issue, perhaps someone else could help me out. I'm using sight perception and was having an issue where the sight was snapping to the new direction instead of rotating with my AI. This would lead to some jank because visually, the AI would rotate and should see the player, but because the snap may have caused the player to be outside of the Peripheral Vision Half Radius, it doesn't detect.

So I found someone saying that they just overrode the GetControlRotation method on the AIController, and replaced it with return FRotator(0.0f, GetPawn()->GetActorRotation().Yaw, 0.0f); and it would rotate as expected.

I may have missed it, but I didn't see anywhere in the perception system where it was calling that method. It seems to really rely on the GetActorEyesViewPoint method.

#

My pawn isn't using control desired rotation stuff either.

misty wharf
#

๐Ÿค”

#

Maybe it's using the control rotation for it? In that case the control rotation can probably snap directly into the new direction. Not sure but that'd be my guess

#

That would explain why changing the get control rotation to use the pawn's rotation would fix it at least

obsidian igloo
#

Is it possible via AI perception to sense the actor as a whole instead of just the root component center? a character can be half occluded by a crate or something and the AI will lose sight of the character when he is apparently visible

misty wharf
#

This is C++ only mind you, so in blueprints you'd need some kind of different solution

sand kettle
#

How do you listen to a blackboard value change in c++?

wise sluice
#

@sand kettle

    /** register observer for blackboard key */
    FDelegateHandle RegisterObserver(FBlackboard::FKey KeyID, const UObject* NotifyOwner, FOnBlackboardChangeNotification ObserverDelegate);

From the Blackboard component ?

sand kettle
#

yeah thats prob what i need ty

dapper iron
#

good day gentlemen, i come to you with a simple question:

#

is there any way to have a dynamic obstacle affect only ONE of two (or more) navmeshes that live on top of eachother?

#

currently this dynamic obstacle is causing both navmeshes to recalculate, when it really only needs to affect a single navmesh,.

misty wharf
#

As far as I know in order to choose what affects what, you would need to create a custom subclass of the navmesh bits

#

I have set it up in one of my projects so that I have two navmeshes where only certain things affect the other one

uneven cloud
dapper iron
#

grow up, i was clearly only adressing the gentlemen in here, not everyone.

dapper iron
misty wharf
# dapper iron this is a good lead, thanks for the input!

This is what I had in my notes for this particular thing, maybe it'll help:

1. Extend ARecastNavMesh, have its constructor set `bUseVirtualGeometryFilteringAndDirtying = true` and override `CreateGeneratorInstance`
2. Extend FRecastNavMeshGenerator, override `ShouldGenerateGeometryForOctreeElement` 
3. Have your custom ShouldGenerate function do checks on the `FNavigationOctreeElement`, it contains the component which is being considered for the navmesh. Can do anything there like check if it's from a certain actor type or such 
4. Have `CreateGeneratorInstance` return an instance of your custom Nav Mesh Generator class 
5. In project settings under navigation system, set up an agent type which uses your custom recast nav mesh instead of the default one

`bUseVirtualGeometryFilteringAndDirtying` needs to be set to `true` or the function on the nav mesh generator won't be called.

misty wharf
unborn sphinx
# harsh storm Not 100% sure *why* this fixed my issue, perhaps someone else could help me out....

Are you using orient to motion in the CMC? I experimented with that setting, which can be neat for more natural turning while walking, but it made it so the npc head was not always pointing where it was seeing. Characters would turn around instantly to shoot as where the controller was pointing was not where the head of the npc seemed to be looking.

Probably not relevant to ur issue, but sounds vaguely similar.

dapper iron
uneven cloud
dapper iron
#

no, what i'm trying to do is optimise, there's no need to recalculate both grids if i only need one grid recalculated

misty wharf
#

Hmm.. I guess maybe if you set certain actors to be of a certain area class ๐Ÿค”

#

Oh yeah now I remember what the problem with that was

uneven cloud
misty wharf
#

You can't have multiple area classes in one place

uneven cloud
#

That's what filters are for. Filters change how the area class works.

misty wharf
#

Well it doesn't make it possible for one area to have two separate area classes applied to it at the same time

uneven cloud
#

It makes you not need to have separate area classes

dapper iron
#

this is completely irrelevant to the question at hand luthage

misty wharf
#

If the area class is used to indicate the "type" of an area it doesn't really help

#

I needed to do pathfinding queries to determine when certain objects are placed correctly

uneven cloud
#

Give an example of a use case?

misty wharf
#

Only certain objects were supposed to block this pathfinding query, but I couldn't really do it with area classes because you couldn't have a different area class plus the area class for not allowing the pathing for this particular query

dapper iron
#

this is almost my exact use-case :)

uneven cloud
#

The area class can be changed at runtime.

dapper iron
#

in my case, i'm running a nav query to make sure a destination can be reached before permitting the construction of another object that's a path-blocker

misty wharf
#

Sure you can change it at runtime, but if you need to apply that the area is of a certain type, and you need to apply another class to tell it that certain areas an impassable, now you can't have both

#

because the impassable area class will now not count as the area type anymore

uneven cloud
#

Area classes use bit flags. You can use bit flags to signify multiple bits.

misty wharf
#

I couldn't figure out how those were supposed to be used

uneven cloud
#

I've only used them when entering, but you get the area flag and do a bit check on it.

misty wharf
#

Hmm

#

Maybe I'll look into it at some point again

#

The recast bits aren't too bad to adjust for it but there's been the occasional oddity with it that I've not been able to figure out despite it being implemented more or less the same as the default

harsh storm
unborn sphinx
#

Yeah I have that sorted for sure.

harsh storm
unborn sphinx
#

oh I see what you mean

#

I don't know if I understood ur problem fully. Sorry.

harsh storm
unborn sphinx
#

I also misstated what was happening in my example. THe NPC would look where they were moving and the tracers would come from the barrel of the gun, through the backs of their heads behind them

harsh storm
#

Pretty much this:

The single lines are the vision cone. The black circle is the AI. Player is "Play". When the AI would rotate according to the blue line, visually to the player, the AI should see the player. But the vision cone was snapping instead of rotating along with the character. So, in gameplay it would look directly at you. But the cone snapped to the full rotation instead of moving along with it.

#

And overriding GetControlRotation the way I did fixes this.

uneven cloud
harsh storm
#

Slap a socket on the skele and then just override GetActorEyesViewPoint (or w/e its called) and return the socket info pretty much?

unborn sphinx
uneven cloud
#

Yeah. We put the socket between the eyes, so when just the head moves it moves

unborn sphinx
#

So either overriding the getcontrollerrotation or putting a socket, the result is that the pawn's rotation is used instead of the elusive controller rotation for many things?

uneven cloud
#

Get control rotation is used for a lot of things, so making changes to it might have other repercussions.

harsh storm
#

Yeah - that's why I don't like this solution.

unborn sphinx
#

yeah but at first it almost seems like it would be better... but then again I'm sure there are times it would be worse

#

I really wonder if my NPC exhibit this behaviour now

#

at first I had such a wide FOV for them that this wouldn't really present itself. But with a new narrower FOV this might affect them

#

Yeah the probably surely would have this. The rotation of the pawn via the CMC is slowed to 360 units/unit (what are those units anyway? I assumed degrees/sec). But, in reality that controller is snapping so yeah it will miss anything during the invisible snap

uneven cloud
unborn sphinx
#

So typically the controller provides the sight location but you can replace it with a socket on the actual skeleton?

#

I know I am repeating myself but I am learning lmao sorry

uneven cloud
#

The controller doesn't provide the location. It's gotten from the pawn. Get pawn viewpoint

harsh storm
#

For perception, it calls GetActorEyesViewPoint in the Update loop if I recall correctly.

unborn sphinx
#

oh ok so what is the benefit of the socket?

harsh storm
#

More control over where the "eyes" are really.

#

And it would move along with the bone

unborn sphinx
#

ok yeah because in debug views I see that my pawns sight is like above their heads lmao

#

but maybe that is because it's just a 2d cone, right?

uneven cloud
#

By default it's pawn location + base eye height

unborn sphinx
#

oh wild I see ok so then the rotation is just the basic pawn rotation

#

not the head's specific rotation

uneven cloud
#

Yes

harsh storm
#

Pretty much, yeah

unborn sphinx
#

perfect thank you

harsh storm
#

So what she is saying is to put a socket on the head and when the head is moving around, the sight perception's cone moves along with it.

unborn sphinx
#

u could basically do a whole gdc talk that boils down to that lmao those things have so much fluff this one tidbit is huge

harsh storm
#

Being a bit more "natural" so to speak

unborn sphinx
#

honestly there is so much valuable tidbit knowledge here someone's gotta at least write it down in point form

#

and share it..

harsh storm
#

I saw elsewhere that someone used the socket as well. But at the time of me tackling the problem, I didn't want to do that. I can't remember. It was late and I was thinking about Resident Evil anyway.

uneven cloud
#

Lol might have been me. I recommend it often

harsh storm
#

Honestly - I find the AIModule a bit frustrating to read through to be honest. So many weird things to me. Like creating a whole enum class or struct inside of a method.

#

Can just be annoying to parse for me. I can't speak on if it is quality C++ or not though.

unborn sphinx
#

actually adding sockets was never scary was it

harsh storm
#

Not at all, lol

unborn sphinx
#

right so that is a great solution

uneven cloud
#

Using a socket allows art or design to edit it easily.

harsh storm
#

That too

unborn sphinx
#

yes amazing

#

sometimes the simplest distinctions have so much thought put into them and work so well it is easy to overlook due to the simplicity

#

all the complexity of actually coming to the solution is optimized away in the final result of "use a socket" it seems so simple but it is so powerful

tiny sinew
#

Hello, i have an issue with AI

#

When they are near each other they stop attacking

#

and they stometime stop moving too ( the one on top )

#

but their brain is still working

#

(But it seems that sometime the behavior tree turns inactive)

dense owl
#

Are you using stop logic anywhere?

tiny sinew
#

is it a node? if its a node then i dont use it

dense owl
#

Yeah, fair

tiny sinew
#

My " theory " is the bug come from this (wait

#

is this correct

#

( it switch from the 2 BTTask_Attack )

#

well its switching suickly between the Simple paralel itself AND the bttAttack alone

dense owl
#

Would prly need to see whatโ€™s inside your attack task. On a side note, a 0s Wait is kinda pointless, should be a bit higher to serve its purpose

tiny sinew
#

(as it should)

uneven cloud
#

What does your attack task do?

tiny sinew
#

this is my Attack task

#

this is my chase player

uneven cloud
#

Why are you not using the built-in move to?

dense owl
#

BTs have their own MoveTo nodes for starters (donโ€™t need to use AIMoveTo)

tiny sinew
#

Also, they stop attacking if they are too close from each other ( it seems )

uneven cloud
#

Why are you using a delay in your attack task? Delays are just timers you can't abort.

tiny sinew
# uneven cloud Why are you not using the built-in move to?

I dont know, i just follow this tutorial : https://www.youtube.com/watch?v=LL9hpaSLD5g

Hello guys, in this quick and simple tutorial we are going to learn how to continue making a simple AI using Behaviour Trees in Unreal Engine 5
โ†ช๏ธJust opened my Discord Server, join NOW: https://bit.ly/GorkaGamesYouTubeDiscordServer

โžก๏ธCheck out awesome Unreal Engine courses: https://bit.ly/GorkaGamesWingfoxCombat

Episode 1: https://www.youtube...

โ–ถ Play video
tiny sinew
#

now i get the damage at the exact moment of the animation touch me

harsh storm
#

Ah - Gorka Games. I'd definitely stay far away from them

tiny sinew
#

they actully help me a lot for what im doing..

harsh storm
#

They write really awful code. They're whole channel is just pumping out extremely low quality content.

tiny sinew
#

i cant be autonomous code yet and i follow tutorial, if you have better than them i take it lol but they have everything, short and good explained

#

But i trust you

harsh storm
#

Even Ryan Layley's stuff is better

uneven cloud
tiny sinew
#

i cant know if one tutorial is good or not since i have no knoledge about

harsh storm
#

And Ryan does messy code as well. But understand that tutorials aren't going to teach you good code. The point of a tutorial is to teach a concept.

#

If the concept is not taught, it's a bad tutorial.

tiny sinew
#

So what should i do ๐Ÿ˜ข

dense owl
dense owl
harsh storm
uneven cloud
dense owl
tiny sinew
#

Actually i just want something like this :
Ai : Patrol in X Area
If AI See Me = Ai chase me
If ai is close to me = attack

harsh storm
dense owl
#

Eh, Iโ€™d wager they should until theyโ€™ve actually garnered some real exp

#

But then again the same could be said about Duro ๐Ÿ˜›

harsh storm
#

I'm not saying ignore her right meow ๐Ÿคฃ

harsh storm
uneven cloud
#

Programming is about making a lot of decisions. Decisions based on experience. There is NEVER a right answer.

harsh storm
#

Heck - Luthage called me out some time ago about GetAllActorsOfClass. Had she never done that - I would'nt have actually went and looked at what it actually does.

dense owl
#

Yeah, I try not to recommend get all actors, unless absolutely necessary

uneven cloud
#

Get all actors of class is just fine.

harsh storm
#

It's actually fine to use depending on the class you're filtering for.

#

If you only have 4 players - you can do that crap on Tick with zero issues.

#

It literally just reaches into a bucket that Unreal already tracks for you and gets you that list.

dense owl
#

Right, it just ends up being one of those heavily misused nodes taught by crappy tutorial makers in all the wrong situations

harsh storm
#

You're not actually going through each actor in the world.

tiny sinew
#

I Checked this :https://dev.epicgames.com/community/learning/courses/67R/unreal-engine-introduction-to-ai-with-blueprints/K1X/chasing-the-player but im sure about where it will help me to solve my issue
im actually looking for debug more than create it from scratch( i guess? )

Epic Developer Community

This course introduces Unreal Engine's AI tools, exploring how AI agents work within a video game environment and the systems used to achieve realistic ...

dense owl
harsh storm
#

So yes - question me!

harsh storm
#

Because that is your actual problem

uneven cloud
dense owl
tiny sinew
#

Why should i increase the wait node?

dense owl
#

Cause 0.0 is pointless

tiny sinew
#

i thought its 0,5

dense owl
#

If you have it for fallback, make it a little higher at least

tiny sinew
#

Oh

#

you right

#

i did it to test if its bc of this wait node my issue

#

Also, is my issue can be related to delay?

#

because i use this delay on purpose

dense owl
harsh storm
#

The way I'd do it in BP, is bind to an event dispatcher that says the montage is finished.

#

Not use a delay at all.

dense owl
#

My guess is your branch fires over and over again rn and keeps reevaluating before the delay is over

harsh storm
#

But you really should just go through the linked course.

tiny sinew
#

without delay it looks like this

#

they spam attack

#

im in the linked course but i now sure what i should look about that i dont already know about the basic system

#

And this courses doesnt say " dont use delay " or things like this

#

this is why im here to see if people have the answer from previous experience on kinda same issue

#

and without delay they are also buggy on the animation

dense owl
#

Like I said, your branch keeps firing over and over, the delay was masking the symptom

#

Thereโ€™s stuff like cooldown you can use, or even simple wait nodes, but to make it work right you gotta understand the basics

tiny sinew
#

also they are now punching themself

#

i mean, not themself but the other enemy

uneven cloud
#

Basics like event dispatchers so you can wait for the montage to end

tiny sinew
#

By montage you talk about the animation?

#

because i even remove the animation and everyting, add a printstring at the end of the attack to see if they actually attack

#

they do attack

#

but if i move so they are near each other, they stop attack

#

but IF i kill 1 of them AND move, he attacks again

#

So it means the problem is not about attacking or not but about the Why they stop attacking

#

And it looks like there is a information saying " if there is more than 1 contact in the sphere = stop attack "

#

But i have to know its from the Behavior tree OR from there BP eventgraph

#

and i think i should change something from here.. cant tell xhat

tiny sinew
#

I solved my issue by changine the Sphere by a Multisphere

#

(it seems i solved it)

tiny sinew
#

So now my AI is OR attacking me 4 times by 4 times , OR not attacking if another enemy is in its sphere trace

#

My issue is here
they collide between them and so they stop attacking me

dense owl
misty gale
#

Anything changed with pathfinding in 5.X ? Regular Async pathfinding now results in Error ..

#

Cant get much info out of it either

misty wharf
#

I haven't noticed anything

#

I think I had one navmesh disappear but build paths fixed it

fickle vault
#

Do the AI that use Behaviour Trees need the NavMeshBoundVolume?

harsh storm
#

If you're trying to navigate around, yes. BT is a separate system from navigation though

misty gale
#

Seems like the only thing (i can see) returning error is that it cant find NavData

misty gale
#

Hm gotta be my code , the bp node find path to locatin works

misty gale
#

Works in 5.2.1, not in 5.3

fathom sun
#

Hello, does anyone know how EAIOptionFlag::Type ProjectGoalOnNavigation works in UAITask_MoveTo?

It seems to be breaking what I want to do. All I'm trying to do is tell the AI to move at 0,0,0, and there's some stable ground, however it seems that the destination location change to 0,0,-140 for no reason. I also have tried to pass Disabled for this parameter, still the move request is modified internally resulting into the very same destination location of 0,0,-140.

#

Apparently it tries to build the pathfinding query, but it results into this weird location. What might be wrong? All I did is create the navmesh volume, and extend it on the whole area. The ground the AI is walking is mostly flat. I don't see any reason to make it try to navigate beneath it

tropic sundial
#

Hi All,

I'm trying to use Smart Objects with State Trees in Blueprints (for now).
Note that there is a solution/c++ project as I have added a C++ file to it. And I'm currently using Rider to compile/run it if any of that makes a difference.

I've got to the point of 'Use'ing the smart object, I can use the item, but the return value (the Smart Object Behaviour Definition) gives me a valid value,
but I don't seem to be able to use it in any way.

LogBlueprintUserMessages: [TASK_UseSmartObject_C_2] GameplayBehaviorSmartObjectBehaviorDefinition_1 is what I get back.

I think I should be able to get the GameplayBehaviorConfig from that, which would then allow me to setup the behaviour?
In the code I can see references to the GameplayBehaviorSmartObjectBehaviorDefinition, I don't see to have it available in the blueprint editor
anywhere. No casts, can't create a subclass, doesn't appear to have GameplayBehaviorConfig available under it/etc.

Does this mean I have something misconfigured? Do I need to add anything on the CPP side?
I have plugins turned on: GameplayBehaviourSmartObjects, SmartObjects, GameplayStateTree.

Thanks in advance for any pointers.

misty wharf
#

Doesn't calling Use Smart Object or whatever it is called trigger the action on the SO?

#

At least I thought that "Use" was the part of it which would trigger whatever behavior is defined for the SO

#

Yeah at least AITask_UseGameplayBehaviorSmartObject does whatever behaviors are on the SO

#

and if you're doing mostly BP this is probably the one you would want to be using

tropic sundial
#

I thought that too. I'm certainly no expert (obviously hehe).

But it looks like if you use UAITask_UseGameplayBehaviorSmartObject, that will do all the bits an pieces, so does the full process.

However, I'm using SmartObjectSubSystem->Use.. Which appears to only do a bunch of checks/locks and then returns the behavior

#

Can you use an AITask from a state tree task?

misty wharf
#

StartInteraction in the AITask goes from a behavior definition into triggering the behavior but I'm not sure if all those functions are BP exposed

tropic sundial
#

I (possibly mistakenly?) had thought they were for Behaviour trees?

misty wharf
#

I think you can since you can just set the controller of your pawn as the AI task owner

tropic sundial
#

Hmm, yeah it pops up. I wouldn't be able to interrupt it at all or anything like that though I don't think?

Might be a decent fallback option.

I'm still a bit worried that I don't seem to be able to access the classes it seems like I should be able to access.

Makes me think I haven't setup something properly

misty wharf
#

Nah the smart object system is just raw lol

#

It works but it's clearly still work in progress

#

For example TriggerBehavior is the function used to trigger the actual smart object behavior and that function isn't exposed to BP's now that I looked at it

#

I built a bunch of stuff around the SO system in one of my projects so it's certainly usable, but it's not super blueprints friendly unless you use exactly what they're giving you to do so

#

I made some custom extensions to how the SO's function, and made my own AI Task to use them, but even my own AI task is very similar to how the builtin task for it works, so that's probably the way to go with it

tropic sundial
#

Fair enough. I'm eventually going to convert everything to CPP, but find blueprint a good way of just throwing things against the wall so to speak

#

Thanks ๐Ÿ™‚

celest python
#

Anyone saw zoombapup around lately?

misty gale
dense owl
#

Died with Auther ig

wise sluice
#

Hey ! Does StateTree are Hierarchical State Machine?
It seems to be one but i'm not sure ๐Ÿค”

#

Ah crap, read the documentation first ... nevermind

tiny sinew
#

Hello
I had a problem like sometimes the AI STOP moving but the Behavior Tree was still running
And apparently, link "On Fail " to finish execute fix my problem, is it a normal way to fix that?

fathom sun
#

Does anyone know whether it's possible to generate path towards some location/actor and store it in the PathFollowingComponent, but not immediately move using it? The thing is that I need to check whether the destination is directly reachable, do something, and navigate towards it afterwards

dense owl
#

A task always needs to finish so if it has no way out itโ€™ll get stuck

#

The other issue is your move is failing so youโ€™ll need to test your goal location, nav mesh etc to find out why

tiny sinew
dense owl
tiny sinew
#

i keep in mind
Other than that, does it have something to do about the perf?

uneven cloud
fathom sun
uneven cloud
fathom sun
#

As I understand, it would generate the path to check whether the thing is reachable, and then, when I'll try to move to, it'll generate yet another one

uneven cloud
fathom sun
uneven cloud
fathom sun
#

I was wondering whether it's possible to do something similar, but on the AI's path following component, and store it there, so that the next MoveTo would use that (obviously if the destination is the same)

uneven cloud
fathom sun
fathom sun
# uneven cloud Asking if a destination is reachable is TestPath. I do not understand why would...

Asking if a destination is reachable is TestPath

TestPath? What do you mean?

I do not understand why would want to get a path and sometime later actually move to it, as it'll cause bugs.

I'm using coroutines to call the move to, and before that I would like to do different things depending on the reachability. So anytime I call MoveTo, the code after that doesn't run until MoveTo finishes

uneven cloud
fathom sun
#

Do you mean UNavigationSystemV1::TestPathSync()?

dense owl
uneven cloud
#

Yes

fathom sun
# dense owl What happens if something blocks your path while youโ€™re busy doing whatever ?

AI is already capable of handling bumping. If it bumps into its alike, it'll switch to another state, cancelling the previous move to, and try to walk around the bumped another AI. If it bumps into player, it'll get some aggro. If it gets stuck somewhere, there are some checks on tick that check its speed, so that it tries to jump some direction to get unstuck. If it even that doesn't help, it'll try to change the destination. If nothing helps for long enough (like 30 seconds), it'll suicide ๐Ÿ™‚

#

The game has a lot of AI characters (more than hundreds), so killing those that are stuck doesn't make much difference

dense owl
uneven cloud
#

TestPath is pretty cheap. I don't recommend doing hundreds of them in a frame, but it's significantly cheaper than finding a path especially if you use hierarchical mode. It's not finding the BEST path it's saying there is A path.

fathom sun
uneven cloud
fathom sun
# dense owl My point was why save the path at all, and not just check if reachable, do your ...

Initially I was wondering whether it's possible to check the reachabilty and do the move to without re-creating the same path twice losing perfomance (and since there are a lot of characters, it would be considerable). But, as Luthage has said, I can use TestPath that will do the thing relatively cheap, so I'll try to go with that. Still, I would like to achieve the initial idea. If TestPath will turn out to not take that much performance, I'll just end up using that

#

Which PathFindingMode should I be using in the TestPath? Among Regular and Hierarchical the first one seems to be cheaper

uneven cloud
#

Hierarchical is cheaper

fathom sun
#

Oh, all right, thanks

uneven cloud
#

You're welcome.

tranquil ice
#

what can cause a delay when I spawn a third enemy which uses behaviour tree? the glitch is when it's spawned it chases me not right when it was spawned but 1 sec later, at the mean time two first spawned enemies run towards me as they were spawned.

#

and after those two, each enemy has a delay when is spawned and only right after that it starts to chase

#

the sight perception causes the delay I don't' know why ๐Ÿ˜ฆ

thick gorge
#

I made a BT that has characters pick random nodes, walk to them, idle, then walk to another. It works on the characters I have placed in the level, but when I spawn the same character at runtime, he just stands in the spawn spot idling.

Is there some step needed to initialize/activate a BT at spawn?

harsh storm
#

How are you doing it with the ones placed in the world?

#

At some point you're telling them to run the BT - where is that code?

thick gorge
harsh storm
#

It's most likely the same class, no?

#

Just how are you running the BT?

#

Is it on possession?

#

Make sure the character gets auto possessed on spawn as well. It's a setting in the character.

#

Near where you select the controller class

thick gorge
#

Got it. I am making progress, I found where the BT is being run.

harsh storm
#

And where is that?

thick gorge
#

Looks like a separate BP. I put this together using a tutorial without understanding how all the parts work.

#

I'm adding some Print Strings to figure out which parts are executing when. But I do see the Run Behavior Tree node, so I understand that is key to making sure that is happening on placed, and spawned characters. Thanks!

thick gorge
#

Hmmm, I'm seeing a setting that might be the issue Pawn > Auto Possess AI "Placed in World" vs "Spawned"

#

@harsh storm That's the issue I was having. Pawn > Auto Posses AI was set to "Placed in World." Changing it to "Placed in World or Spawned" fixed it. Wow, such a literal option. UE5 has so many options for built in solutions. ๐Ÿ˜… (only took an hour to find)

thick gorge
#

Thanks a bunch Duroxxigar!

thick gorge
fickle vault
keen crow
fickle vault
keen crow
#

is there anything stopping you from just placing a navmesh bounds volume on the map?

wary ivy
fickle vault
#

So basically, if I use BT to get AI to move, I won't need navmesh. But if I use AI to Move, i'll need navmesh?

ivory rune
#

If you wanna AI to move to some place by path finding.

keen crow
fickle vault
#

SVO?

keen crow
#

sparse voxel octree

fickle vault
#

ah

keen crow
#

not goida

fickle vault
#

In the end, navmesh is a hassle

#

but it is also the easiest option atm

#

The thing is, i have this minion ability and I want it to be able to move on its own

#

best if no need navmesh

young plank
#

Hi, I'm wondering what's the best way to implement an event-based decorator. In broad strokes, the algorithm looks something like this:

  1. Start listening on the external event on OnBecomeRelevant call.
  2. Once external event has fired, store EventPending flag inside NodeMemory
  3. Return state of EventPending flag inside CalculateRawConditionValue
    The main issue is there no good place to reset EventPending back to false. We have OnNodeActivation callback, but it fires only if all other conditions for node activation are met (e.g. some other decorators on this node might evaluate to false and OnNodeActivation would not be called). But without this callback it's impossible to know when to reset the flag. Technically it's possible to use CalculateRawCondition to reset the flag, but in case of successful node activation, this method is called multiple times and the return value has to stay true in order for activation to finish succefully.
    Has anyone managed to find a good way to implement something like this? I've studied UBTDecorator_GameplayTagQuery from the engine's source, but it's not exactly what I want.
misty wharf
#

BT's aren't great for events. I have something like this in mine but the value it gets is a bool in the blackboard and it has a separate task which resets it - maybe it's possible to do within a decorator itself since you can do it this way also

#

fwiw, StateTrees have support for events out of the box, but they do have a bit of a learning curve and gotchas due to nearly zero useful documentation beyond the very basics, and some odd bugs here and there (which you can work around, but in any case)

young plank
#

Well then I'm not sure how to properly structre somewhat complex behaviours. For example, If I want an actor to react to some instantaneous transient events in the world (e.g. grenade just exploded, player started an attack) I need a way for an agent to react to those things. You can't poll everything.
Problem with resetting the event from outside is you have this brief period of time where the decorator will keep returning true even though the event has been already processed. It can lead to some nasty bugs.

lyric flint
#

What are good game genres to use behaviour trees for? I feel like with most indie game scopes, it's overkill compared to HFSMs. Cause in an indie shooter or a zeldalike you only have like what, 2-3 states per enemy with clear patterns.

#

I just need to work with BTs more so I can put a game using it in my portfolio.

twilit nova
#

Hey, I have an issue with some of my agents, I think it has something to do with StateTree, sometimes they get "stuck" if you see what I mean.
If anyone knows why, I'd appreciate the help ! Thanks

keen crow
#

What's the best way to implement NPC going to some location X while keeping it's distance from it's target (player)? So far I can think of 2 approaches

  1. After I've got X, do a series of MoveTo with small paths. In BT, under some selector, have a looped sequence that runs an EQS that finds a point that is closer to X and at least N meters away from P until some decorator says that NPC is at acceptable distance to X
  2. Somehow utilize recast navmesh (perhaps override something like FRecastQueryFilter::getVirtualCost) and/or any other related entities (put navmesh modifier volume on player, consider player in crowd manager, honestly idk)
wise sluice
twilit nova
wise sluice
#

Ah sorry yes! I encountered the same issue during my test but i'm not sure how i solved it

#

At first it was because, i had an Idle state and the tree was stuck inside it since there was no MassSignal to refresh the StateTree
But here you got an AI that doesn't finish its path

sudden citrus
#

What's a reasonable way of preventing navmesh generation on top of static meshes? Say trees etc.

#

Or do we just let it happen and check for islands accordingly?

sudden citrus
wise sluice
#

I just checked the setup that I made i got the same issue @twilit nova
Some agents are just "stuck" at distance 0
The only way to solve that is to dig into the MassNavigation logic and add some kind of acceptance radius or just debug it?

twilit nova
twilit nova
#

Do you know what those numbers mean ?

wise sluice
#

Hmmm i think it is the ID of the State
Let me check

#

That's how much the state tree changed since start

twilit nova
#

Ok, I see, thanks. So they really are stuck but the question is why

wise sluice
#

If you can dig into c++ check the MassNavigationProcessor

twilit nova
#

Sadly I'm not very familiar with c++

wise sluice
#

More exactly
UMassSteerToMoveTargetProcessor

dense owl
#

Thatโ€™s a #mass thing no? ๐Ÿ™‚

twilit nova
dense owl
sand kettle
#

I'm watching this SquareEnix AI presentation https://youtu.be/BV2GTGbSjq8?si=w3nSNJqtGJUgEVwx&t=2556 . At 42:35, how come their agents don't move after they reached their destination? I tried their exact same BT and EQS setup and mine always keep moving around because obv eqs keeps recalculating the destination. Could it be some logic in their custom move to node that prevents this?

harsh storm
#

I wish I could understand Japanese - they give some really neat talks ๐Ÿ˜…

sand kettle
#

I don't understand it either but it still really helpful since they screenshot/visualise all their queries ๐Ÿ˜…

sand kettle
uneven cloud
misty gale
#

When a spot is first picked it's gonna be superior to other spots unless something drastic happens

uneven cloud
dense owl
#

Realistically if your tree bp has can ever affect nav on, that shouldnโ€™t even happen

sudden citrus
#

The base - sure

#

but someone asked me what to do if there's navmesh on leaves high up

#

like imagine you have a cube, and the cube produces a hole, but then has a poly on top.

#

my experience so far is that generally you should be more clever about querying the nav, because you will inevitably have silly islands

#

curious if there's a sane way of not generating silly islands where you can help it

brittle socket
#

I'm doing an optimisation pass on my plugin and I've realised we're losing about 3ms a frame to a small number of checks to get the closest point on the navmesh.

I'm not sure exactly what I'm looking for, but is there some knack to getting a nav location or check whether there's a valid path to a point without tanking performance (or is it known to be very expensive)?

I can imagine what calculations I'd need to do to get the same result from say a triangle mesh, and I just can't see why it'd be so expensive, unless it's doing a load of other things under the hood that I don't need it to do.

harsh storm
#

Just recently pinned too

uneven cloud
dense owl
brittle socket
uneven cloud
sudden citrus
#

pls refer to the cube example

dense owl
#

If that poly is its own separate actor, then it will have the same option. Otherwise, just do what Luthage said and use modifiers

sudden citrus
#

you can't attach a modifer to a static mesh, and we're talking about huge levels

#

Proc gen trees etc. You could say use proc gen to place nav modifiers... This isn't generally something I would be concerned with but I'm making sure my reasoning is solid

#

So tl;dr is there are tools in the engine for this, and they're not "do stuff to your static mesh to magically not be navigable", right?

sand kettle
sudden citrus
dense owl
brittle socket
misty gale
sudden citrus
dense owl
#

Who said to do something else? You were given two different solutions, pick one

#

Figured Iโ€™d give you another way to skin the cat, I would never say donโ€™t do what Luthage said if thatโ€™s what you thought

#

She empirically knows better

sudden citrus
#

1 is to separate the actor, 2 is to use modifiers, neither are that. These are plain SMs placed in the level

#

My question is basically if anyone has done the "don't let SMs generate nav on top" solution, was it neat enough to implement, do they recommend it

misty gale
#

I remember seeing a trick for a case that sounds like this

#

It was some hollow cube with an "internal cliff" so to speak where the navmesh would generate in the middle

sudden citrus
#

There's a setting in the engine to fill collision underneath a mesh to prevent that, the problem I was asked about is generating nav on top of something that shouldn't have any

misty gale
#

Perhaps that was just nav modifier really

#

Plain sm's is also their own actors(sm actors) btw

#

Generally you have a test if a point is reachable or not, which should exlude all islands (unless nav linked )

sudden citrus
#

making trees BPs is probably it if it doesn't carry a huge overhead over StaticMeshActors.

misty gale
#

It sounds a tad ludacris to me but what do i know

#

Not that i care about a cost, its probably very very cheap(free?)

#

Id expect it to only have a tiny cost during nav mesh generation

dense owl
#

Luda! ๐Ÿ˜€

misty gale
dense owl
misty gale
#

Sometimes the joke is in the misspelling of the thing ๐Ÿ˜† (row row)

#

Like automagic

dense owl
#

Accurate

sand kettle
misty gale
#

Nice

lyric flint
uneven cloud
lyric flint
#

Tbe arborist one or the flame retardant one?

deft sedge
#

ever run into issues with this? This is the last message I'm getting before engine crash atm

uneven cloud
sand kettle
#

What happens when you attach multiple generators to the query root? Does it have any use? Seems like nodes on the right never get executed anyway

harsh storm
#

I believe the 2nd will only run if the first doesn't meet the criteria or something like that

#

I think it explains it in a tooltip or the docs on EQS

#

I've just never done it before

ember river
#

Quick question, I duplicated some AI controllers and blackboard. The AIController I want to use seems to still be linked with the old blackboard. How does one change that?

harsh storm
#

Blackboards are tied to a BT asset. Unless you have a variable for a blackboard in your AIController that you made.

ember river
#

Question really is, how to I set the behavior tree to the right blackboard or vice versa

#

Is it even possible or should I just create a new one with them properly linked

harsh storm
#

In the BT editor, at the top, you can switch to the BB editor. Then you should be able to switch it there.

ember river
ember river
#

nvm, figured it out. Had to click on Root and change it

#

Thanks for answering

harsh storm
#

Yeah, I don't change it often. Forgot exactly where you changed it at. Just knew it was in there somewhere.

ember river
#

Dude, I haven't did anything AI in almost 2 years haha

#

I feel you. I learn stuff, then, move onto a different process in the project. All that old info is semi-lost

harsh storm
#

Anyone happen to know where the debug drawing stuff is for the perception debug visualizations?

uneven cloud
cosmic gull
#

I can't seem to make my AI actor follow me vertically. It follows me around just fine near the ground but when i go up in the air too much it seems to "lose sight" and just stop moving towards me. Both of us are using flyer movers and im using the AI MoveTo function with Target Actor set to my character. Any ideas what might be wrong?

dense owl
cosmic gull
#

Oh ok ty!

bitter wyvern
#

Hey so in editor, moving my navmesh works fine at runtime and it updates and everything. when I make a build and play it, the navmesh does not update ever. Anybody know anything about this? for reference the video is what is happening in editor. I change the position of the navmesh and it updates fine. when I play the packaged game build, the navmesh never moves.

uneven cloud
bitter wyvern
uneven cloud
bitter wyvern
uneven cloud
bitter wyvern
uneven cloud
bitter wyvern
uneven cloud
#

You can also look to see if it's working in a standalone play (when it opens another window), because it's easier to debug than a packaged build

bitter wyvern
#

Ok thank you for these suggestions i will try them and lyk how it goes!

uneven cloud
#

You're welcome!

bitter wyvern
# uneven cloud You're welcome!

I am calling this from a BP_Actor that i place in the scene. Also it works fine in Standalone window. I will try a debug build next.

#

ignore the extra setactorlocation lol

#

I do assign both the navmesh and recast navmesh in the details panel here, could that have something to do with it? kinda new to unreal idk if thats best practice

wraith veldt
#

Hey all, I've got an issue with a misbehaving navmesh. First a little background info: I have a procedural map generator that works by sticking rooms together. Each room is a Dynamic Level Stream that contains a Nav Mesh Bounds Volume, with generation set to runtime so that the navmeshes join together once their rooms stream in. This part works fine.

Enter the problem (image one), and the likely cause (image two). The problem room is always the start room, which is located at the world origin. The room in image two has a set of brush stairs that line up perfectly with the ghost-ramps, and the ramps only appear in maps that include the stairs room.

Updating the navmesh by opening or closing doors, adding new meshes, etc. doesn't do anything to make the ramps disappear. I'm guessing the issue has something to do with Dynamic Level Streaming leaving some kind of collision artefact but I wanted to see if anyone here's had a similar issue with brushes / streaming or has any idea how to fix it.

bitter wyvern
bitter wyvern
uneven cloud
bitter wyvern
uneven cloud
bitter wyvern
uneven cloud
bitter wyvern
uneven cloud
#

You're welcome!

gleaming star
#

yo what's good guys, i am struglling with some behavior tree stuff where my AI seems to get "stuck" on one of the tasks and i have no idea why...

disclaimer: this is multiplayer game

so

  • i have an enemy AI that roams, has AI perception, and on sight will attack, and on hearing will investigate

i want to have it so that when i attack the enemy from anywhere, the enemy immediately targets the player , but it seems that the enemy gets "stuck" on the "moveto" node, but it doesn't really make sense, as i am (to my knowledge) setting this variable of the target correctly.

i'd be happy to share any and all of the current logic if anyone may be able to assist.

i am using an AI controller and a BP for the main base enemy and then using a behavior tree and blackboard all together. it is kinda complex and confusing even to me right now but i still do think everything should be working.

the target reference is being set on "event any damage" on the enemy BP and the variable is being sent into the AI controller to change the state of the enemy to "attacking" but it seems that the "target" isn't being taken or it gets "lost" somehow.

the enemy on any damage will sometimes go towards the player that attacked it but most of the time it will randomly move to a spot and then "reset" or get "stuck" doing pretty much doing and i have no idea why, but in the Debug it is stuck on the "move to " task.

would anyone be able to assist me in finding a potential solution to this?

thx in adnvace. im about to pass out, so feel free to dm me, or write me here, i'll be fresh by the morning. ty in advance

coral mesa
#

im using floating pawn component why is it that while following player, they tend to go out of map and cant go back to navmesh?

harsh storm
raven nacelle
#

Tell me, is it possible in Unreal to configure the calculation of the navmesh path relative to the size of the object?

Is it possible to support multiple Recasts simultaneously out of the box?

dense owl
gleaming star
dense owl
celest python
#

I think rather than actor count the hierachy depth matter more

gleaming star
dense owl
harsh storm
harsh storm
#

@celest python This is with a 12 class deep hierarchy.

#

Still, pretty fast. (But also slow at the same time)

#

@dense owl You might be interested in this info as well.

#

Do note, as siliex pointed out though, this isn't taking into consideration memory concerns.

celest python
#

which CPU you have?

harsh storm
#

Ryzen 5950x

dense owl
#

Yeah I mean I donโ€™t personally think thatโ€™s a bad node to use, I just avoid recommending it to people because it ends up being misused everywhere

celest python
#

in BP its bad enough though ๐Ÿ˜„

#

that array copy will cost you

#

C++ semantics eliminate tons of overhead while BP cant

dense owl
#

Wait, this was not in bp?

celest python
#

hopefully not

#

in BP you pay for duroxx's benchmark cost + copy of 8 * 300.000 bytes with some branches inside of the reflection system

#

gets real slow

dense owl
#

Well then what was the point of this @harsh storm , I thought weโ€™re talking about the get all actors of class bp node

harsh storm
#

Because of a question in #cpp

dense owl
#

Oh

harsh storm
#

I'll spin it back up for the BP node version

dense owl
#

Yeah, I mean most things are fast in cpp ๐Ÿ˜€

harsh storm
#

@celest python @dense owl

#
void AJRealControlActor::CalculateTiming(TArray<AActor*>& TheList)
{
    StartTime = FPlatformTime::Seconds();
    TArray<AActor*> FoundActors;
    UGameplayStatics::GetAllActorsOfClass(GetWorld(), AJRealControlActor::StaticClass(), TheList);
}

void AJRealControlActor::FinishCalculation()
{
    EndTime = FPlatformTime::Seconds();
    UE_LOGFMT(LogTemp, Log, "Total actor count: {0}", GetWorld()->GetActorCount());
    UE_LOG(LogTemp, Log, TEXT("Time taken in seconds: %.6f"), EndTime - StartTime);
}
#

So I'm literally pretty much doing exactly what the GetAllNodesOfClass does now.

celest python
#

this isnt 1:1 with node

#

have a BIE and benchmark its call, and in BP use get all actors of class from that BIE's entry

#

oh nevermind

harsh storm
#

I'm literally calling the exact same method from gameplay statics

#

Which is what that node is

lunar grove
uneven cloud
uneven cloud
harsh storm
#

Editor. I know it still isn't optimal.

#

I only pinged because of our previous talk about GetAllActorsOfClass

#

I'd expect it to be better in packaged anyway.

#

.1ms in editor is quite acceptable

#

I later did one with a class hierarchy of 12 deep as well.

uneven cloud
harsh storm
#

Yeah.

#

I'll do a packaged one later today, after work.

uneven cloud
#

Profiling anything in the editor is frankly pointless.

celest python
#

BP node always go through level actors

#

If I'm not wrong

uneven cloud
#

No it doesn't

harsh storm
#

It doesn't

uneven cloud
#

The BP node eventually uses TActorIterator. Which works differently if you are in the editor vs in a packaged build.

harsh storm
#

I just threw something quick together. Heck, I used python to create all of my classes ๐Ÿ˜…

#

I'll set up a better one tonight and post the results.

gleaming star
#

would you be interested in hoping on VC to take a look? i mean, it gets stuck and break in numerous ways and AI is super compilcated when considering the character/player, the enemy BP, and the AIController

#

communicatingbetween all of them is super complicated, espcially in a replicated senario

#

it almost seems like it works for the "first" enemy but the logic "breaks" when many enemys are in play as if the AIC doesn't know who is who and doesn't know how to properly set and forget targets. like the AIC should have a specific instance for each enemy but for some reason it doesn

#

seem to work like that

dense owl
#

Sry i donโ€™t really do VC. As for the actual issue, to reiterate our story so far:
I asked you to use the debugging tools to get more details on why your move is failing .
You continued to say itโ€™s stuck.
I asked if you actually did what was suggested.
You doubled down and said yeah you did that already, how else would you know it got stuck?
I then challenged that by asking for a screenshot of the vislog.
You then proceeded to fall asleep, came back and forgot the entire conversation and now asking to hop in VC because โ€œAI is super complicatedโ€

#

Based on this, there is nothing I can do to help further, but I wish you well

gleaming star
#

lol it's so broken i have no idea how to even start to explian

#

ggs

#

it does this one time, does that another

#

im going to start over

harsh storm
#

@celest python @uneven cloud @dense owl Development packaged build. Bottom is 12 class hierarchy deep. Top is 3. Both only have one actor the represents the class in the world.

unborn sphinx
#

Why is EQS still listed as experimental? Is it not in widespread use?

harsh storm
#

Because the editor tooling isn't up to snuff according to Mieszko

unborn sphinx
#

Hmm it seems fine to me. It was definitely confusing at first but now that I know it it seems wonderful. My friend EdWordy is refusing to use EQS because it is experimental. He is struggling to get a grid of points projected onto terrain/navmesh and I feel like EQS could do it for him very easily.

dense owl
unborn sphinx
#

Lyra does so yes I do too lmao

dense owl
#

Well thatโ€™s experimental, you canโ€™t use it !

unborn sphinx
#

We are not working on the same game

#

but good point yes

dense owl
#

Ok well, your friend canโ€™t use it

unborn sphinx
#

he probably wouldn't

#

I see him struggling with ancient ue4 workflows lmao

#

not struggling actually

#

he is quite capable, moreso than me

dense owl
#

Some experimental flags have been there for a long time, only still there because the system is not considered flawless yet, but may never get a chance to get there or not for a long time

#

The experimental warning is more so there for liability purposes probably

unborn sphinx
#

Yeah like if their entry-level designers are all struggling to learn eqs (it seems super complex, scary, and foreign at firsct glance) Epic can say we never said to use it!

#

"their" being random gamestudio

royal mist
#

i just dont get how ur supposed to use EQS to navigate a grid

#

u can use simple grid generators thru EQS but the AI runs straight to the target, the grid is seemingly ignored no matter the density, unless im misunderstanding the use case

dense owl
shell mirage
#

I am looking at UBTDecorator_BlueprintBase, there's a warning at the top which discourage you to use it as a base for creating native C++ classes.
Base class for blueprint based decorator nodes. Do NOT use it for creating native c++ classes!
I am wondering why that's the case, there does not seem to be anything in there that could cause problem. All there is, is a buch of helpers to make your life in blueprint easier no?

In general why must there be a distinction between blueprint bases?

royal mist
dense owl
royal mist
#

whats the title?

dense owl
#

Unreal Engine AI with Behaviour Trees

royal mist
#

kk

#

i still think i need a grid object

#

like eqs is cool but i need selected tiles as well

#

or atleast a visual representation? idk

deft sedge
royal mist
#

my main issue is i have a grid, that i use for navigation, that doesn't conform the the landscape

#

and idk how to make it generate based upon the landscape, i tried some janky stuff to no avail

#

so i might just do away with the grid

#

idk maybe i can use eqs

deft sedge
#

@royal mist @mechdawn solved that same issue already

#

idk, why he's not in this server though

royal mist
#

wym sorry, what did he solve? the grid conforming to the landscape?

unborn sphinx
uneven cloud
gleaming star
#

i fixed issue

#

im legendary

#

figures

unborn sphinx
uneven cloud
unborn sphinx
#

Well, that is true... however they are using the AIMoveTo nodes in BP, so afaik they are using navmesh

#

Basically I believe they have a landscape, with a navmesh, static meshes etc in there. They also have a custom grid system that has grid points that are not yet conforming to their landscape. They can point and click and tell the characters to go to these points, but they just pathfind directly to the point and don't walk along grid lines. They want the character to walk along the grid lines and for the grid to conform to the landscape. I suggested EQS could at least get them points on their landscape and work from there

#

Since already using navmesh, just project points on grid. You would have to iterate along some path of your own creation to force the pathfinding to be along grid points but that shouldn't be too too hard

#

just have a goal to move to in real XYZ coords. Then project a grid of your sizing. Find the point in the cardinal direction that gets u closest to where u wanna go and move. repeat lmao

#

it seems silly though because u have to essentially build another pathfinding system on top of the previous one...

#

The more I think about this, the more I think this would be a viable solution. The grid the player sees and interacts with is totally separate, but must be conceptually linked to maintain physical consistency, with an EQS grid that you project for movement with world origin as context. somethin like that

#

if u can assure ur character stays on the "grid" by carefully only moving to other grid-spaced points, it might work to omit the world origin context and have the player move only by grid amounts

#

character rather

#

this is just a crude way to get a grid that neatly kinda conforms to the landscape

#

but actually it doesnt solve his UI issue of not having a grid that conforms to the landscape

#

lmao

royal mist
#

yeah ive been thinking hard about it and i think i wont use a grid, the choice is causing too many issues.

royal mist
#

but i think i can use eqs to solve certain distance based queries, like getting path length and such

uneven cloud
unborn sphinx
#

agreed. what is the better approach, in a few sentences?

lunar grove
# deft sedge what did you do instead?

I ended up writing some custom vision tracker. The problem I've encountered with sight sense for players is that it's cone based, while I needed that for players, that have a pyramid based FOV, with sides usually unequal (monitors are usually wide).

Can't really tell you all the details, as there's a lot of project dependent stuff going on, but essentially I registered all the actors that wanted to take part of this vision tracking process. I had the so called "observers" (players who observe) and "targets" (things being observed by players). At a certain interval, for every observer, I iterate through every target, and firstly check whether they're even in vision range, secondly I check the observer rotation relatively to target, and if they're rotated enough, I consider things in the FOV, but it be sure that the target can be seen. Finally, I launch a trace using visibility channel at the centre of the actor, because it might be behind a wall.

The solution is not perfect, as when target is too close it might be considered non-observed, as its centre is not seen (note that I check whether the actor's pelvis can be seen). There are tweaks to do depending on your project, but for my case that works fine.

dapper iron
inner zephyr
#

I am totally confused. My nav mesh is displayed correctly in edit mode but as soon as I start the PIE session it is placed much further down. It just floats in the air. What could cause that?
Weird. Can't really make out what broke it but I just created a new level, dragged the old one inside and broke it so it's not an instance anymore. Now it works fine ๐Ÿคทโ€โ™‚๏ธ. But I'll have to setup the streaming levels again ๐Ÿ˜ญ

gleaming star
#

Sometimes my enemy will know I am the target but canโ€™t get to me (or at least thinks it canโ€™t get to me).

How can I make the enemy a bit โ€œsmarterโ€ in knowing that it can just go up / down a hill or find a route to get to me? This error still occurs with a nav mesh that covers the entire map ect

shell mirage
#

Oh they're structs, no wonder I couldn't find them via the class creation menu