#gameplay-ai

1 messages · Page 27 of 1

sacred shale
#

Is Detour Crowd AI Controller different from if I were to just initialize my path following component with the subclass Crowd Following Component? the logic seems very inconsistent, I created a new AI Controller which just derives from AIController but I cannot derive from DetourCrowdAIController

harsh storm
#

DetourCrowdAIController isn't exported from the AIModule. So you can't derive from it in C++. But if you look at it, it is literally just the AIController with a different component passed in the initializer

#

Really no additional code.

#

So you can just copy that.

sacred shale
#

I'm just trying to figure out where either the crowd following component or AI Controller recalculates the direction vector relative to the crowd following component's velocity, or some other thing. Looking at the AI controller's cpp tick it only updates the control rotation and not the direction vector if it's moving

harsh storm
#

¯_(ツ)_/¯

#

I haven't actually looked at the pathfinding stuff.

sacred shale
#

not a lot of this is commented or documented very well lol, making it a big pain in the ass 🙂

sacred shale
#

so as far as I can tell the Path Following Component's tick updates the pathfinding and the CrowdManager (which registers every Crowd Following Component on every character associated with a Crowd Following Component) updates each of the crowd following component's characters' crowd velocities to determine where to move

celest python
#

Pathfollowing is the wrapper around it

#

MoveTo:

  • Makes a pathfinding request, if succeeds, it routes the found path to PathFollowingComponent
  • PathFollowingComponents keeps its own state, checks if pawn reached the goal etc
  • MoveTo listens to the state and other variables of the BT/BrainComponent to manipulate the behavior of the task (not the movement), so it can cancel itself or re-trigger path etc
    PathFollowingComponent:
  • If there is a valid path to follow, it does bunch of vector math to follow the path along point A to point B, point A being current location of the pawn and point B is the next path point from the path array
  • On FollowPathSegment, it moves the pawn by adding move input to its movement component, it also lets you manipulate the direction via a delegate but it does not exist in CrowdController
#

real crowd stuff happens at UCrowdManager

sacred shale
# celest python real crowd stuff happens at `UCrowdManager`

Is the crowd manager's tick dependent on the path following component / move to? I guess I'm trying to figure out how I can take my existing direction vector and manipulate it based on information from the crowd following component. But it looks like the crowd following component is only ever made to interact with the crowd manager and generally isn't used outside of that since the crowd manager keeps track of all of the information relative to each crowd following component

#

And if I'd want the information for how I should redirect my AI's direction vector it sounds like I would need to get information from the crowd manager for each crowd following component

#

This would be so much easier if I didn't have custom locomotion logic instead of using move to 🙂

uneven cloud
#

ApplyCrowdAgentVelocity is the function that you are looking for.

#

You need to build with the debug editor config to get breakpoints to work on editor files. If no breakpoints are getting hit, then your setup is wrong.

celest python
#

At least not via PFC

#

I didnt read the Manager class' code so I dont know about it

uneven cloud
celest python
uneven cloud
#

First rule of working with UE is don't fight the engine. There is usually an easy way to do what you want to do, you just need to find it.

sacred shale
#

On tick

uneven cloud
sacred shale
#

thanks, maybe I'll end up creating my own crowd following component and override ApplyCrowdAgentVelocity

celest python
sacred shale
# celest python What are you trying to achieve by the way?

I'm trying to achieve the same thing as the default Detour Crowd AI controller logic, except I have custom locomotion logic which isn't using Move To or character movement. I instead have a separate component for all that stuff that handles all that move input through curves and animations. Basically I'm trying to find a way to convert the existing detour functionality into my custom locomotion system

#

actually hm, I'm not sure if calling an overridden ApplyCrowdAgentVelocity would even work since it would still be dependent on the crowd manager to listen for all that, which would probably require Move To

#

I'll try anyways 🤷‍♂️ 🙂

uneven cloud
celest python
#

Something is wrong somewhere but if your end goal is to manipulate the FVector direction that detour provides you just need to override ApplyCrowdAgentVelocity and use your own logic to call RequestPathMove or RequestDirectMove from movement component

#

you seem overthinking or overengineering something or both

sacred shale
#

I didn't end up creating this custom locomotion system, but right now my project's pretty tight and would require a lot of time to refactor my entire system into character movement using Move Tos

#

but honestly might be worth it given the amount of time I've spent banging my head against a wall over this specific problem

dense owl
#

You are currently on fire.

celest python
#

how come your system is not using MoveTo

#

its just a fancy wrapper to call MoveTo() in pathfollowing component (the BTTask)

#

are you not using pathfollowing component at all?

sacred shale
#

because my characters' movements aren't using character movement, so using Move To would just cause them to slide along the ground, the entire animation blueprint is set up with all this custom locomotion logic rather than using traditional character movement

sacred shale
celest python
#

so you are just trying to register your own system to detour?

#

so you can make it provide you velocity

sacred shale
#

nah I'm trying to use the existing detour system in Unreal but it seems more trouble than its worth

#

I've spent a couple days on this and it's been drivin me nuts, so much of the actual movement re-calculation is dependent on stuff thats already built for me

#

I have this already working in the sample third person project on the official unreal docs which specifically tutorializes how to use all this stuff

celest python
#

it doesnt matter which movement component you are using as long as PFC provides a valid value

#

(Detour <-> PFC) -> movement component

uneven cloud
#

It sounds like he didn't make a new movement component. Just made a new component and ignores the movement component. Which the movement component is likely still doing expensive checks.

sacred shale
#

I didn't make this specific locomotion logic lol

#

I would just use what's given to me if I could 😄

celest python
#

what do you have right now? from which base classes derive from?

sacred shale
celest python
#

literally an UActorComponent?

sacred shale
#

yea

#

I gtg figure this out tho I'm wasting more time complaining than actually making progress lol

#

but thanks for the help sorry that my problem seems pretty vague without specific examples and stuff

#

I can't show a lot of code specifically bc of NDA

celest python
# sacred shale I gtg figure this out tho I'm wasting more time complaining than actually making...

detour is abstract so if you provide info to it, it will return you a FVector that represents current direction agent should follow
UCrowdFollowingComponent is responsible of registering its own agent data to crowd manager, and crowd manager calls UCrowdFollowingComponent's ApplyCrowdAgentVelocity
create a new manager class based on crowd manager, see how it registers agents, do the same for your own actor component

#

CrowdManager is specific to UCrowdFollowingComponent but actual detour is not

#

otherwise prefer the sane way, refactor to proper classes 😄

uneven cloud
#

It's not vague. You just are trying to rewrite far more than you need to. And fighting the engine.

sacred shale
#

I'm not trying to rewrite anything, just trying to learn how this all works for my specific application

celest python
#

problem is once you get rid of gameplayframework elements you end up rewrite a lot of stuff

#

you got rid of two core things to move something

#

pathfollowing comp and movementcomp

#

those are hundreds of lines in total

#

and each function serves a purpose

#

what worse is you're trying to interop something something specifically written to work with those which increases your burden

sacred shale
#

again I didn't write any of this custom locomotion logic lol

celest python
#

I know but just trying to make the fire you're in more obvious to you 😄

sacred shale
#

ye I know I'm on fire lol

celest python
#

dont solve the tech debt with more tech debt

uneven cloud
#

The movement component doesn't even need to be a character movement component. Just a nav movement component, which is really light weight.

crystal hatch
sacred shale
#

thanks guys. sorry I made a bigger deal of this than I should. I guess I need to learn when to draw a line in the sand when it comes to overcomplicating problems that can just be solved by doing it the easy way

dense owl
#

The guy who made your custom locomotion is a bastard 😀

uneven cloud
#

It's so common, even in big studios, to rewrite large parts of the engine because of the "not built here" mentality. It always causes so many problems.

crystal hatch
harsh storm
crystal hatch
#

Epic used to follow "not built here" policy for ages. It started going away with UE4, but we still have some of that. I'm actively fighting it!

celest python
sacred shale
#

lol

harsh storm
dense owl
#

More of an ego problem

crystal hatch
uneven cloud
harsh storm
#

I still like putting stuff in Actors!

crystal hatch
harsh storm
#

Mass is too volitile for me. I know that old is what makes games. Not new and shiney!

celest python
#

I enjoy mass but get lost in codebase a lot blobsweat

Complexity should come from composition of simple things rather than monolithic complex things. Howgh!
this is the exact definition of mass

dense owl
#

Hehehe, I wonder who authored that 🙃

harsh storm
#

I'll let the masochists figure it all out, then come in and reap the benefits 😈

crystal hatch
harsh storm
#

How's mass replication comin' along? And does it have any tie ins with Iris?

harsh storm
#

I don't know if it is said enough or not, but I do most certainly appreciate you Mieszko!

sacred shale
#

what a nice community lol

crystal hatch
crystal hatch
harsh storm
#

Ah - so Iris will aid in its development. That's actually kind of exciting.

sacred shale
#

damn y'all must be canadian too with the "eh"s 👀

celest python
celest python
harsh storm
#

There isn't much actual concrete info on Iris yet. So I'd imagine it's still a bit in the design phase for Mass Replication

celest python
#

ECS allows tons of cool stuff like better rollbacking and maybe even slight possibility of implementing lockstep especially with reflection system but I guess it's mostly relying on Iris's internal architecture

celest python
harsh storm
#

I'm still excited to actually see Iris for just the high-level systems.

#

Let alone mass benefits 😅

crystal hatch
silent hamlet
#

I struggle understanding what is mass built for. What are the use cases where I'd want/better make use of it?

harsh storm
#

Zombies. The answer is always zombies.

crystal hatch
#

if you want regular FPS with 20-30 AI opponents you don't need Mass

harsh storm
#

Unless you want those 20-30 AI to go brrr

silent hamlet
#

Ok so it's definitely going in the direction of supporting big worlds.

harsh storm
#

You can check out flecs to get an idea. There is even a pretty simple integration for UE out there.

silent hamlet
#

I am a solo dev working on a small project. I'll keep looking at mass from the right distance 😁

celest python
# silent hamlet I struggle understanding what is mass built for. What are the use cases where I'...

Workflow wise difference TL;DR explanation:

  • It's an ECS framework, an alternative to default Actor/Component system (but still interops with it). Actors and components rely on object oriented programming while Mass/ECS focuses on data oriented programming
  • DoD has advantages of easier parallelism, better CPU cache coherency etc. which makes it naturally faster than OOP (you can watch Mike Acton's 2015 talk about data oriented programming)
  • Entity is a collection of Components which are just structs with data only and Systems execute entities (runs the code)
harsh storm
#

No shame in that!

#

It would've been nice if Mass didn't change the lingo though 😭

idle crystal
#

Hey, I have ran into a problem, the problem is that my character cant move to the next targetpoint if its on the right side of the character. If its not it has no problem moving to it, a tried debugging (in my bp i still use the debugs) but i cant come to a conclusion. I tried to rotate it 180° so the target point is relatievely on the left but it doesnt work, even if it would would it wouldnt be my final solution. I would really appreciate some help. I used a yt video for this but it simply cant turn right. I did it over several times but it still doesnt work. https://www.youtube.com/watch?v=SfnvbzfGZnE

Hello everyone. This is a quick Tutorial, how to create a simple NPC System.
I used the Version 4.27.2 of the Unreal Engine for this one.

Discord: https://discord.gg/exuHzHjahe
Level: https://www.unrealengine.com/marketplace/en-US/product/modular-houses
State Machine: https://youtu.be/u4avH99F6FA
Animations: https://www.mixamo.com/#/?page=1&ty...

▶ Play video
harsh storm
#

Now - if we could get the transform updates to go brrr 😅

crystal hatch
harsh storm
crystal hatch
harsh storm
#

While you're here Mieszko - what is one thing you wish was different about the BT in UE? 😈

crystal hatch
#

I wish the developer had time to work on it more before he was dragged away to other projects 😉

harsh storm
#

It's no longer the hotness 😭

crystal hatch
#

but seriously - local variables. It's something I even prototyped - a BT node could declare variables that could be utilized in child nodes, and the vars would get auto reset on node's "cease being relevant"

#

a kind of extention of BB

celest python
#

Wouldnt it replace the blackboards directly?

crystal hatch
#

no, a suplementation of BB

#

BBs store global state, but sometimes you just need something local to a given branch

celest python
#

Ah, I see, BT variables are for execution logic rather than AI state

harsh storm
#

I've seen some bring up that they don't like that the BB isn't shared between all the BT users - was there any particular reason for this design decision?

crystal hatch
harsh storm
#

I know the asset itself is shared, but the key values are unique to the agent.

haughty coral
#

there is a per key checkbox you can enable to make them shared

harsh storm
#

...

#

How did I miss that?

haughty coral
#

Instance Synced

crystal hatch
silent hamlet
#

BT included in engine is great but I find it way more comfortable programming ai with state trees at least for standard idle patrol chase cases. It feels just more natural to think of it as state machine

harsh storm
silent hamlet
#

That was a great addition in UE 5 that nobody basically spoke about

harsh storm
#

Classic Unreal though. It's just a checkbox away 🤣

crystal hatch
harsh storm
silent hamlet
#

Oh here yes but I mean in official communication channels. Some brief mention is all

harsh storm
#

Well - because it isn't glamorous

#

Not like Nanite/Lumen

silent hamlet
#

I guess lumen and nanite had to steal the stage

#

Yea

harsh storm
#

Listen to the sales pitch

celest python
#

I'd like values in BB to be regular FProperty values instead of UBlackboardKey's and has property extension support instead of FBlackboardKeySelectors, would solve majority of my issues

harsh storm
#

"We have fully dynamic, real time global illumantion AND unlimited polycount"
vs
"We have a fancy state machine"

#

Which is going to garner more hype?

#

Let's be honest here.

crystal hatch
harsh storm
#

What is under the belly of ST is pretty neat though 😅

celest python
#

its even referred as "UnrealScript variable" in source code 😄

haughty coral
celest python
#

yeah was UProperty back at the day

silent hamlet
crystal hatch
harsh storm
celest python
#

Did API also change with new FProperty system or was it same as UProperty?

harsh storm
#

Also found it kind of annoying on how you update data in the ST at runtime. Never even figured out if the way I was doing it was "correct" 😅

celest python
#

turns out it wasnt

haughty coral
#

How I see it is that in the beginning the engine was just growing, there were even no plugins and every team was inventing what they needed for their feature. Nowadays it is a bit different when we are getting more standardized reusable stuff like property binding, instanced structures, MVVM and in general a more consistent experience between all the systems. I am sure BTs could be significantly different if it was made from scratch nowadays.

celest python
silent hamlet
celest python
#

Mass was my favorite because it directly provides an alternative for gameplayframework itself

harsh storm
#

I still love the GameplayFramework

celest python
#

If I could have more than 3 brain cells maybe I could figure out how DOOM Eternal does that "no game thread" thing and I could not love gameplayframework again

#

but since I dont have any choice I love it too 😄

harsh storm
#

I don't love it out of necessity though. I love it 'cause it's generally pleasant to use for a majority of games that I like to make.

celest python
#

being too used to regular workflow of actors provide is a huge selling point for me

celest python
harsh storm
#

I know. I enjoy ECS as well to be honest.

#

But ECS is still quite young in Unreal. And I want to make games.

celest python
#

Cant say I used enough ECS to love it, I just know what I dont like in OOP

#

but I often find myself in a situation where I thank god virtuals and inheritance exists

#

I guess I'd prefer a scenario where low-level side of things go brr with ECS and scripting doesnt even care about yolo with OOP

silent hamlet
#

The gameplay framework is perfect for small projects. Having modular systems is great but I think they become more and more useful as projects start to scale. I have a background in backend web development where modular architecture has taken over but i feel like the complexity of managing these systems has increased tenfold. Sometimes the benefits justify the effort. Sometimes the don't. And I feel the same risk exists in game development

celest python
#

I dont think gameplayframework is going anywhere anyway 😄

harsh storm
#

GF is fine for bigger projects as well.

#

A lot of games these days don't actually have a lot of moving actors anyway.

harsh storm
#

Not to mention, they're also doin' work on multithreading animations. So anims go brrr

celest python
#

I finally found a way to both get immediate physics callbacks and run logic on another thread for MoveComponentImpl btw

#

and its not even hacky ( FSimCallbackOutput praisethesun )

#

cant wait to shoot myself on the foot again while trying

fossil wraith
#

Does EQS based AI need nav mesh volume still?

dense owl
#

Yes

uneven cloud
uneven cloud
mossy yew
#

Hi guys, does AIPerception have debug lines in editor similar to pawnsensing?

#

the only thing I found is to press ' at runtime

dense owl
#

Also, not sure you should be using both PawnSensing and AIPerception at the same time

mossy yew
mossy yew
#

was wondering if it's possible to see those debug lines when editing

#

though now I run into a problem, the detail panel of AI Perception is gone

dense owl
#

window -> details

mossy yew
#

usually when this happens, restarting or renaming the name works

#

yea it's checked

#

I can see other component's detail

#

ah

#

had to comment it out then compile then uncomment it then compile

#

thx

dense owl
#

I haven't played with PawnSensing, but if you use EQS, it can draw pathing and hits for you at runtime

#

I’m def using wrong terminology here, but if you watch the first pinned video you’ll understand

mossy yew
#

since you mentioned EQS, I'd like to ask do we usually use EQS or AI Perception with BehaviorTree? or both?

dense owl
mossy yew
rigid portal
#

Hiya! How would I go about having my AI robot climb a wall? is there a nav mesh way, or do I have to basically play an animation ?

celest python
spring inlet
#

what would be a good approach to run a (dynamic picked) task (executed from BP) on top of a running BT?

celest python
#

if I understood correctly thats not the ideal way to execute BT (you shouldnt make BT to jump arbitrary nodes externally)

#

can you elaborate more

tawdry zephyr
#

Hi guys, I'm testing collision with AI in multiplayer with ~200ms latency because this is a non-competitive co-op game when played in multiplayer so would like to support that much. For this I made a third person template and duplicated the character, made it walk 100cm/s, and added AIMoveTo random point in radius. Not much else besides debug stuff (ping widget & p.netshowcorrections 1). The second video shows with 425cm/s speed which is more realistic for a game to use, notice how it becomes truly egregious, even more so with larger capsule radius.

First off I work with Character/CMC and prediction all day every day so I understand how/why this happens. But it did seem quite extreme so I'm wondering if there is actually anything I can do to assist or improve it. Basically, when the player character moves into the path of an AI controlled character the desync can become truly extreme and will thoroughly desync.

As an oceanic gamer (NZ) I'm used to the uphill battle of playing games with this amount of latency and I don't think it ever becomes this extreme even in competitive games when involving other players, but I do suppose I never had the opportunity to test with AI. I don't have a secondary player to test with at the moment but I'll get my sister to help when she visits on Sat.

tawdry zephyr
#

<@&213101288538374145>

#

Probably not quite what they had in mind...

pallid mica
#

Yop

#

Ban them manually

#

They spammed it everywhere.

celest python
#

and you shouldnt support beyond like 150ms or something even for co op, maybe 200ms at max

#

its too high to recover

#

from what I can see problem occurs because AI is pushing the player and since this hapens in server, client is not aware of its new position yet

#

so server ends up correcting

#

You might consider making AIs not push the player

tawdry zephyr
# celest python I think some games either steer away from player or wait player to pass and stop...

This is actually what I just arrived at. I made the player character affect dynamic navmesh - actually attached it under my blob shadow component because it sticks to the floor so it still works when jumping (reserving their landing space, effectively). Combining that with disabling collisions between the two is a good start. I have a dither effect already for characters (AA faking transparency for hiding meshes without the cost), so if two players overlap their characters I can just dither the non-local character partially.

celest python
#

player character affect dynamic navmes
thats generally discouraged

tawdry zephyr
#

Without that the player can walk inside AI - I still plan to have AI collide with player while idle

patent hornet
#

if you're using GAS, have the AI give the player gameplay ability that pushes the player back

#

rather then doing it by force

tawdry zephyr
#

Ooh that's a good one

patent hornet
#

it should avoid corrections

pine steeple
#

i just stopped the ai from colliding with the player pawns

#

🤷

tawdry zephyr
#

In my case I do need enemy AI to body-block players from just walking through them

#

So I will disable collisions for non-enemy AI and then try the GAS solution for hostile AI

#

Well, I can disable collisions for hostile AI too, and the GAS solution will mimic it

celest python
#

prone to bugs for AI movement and relatively expensive

spring inlet
#

so i would like to execute some task, which runs until it's landed and shuts the motor off

#

but i don't want to clutter up the BT with small things like this

tawdry zephyr
celest python
#

run the task

#

when its finished activate again

spring inlet
#

but what kind of task should i make?

#

i've seen AITask in cpp, would still like something which can be implemented in BP

celest python
#

so its a complex thing and should be decided properly based on your design

#

issue comes from you cant jump to random nodes in BT

#

you can only prioritize behaviors with BB values and selectors

#

so you have multiple options

spring inlet
#

and i don't really want it in the BT aswell

crystal hatch
spring inlet
#

yea there's an article which also says to not try to implement a state machine in BT

#

so i try to avoid it 😄

celest python
#

and after they're finished they are popped from stack

#

and default behavior is running

#

This is a generic way I thought a while ago

#

a simpler thing would be just locking the braincomponent in somewhere

#

and running the logic whereever you want until its finished

spring inlet
#

so just something like a latent action / coroutine for the task?

#

that's the article 😄

celest python
#

(I'm so ashamed of how terribly I wrote that)

spring inlet
#

wait you really did?

celest python
#

yes

#

I'll remove it later and re-write in my blog one day though

spring inlet
#

nice, thanks for that overview 👍

#

well it's a good overview to not run into a bad design pattern

celest python
#

Yep but my 3 brain cells junior brain misunderstood some things about AIModule's design choices back then and quite shitposted about it 😅

celest python
# spring inlet so just something like a latent action / coroutine for the task?

Here's what I did

  • FBehaviorTask with virtual function Execute()
  • TArray<FBehaviorTask> for LIFO stack logic
  • UBrainComponent derivative class, whenever a new FBehaviorTask is added, it runs it, newly added tasks can decide if current ones should be cancelled or not
  • UBrainComponent derivative also listens for end/start events of FBehaviorTasks, if any is ended pops the LIFO array and if nothing left in the array continues executing the BT, otherwise switches to next prior task and ticks it
#

Execute either runs a BT or triggers a GAS ability, each task type has its own derivative of FBehaviorTask

spring inlet
#

could this also be extended with a 2nd array where i can push tasks which are allowed to run in parallel to the BT?

#

or is deactivating the BrainComponent necessary to run other tasks?

celest python
#

so you can prevent conflicts of tasks

#

UBrainComponent derivative here means UBehaviorTreeComponent btw

#

BTComp is a brain component

spring inlet
#

guess the FBehaviorTask is a custom struct!?

celest python
#

yep

#

everything in the list is custom

#

if you want to reference them in editor use a uobject though not struct

#

BTs doesnt support instanced structs too yet

spring inlet
#

i'm thinking of just using the existing "system" of UBTTask_BlueprintBase

#

that way the tasks could be implemented in BP and i could use them for BT and my custom execution thing

celest python
#

i think they are meant to run on BTs, though, prefer UAITask instead

#

and see how MoveTo node is exposed to BPs*

spring inlet
#

thing is that UAITask isn't Blueprintable

#

so i would have to write every little task in cpp

celest python
#

then I'd say create a new UObject, UBTTask_BlueprintBase is BT dependant

spring inlet
#

well it runs on the BrainComponent after all?!

#

i don't think that it's much aware of the outer flow tree

celest python
#

UBTTask_BlueprintBase is the UBTTask itself

#

you wont be able to execute it outside of BT

#

BrainComponent is something different, its a generic AI thingy that runs AI logic for AIController

#

StateTree also runs on it

#

you're looking for something to lock/disable BrainComponent and run your external logic until its done or do it with parallel nodes in BT

#

if you're okay with having your secondary/blocking tasks as BTs you can prefer Run Behavior Dynamic too, but if you want to queue secondary tasks, want them to execute different things etc. create a new object class and poll them on parallel

tawdry zephyr
spring inlet
#

so digging a bit through the source... UAITask seems to be supposed to be used with UGameplayTasksComponent

#

i can't believe that there's no engine feature for something like this

#

this seems to be quite common requirement for AI stuff, or not?

verbal violet
#

Hello ppl, is there any easy way to check is my character on some specific nav area? I have characters whom is forbidden to use some nav areas, so I need check if they accidentally drop on forbidden area and than do something

twilit folio
#

Hello everyone, simple questiom, how can I make this character walk through the middle of the nav mesh instead of the side?

radiant path
ocean wren
celest python
#

or interpolate the path direction from path following component

#

FMath::CubicInterpCR

twilit folio
#

I'm using Blueprints for this.

celest python
#

then you're very limited with options, none of two is exposed to BPs

harsh storm
#

(as opposed to just snapping around)

celest python
#

yes

#

wouldn't mind some resources covering this
sadly there arent much

#

but I think GPT4 can help

#

GPT3.5 can partially implement the math part

#

4 would kill it

#

TL;DR get Path from path following comp, bind the PostProcessMove delegate, calculate new interpolated direction with FMath::CubicInterpCR

#

T1, T2, T3, T4 are path point FVectors

#

Exponent can be around 0.5 and 1.5 i guess, depending on path lenght you can lerp

still crypt
#

🤔 If you just interpolate the direction how do you avoid errors compounding over a few turns getting you off path?

celest python
#

i dont know how it works but it magically never went out of the path for me

#

generated "spline-ish" path was always inside of the navmesh

still crypt
#

Hm, fair enough

celest python
#

my 3 brain cells are not enough to explain nor understand why it works

#

math scares me

#

but i guess its about tangents being calculated properly

ocean wren
#

Yeah, its about the continuity of the spline.. it depends on which spline you use, there's a nice article about it by Natalie Taterchunk from AMD or NVIDIA If I recall

#

Basically, look at the spline maths implementation and you'll find one where you give it the same tangents and it maintains continuous values at each spline point

#

Typically, I'd look at the string pulling, figure out where its doing the pulling (funnel algorithm) and find the pre-pulled points and do a spline between those through the pulled point (i.e. only pull the corner point and use a spline position relative to that with some clearance offset)

#

Hard to explain without a whiteboard

#

You can also watch Freya Holmer? videos about splines for info

#

On an off-topic note.. I really shouldn't watch korean street food cooking videos 🙂 hahaha

#

I don't know what any of it is, but I want its deep fried goodness! 🙂

fossil wraith
#

The first point in the map works but the others dont

#

the move too is being triggered but character doesnt move

#

NEVER MIND I FIXED IT

still crypt
#

I want to increase the cost of nodes close to nav-mesh edges, what is a reasonable way to go about this without having to rip out too much engine code?

hard obsidian
#

I have Enemy AI which can detect players and Can attack when close to the player but when I play attack anim montage it rotates the player in a different direction. But If I set the anim montage to none it works fine no rotation happens.

celest python
#

You can generate a spline along the edges in editor time and build nav modifier

#

but you also have to ensure modifier's radius wont block whole path

#

if nav corridor is too narrow

still crypt
celest python
#

More spline points and smaller boxes 😄

still crypt
#

Not sure if that would be a very scalable solution 😓

celest python
#

navmesh is baked

#

once its generated

celest python
#

either box or not

#

its actually a rectangle not directly a box

still crypt
# celest python navmesh is baked

True, I suppose, but not if you want dynamic generation to handle stuff like breakables or whatever. Not sure if anything is cached if your modifiers are static but it still feels like a pretty awkward approach

celest python
#

On yeah that would definitely explode your cpu

harsh horizon
#

not sure if this belongs here but I'm trying to get my enemy class to move from A to B (for now just a straight line, later I want to change it to a spline) but for some reason they're just refusing to move. I have a nav mesh volume over my scene and I have an AI MoveTo node but it just refuses to move there

#

I also have this set so I know it's not that

uneven cloud
harsh horizon
uneven cloud
ocean wren
# still crypt I want to increase the cost of nodes close to nav-mesh edges, what is a reasonab...

You can alter the cost by subclassing one of the Get... Cost functions. Can't remember the exact name. GetNavPolyCost or something similar. Basically, it gives you a navpoly which you can then query the nav system to get the edges of the poly and each edge has two navpoly id's if its an internal edge and only one if it hasn't. So you can just increase the cost of the navpoly traversal by the number of edges with only one connected navpoly. I think the starting point is GetPathCost or something.. follow the flow of that.

uneven cloud
# harsh horizon Nope.

When are you calling move to? Is there any other logging? Turn off all categories other than the navigation ones to make it easier to read.

still crypt
finite gyro
#

Can anyone please explain to me why when I spawn in a character (which has auto possess by AI when spawned) and immediately possess it by the player controller, there is still its original AI controller hanging around? Now there are two controllers (AI and player) but only one character, i dont understand this

dense owl
finite gyro
#

i did this

#

doesnt work

#

even destroying it doesnt work

dense owl
#

Iirc I had a similar situation, and I was advised against trying to switch the character’s controller at runtime. Rather just spawn it with the right controller to begin with. I’ll check to see what I ended up doing

finite gyro
#

but the nature of the game requires changing the controller at runtime. I was making a similar project back in 4.27 and i had no issue with this, i could just switch between characters seamlessly and the ones i didnt control were automatically taken over by ai

#

the difference here though is that im using AI perception, and like this the unused AI controller keeps sensing everything even though its not controlling anything

dense owl
#

Then maybe destroy the perception component ?

finite gyro
#

doesnt work

#

im not sure if im dumb or if this is UE5 being UE5 lol

harsh storm
#

Controller is an actor. It still exists in the world. If you have the perception stuff on the controller, this makes sense to me.

#

Also - I don't think unpossessing destroys the controller. So it sticking around after unpossession, also makes sense.

finite gyro
#

i have to have it on the controller because damage perception sense doesnt work on a pawn for some reason

#

i just need to get rid of it somehow after i unpossess it

harsh storm
#

Just destroy it

dense owl
#

yeah, makes sense, since it looks like I ended up spawning the AICon, spawning the actor, and then possessing the actor with it, in my case

finite gyro
#

ah so you dont have auto possess then

harsh storm
#

Don't have auto possess if you're just going to unpossess right after spawning

finite gyro
#

but im gonna have multiple characters, im just gonna possess one with the player

#

i tried this and its still there

dense owl
#

how are you getting that player controller reference, where is this code located?

finite gyro
#

im testing this in gamemodebase now

#

this is before it

harsh storm
#

That Get PC is going to be bad once you have more than one player.

finite gyro
#

like the player possession works fine, its just that the AI controller is still there

finite gyro
harsh storm
#

Are you sure the AI Controller is valid

finite gyro
#

ah yeah, its not

#

but idk why

#

because if i dont possess it by the player controller, it runs around with the AI controller

#

okay im really lost now lol

#

like this its valid, but it still doesnt get destroyed

#

even this doesnt work on the pawn

finite gyro
uneven cloud
dense owl
ebon apex
#

Hey guys! Is it somehow possible to use Launch Actor or set velocity of actor who is possessed by AI without stopping brain?

#

In my current setup I have to call Stop Logic in On Launched event handler, and give attack command in On Landed but I would really like to get rid of this

#

Without this, launch actor or setting velocity just do nothing

crystal hatch
harsh storm
#

@crystal hatch Hey Mieszko, two questions if you don't mind:

  1. What's up with removing the class export in the AI module? What's the plan? 😅 https://github.com/EpicGames/UnrealEngine/commit/5db685f9
  2. I heard a rumor that we may be getting namespace support for UHT stuff. Have you heard anything about this?
crystal hatch
harsh storm
#

@terse star 👆

#

Just that it's being worked on is good enough for me! 🥳

#

It's like my #2 requested feature 😅

harsh horizon
#

Although doing some more visual logging I did just find this

uneven cloud
harsh horizon
uneven cloud
dense halo
#

Hey, does anyone know how to set a sub behaviour tree's blackboard values from the parent behaviour tree?

#

Or better yet, share the parent behaviour tree's blackboard values with the sub behaviour tree?

fierce carbon
#

What is the best way to create navmesh for ai when the ground is created upon begin play?

tawdry zephyr
celest python
tawdry zephyr
#

@patent hornet Since your suggestion for resolving AI collisions by having them give you an ability that pushes you back, I actually played FFXVI, they have an interesting system that forces you to sidestep AI.

And just now, I duplicated and rewrote Lyra's interaction tasks, because it does exactly what you suggested - provides an ability (for interaction). See screenshots.

This is my most minimal implementation to get a result for testing, but it actually produced an interesting result - if I really try I can breach the 500cm Strength on the Apply Root Motion Constant Force which makes it feel like there is a collider that instead of being a solid object is more of a suggestion - in real life you can get that close to a person and really invade their personal space if you are feeling stupid too 🤣 It actually feels quite nice. I prefer it.

And I could absolutely couple this with an animation like FFXVI does, where it sidesteps, of course having actual root motion on an animation could feel super disruptive depending on gameplay.

#

I'm going to make the AI play a "shove" animation 😄 It will look so rude, I can even make them say "move it!" if they're a gruff looking soldier

ocean wren
#

I used the DetourCrowdController and added a seperation force that took into account other agents and a push force scalar value.. so a human player could "push" through the seperation of another agent.. otherwise they'd be equal in terms of the seperation steering force.

dense halo
harsh horizon
#

@uneven cloud I fixed it!

boreal tundra
#

Can someone help me? My AI during a chase gets glitched and starts snapping continuously. Also, how can I avoid my AI to walk towards walls when pathing? Thank you

dense owl
dense owl
#

use words

#

or screenshots of the visual log

hearty niche
#

how would you recommend previewing my navmesh if my navmesh only generates around invokers (only way to do it in world partition as of now afaik)

zinc cape
#

Im new. Can anyone help me call this weapon pickup vector in my ai task for getting the vector? Or what can I plug into the actor location? I just need the ai to go to the pickup. ty!

boreal tundra
dense owl
dense owl
boreal tundra
#

Basically the killer get stuck and start shaking

#

and if you go behind him he'll get unstuck and chase you again

dense owl
#

did you look at the tree at runtime to see what happens?

boreal tundra
dense owl
#

also that decorator on the first selector of the right branch is prly unnecessary. Because if the left side branch fails, the right side branch will execute. same with the next set of decorators

#

look at your tree, alt+P to start the game and observe the flow of code in the branches

#

you can also pause the tree at anytime and rewind so you can see what is failing

boreal tundra
dense owl
dense owl
boreal tundra
#

I don't use it and I don't want to keep it

#

but the packaging gets error

dense owl
boreal tundra
#

Thx

zinc cape
#

or should I set a reference to the gun?

dense owl
#

You also need to give your tree a fail condition

#

Right now you have a selector that has nowhere to go but down that branch

#

So move your branch to the left and put like a wait node or something on the right, so it has somewhere to go if the branch fails

zinc cape
#

like this?

dense owl
#

yeah. Do you need that simple parallel or would a sequence work instead?

zinc cape
#

I think a sequence will work from what i understand

dense owl
#

Does your tree go past your first decorator? I could be wrong, but I think that check will run before your service has had a chance to run and set the values.
I'd also maybe add a Gunlocation1 is set decorator further down, just to avoid it trying to move to 0,0,0, but might not be necessary

zinc cape
#

the black board is saying failed even though there is a gun in range:(

dense owl
#

And I would move that whole branch left more, for visibility's sake, because in BTs, the left-to-right order is very important (it determines execution path), so it's important that you can see that distinction at first glance

zinc cape
#

Ah ok makes sense yeah the reason is cause i have the other stuff on stand by basically

#

He moved to it!!

#

last question is what do i set it to so that it prioritizes picking up the gun over attacking the player?

hearty niche
dense owl
#

hover over the number at the top right of a tree node to highlight the execution order

zinc cape
#

Ah ok that does work Thank you so much for the help! Now I just need to get him to pick shouldn't be too difficult lol

dense halo
dense owl
dense halo
#

so I'm guessing I'm going to add all the new blackboard keys that I want in the sub blackboard to the parent one, and have it shared?

dense owl
#

ok I think I figured it out

#

for that run behavior tree to not give you a bb not compatible message, it looks like both BTs need to run off the same blackboard. Note that if you change the BB on your 2nd tree to match the first one, the change won't register until you save that 2nd tree

dense halo
#

also, does anyone know if it's possible to set a filter on a Blackboard Key Selector in blueprint?

#

i.e have an expose Blackboard Key Select variable, but only allow keys that are object types or int etc

left crest
#

Hey everyone, I'm using a BT for my ai and using an EQS query to pick spots to wander around the player. My issue is that when the EQS query gives the ai a spot behind the character to wander to, it tries to walk straight through the player. Does anyone have any advice to get the ai to avoid the player while navigating to the point? I have started looking into nav query filters, but I felt there was an easier option

dense owl
#

And make sure the 2 can collide

left crest
# dense owl RVO or DetourAI

I tried both of those but it didn't seem to work. I had been messing with the collision, so I may just have to switch those around and try again

#

Do they just have to block?

dense owl
#

Yeah

#

Try either of the two not both ^^^^

winter moon
#

right now my project is purely c++. are behavior trees worth using in this scenario? my ai will be relatively simple, as in a generic enemy with a few states

tawdry zephyr
uneven cloud
tawdry zephyr
#

PushPawn plugin released under MIT License.

Provides a net predicted solution for Pawns to Push each other. Uses GAS to prevent desyncs that often occur when colliding with AI.

https://github.com/Vaei/PushPawn

Not bad for a night's work.

#

If anyone wants to use it, you absolutely will need to go through that Readme

#

But its a solid system, both these examples are >200ms latency with p.netshowcorrections 1

#

Hopefully someone gets some use out of it, its pretty niche I think

winter moon
#

Is it bad practice to have one monolithic behavior tree?

tawdry zephyr
dense owl
uneven cloud
north tide
#

Is there any good docs/tutorials for setting up a simple chase AI with C++?

uneven cloud
north tide
still crypt
#

If I want to use a delegate in a BTDecorator the underlying node has to be instanced right?

olive prism
#

how to make an AI grab a player when touches it?

What I did was create a collision (in the AI) and in the ActorBeginOverlap event I wanted to do an attach actor to actor, but I don't know if this is the right thing to do

My idea is to do like the AI in Pacify or Devour that when they touch you they take you to a random point on the map

signal island
fluid cedar
#

Are behavior trees right option when I need performance?

celest python
#

BTs are right option when you need to have a behavior decision tool that you design by prioritization of the behaviors rather than states

#

Performance is not a concern for BTs

fading field
#

Hello, is there a way I can control where the ai looks while it's walking around?

#

Is that something I can set up in the behaviour tree or do I do that in the enemy blueprint itself?

celest python
#

AIController's "focus"

#

and AIController::FaceRotation function (only available in C++)

#

If you set focus AI will rotate there

fading field
#

oooooh I see, thank you so much!

dense halo
uneven cloud
lyric flint
#

I have two functions in my Character called Sit() and Stand(). I also have two Behavior Tree Tasks called BTT_Sit and BTT_Stand which set the state of the Character with an Enum.

My animation blueprint then checks that state and selects one of four animations (see picture). This all works well, however...

When I want the character to move, I call BTT_Stand and then the Move To task. The character stands and starts moving, but they move while they are still transitioning from sitting to standing. I imagine I have to delay the Finish Execute node in my BTT_Stand until the character has finished standing. What's a common way to be notified of when the ABP finishes its current node? Or is this entirely a backwards way of approaching this?

uneven cloud
fierce carbon
#

What is the best practice when create navlinks attached to spawned actors? I want to achieve the following:

dense owl
#

uh... I guess you can't place bp comments inside EQS Querries? 😅

lyric flint
hazy oracle
#

Hey guys, I'm working on animal ai, and want different animals to be able to walk up different slope angles, what would be the optimal method to set that up? Generating paths seems so ignore character movement settings, is there a way to have settings for multiple agent types?

#

One thing to mention: map is very big, so what I really want is a way to do it without placing navmesh modifiers everywhere

winter moon
#

Currently playing around with behavior trees, it seems that this type of framework is best used in editor rather than c++. I was thinking of doing the blackboard and behavior tree in the editor, and the tasks in c++. I don’t know if this is a good approach

marble pilot
#

Hey, can someone tell how I can get context as actor or location in C++ EnvQueryTest?

orchid meadow
#

hello there,
I am working with EQS but need some help.
I actually want to use EQS with player controller character Not with AI.
Anyone could guide me with this to use EQS with Player Controlled character not With AI there are a lot of YouTube videos on EQS with AI but no video on EQS using with player controlled character.

dense owl
orchid meadow
#

I want to use motion warping with EQS to detect the points to check for sync points.

dense owl
orchid meadow
uneven cloud
uneven cloud
marble pilot
uneven cloud
uneven cloud
harsh storm
#

What's your favorite thing you've used EQS for Luthage?

#

Like, "wow, I can't believe this worked"

#

@ocean wren See the new AI stuff with Unity?

marble pilot
uneven cloud
#

Abilities. My combat branch on the BT is 6 nodes. Then design can add whatever ability they want and the AI just picks them.

harsh storm
#

I'm too noob with EQS to conceptualize doing that 😅

uneven cloud
harsh storm
#

I still just use it to find a potential "investigate" spot. So go to the last seen location, then pick random X spots on where the player could've potentally have gone 😅

uneven cloud
uneven cloud
harsh storm
#

I still just use the random point in navigable radius - or w/e the function is called

#

At least for standard wander behavior

uneven cloud
#

I prefer a less random wander. Especially one that they don't turn 180 degrees to go to the next point.

harsh storm
#

Yeah, I can see how that'd give a more controlled wander actually.

#

Then probably do a test to see if you need to make any turns. IE - if you end up facing a wall

marble pilot
uneven cloud
marble pilot
uneven cloud
sand kettle
#

Why doesn't the Run Behavior subtree abort after failing once? Is this a bug? When using the Sub BT content inside the main tree without Run Behavior, everything works fine.

In my case, when I'm in patrol mode and LastSoundLocation is set, the nested tree aborts and runs successfully for the first time. However, if the nested tree fails (because MoveTo can not get to location) it wont be able to run/abort again until it gets re-evaluated again after patrol finishes.

#

Also if the abort decorator is not on the top level node, it wont abort at all

orchid meadow
#

I am not getting any debugger value from EQS

#

I am running EQS from BP_ThirdPersonPlayerCharacter BeginPlay().

dense owl
# sand kettle Why doesn't the Run Behavior subtree abort after failing once? Is this a bug? Wh...

it's generally good practice to assume you did something wrong before you start thinking you've actually encountered an engine bug. In 9/10 cases, it's you.
You probably don't have the right abort settings on that Heard Sound decorator. Also, your subtree Selector only runs down the one branch. It is good practice to have a fallback behaviour, i.e. a wait node on the right, in case the main branch fails.

uneven cloud
sand kettle
# dense owl it's generally good practice to assume you did something wrong before you start ...

I know, but atm it just seems odd to me that a nested tree with the same behavior as a subtree in the main BT would work differently. If all branches fail in a nested tree, it just gets stuck at the root node and it wont abort it again. Whereas it's fine with a normal subtree. But I prob don't fully understand it yet.

I tried both value and result change aborts so I don't think it's the settings.

Having a fallback branch is sort of how I've fixed it. I put a Force Success decorator on my sequence, but that is good to know, ty for helping 🙂

orchid meadow
uneven cloud
orchid meadow
#

ok
I try.
thanks.

lyric flint
#

I've been trying to learn how Supported Agents work for the nav mesh. I am trying to add a "Small" character as a supported agent. However, my character refuses to move and the Visual Logger states:

LogAINavigation (Warning) Unable to find NavigationData instance while calling AAIController::BuildPathfindingQuery

I believe my settings are correct. Attached are my Project Settings > Supported Agents settings, my character's collision settings, and my nav mesh's settings, respectively.

I was assuming that my character will choose to the supported agent that matches its own size. Is this wrong? Am I missing a setting somewhere?

uneven cloud
dense owl
#

Hehe, you make it sound so easy

uneven cloud
lyric flint
lyric flint
#

Sorry ignore that, I'm dumb. I needed to rebuild the paths.

uneven cloud
lyric flint
#

Very cool, thanks!

uneven cloud
#

I haven't looked at it yet, but I think the new world condition system is very similar to my condition system.

uneven cloud
dense owl
#

ooh, it's a new plug-in. Weird, I couldn't find anything on google that references it. I guess there's no docs yet?

uneven cloud
#

I haven't seen any docs yet. I saw a tweet a while back describing it and it sounded like my system. We aren't on 5.2 yet.

ocean wren
harsh storm
# ocean wren Haven't been paying attention, too busy buying guitar stuff, what did they do?

Say hi 👋 to Unity Muse, our AI platform that accelerates the creation of real-time 3D (RT3D) applications and experiences like video games and digital twins.

Starting today, we’re beginning a closed beta for Muse Chat, a critical feature of the Muse platform. With Muse Chat, you can leverage AI-based search across Unity documentation, training...

▶ Play video
dense owl
#

I feel like I know I'm doing this in a stupid way. Current Target is a BB key that is set before this task is reached, but this was the only way I could extract its value as Actor. So you know, feel free to throw the book at me, I'm ready lol

#

basically I'm having to get the BB key's value as Object, then plug it into a key inside the task, and then get its value as Actor

#

because get BB value as Actor is not available directly from get Blackboard

uneven cloud
#

The entire point of using a blackboard selector is to not have to hard code the key name!

#

There is no such thing as get BB value as actor. It's get BB value as object and then you cast to an actor.

dense owl
#

I mean there is that node but you can only use it on a BB key but yeah I get what you mean

#

Ty

sudden stag
#

whenever i use any "AiMove" node the character has it's velocity and accelration set to zero even though it's moving. if i use "addMovementInput" those variables are updated correctly and the currect running animations are playing. what am i doing wrong here?

uneven cloud
sudden stag
#

again ticking use acceleration did fix the issue. it might be something dumb i did when i was messing with CMC 😅
thanks a lot tho!

#

btw is this like a new 5.2 option? i never recall it being a thing in previous versions...

dense owl
#

pretty sure it's been there for a while

sudden stag
#

huh

#

well at least my char is running instead of floating now

uneven cloud
#

Personally I think it should be turned on by default. It makes the movement look better.

dense owl
#

I don't understand why my test is failing. If I don't turn off reject incompatible items, it just ignores the gameplay tags altogether. I've made sure those targets have at least one of those gameplay tags on begin play

#

but the EQS is perceiving them as GameplayTags(0). I'm thinking I am supposed to implement the IGameplayTagAssetInterface from cpp for this query to work.

fierce carbon
#

Is it possible for navmesh to work on the lower level as well as the top level? Or would it require something other than a navmesh?

sudden stag
lyric haven
#

Somebody can help me about making a simple enermy shooting?

oblique basin
hollow cloud
#

Hello everyone
I'm trying to create an AI system for the enemy in my game, where the enemy continuously stores the player's location in the 'Player Location' variable and moves towards that location. When the player becomes hidden from the enemy's view, the last known player location is stored in the 'LastKnownPlayerLocation' variable. The enemy moves towards this location if the player is seen again, but otherwise returns to the initial position or 'StartLocation'. I initially implemented this system and it worked fine. However, when I moved a part of the code that involves storing the variables 'Player Location' and 'LastKnownPlayerLocation' into a service within the Behavior Tree, it no longer saves the locations, and the enemy only moves towards the 'StartLocation'

Codes:
ShooterAIController: https://codefile.io/f/B9iTbCHvQ6
*The commented section is for when I wasn't using the service and had written it in the AIController, which was working.

BTService_PlayerLocationIfSeen: https://codefile.io/f/SHw85J0HRX

BTService_PlayerLocation: https://codefile.io/f/RGh6gNxh6n

frozen swift
glossy basin
#

Hi everyone! Quick question, can someone try to explain me how the avoidance config works in UE5? I have some AI Enemies with a Detour crowd AI Controller that surround the player, and they do this by walking towards specific points around said player. The thing is that sometimes, if, for example, enemy A is on the way of the location that enemy B has to move to, instead of Enemy B evading enemy A by walking around it, it gets stuck ☹️

I tried to tweak with the values, like changing the amount of adaptive rings so that my enemy had more rings to look for a better path, but the change was still the same. They walk with a slow velocity when surrounding the player, maybe this is the cause?

dense owl
uneven cloud
hollow cloud
gleaming hemlock
#

Does anyone know of a very advanced Behavior Tree tutorial? All the tutorials i found on youtube are pretty much the same. Sense enemy, pursue, attack.
Im doing a strategy game, and need to see how something very complicated is done?

uneven cloud
gleaming hemlock
#

this one also seems to be good

uneven cloud
#

You are unlikely to find a tutorial on a "very complicated" AI.

gleaming hemlock
uneven cloud
gleaming hemlock
#

but the ai of strategy games is complicated

#

its not like just a dummy going around looking for enemies

#

its too many factors

#

but idk

dense owl
#

btw the 3rd pinned video is a very good at showing you what you can do with AI in UE

orchid meadow
gleaming hemlock
dense owl
uneven cloud
#

I believe that one is part of AI with Blueprints.

gleaming hemlock
#

i went through that one already yesterday

uneven cloud
gleaming hemlock
#

thanks

#

ok i already have lots of tabs with videos

#

i think this will be enough for my workout session 🐺

#

🏋️‍♂️ unreal

quaint bolt
#

I feel like the Unreal BP course shows you the "how", but you need some other resources to show you the "why"

#

The book above has a good chapter on choosing the right AI architectures given your game's design reqs

gleaming hemlock
#

is it theory

#

like theory of ai ?

#

or it goes into specific examples

#

thats a big book

#

900 pages

quaint bolt
# gleaming hemlock 900 pages

It covers the full gamut. Yeah we ain't reading all 900 pages 😛 but I'm keeping it around as a reference to understand how things work. I am only reading the chapter on the design process to start

#

Like, "how do I choose between BTs, FSMs, utility AI, etc etc"

uneven cloud
#

AI for games is OK. Pretty old though. GDC has an entire AI summit, many of which are free. There are also the Game AI Pro books, which are free online.

quaint bolt
#

Ah interesting 👀 adding some new bookmarks!

gleaming hemlock
crystal hatch
gleaming hemlock
dense owl
crystal hatch
crystal hatch
#

but not reading 😄

gleaming hemlock
crystal hatch
grand saffron
crystal hatch
dense owl
#

I’m from Romania originally, so close enough

crystal hatch
#

Oh yeah, same diet 😉

dense owl
crystal hatch
sudden stag
#

but i like it baked rather than boiled

uneven cloud
#

Not from a Slavic nation, but my family is. Grew up on a very similar diet.

still crypt
#

Is the PostProcessMove Delegate not called if you're using the UCrowdFollowingComponent?

still crypt
#

Also, on the note of crowd following, the docs say All agents will operate on the same navmesh data, Does this mean you can't have different agents (Say for different sized characters) when using it?

harsh storm
#

TIL that #gameplay-ai is made up of potato diets @uneven cloud @crystal hatch

tawdry zephyr
#

@crystal hatch does this mean it was accepted/merged?

#

Or was it just added to your Jira

crystal hatch
#

It means your PR is in 🙂

#

and has been in for two weeks now

tawdry zephyr
#

Thought so 🙂 Thanks

elder pivot
#

Has anyone some hints/best practices for open world navigation. I need to support a 50km² map with ~1k ai units. I guess Invokers will have a huge performance impact at this amount, so I guess that is not feasible? Should I tile the mavmesh by myself or is the 5.1 world partitioning a reliable feature for navmeshes too?

reef shore
#

how do you generally make AI Characters not damage each other?

#

I'm using the same projectile class between the main character and the ai characters and it mainly only ignores the instigator.

undone heron
#

Hey, how do I test if movement fails on ai? Say it can't reach its target for example

#

I want to include a mechanic where the ai loses interest of the player if it can't reacht them for a few seconds

bronze zephyr
#

Working on a shark AI system for my survival game. EQS not working on a floating pawn. Using multiple box traces atm to determine a valid location to move. Not really ideal. Anyone suggestions would be greatly appreciated.

bronze zephyr
frail bough
#

The ai character here is not following me, however, the printstring at the end is triggering. This confirms, I think at least, that the playercharacter is being sensed properly. Any ideas?

tawdry zephyr
# elder pivot Has anyone some hints/best practices for open world navigation. I need to suppor...

Surely you don't have 1000 on-screen?

My game is a large open world. I don't place any characters/pawns in the world at all. I built a robust spawner actor (from AActor) which has "Spawn Relevancy", which is just net relevancy, but shorter, and extended to factor all waypoints. If any player is near a spawner or the bot itself or the waypoint then it'll be spawn relevant.

And yeah, I use navigation invokers.

tawdry zephyr
crystal hatch
tawdry zephyr
#

Was hoping you'd be familiar with them but all good

crystal hatch
#

We split into teams so that I don't need to care what they're doing 😉

tawdry zephyr
#

I totally appreciate that you're on here, it goes a long way IMO

#

Wish other departments would follow suit 🙂 Dan over in audio is amazing too

#

Without UDN access it can be pretty hard to get even basic changes and fixes in

harsh storm
tawdry zephyr
#

#cpp energy is way too weird for me

#

I know it sounds like a joke but I just don't know how else to phrase it

harsh storm
#

It's not often you get to receive help (for free no less!) from the person to blame thank with the AI systems of a given engine!

celest python
#

and acceleration gets zeroed so your velocity is

candid lantern
candid lantern
#

haha

uneven cloud
tawdry zephyr
harsh storm
#

I wouldn't place my bets.

uneven cloud
tawdry zephyr
#

Mm that's a shame. I might have to revisit my use. Alternatively I could just place invokers that envelope AI heavy areas such as towns/camps. I already have them tied to my spawners, so I can just remove them from my AI pawns and make them envelope waypoints.

#

Is the general idea that if they're not causing anything to change on a given frame, then they don't have high cost?

uneven cloud
#

They have a high cost, because they generate navigation. Being on static actors means they don't constantly cause regen, but they do when that area is loaded.

tawdry zephyr
#

Thanks, that gives me a path forward 🙂

visual dawn
#

Hello am looking for a comprehensive tutorial for AI with cpp that has EQs and other essential to make AAA AI’s any available?

uneven cloud
harsh storm
#

To get started with AI, there are some pinned resources. And there is a course on the UE learning site...uhhh - Blueprinting for AI or something like that

uneven cloud
visual dawn
uneven cloud
#

The AI with Blueprints course goes over all the systems. Don't let your ego drive your learning.

harsh storm
uneven cloud
tawdry zephyr
#

Dismissing a useful tool to stick to a more complex one doesn't make you a better dev 😄

visual dawn
#

Am out

uneven cloud
#

To be fair, large games need to really limit BP. But you shouldn't be making that size of a game if you still need tutorials.

visual dawn
#

But it’s understandable

#

I appreciate ur effort for the link

#

Ur a hero

uneven cloud
# visual dawn Lol u dnt knw me

Tutorials don't go over best practices for games made by 100+ professional devs. They are made by hobbyists for hobbyists.

visual dawn
#

I checked ur link and it’s just a lot of archives

#

Am I meant to swim in it

uneven cloud
#

There is search functionality and filters.

uneven cloud
elder pivot
uneven cloud
elder pivot
#

We already have that, currently we use havok for physics and navmeshes/navigation. But our graphics engine looks a little bit dated, so we are evaluating Unreal. My task is to look at the navigation options unreal has to offer. But so far it doesn't look promising for this scale at all.

tawdry zephyr
#

I'm rather curious if its any good myself, esp. since it costs a decent bit (depending on your level of funding)

gleaming hemlock
#

In behavior trees we only have sequences or selectors

#

what if i want to run all the nodes below

uneven cloud
crystal hatch
tawdry zephyr
ivory rune
tawdry zephyr
#

That generally means its really high 😄

ivory rune
#

It is not really open price but you need to negotiate with them for your service, lol

gleaming hemlock
tawdry zephyr
#

I'm sure if I wait long enough Epic will buy it

harsh storm
#

Epic will buy it if Fortnite needs it.

crystal hatch
uneven cloud
harsh storm
#

A couple days of Fortnite monies

uneven cloud
harsh storm
#

Oh - M$ owns it? 🪦

ivory rune
harsh storm
#

Make a new nav system and call it "MetaNavigation" and Tim will certainly notice.

#

Could even get a grant for it most likely.

celest python
harsh storm
#

Their metaverse is Fortnite

celest python
#

Gameplay/engine code is not directly related with workflow and Tim's obsession

tawdry zephyr
#

So how does Mercuna compare to Havok

crystal hatch
harsh storm
#

Well. I can't debate with someone who probably sits in on the meetings about Unreal in 2026 🤣

crystal hatch
celest python
#

and UEFN itself

harsh storm
celest python
crystal hatch
harsh storm
#

Oh no no no. Not me good sir. I spill no guts.

#

It's more so I can chuckle silenty behind my screen on Discord.

crystal hatch
#

also, "get hired" might get tricky 😄

harsh storm
#

Yeah...that requires effort.

celest python
#

I think part after getting hired is even more exhausting

#

Engine dev is too stressful PandaOhNo

crystal hatch
harsh storm
#

My plan has been thwarted 😭

#

(I don't have any good emojis)

harsh storm
#

And you don't make games if you're making engines!

celest python
#

Since after getting insanely burnout from working with Blueprints VM a couple of times, I sometimes open up niagara and chaos modules and stare at the classes to think how epic devs able to keep up with same pace to rush features to next version

crystal hatch
harsh storm
crystal hatch
harsh storm
#

Besides - you've already built these generic systems for me!

crystal hatch
harsh storm
#

Found a better "thank you" gif

dense owl
tawdry zephyr
#

"Fortnite needs Havok!" *

celest python
#

I think if you're a promising indie studio with arguably enough budget and a team with past experience on AAA companies like Havok tend to agree on revenue share

#

Thats how Kythera also does

tawdry zephyr
#

Why do people usually license Havok, are UE's tools not adequate, or do they just want flying AI etc

harsh storm
#

UE's tools might not be adequate for that specific problem

celest python
#

One of my friends was told most of their programmers was familiar with Havok so instead of building new systems on top of the existing AI they were considering licensing Havok

tawdry zephyr
#

I notice BOTW used it, but their AI is so simple. Guess they needed something since they don't have UE 😄

harsh storm
#

Well, a 3rd party engine, it'd make a lot of sense to license Havok

tawdry zephyr
#

Yep

celest python
#

Their so raved physics engine is also Havok

tawdry zephyr
#

Yeah, they definitely did a good job with it, because its verrry reliable, their shrine puzzles wouldn't be possible otherwise

ivory rune
#

yeah, havok is solid.

celest python
#

Its probably default havok btw 😄 I dont think they modified it more than slightly

uneven cloud
tawdry zephyr
#

Well, I'd like all that too, but 😄

uneven cloud
tawdry zephyr
dense owl
#

I don't think it works that way lol

tawdry zephyr
#

😄

#

It did with live coding, right after I bought a year license

#

Back when it was Live++

#

If I license HavokAI Epic will buy it within the month

#

My superstition is definitely rooted in fact, you should shout me a license

uneven cloud
#

I'd like to keep my job. Also it doesn't work that way.

tawdry zephyr
#

I know that

worldly quarry
#

Hi how are you? Just a silly question,
Is anyone using State Trees in a moderately successful way?
I'm having a hard time trying to do very basic things and the functioning is extremely erratic. I surely have problems with some concepts, but there is also no documentation or the existing one is superficial.
Is this really production ready?

crystal hatch
tawdry zephyr
#

Its a very new feature, definitely not ready

#

Maybe 5.4, but probably not

crystal hatch
#

5.3 will be already a big improvements, including a first draft of the ST Debugger.

uneven cloud
harsh storm
#

@crystal hatch Curious - any particular reason you haven't gotten the "Epic Staff" role?

crystal hatch
harsh storm
#

"They don't know that I'm the one who wrote the system" - Mieszko while conversing with someone about a tool in #gameplay-ai or #mass

#

Actual gif of Mieszko behind the screen

crystal hatch
harsh storm
celest python
#

only admins + epic staff see it

spring inlet
#

SmartObjects cant move? 😦

urban turret
#

Need quick prefered setup answer. Setup AI perception component on AI controller, should I just place all perception components on the controller or place the Stimuli source on the pawn? Also should the TeamInterface be on the pawn or controller?

harsh storm
#

More like DumbObjects, am I right

spring inlet
#

well i think its because of the cache they use?!

#

and yea in 5.1 they are really dumb (and broken by design)

uneven cloud
#

Smart objects also can't replicate their state either.

spring inlet
#

i don't need replication, but i can see how this is annoying for those who need it 😄

uneven cloud
sonic garnet
#

guys please.. does anyone know why the " ai move to " or " move to actor " acceptance radius wont work if you are standing on a higher/lower ground then the ai?
they just come up real close to shoot.. picture for refrence to what happens.. they dont shot from there, even tho i AM in the range of acceptance radius.. he will come around all the way up to me and shoot. This problem is not present when we are both on a flat surface.. please help--thanks 🙂

celest python
crystal hatch
# sonic garnet guys please.. does anyone know why the " ai move to " or " move to actor " accep...

Also bear in mind, that AcceptanceRadius is just a runtime parameter of when to stop moving, it doesn't take part in pathfinding.

Also2: AcceptanceRadius is being checked on the last segment of the path. You'd see the same issue on the flat surface if there was a fence (or something else untraversable) forcing similar holes in the walkable navmesh.
You can fake a "check AcceptanceRadius all the time" by adding a "check distance" decorator on the move to task (to abort move when within given distance from the target)

sonic garnet
sonic garnet
crystal hatch
#

You need a "distance to BB key" decorators. I don't remember if there is one provided by the engine. If there's not then it's a great opportunity to learn how to create one since it's trivial and can be done with BP if you're not a coder.
That's assuming the "move to" target is in your BB.

uneven cloud
#

There's an is at location decorator that I believe also allows you to set the radius.

lethal helm
#

Spawning some actors from my gamemode during PreInitializeComponents how do I get nav data to generate for them?

#

doing this on ABP doesn't work

if (NavigationSystem)
{
  NavigationSystem->Build();
}```
dense owl
#

Rotate to BB entry gets stuck as if it were missing a Finish Execute node. Google says make sure use controller rotation yaw is unchecked, but that wasn't it. I thought I'd found the issue (abort self causing the EQS service to constantly refresh and change targets), but that I fixed that and still nothing. Thoughts?

#

More info from Visual logger. Looks like after the BB condition is met, I get a perpetual stream of suspended/resumed branch actions

uneven cloud
lethal helm
#

Adding a 1s delay to build after ABP works

uneven cloud
# lethal helm dynamic

You need to wait until the navigation is generated before spawning them. Do not use a delay. There is an event you can bind to.

lethal helm
#

can't wait actors need to be spawned as early as possible

uneven cloud
#

As early as possible means "after the navigation is ready"

lethal helm
#

which is apparently sometime after ABP

uneven cloud
#

ABP?

lethal helm
#

actor begin play

uneven cloud
#

Well actor begin play can happen at literally any time. I take you mean the game mode begin play.

lethal helm
#

Yes

#

Whats this event?

uneven cloud
#

On Navigation Generation Finished

uneven cloud
dense owl
#

oh, 180 seems to work better

frail bough
#

https://medal.tv/games/unreal-engine/clips/1gQqtDdenrIM0l/d1337chDUASw?invite=cr-MSxLM1EsMTA1NTU1ODkyLA Hey guys so I decided to go back into my AI testing level because I noticed how unthreatening the enemies actually are. They're made using a simple follow player blueprint, and I'm happy to change that if necessary. You'll notice in the clip below that the AI will essentially only attack me when I'm standing still. I've tried tuning acceptance radius to no avail.

Watch Untitled and millions of other Unreal Engine videos on Medal, the largest Game Clip Platform.

▶ Play video
lethal helm
#
  1. You should have the attack animation on the enemy be upper-body only so it doesn't slide while it move-attacking
#
  1. You should have the attacking and the moving be concurrent instead of out-range -> move closer -> attack -> out-range -> move-closer -> ect
frail bough
#

Yeah I'm working on the upper body thing, was just going to fix mechanics before anims

lethal helm
#

Okay. Easiest solution is to just put the attack logic on your dude

#

SetTimer TryAttack on 1s timer

#

if AggroTarget is InRange do Attack()

frail bough
#

Yeah so I was setting something like that up, however I didn't really understand howw to use the timer. One of them needed a function name, and the other needed event.

#

Do I need to put the timer logic inside my attack event?

lethal helm
#

drag off the event pin and search custom event

#

You might want to go through a "basics of ue4" tutorial first before diving into something like AI though

frail bough
#

Alright, thank you.

dense owl
#

there's more to it than that, but that'll give you some idea

lethal helm
dense owl
#

works no problem

lethal helm
#

BeginPlay
NavigationSystem->OnNavigationGenerationFinishedDelegate.AddUniqueDynamic(this, &AMyGameMode::UpdateNavigation);

#

never gets called

dense owl
#

My cpp knowledge is still very limited, but the screenshot I showed you was on the Game Mode's Begin Play

lethal helm
#

mine is too

dense owl
#

so if it doesn't work, you might be missing a step

lethal helm
#

our code is identical

#

GameMode Begin Play -> Bind DoThing() to OnNavigationGenerationFinishedDelegate

dense owl
#

🤔 are you certain you're properly referencing the navigation system?

#

I guess if it was nullptr it'd yell at you, so not sure

lethal helm
#

It would crash if it was nullptr

#

this looks promising

#

nope doesn't work

#

Rebuilding right after those actors are spawned doesn't work

#

So looks like the good ole 1s beginplay delay is the winner

#

NavigationSystem->Build() doesn't trigger the delegate either

dense owl
#

I don't understand why it doesn't work for you

#

btw are you in UE4 or something?

lethal helm
#

what version are you on

#

most people are

#

4.25

#

Toss a cube or something in there during runtime though and Bam there goes the delegate

dense owl
#

5.2

#

That’s odd

#

Idk about most people that seems pretty outdated. But then again I haven’t checked any polls 😅

lethal helm
#

ugh

#

visual studio can't find where OnNavigationGenerationFinished is called either

dense owl
#

Check UNavigationSystemV1, see if it’s anywhere in there

#

If not, I’m sure one of the greats in here know

lethal helm
#

Nope. Are parts of the navigation system closed source or something?

dense owl
#

Not likely

lethal helm
#

Looks like it's being called in RecastNavMesh

#

And visual studio search is just stupid I guess

#

it's literally highlighting it yet it's still not in the search results

dense owl
#

I hear Ryder is better

#

Btw, maybe run your code by #cpp guys, just for a sanity check

lethal helm
#

hur dur being stupid was the issue

#

NavigationSystem::Build() turned out to be sync so it finished before execution even got to the bind the next line

#

That helps a bit. Still dunno why the initial build when I load in isn't happening though

lethal helm
#

Wrong function delegate

#

The one I needed was
NavigationSystem->OnNavigationInitDone.AddUFunction(this, "LoadCustomActors");

gleaming hemlock
#

whats the difference between a wait node and a cooldown decorator?

#

they seem to do the same thing. just wait x seconds

dense owl
gleaming hemlock
#

thanks

uneven cloud
dense owl
#

Ah, a much better explanation

sudden stag
#

is there a way to get the Ai sight config?

sudden stag
#

btw i just want get. im know that you cannot change the sight config values at runtime with bps