#gameplay-ai

1 messages · Page 39 of 1

round grove
#

so the task object has one thread running the queue and another thread listening for an abort which can then interrupt/clean the other thread at any time?

misty wharf
#

I would stay away from threads. You can just make use of ticking if you need to run something like that

deft mural
#

Is there not some sought of C++ only TQueue type?

deft mural
#

This is how it looks at the moment.

round grove
misty wharf
misty wharf
round grove
deft mural
#

This is how my blueprint task looks.

#

I am trying to move it into C++.

misty wharf
#

Yes the point is that if you're running this in an AI controller, then your Context actor would be the AI controller

deft mural
#

I even looked at the generate header preview to make sure my specifies were right. That did not help.

#

Why can I not get the correct UI to come up when binding inputs?

misty wharf
#

Ahh that's what you meant

deft mural
#

Sorry.

misty wharf
#

try this

UPROPERTY(EditAnywhere, Category=Input)
AActor* Whatever;
deft mural
#

Okay.

#

I have added that as a new field.

misty wharf
#

also this needs to be in the InstanceData, not as a property on the task itself

deft mural
#

InstanceData?

misty wharf
#

A separate struct used to store instance-specific data like this. The builtin ones should have examples on how it can be defined

deft mural
#

Okay.

#

I am still new to the C++ side of things when it comes to State tree.

deft mural
round grove
deft mural
#

I see how easy it is in Blueprint.

misty wharf
deft mural
#

What does the Hidden specifier do?

#

I was just looking through some of the State Tree source code and found this.

misty wharf
#

I'd imagine it prevents the struct from showing up in some lists

deft mural
#

Probably.

#

It's interesting that you can define all properties inside a blueprint task. I wonder how this works under the hood?

minor geyser
#

is there a way of saving a BT as a .png? so you can reference a previous version easily if you break it :x

misty wharf
misty wharf
deft mural
#

It has a version history system.

#

It's weird how you need to put public for inheritance for structs.

misty wharf
#

it's just how inheritance in C++ works... if it wasn't public then methods on them would become protected or private and potentially break stuff

round grove
misty wharf
#

Pretty much

round grove
#

ok, thanks - took me a bit to understand. The advantage here is that I gain a bit of modularity and can cancel the current task without having an on tick 'interrupting key pressed?' bool?

misty wharf
#

Yeah.. in general in UE you don't need to poll for inputs

#

you get events and then you can react to those events

bitter wyvern
#

is there a way to disable an AIStimulusSource during runtime so AI Perceptions wont sense it?

stark tangle
#

hey guys, i have an issue with a Service node of my Behavior tree
i need a Service, which must force an AI-controlled pawn immediately drop a right branch (moving to waypoint) when they see an enemy, and go to that enemy to attack it
i have a Perception logic in a AIController, so i need just force a pawn to follow it
what do i need inside of a Service then?

tawdry zephyr
#

@crystal hatch I can't DM you, think the server default settings changed
I sent Daniel a couple more engine bugs, one with a fix included, but I don't think he checks Discord
If its not too much trouble could you ask him to check his DMs 🙂

harsh storm
#

I thought I understood the NavModifierComponent, but apparently not. It works as expected with the doors, but with a different static mesh, it doesn't do anything 😭

uneven cloud
harsh storm
uneven cloud
harsh storm
#

😭

uneven cloud
#

What you can do is the opposite. So build the nav mesh with it in the "bridge" position. When the game starts, move it to the starting position and add a nav modifier to where the end position is (to cut out that bridge nav mesh). Then when you move it back to the end position, disable the modifier.

harsh storm
#

Nice idea. Thanks!

uneven cloud
#

You're welcome. We do it a lot of the time for different things.

harsh storm
#

Figured out something about the nav modifier component with this mesh. It seems it's not finding the bounds of the static mesh correctly?

#

And for w/e reason, for this one, I needed the static mesh component to be able to affect the navigation - but for the doors, I don't.

#

And the nav modifier component even seems to have a check to see if the root component has that option checked or not, and it shouldn't matter 🤔

fathom sun
#

What's the difference between nav walking and regular walking in the character movement component? When should I be using the nav walking rather than the regular one?

dense owl
harsh storm
dense owl
harsh storm
#

Didn't try that because I didn't want to wrestle with it at the time.

dense owl
wise sluice
#

Generally you use Walking for your Players
And NavWalking for your AIs

#

Except if your players' pawns move thanks to a path

dense owl
#

🤔

misty wharf
#

I tried using nav walking in my project for AIs and it was pretty janky

#

but it would probably be worthwhile to look into because regular walking is fairly performance consuming thanks to CMC being CMC

harsh storm
#

I've always used nav walking for my AI to be honest

fathom sun
#

I personally have noted that using nav walking doesn't allow AI to slide along some round collision. So if one AI character walks into another, it'll stuck there. That doesn't include any crowd avoidance or RVO obviously

wise sluice
fathom sun
#

What exactly? I have tried to search for properties in the CMC, but didn't find anything

wise sluice
#

Using the ADetourCrowdAIController

#

There is also another solution
Both are explained here ☝️

harsh storm
#

That doesn't include any crowd avoidance or RVO obviously
You may have missed this part

obsidian delta
#

Does anyone know why sometimes changing navigation mesh tile size, does absolutely nothing?

dreamy star
#

Hi.

I Have a question that i would need to discuss with someone familiar with AI and AI behaviours or maybe even training AI via ML. I have a car game, but the NPC/AI should be able to move like frearoam on an open maop terraint, not after a path or a spline.

I would highly appreaciate if someone with infor or ideas, or knowledge of great videos/tutorials could give ´me some help here.

Tag me with your answer thnx in advance // Philip

misty wharf
#

There's a bunch of vids on YT if you look up machine learning car ai or something like that. I think game ai pro also has some sections on racing games, they are free on the game ai pro website

#

In general I think this is fairly complex for an open world'ish thing. A spline based approach would probably be a lot simpler to implement - they don't have to stick to the spline, but rather just use the spline as a "guide" towards which they steer. This would allow them to deviate from the spline if necessary, but make it so they don't really have to understand what's happening when moving normally

deft mural
#

What are AI messages used for?

languid agate
#

Hi guys this should be pretty simple but I am not sure how to go about it.

Basically, I have a 90-degree left and right turn for my boss character, currently, they are set to rotate to their new target destination before moving.

How can I set up a way to determine if it is a left or right turn and have it play the correct animation during the rotate to BB entry function?

languid agate
dense owl
#

Also try not to cross-post, it’s against #rules

languid agate
#

Thats what I mean I dunno how to define that information to use as a variable.

I guess I would have to maybe do something with a Dot product times it by 360 and use that somehow to determine left and right but again I would be just guessing kinda

I will note that for the future just thought this channel might be particularly quiet

dense owl
languid agate
#

If you look at the previous clip he is just playing his idle animation when rotating without any foot movement

#

It doesn't need to be perfect like with IK's or anything as long as it plays left or right turn to match the rotation roughly

#

I just need a way to get if it is a right or a left basically I can figure the rest out with triggering bools, states etc. Just unsure how to know which way he is turning

dense owl
languid agate
dense owl
#

Yeah, I get you

dense owl
# languid agate Pretty much yeah but it's not the animation I am struggling with I just need a n...

Normally you’d prly use one walking animation but if he needs to lean over or something, then you’d prly need to do something like subtracting the current rotation from the target rotation, and pick the animation depending on the result. For example, if the result is positive, then it’s right and if it’s negative it’s left. This would require some testing and there might be better solutions out there but that’s where I’d start

languid agate
#

I tried that but I am pretty sure I had the sequence messed up a little i will try this again with a dot product and using greater or less than 0.5 should determine left or right I think if I make a dot product out of the forward vector Z axis maybe

uneven cloud
uneven cloud
dense owl
#

Yeah, that is indeed much cleaner 😅

deft mural
#

If IGenericTeamInterface is not useable in blueprint, what's it's use?

dense owl
#

Just needs like 5 mins of work in cpp to expose it

deft mural
#

Okay.

#

Thought so.

#

I will do that later.

karmic pelican
#

why is this node running while it's returning false?

karmic pelican
#

nevermind, fixed it

dense owl
karmic pelican
#

for the IF statement, still not sure what to do, but I kept both

#

the Service runs all the time? in AI

dense owl
karmic pelican
#

Deal, thanks

bitter wyvern
#

Is there a way to abort a simple move to before its complete

dense owl
worn widget
#

Means that whenever the node it's attached to deactivates you can get an opportunity to clean stuff up

karmic pelican
#

But I've got another thing

#

I'm doing this, but if the pathfinder from the EQS fails. I want it to skip the MoveTo or do another EQS instead.
Not sure on how to do that tbh

#

I'm quite new to AI and EQS stuff

#

I have this but always always returns false

dense owl
iron nymph
#

Does anyone know if the default Team attitude solver resolves team 255 as neutral for all? I was under the impression it should but when I assign agents to team 255 they still show up as hostiles for other teams

dense owl
karmic pelican
ashen trail
#

Does DetourCrowdAIController not interface with regular "dumb" AIController?
I'm moving my pawns along spline points.

I want the "regular" pawn to always go linearly between the spline points and NOT go around other pawns
I want the "smart" pawn (which is a bit faster than the "dumb" ones) to go around the other pawns.

I setup the dumb ones using default AIController and the "smart" ones using DetourCrowdAIController but nothing really happens - instead of avoiding the slower pawn, the "smart" pawn just gets its velocity lowered and follows in the same line.

Any tips/ideas?

karmic pelican
# dense owl 4th pinned link in this channel

https://forums.unrealengine.com/t/how-to-use-eqs-to-check-if-path-to-target-exists-is-valid/508900/2
this helped to detect if the pathfind fails
while the video taught me something new about failing a node and such, thank you!

uneven cloud
dreamy star
#

Hi.

I Have a question that i would need to discuss with someone familiar with AI and AI behaviours or maybe even training AI via ML. I have a car game, but the NPC/AI should be able to move like frearoam on an open maop terraint, not after a path or a spline.

I would highly appreaciate if someone with infor or ideas, or knowledge of great videos/tutorials could give ´me some help here.

Tag me with your answer thnx in advance // Philip

dense owl
gilded tree
#

Hey guys, how can I ensure that my ranged AI can see my player before they attack? My AI decides whether to chase down the target with melee attacks or long ranged attacks depending on the distance from player to AI. However, if I hide behind a wall the AI will just stand there shooting at my location. Any tips? 🙂

dense owl
gilded tree
#

Yeah

dense owl
#

Are you using EQS for this yet?

misty wharf
#

Sounds more like a perception issue rather than EQS

#

If you are using perception, you will get a perception event with successfully sensed set to false when sight is lost

dense owl
#

But yeah you’re right about the perception

misty wharf
#

Yeah depends on how it should work I guess, easy start would just to have the AI pathfind normally towards the player's position

dreamy star
dreamy star
#

Oh yeah, well I wanted to find someone to talk to about this stuff that's why I posted again

misty wharf
#

Tbh unless you get really lucky you might be hard pressed to find someone

#

It's a complex and kinda niche topic, but who knows :)

uneven cloud
misty wharf
#

Huh, there's a function like that in the AI controller? :P

uneven cloud
#

Why do you think you need GOAP? What does it give you? What is the difference between GOAP and a BT? If you don't know the answers to this, you need to do more research.

gilded tree
#

Cant find that function 🤔

#

Does it maybe not inherit from the Detour crowd AI controller?

misty wharf
#

I think the one she's referring to is LineOfSightTo

gilded tree
#

Ooooh

misty wharf
#

(but if you're using perception you probably can do it in a different way)

gilded tree
#

yeah, would hope so 🤔 Im using both vision and hearing though

misty wharf
#

Right, in that case you want to check what I mentioned above

#

You should be getting a stimulus event from perception for sight when line of sight is lost

gilded tree
#

I can just have the AI move to a closer location after attacking though, that could work 🤔

uneven cloud
#

If the NPC is still shooting at the wall and they are using perception to pick a target, then the problem isn't with perception.

misty wharf
#

It could be just a mistake in how the perception is being handled, it's kinda tricky to understand how it all works at first so those are pretty common problems with it

gilded tree
#

Well, I can have the AI run one montage of the ranged attack and then move to a closer location based on their previous location, that would force the AI to change locations 🤔

karmic pelican
uneven cloud
#

What kind of complex and dynamic behavior are you actually looking for?

gilded tree
#

Like, have the AI choose a point to move to between their last moveto position and towards their perception target

#

It's not failproof, but could give the impression that it's tactically moving about

uneven cloud
dense owl
#

“coding to generate emergent behaviour” sounds a bit contradictory

uneven cloud
karmic pelican
gilded tree
karmic pelican
#

ok, how can I return if a pathfind is valid or not?

#

like I want the actor to make another EQS for another location for example

uneven cloud
karmic pelican
#

and the rest of the sequence will not run

uneven cloud
karmic pelican
#

doing something like this

uneven cloud
#

That can be done in a BT. I'd use Utility before GOAP for that, but it can also be done in a BT.

uneven cloud
karmic pelican
#

second generator?

karmic pelican
#

ohh okay

#

didn't know we can do that

uneven cloud
karmic pelican
#

thank you

#

and the percieved actor will check all actors currently in the actor's sight?? not age

terse panther
#

is there any way to set the default values of keys in a blackboard 🤔 ...
as far as i can see there is none...
its sometimes annoying to set the key default value right after running the behaviour tree...

misty wharf
#

I think you just have to set them f.ex. in your AI controller's BeginPlay before you start the behavior tree

uneven cloud
#

Starting the BT should not happen in begin play, it should be on possess.

rigid tulip
#

Anyone knows why I keep getting these message on client (client side allow navigation is OFF):
LogNavigation: Warning: ConstructTiledNavMesh: Failed to create navmesh of size 0.
(UE5.1)

uneven cloud
#

BTs separate out the decisions from the actions. They aren't bad at making decisions, but you also don't need to put the decisions in the tree. BTs are a priority order set of actions. Sometimes that's great for what game you are making and sometimes it's not.

You can't really pick the right architecture without fully understanding the options. I will reiterate that you should do more research on how they work. Not research on what other people think you should use.

uneven cloud
#

There's a lot of really bad advice out there, mostly from people who don't understand the different options. Especially with "GOAP is better" or more advanced or whatever. Planners (arguably HTNs are better than GOAP perf wise) have pros and cons just like BTs do.

dense owl
uneven cloud
harsh storm
#

There is still a lot of misunderstanding between State Machines and BTs. Good luck demystifying the other AI architectures 😅

dense owl
#

Yeah, I mean until recently I hadn’t touched animation at all, now I realize SMs are animation related ?

uneven cloud
harsh storm
dense owl
#

Ah I c

uneven cloud
#

The CMC is also a state machine

harsh storm
#

You can have a state machine for pretty much anything

#

I always write my BTs as more like a behavior priority selector pretty much

#

"What is the most important thing for this AI to do". And then work down from there

#

2nd most, 3rd most, etc...

dense owl
#

Seems reasonable

keen crow
#

Is it necessary to inherit BTService node memory from FBTAuxiliaryMemory? I've just realized that I never did although it seems BTComponent actually somewhat relies on the fields of that structure 🤔

rigid tulip
misty wharf
#

Ah yes, navmesh walking

#

I decided to try it in my project and immediately get mysterious issues such as the npc no longer appears to trigger overlaps

#

wonder why it would be affecting that...

#

Generate overlaps is enabled on capsule... it starts working if I also enable overlaps on the skeletal mesh, which seems a bit weird

dense owl
#

What about perf gains?

misty wharf
#

Hard to say. Will need to test some more

#

I was doing quick testing in PIE spawning 20 mannys who just run towards you and hitting like 30 fps drops as soon as they were spawned, I don't think changing it to navmesh walking had much of an impact

dense owl
#

Lawlster mentioned the CMC itself comes with big perf hit

misty wharf
#

It does yeah

dense owl
misty wharf
#

Yeah I was using unreal insights but it was not being very insightful

#

mostly claiming that slate was taking majority of the render time (eg. the UE editor itself)

#

messing around with something that might need to spawn quite many characters so want to just see whether it's going to perform properly and where the issues are going to be, but will need to test some more later

echo lark
#

does anyone know how to access State Tree parameters from Task in code ? (or any other node), without using bindings.

vivid fern
# uneven cloud Game AI Pro has good articles on different systems. HTN, Utility and hybrids. ...

in most shipped projects ive worked on I end up in a very hybrid type of place..

I usually end up with a set of high level behaviors in a priority order, that are "tested" to see if I meet the conditions to do the sequence of events each chunky high level behavior represents.. These can also be nested so that a single high level behavior can be broken down to smaller, but still chunky components

Typically a behavior tree runs these sequence of events/tasks, but the gating condtionals tend to vary per game ive worked on.. Sometimes its all done in a single behavior tree, sometimes its a set of functions that then runs smaller behavior trees, etc..

So like at a high level it looks pretty HTN-y as we select behavior but then when we find out what to do, it processes all the tasks and actions with a behavior tree.

State machines come into play to manage character state.. this is usually either the same SM or a tightly coupled SM with the animation state, though I have used them to drive AI decisions as well..

The above is engine agnostic explanation.. in 16 years i never have shipped an unreal game haha but in engines i've used (mostly internal tech) its how i've gone about it

#

AI perf only really gets bad due to counts and external systems not having good codepaths for AI to make efficient calls to ime

#

the actual decision logic is pretty quick typically in comparison

vivid fern
#

in my experience

dense owl
#

Oh ok I thought it was some system 😅

terse panther
terse panther
uneven cloud
vivid fern
#

yeah

#

this seems to work well flexibility wise

uneven cloud
#

Yeah, especially if you have a lot of variants.

uneven cloud
vivid fern
#

well and also its easier to hand designers a big block of "this is behavior that does x" than "here are the little bits and peices for you to make behavior"

#

ive never met a designer that wants to futz with the behavior tree haha

terse panther
#

how can we learn other AI systems like HTN and GOAP etc, as for behaviour tree and FSM we can use them in unreal and unity. So do we have to create these on our own or is there another way? as for HTN i think there is a plugin by unreal engine, but never used it

uneven cloud
vivid fern
#

🙃

#

at the end of the day they really just want knobs and levers to tune outcomes

terse panther
#

thank you for this

uneven cloud
terse panther
vivid fern
#

nothing wrong with creating a simple mostly naive implementation of some of these patterns to get the feel of how they would fit into your game if you have the time/bandwidth to do so

terse panther
harsh storm
#

The marketplace HTN plugin looks might nice to be honest. Always had my eye on it. Just, haven't needed it just yet 😅

terse panther
misty wharf
#

Well that's certainly interesting... poking around the state tree thing and turns out at least witht the state tree component...

  • if you use GetExternalData and your handle is to a pawn, it pulls the component's pawn
  • similarly if the handle is to an AI controller, it pulls the component's controller
  • if your handle is to a component, it pulls the component from the owner
  • if it's a world subsystem, it pulls the world subsystem from the world
  • if it's some other actor type it just assumes you want the pawn
#

imagine if this was documented somewhere beyond just "if you want external data use Get External Data" which never made any sense because how would it know what data you actually wanted... well turns out it just gets set by the state tree component

echo lark
#

for more details need to compile full debug and go in. That is from what I tested so far. It seems like it doesn't care about any specific types. It will just grab whatever is closest match

#

within hierarchy of classes

#

What's I dont understand is how parameters work..

#

and Why I can't bind properties within the same task -;-

misty wharf
#

external data is anything that is set into the state tree by something else, really

#

because if you ask for a game instance subsystem or something, you'll get nothing because there's no code to populate that into it

#

in case of StateTreeComponent, the code for populating it is in SetContextRequirements

#

I've not looked at parameters much tbh, I see there's a field to fill them in if you look at the details of the state tree component but that's about as far as I bothered with them :D

echo lark
#

SetContextRequirements
Yeah handles wont really work correctly if don't set it from schema in some way ; d

#

I tried to convert State Tree into "utility selector" and it honestly kind of works, without even modifying engine code

#

Wall I hit is how to create "results" for each actor. I have it working, but UX for it sucks hard 😄

#

it would be so much easier If I cloud bind inputs/outputs within the same task

#

or would be able to write into some global parameter from task and read it from other bound property

misty wharf
#

I'm currently attempting to create a state tree task in C++ that would allow me to use AITask_MoveTo or something similar but I'm not quite sure how exactly you're supposed to bind a delegate to the task 🤔

#

I have it in blueprints but I've noticed with sufficiently many AI's using the task it consumes 1/4th of the entire frame to run them so wanted to see if moving it into C++ would make it perform a bit better

echo lark
#

assuming you are using the default component for State Tree, you can just store delegates inside instance data, it should survive for duration of tree execution.

misty wharf
#

Yeah the problem is more on the side of how do you have the delegate tell the task to finish, or how do you bind to a dynamic delegate to begin with because you can't have UFUNCTIONs in a USTRUCT

half stone
#

what conditions need to be true for AI MoveTo to work? I know for a fact that the node is begin called, I created a navmesh bounds volume and pressed P, the character is set to AIController, but it is just not moving

#

is there something I'm missing?

misty wharf
#

I would look in visual logger as navigation logs more output into it

#

Various reasons for it, like trying to move somewhere invalid, or missing a suitable movement component, etc.

half stone
misty wharf
#

no, visual logger

half stone
#

oh I'll take a look

#

thanks

#

turns out I was forgetting something, I just had to call SpawnDefaultControlelr at BeginPlay

#

@misty wharf

misty wharf
#

Yeah it's often something simple like that lol

#

By the way if anyone's curious about statetree performance BP vs C++ - I had two state tree tasks running on about 60 AIs, getting called pretty often. BP version: 10ms / C++ version: 171us

#

profiled with Unreal Insights

echo lark
misty wharf
#

Yeah. I looked at some of the builtins, seems the intended way is to just tick the task

#

I ended up implementing it like this:

EStateTreeRunStatus FShSTT_MoveTo::EnterState(FStateTreeExecutionContext& Context, const FStateTreeTransitionResult& Transition) const
{
    const FInstanceDataType& InstanceData = Context.GetInstanceData(*this);
    if(!IsValid(InstanceData.TargetActor))
    {
        //Target is not valid, can't move to it
        return EStateTreeRunStatus::Failed;
    }
    
    AAIController& Controller = Context.GetExternalData(ControllerHandle);
    Controller.MoveToActor(InstanceData.TargetActor, InstanceData.AcceptanceRadius);
    return EStateTreeRunStatus::Running;
}

EStateTreeRunStatus FShSTT_MoveTo::Tick(FStateTreeExecutionContext& Context, const float DeltaTime) const
{
    const AAIController& Controller = Context.GetExternalData(ControllerHandle);
    bool Moving = Controller.GetMoveStatus() == EPathFollowingStatus::Moving;
    return Moving ? EStateTreeRunStatus::Running : EStateTreeRunStatus::Succeeded;
}
echo lark
#

yeah, seems about right.
Other thing I learned is that Global Tasks/Evaluator are run on tree start until tree runs out of them. Then If you want to run states, you need to tick tree.
And if any of the global tasks return other tree status than Running.. You need to start tree again ;

misty wharf
#

Yeah it's a pretty big gotcha that if your global task returns something else than Running the entire tree just stops

#

Imagine if documentation existed

#

lol

echo lark
#

no way. None read it.

Ok I tried, and only learned basic how it work in editor 😄

misty wharf
#

Yeah at least there's a little bit of something

crystal sequoia
#

if I want agents using the nav mesh to be able to walk off all ledges anywhere on my map regardless of height is there a simpler way to do that then adding nav link proxies all over the place? I want my agents to be able to chase a player. When I do use nav link proxies they also seem to slow down and sort of stutter a bit at the top of the ledge before jumping so they are unable to keep up with a human player.

dusk pewter
#

@crystal sequoia you can do a task that detects if there is any walkable area at a certain distance or height and jump off to there regardless of nav mesh

halcyon dagger
#

If I use nav mesh invokers en I don't need nav mesh bounds any more?

echo lark
#

you need

#

nav mesh bounds marks where nav mesh can be generated

misty wharf
#

Did you ever figure out what caused this? I just ran into it on a task that had no instance data and seems adding instance data fixed it 🤔 Seems kinda weird that it would force you to have instance data even if you're not using it

misty wharf
#

lol yep saw that message also

#

I guess it just really wants you to have instance data even if it's empty

harsh storm
#

Perhaps.

#

I haven't used ST since like Jan/Feb of this year though.

dusky lodge
#

How are the Supported Nav Agents supposed to work?

#

It seems like its only available as part of a NavMesh, but I cant find where you classify a Pawn or AIController as belonging to a particular Agent type?

keen crystal
#

My AI character is setup to possess automatically, however on OpenLevel or RestartLevel, the AI never possess. Any ideas why?

dense owl
#

Sry I realized I misread

dusky lodge
dense owl
#

It has to do with the nav agent radius afaik

#

Which you can change on the CMC

#

Might be on the floating pawn component too, idk

dusky lodge
#

You would think it was an explicit decision by developers to which agent settings a pawn or the like belongs to.

dense owl
#

Yeah, from what I’m reading, the movement component agent settings are as precise as it gets

uneven cloud
#

The navigation system finds the best fit nav data for the agent properties. It actually makes more sense when you consider games with NPCs of various sizes, but using buckets for nav data. Because of the memory cost, you really don't want more than a handful of nav meshes.

misty wharf
#

Ugh found yet another fun state tree gotcha

#

if you use GetExternalData and it so happens that the thing you asked for isn't available... it just silently does absolutely nothing. No log info, nothing. Good luck figuring that out if you weren't paying attention to the one line of comments somewhere inside UE's source code that says the state tree won't run if the data isn't there

ocean wren
#

Thought I'd share, skinned skelmesh from Luma.ai text to 3D model (I had a mess last night and this morning)

#

Thats the luma model, before I import it into accurig for automated rigging

#

clearly you'd retopo first.. but hey, works alright

paper sparrow
#

What's the most efficient way to make an AI Controller follow a road / path / route? Someone suggested lots of target points that you 'walk to' but that seems archaic to me. Is there some sort of Spline system you can setup that you can reference in a 'move to' or 'follow' command?

wise sluice
#

There is zone graph but let me verify if that's not only available for Mass

#

Seems to be only for Mass tho 😔

#

You would need to use Mass and awake/asleep your AI to move from road to any other behavior

paper sparrow
#

Cool feature! No worries, I'm not using mass, I was hoping for maybe something simpler, like a spline template with a 'AI Follow Spline' command or something

misty wharf
#

I don't think it should be too hard to implement something where you dynamically adjust the point you're steering towards

#

Eg. you set up a spline which is your path, and then your actor picks a point slightly ahead of it on the spline to steer towards

#

and you just keep updating that

paper sparrow
lean cliff
#

Hi all,
Once I've Called UEnvQueryManager::RunEQSQuery, am I able to cache and reuse the same return UEnvQueryInstanceBlueprintWrapper object ptr to call RunQuery again to avoid frequent creation of the UEnvQueryInstanceBlueprintWrapper obj? Or does some sort of de-registration happen at the end of the EQS query?

#

Nevermind, I can literally just bypass all of that and call FEnvQueryRequest::Execute and pass in the callback obj + OnFinished function to call bypassing the need for the wrapper at all, just noticed in my ill state that it's a blueprint wrapper - brain is clearly having a go slow day!

rapid obsidian
#

Hello I am looking for advice.

I am making enemy and minion ai. I got them to attack each other no problem. I created a token system so they can only attack so often.

Where I am confused is how to program how a fight between say 4 enemy slimes and 4 minions should work.

Currently I get closest targets, if he has an attack token available reserve It and attack. But each slime will just get closest and do that. A lot of times they will stand around because they are targeting same opponent. How can I go about getting different opponents? Any suggestions?

misty wharf
#

Maybe you can have some system in place that gives a list of alternative targets if the desired target is unavailable? Or just have a list of available targets and pick from there (eg targets with tokens)

rapid obsidian
#

Yea I was thinking of checking all targets with tokens and choose one with a free token, but then not sure if the AI would just change targets Everytime someone else took their target over and over. I feel like there needs to be some sort of threat or prioritizing or something somehow

astral sinew
#

Hello. Stupid question. Shouldn't Rotate to face BB entry be able to take any BB objects?

harsh storm
#

Not all objects have representation in the world. Click the dropdown and choose a specific type of Object. Like Actor.

#

I'd imagine the key has a restriction to Actors or vectors.

astral sinew
#

Yep that was it. facepalm Thanks.

minor geyser
#

when i use this, it never succeeds, how do i "succeed" it? do i need to put something in the gameplay behavior?

misty wharf
#

If your gameplay behavior immediately returns iirc it won't actually acknowledge it

#

so your gameplay behavior needs to at least wait until the next tick before finishing, or you need to write a custom version where it works correctly

minor geyser
#

but, what node do i put in the gameplay behavior to finish it? i dont see anything like execute finished for example :X

misty wharf
#

Isn't there End Behavior or something?

#
    UFUNCTION(BlueprintCallable, Category = GameplayBehavior, meta = (DisplayName = "EndBehavior"))
    void K2_EndBehavior(AActor* Avatar);
#

at least the code suggests this exists

minor geyser
#

yes! i will try, thanks 😄 totally missed it

uneven cloud
paper sparrow
uneven cloud
uneven cloud
paper sparrow
# uneven cloud Spline component

Oh yeah I know about the spline component, I was wondering if there was an AI-specific variant or function you could use to make an AI actor follow a spline path nicely

uneven cloud
paper sparrow
#

The best thing I can think of is what 'zomg' recommended, continiously take the next point infront of the actor and move there

#

Ok, if that's the best way to do it then all good, just checking in if there' an alterative way

minor geyser
#

mmm it still does not succeed if i put the endbehavior in the behavior, i set a breakpoint to trap it if it does succeed and it never happens :/

uneven cloud
paper sparrow
uneven cloud
pliant ginkgo
#

hey, how would i go about improving the performance for large number (300-500) of Ai agents from the CMC?

harsh storm
#

RIP

pliant ginkgo
#

I cannot afford to create my own cmc as the game is multiplayer

harsh storm
#

That's even more reason to make your own CMC honestly

#

You're going to need to do a lot of optimizations

pliant ginkgo
#

oh, is my only option to make my own?

harsh storm
#

Most people struggle having like 80-100

#

CMC is not designed for this high count

pliant ginkgo
#

i'd be fine with less accuracy, cmc doesn't seem to have that option tho

harsh storm
#

Navmesh walking movement mode helps some

pliant ginkgo
#

yeah emphasis on 'some'

dense owl
#

Ik you said it’s late in your development but it still sounds like #mass might be the right way

#

Tho I’ve heard of people faking stuff with HISMs, if you can afford to do that in your use case

#

Btw my comment about people saying make your own CMC was before you said you’re gonna have 500x of them 😅

pliant ginkgo
#

brought me down from 50ms to 20ms from the CMC

#

i'm not aiming for 144fps w/ 500 AI, just "Playable lag", ie 15-25fps

harsh storm
#

What an odd target FPS. But you do you

pliant ginkgo
#

its just an extreme case, the worst the game can get

#

generally you'd have less ai

dense owl
harsh storm
#

Animations are costly as well

pliant ginkgo
#

well that screenshot is right from profiling :P

pliant ginkgo
#

compared to cmc and some of my code

dense owl
#

Mb my discord’s been acting up not loading screenshots until I restart the app,

pliant ginkgo
#

motherfucker

harsh storm
#

Slate be takin' up a lot of time

#

(I should probably look into insights more, lol)

pliant ginkgo
#

imagine your hud taking your entire 60fps frame budget 🤣

harsh storm
#

The real reason games like to go hudless, lol

pliant ginkgo
#

its the most basic ass hud too

#

abusing too many event ticks lol

potent loom
#

How many canvas' do you have merpl

pliant ginkgo
#

one per each part of each widget, eg

potent loom
#

ye

#

that's ur problem

harsh storm
#

Canvas can be costly

pliant ginkgo
#

id rather make my own cmc than optimize ui 😭

potent loom
#

tldr; replace canvas with overlay

pliant ginkgo
#

thanks will do

potent loom
#

but canvas' will absolutely shred performance

#

also the rest of common ui is pog as well, saves a bunch of time not that hard 2 learn

harsh storm
#

It's so common, they made it a plugin instead of base.

pliant ginkgo
potent loom
#

yeah lol the curse of too many things in unreal 🤣

harsh storm
#

I still haven't really bothered with common ui

dense owl
potent loom
#

this is easier to optimize than the cmc tho prolly

dreamy star
#

Can someone pls help (live prefarabli) we cant get our AI spline to move

#

We have tried builds 100 builds and it cant be done.

waxen portal
#

does this mean can't be executed in the first 5 seconds?

dense owl
waxen portal
#

it wont run the first 5

dense owl
waxen portal
#

this one means if not in cone abort or the other way?

dense owl
# waxen portal

Could it be that the next decorator is failing? Have you hit pause and stepped through the tree?

dense owl
waxen portal
waxen portal
dense owl
#

Like hit pause and go back using the arrows

#

You can also remove the other decorators under it and just put a wait there or something to test

dreamy star
#

Ok so we FINALLY found the problem, but not the solution. There is something with the Spline that cant detect the Level (generated Landscape) but it can detect on a regular plain. Why is that?

waxen portal
#

can i change the brush?

uneven cloud
uneven cloud
# pliant ginkgo motherfucker

You really should profile using a packaged test build. You are going to get very different results when trying to profile via the editor.

harsh storm
#

You pretty much have to make your own CMC for smoother gameplay for a number of things. Because of FSavedMoves. (I should've been more clear on which part I was referring to. The networking portion of the comment. Not necessarily improving perf for the AI)

uneven cloud
#

Every single time I've seen a team do their own CMC, it's always worse.

harsh storm
#

I'm talking about inheriting from it btw. Not a full bespoke custom thing.

uneven cloud
#

That's completely different

uneven cloud
waxen portal
#

da sprite thingy face

uneven cloud
pliant ginkgo
harsh storm
#

Not in editor.

#

So package it up and play

pliant ginkgo
pliant ginkgo
harsh storm
#

Definitely not shipping. But otherwise, I think the others are fine? I haven't used much of insights to be honest. #profiling would know though.

pliant ginkgo
#

I been using the 'Session frontend''s profiler

#

Oh yeah thanks

uneven cloud
pliant ginkgo
#

Oh i never noticed a test setting

uneven cloud
#

Know how I knew you were profiling in the editor? Your slate numbers.

pliant ginkgo
#

Ooooh

#

So its not just due to my event ticks

pliant ginkgo
#

It does get significantly faster the 2nd time but the 1st one is too long

uneven cloud
#

You might have non performant UI, but it's unlikely to have that bad of slate issues in a packaged build

uneven cloud
pliant ginkgo
#

Interesting, I'll filter those out then

dense owl
dreamy star
# uneven cloud Every single time I've seen a team do their own CMC, it's always worse.

Hej , we have some issue with landscape and spline . If we remove the landscape and use a plane the spline works in. Build. It always works in all cases in editor tho.

Might be something with collision when the landscape was generated or something with the material function we painted landscape with or maybe something else ... We can't figure out what it is .

dreamy star
#

@uneven cloud Do you have any ideas ?

Its something in the landscape material that has material funcitions, and check the material when AI is moving to make different sounds.

When we build with only a landscape without material it can move, when we build with material and paint the landscape, it moves on the first tick then stops (not visible but we hear the step sounds)

waxen portal
#

Do all the blackboard key get assigned the stuff they should? Relying on random literal names seems bad, how does it know when to put a vector value if I have 9 vector keys

dense owl
harsh storm
waxen portal
#

Do I have to put the exact same name? Or if typo won't be assigned?

dense owl
waxen portal
#

Question guys, if I have a selector and the left branch (sequence) is executing, can it jump to the right if it's if it's true or it won't jump unless it breaks?

waxen portal
#

so the sound thingy never executes if the actor is not set right

#

pointless

#

cant jump

dense owl
#

You also don’t usually need that second decorator

#

If not set fails, it means it’s set

#

There are some instances where you need both tho

waxen portal
#

Gotcha thanks for the help👍

uneven cloud
waxen portal
#

this is a notify when you land but absolutley nothing happens, any1 know why?

uneven cloud
uneven cloud
waxen portal
dreamy star
harsh storm
# uneven cloud Have they changed it to a TMap? Last I looked it was an array.

Gosh dang it Luthage. You did it again. Caused me to actually look at it. It's a UDataAsset with a TArray<FBlackboardEntry> for the actual contents. So, yeah it is still an array. I've always thought it was a TMap because the way you work with it was very map-like.

FBlackboardEntry has the entry name as an FName. And a TObjectPtr<UBlackboardKeyType> for the type.

harsh storm
uneven cloud
uneven cloud
#

You can get the key ID from a blackboard key selector.

misty wharf
#

Anyone played around with customizing pathfinding? I'm trying to see if there's some way to make actors prefer moving only in cardinal directions

#

I tired setting up a query filter which increases cost on paths the more they diverge from directly on X or Y axes but it doesn't really seem to have an effect

dull harbor
#

it likes to make clusters of ai

#

especially at like 0:49

#

for now it goes to enemies and neutral but:

  • switching to enemies makes it chase nothing
  • the ai doesnt have their own stimuli
lyric flint
#

how is the targeted char selected?

#

@dull harbor

dull harbor
#

hopefully you can read that

#

this is update actor bbkey

dreamy star
lyric flint
dull harbor
#

which is weird cuz i thought they needed stimuli

lyric flint
#

there's a way to make them respond to certain actors only but i cant remember it rn 🙂 , give me a minute pls

dull harbor
#

i swear ai was easier in 4.26

lyric flint
#

you'd need to make use of this

dull harbor
dull harbor
#

they think im neutral

lyric flint
#

yeah, give me 1 more minute pls 🙂

#

@dull harbor

#

u can define it only in c++ it seems

dull harbor
#

this is so mean of epic

south ferry
#

you can use LowEntryExtendedUtilities plugin

dull harbor
#

whats that

south ferry
#

they exposed the functions to set GenericTeamId

lyric flint
#

u can also use this i think

#

and just check the classes

south ferry
#

affillation detects based on the IGenericTeamAgentInterface

lyric flint
#

with for each loop

dull harbor
#

oh thank goodness

uneven cloud
south ferry
#

default is 0 = neutral

dull harbor
south ferry
#

=/= is hostile
== is friendly

dull harbor
#

whats ini

lyric flint
#

a config file

dull harbor
#

oh...

#

those 😨

uneven cloud
# dull harbor how do i disable auto registering
Epic Developer Community Forums

In C++ all you need to do is to call UAPerceptionComponent::UnregisterSource. This function however is not exposed to BP, so if you want to do it in BP you’ll need to put more work in. You need to make pawns not auto register for AIs’ sight sense. To do that add following to your DefaultEngine.ini: [/Script/AIModule.AISense_Sight] bAutoRegiste...

south ferry
#

with the plugin you can set those team id

dull harbor
uneven cloud
south ferry
#

yes, 0~65565 only however

dull harbor
#

??????????

uneven cloud
#

No. The default affiliation is team id != Other team id

dull harbor
south ferry
dull harbor
#

ah

#

cool cool

dull harbor
#

so should i set the team id of the ai to 2 and the player to 1

karmic pelican
#

how can I keep updating the AI MoveTo with the EQS??

#

it updates the EQS, but the AI moves to the location it set before updating

dull harbor
#

ok uh @south ferry so i set them to only follow enemies

and i put first person character team id to 1 in construction

and ai team id to 2 in construction

still doesnt work tho

karmic pelican
#

nv, fixed it, my bad

dull harbor
#

now they just dont follow

lyric flint
uneven cloud
lyric flint
lyric flint
#

just in case

#

i'm unsure how it's supposed to work though

dull harbor
dull harbor
lyric flint
#

make it set to neutrals

#

as well

#

just don't have friendlies detection enabled

#

@dull harbor

south ferry
#

i just remembered something

only AAIController has IGenericTeamInterface implemented by default 🤦‍♂️

#

so it wouldnt work without c++ anyhow

lyric flint
#

@south ferry

misty wharf
#

The fact AI controller implements that by default is kinda confusing

south ferry
#

yea

misty wharf
#

It literally cannot work without implementing it on a pawn

south ferry
#

since it sense the pawn..

misty wharf
#

because perception system doesn't consider what the controller implements

#

yeah

dull harbor
#

so can i detect if its a player or something

lyric flint
#

no...

south ferry
#

ye so you have to detect neutral, from the array of perception, either use casting or actor tag to differenciate between player or ai

south ferry
lyric flint
dull harbor
#

how would i just check if the actor is a player

#

jeez this was supposed to be easy

lyric flint
#

use this

#

with for each loop

south ferry
#

they are both fine

#

you can do the checkings on the Actor reference

lyric flint
#

i should probably silence myself as idk how these events actually operate 🙂

waxen portal
misty wharf
#

target perception update is probably easier to use

#

just cast the actor to your player class

#

and check stimulus' successfully sensed to determine whether sight was gained or lost

south ferry
#

also casting isnt so bad if the class is already loaded somewhere else in the game
casting is only bad when it loads an entire class unintentionally or having too much dependency

waxen portal
south ferry
#

if you dont want to care about classes, then use actor tags to differenciate them

dull harbor
#

this works

#

yay 🎊

uneven cloud
dull harbor
#

now these ai are really scary lol

#

they can use chase you and use doors and are fast 😨

#

in the 4.26 version they could open doors cuz doors kinda sucked

#

i wonder if i can have an ai tell the other ai in a certain area where the player is??? but this would kinda suck if there were multiple players

south ferry
lyric flint
#

what would be the best way to implement broadcasting to nearby AIs like that?

#

with a collision box?

#

or maybe a multitrace?

dull harbor
#

why are they green guys instead of devils

#

huh

misty wharf
dull harbor
#

would be so complicated

#

and i kinda dont need to worry about this right now heh

south ferry
whole tangle
#

Hey there, I was wondering, is it possible to tell an AI character to jump, and to have some relatively fine control on how said character is jumping?

dense owl
#

The same way you would do it with a player, I’d imagine.

uneven cloud
dull harbor
#

what are all these voice channels for

#

are they just general

dense owl
#

Please stay on topic

dull harbor
#

i was gonna screenshare my ai

#

lol

dense owl
#

Better you just screenshot and explain the issue

misty wharf
whole tangle
uneven cloud
dense owl
dull harbor
#

his name is carl... he is mean

misty wharf
uneven cloud
misty wharf
#

hmm

#

yeah I guess if you override GetTeamAttitudeTowards on the controller that's doing the sensing and have that cast Other and get the controller from it that would do it

#

It just feels a bit backwards that the one that is sensing needs to deal with that :D

whole tangle
#

If I wanted to turn off gravity for my agent, what would I do? I couldn't find a good way to do it online.
(in C++).

dull harbor
#

the viewport

misty wharf
#

Depends on what the agent in question is

#

If it's a character you can turn off gravity from the CMC

whole tangle
karmic pelican
#

how can I keep the AI to move to the updated location??
the AI will fire only when the point is reached

#

what happens, the AI sets a location and goes to it
when the EQS updates, the AI will remain moving to the first location until reached

#

I instead, want the AI to move to the updated EQS location and on success we do the rest.

#

any ideas?>

uneven cloud
karmic pelican
#

thank you!

karmic pelican
#

this is never going into the sequence, why??

harsh storm
karmic pelican
#

That's embarrassing

#

thanks

#

yup, all working well

rapid obsidian
#

This is what I am thinking on how my ai choose and fight other ai. Any thoughts on this?

Basically I got minions and Enemies. Slimes and stuff.

So if I have 5 minions fighting 5 slimes I want it to flow and look good. not just them all jump on 1 thing

dense owl
#

any idea why this would be happening? the AIMoveTo always returns success when really it prly shouldn't considering the path is never resolved

rapid obsidian
#

maybe because of partial path?

karmic pelican
#

what's the best way to deal with enemy reaction time??
the enemy will only be able to attack when the reaction time is >= 0 and we will stop reducing.
if not, we will keep failing and reduce the reaction time

#

was thinking with a service, but not sure how would I make it to fail within the condition?

dense owl
#

It can’t seem to project to the navmesh for some reason

uneven cloud
dense owl
jagged verge
#

Hi, I'm trying to make that AI Enemy able to avoid bullet(slow speed) by running EQS and MoveTo the location.
But Query doesn't get score from bullet actor's distance.
For Bullet Context, I just set Cast BP_Bullet. How could I make it?

#

also, I try another way like this. but AI Character only come to bullet actor

karmic pelican
# uneven cloud Please explain better

I got it working
Reaction time says to the AI when to attack when it reaches 0
I ended up doing it in a service and a decorator
Service to reduce the reaction time until 0
And the decorator to check if it's >=0

#

And it worked well

karmic pelican
jagged verge
#

It's the Bullet Context node

misty wharf
#

That's never going to work unless the actor performing the query is a bullet

#

Note that the parameter is name is Querier Actor - the actor which is performing this query

rapid obsidian
#

for me i got the querier actor's blackboard and got the actor i set as target

#

but mine is for AI not sure about yours

dense owl
#

I've tried diff move to nodes, diff AI Controller classes, testing the navmesh on the landscape vs on a mesh, using actor or location as a goal

uneven cloud
dense owl
#

sec I'll get one with something other than AIMoveTo

uneven cloud
dense owl
uneven cloud
dense owl
#

ty

uneven cloud
#

Start with doing vislog location for the start point (pawn location) and end point. It says that it can't project the end point, so showing the end point will likely show you exactly why.

dense owl
misty wharf
#

Anyone know if there's some particular reason StateTreeRef in UStateTreeComponent is not settable? As far as I can tell there is nothing in there that wouldn't allow switching it at runtime

#

(Looking to reduce my boilerplate a little so I could define the default tree in my pawn and the controller would grab it from there instead)

dense owl
#

I tried setting the Z to 0 as well, so the sphere is even lower on the mesh just in case

#

but now with move to location or actor I don't even see anything in the vislog about the actual pathing, only these redirects

#

I don't get this, I've made AI before with no issues 😅

#

ah ffs

#

I thought about this before but I didn't actually try it... 🤦‍♂️

#

Had to add a delay until next tick between the line trace I'm doing and the actual moveTo node

#

weird tho, it's not like I have to wait for the line trace to get the vector, I'd tried it with fixed vectors too

#

running this onPossess btw, so not like it's a BeginPlay issue 🤷

misty wharf
#

Hmm, it's kinda looking like state tree doesn't really have any mechanism of easily waiting for a task to finish, and then performing another task based on the finished task's data 🤔

#

Eg. you have a task which runs an EQS query and you want to use the result of it in another task - how are you going to do that? You can only link task parameters into tasks in parent states, but you have no way of determining whether a parent state's task has finished.... because if the parent state's task actually ever finishes, it causes the entire state to finish immediately

#

So it seems you either have to do all this work up front, or you have to keep retrying until the data becomes available, which you determine via some other property

dense owl
#

idk why I had to add a slight delay after Event Possessed for the AI to be ready to move (maybe bp too slow?), but it's not like I need it to go as soon as the game starts. the vislog nodes are def helping troubleshoot the path issues, thanks @uneven cloud 🙏

misty wharf
#

Hmm so there is an actual example in the engine source of how a delegate can be used within statetree tasks 🤔

#

It seems to suggest if you want you can write into instancedata in the delegate through the struct ref

#

It also unregisters the delegate if it's still valid in ExitState as one might expect

#

(this is in FGameplayInteractionSyncSlotTagTransitionTask if anyone is wondering)

karmic pelican
#

is there a way to run the generator on the right if the left one is valid?? (by context)

misty wharf
#

afaik the additional generators only run if the previous ones produce no results, so that would be no

karmic pelican
#

alright, thanks

foggy sequoia
#

What Have I forgot to do Cant seem to set to Target Actor

dense owl
foggy sequoia
#

dont see any option to do so

dense owl
#

How are you setting this target, inside a task?

foggy sequoia
#

from the Ai controller

dense owl
#

Show code

foggy sequoia
#

cant atm playing BG3.

#

I will get back to this tommorow thanks anyway :L)

mortal spoke
#

Can I use multiple sights on a perception component or is this not allowed?
When I use second sight, it seems to not be registered

dense owl
#

sights or senses?

mortal spoke
#

sight, wanted to do two different configs (e.g. one for noticing for combat and one for stealing)

misty wharf
#

Two sight configs on same perception component won't work

#

You can add a second perception component and give it a different config

mortal spoke
#

Thanks, will check that out.

rapid obsidian
#

ive never even heard of vislog i needa learn that

dense owl
dense owl
jolly lotus
#

Does anyone know how to use FindPathToLocationSynchronously()? What is the WorldContext UObject first parameter and PathfindingContext supposed to be?

#

Also wondering do people generally follow the public/private split or just put all their code in one directory?

flint matrix
#

Hey folks, why doesn't State Tree component start its logic when you add it to the AI Controller instead of the Controlled Pawn?

#

Also why doesn't the State Tree enter/exit state debug feature work in 5.3.1? I can't figure out why the button is there, but it doesn't function.

stoic cove
#

Hello. I'm trying to get navigation mesh invokers to work. Followed several tutorials but for some reason my AI does nothing. AI works perfect with a normal navigation (non-invoker) volume. When using invokers pressing P also does not show the green nav mesh. But I guess this is logical as navigation only gets generated on runtime? Question still remains why my AI doesn't do anything? Is there a way to see the generated nav mesh on runtime?

#

Wait, ok so I reverted everything back to static, disabled invokers and now my navmesh doesn't work anymore either?

#

Everything worked perfectly fine before switching to invokers? What is going on? 🤔

foggy sequoia
#

OK, Anyone know why I cant select my target Variable here, Cant even see any option to expose them?

#

Strange AS my EQS can use it.

jagged verge
foggy sequoia
#

nvm I just Made My Own, as the inbuilt one seems to have an issue.

jagged verge
#

I solved it. I use Get actor of class then it has affected. Thank you!!

terse panther
terse panther
minor geyser
#

when designing a generic BT to handle the most common NPC tasks, is it best to try to keep it all in one BT or should I have a "core" BT which then runs smaller BTs which are just for specific tasks? if that made sense :X

dense owl
#

You can always start with one tree and make your way from there, refactoring is inevitable anyways

minor geyser
#

I see, I will start making some smaller BTs for individual tasks rather than trying to make just one big BT and see how it feels. I already have a robust BT for the common tasks, my problem is getting the BT to go "back" so it can start with another task earlier in the tree as it just wants to move right, this problem is easily fixed by just splitting it into smaller trees though. Do the BTs share a blackboard if they are all on the same aicontroller? that would massively streamline things

dense owl
#

Otherwise it’ll yell at you 😀

minor geyser
#

cool! i will have a play around, thanks for the info!

uneven cloud
jolly lotus
#

You're saying there's an equivalent class functions for actors?

uneven cloud
jolly lotus
#

Yeah I do organize in directories, but don't find a lot of value in private/{dir1} + public/{dir1} vs one set of folders other than unreal seems to expect the first way

uneven cloud
jolly lotus
#

What do you mean by built in functionality?

uneven cloud
uneven cloud
jolly lotus
#

I see, yeah that makes sense.

#

This is actually to find the distance to different players before I move though, to make the decision on who to target

uneven cloud
uneven cloud
jolly lotus
#

Ok thanks

half stone
#

Hello, I have multiple types of enemies in my game. I'm trying to make animation blueprints in a reusable way. I already made the ABP for the melee enemies and now I'm trying to use basically the same blueprint just with a different skeleton and animations for the ranged enemies. Is there a way for me to do that? I tried creating an animation template but I couldn't find a way to change the animations. Do you guys know a smart way to do that so I don't have to basically create the same state machine and variables in another ABP?

misty wharf
half stone
#

thanks

dense owl
#

We need a Luthage appreciation day 😀

misty wharf
#

Somehow this channel gets a lot of animation questions so you're not the first one lol

half stone
#

now I might be stupid here but I can't see an animation channel

#

it shows up if I click on your link but I just can't find it otherwise

misty wharf
#

🤔

dense owl
misty wharf
#

It's in the Content Creation category, yeah maybe you got it hidden somehow

dense owl
#

The naming of those categories is… lacking

unkempt pulsar
#

Any way to make certain AIs not use navlink proxies? I want them to not use navlinks in their pathing

uneven cloud
karmic pelican
#

I do not want this to generate here, since the actor on the right is out of range

#

but generate here since the actor is in range

#

is it possible?
or should I make a custom generator in cpp? making the actorsofclass does the cone?

dense owl
karmic pelican
uneven cloud
karmic pelican
misty wharf
uneven cloud
karmic pelican
uneven cloud
karmic pelican
#

okay, thank you

#

like this?

waxen portal
#

can i set/ get vlaues of a blackboard from the character bp?

#

like for making ai go to where the player see or smth like that

dense owl
#

As opposed to just doing it from the tree ?

terse panther
#

Or directly from bt

#

*in bt

waxen portal
#

makes sense

waxen portal
#

yh basically get actor from class and get the event and feed the params

rapid obsidian
#

You can use get player character node, use an interface, cast to player all kinds of goodies

harsh storm
# uneven cloud It is actually my birthday today

Happy Birthday Luthage. Thank you for always sharing your knowledge so willingly and especially thank you for always making me double check the code itself. I highly appreciate you 🥳 🥳

hollow bluff
#

Does anyone know how to increase the avoidance distance of moving ai actors (RVOAvoidance or detour) without making the character capsule bigger?

dense owl
hollow bluff
#

sadly had no effect

#

if I make the character capsule bigger things work perfecly

#

but than they don't fit through doors

dense owl
#

Hold on

#

There’s a couple of settings under the RVO avoidance

#

Did you try changing that consideration radius

hollow bluff
#

yea I did

#

but I think it is just the radius in which range it considers other actors

#

not the actual avoidance distance

dense owl
#

And the weight?

hollow bluff
#

tryed some values but anything other than 0.5 just had weird results

dense owl
#

lol comments

dense owl
# hollow bluff tryed some values but anything other than 0.5 just had weird results

The 1st and 3rd have the same exact comment

/** The scaled collider radius to consider for RVO avoidance **/
    virtual float GetRVOAvoidanceRadius() = 0;

    /** The scaled collider height to consider for RVO avoidance **/
    virtual float GetRVOAvoidanceHeight() = 0;

    /** The scaled collider radius to consider for RVO avoidance **/
    virtual float GetRVOAvoidanceConsiderationRadius() = 0;
hollow bluff
#

how would I change the Radius without making the collider bigger 🤔

#

I use mostly bp, would I need to do this in cpp?

dense owl
#

idk if you can. Tbh I know very little cpp, but looking at the overrides in the CMC, it looks like that is directly tied to capsule size

#
float UCharacterMovementComponent::GetRVOAvoidanceRadius()
{
    UCapsuleComponent* CapsuleComp = GetCharacterOwner()->GetCapsuleComponent();
    return CapsuleComp ? CapsuleComp->GetScaledCapsuleRadius() : 0.0f;
}
hollow bluff
#

could I just put in some other value for the CapsuleRadius or would this require me to compile the engine from source?

#

because right now I am just using the one from the launcher

dense owl
#

Yeah, not sure if you can do it otherwise. There's the AvoidanceConsideration one that's not being overridden and is the one exposed in the settings there, but I can't tell what the diff is between the 2, I think maybe that one is used for rotation?

#

There are smarter people in here that might know if there's a way to change this otherwise 😅

#

You can try DetourCrowdAI instead (turn RVO off) see if that works better for you

hollow bluff
#

I think consideration radius is how far the character to avoid can be away

#

but I need the GetRVOAvoidanceRadius to be bigger as it seams to be t5e actuall distance they keep

dense owl
#

but afaik to make either of these options work smoothly, you need to go into cpp at some point

hollow bluff
#

@dense owlI think I just found the dumbest solution ever...
I thought what if it only runs "GetRVOAvoidanceRadius()" at begin play. Than I can make the capsule big by default, and than after some delay make it small again and it still uses the big radius. As dumb as it is it seems to work 😆 Thanks for the help 🙂

dense owl
hollow bluff
#

yea me, too 😅 for not it works like a charm but if I end up with any other issues I will have to look into a cpp fix

#

I just don't want to have to compile the whole engine just to change one float value 😅

dense owl
#

it might not be necessary to do all of that, but I'm afraid I don't know have that know-how 😅

hollow bluff
#

same here

uneven cloud
hollow bluff
#

sadly I can't figure out how to tune the avoidance radius

dense owl
#

hehe, I had a feeling Luthage would know we're doing hacky shit 😄

dense owl
hollow bluff
#

I already tryed both

#

but cant find avoidance radius for detour, too

dense owl
#

you could try adding a fat sphere/capsule to your char that ignores other objects

hollow bluff
#

I did that too but for some reason it just ignored that collison for moving even if set to blockAll

dense owl
#

I'm having a hard time reading through it but it looks like it's doing a lot more complex calculations than RVO

exotic narwhal
#

Hi, I have a question about the decorators of the behavior trees.

TL;DR - Is there any way to "short-circuit" the decorators?

I'd like to abort the lower priority tasks when all 3 decorators return success. Setting like this works, but the problem is the last decorator (Can go straight to) is rather expensive, so I want it to be executed only if the prior 2 decorators return success. Right now it runs every tick no matter the prior 2 returned fail or not. Is there any way to do this? I tried turning it into a composite, but no luck. I know it can be done if I make a new decorator that combines those 3, but I want them to be separate, as they can be used separately elsewhere.

uneven cloud
uneven cloud
exotic narwhal
# uneven cloud No. You need to make one decorator

😔 OK... Thank you for answering. Just one more question, at least is there any way to call another decorator inside a decorator or do I need to move all the nodes of those 3 to a blueprint library and make them to call the ones in that?

uneven cloud
exotic narwhal
#

Got it. 😂 Thank you for answering!

ancient wedge
#

Hey guys, what would be the correct way to replicate the focus to the ABP? We want the character to look at the head location of the focus.

fresh vortex
#

Hello. I'm trying to create a simple rts (base defence game). I'm rather a beginner when it comes to blueprints but i want to optimize the game as much as i can. So far I'm having issue with AI tanking the fps rather quickly. Having 18 AI drops fps from almost 90 to 40. Im only telling the units to move to specific location and attack building - I think i have most of the stuff on timers instead of ticks. Is there something else i can do to save performance (like some simplier navigation method or something?).

wanton compass
fresh vortex
#

@wanton compass Thank You. I'll look into it 🙂

wanton compass
fresh vortex
#

@wanton compass Thank You again. I don't mind it being scary! It looks like debugging tool from Unity 🙂

wanton compass
#

Does anybody know, how to combine Navigation Invokers, with a simplified pre-baked pathfinding for the open world that would support them?
When I enable "Generate Navigation Only Around Navigation Invokers" I can't pre-build the navmesh in "NavMeshBoundsVolume". When I disable it, the Navigation Invokers stop working for me.
Is there a way to combine those approaches or are they incompatible by design? If so, how do I avoid my actors with NavigationInvokers getting stuck in dead ends?

wise sluice
fresh vortex
wise sluice
#

But yeah invokers are for dynamic navmesh while prebaked is with the static option 😦

not sure about the static + dynamic option tho

hollow bluff
# uneven cloud How small is your capsule?

22, is best at representing it's size to fit though small spaces. But I want them to keee some distance from each other, it looks best with a size of 60. But than they don't fir though doors

wanton compass
#

If static navmesh is trully unavailable for Invokers then the only thing that comes to mind is inplementing a custom node system for long-distance travel for NPCs (along the roads for example)
Are there any premade solutions for that?

#

Plugins are fine too

celest python
knotty kiln
#

Hi guys. I am working on a project with a particularly large map in UE 4.27. I was wondering what is the best approach for the navigation for a large area with many AI. I read about Navigation Invoker's but I have some questions in mind. I am trying to keep the project as optimized as possible so I was wondering, would it be better to use a one large static Nav Bounds Volume or a dynamic one with invokers attached to the AI/player?

versed maple
fresh vortex
# celest python Timers are not an answer to tick being slow btw

@eren I've managede to increase my fps from 20 units on screen at 18fps to 120units at 35fps 😄 Thanks for the help. I still wonder what would be a better solution to this 'set timer' - with the current red line connected, the fps still drops from 44 to 35 at 120-140 units on screen. Without the red even connection, it barely drops by 1 fps. I don't know how i could optimized it :/

knotty kiln
#

a 1 sec timer wont affect your performance that much :0

celest python
#

shipping build matters when it comes to BP

#

Editor build is 10x slower than shipping

fresh vortex
#

I see

dense owl
#

Always good to do actual profiling, as much as Eren’s blog says timers can be expensive, it doesn’t mean that’s what’s slowing down your game right now

celest python
#

timers can be expensive
timers can be more expensive than a tick call*

#

but still true

fresh vortex
#

I'll do the profiling then. I already gained a huge amount of performance just by removing one of the timer events. I'm also very early in the 'development' so I'm not sure how much i should worry about optimization - just the fact that i can have 120units now instead of 18 is a huge win. Thanks guys for all the help/feedback 🙂

celest python
#

Performance comes from design, not from having tick/timer/other in different forms

#

And you're mostly bound to whatever BP exposes you when you want to optimize, for example default CharacterMovementComponent is most common overhead in the UE so far (and its not a thing you can optimize without deep C++ knowledge)

#

So you should do a wide research while profiling constantly and carefully structure your project

fresh vortex
#

Thanks, I'll try - i take since BPs performance can be so bad in editor, it's better to do all the profiling in the build? There's just soo much to learn at once. Every time i fix something, two new issues appears :d

celest python
#

then package your exe

#

and profile with insights

#

you can also read the rest of the article that I've sent

#

(when you have time, because it wont provide an immediate information)

fresh vortex
#

Aye, i glanced through it quickly to find the things I was doing in my BPs wrong, but i will definitely dive deeper into it later on 🙂

uneven cloud
ancient wedge
uneven cloud
uneven cloud
uneven cloud
hollow bluff
uneven cloud
uneven cloud
hollow bluff
uneven cloud
dense owl
uneven cloud
hollow bluff
dense owl
#

In RVO

#

Idk about Detour

#

Idk enough cpp to decipher the math they’re doing there, I just saw it was complex

hollow bluff
#

pretty sure Detour also uses capsule size

uneven cloud
#

Detour has more things you can tune, but it's been a long time since I used it.

hollow bluff
#

because I had no luck tuning/ understanding them 😅

dense owl
#

Ah right I forgot they have them in settings

hollow bluff
#

I already cranked up max agent radius and my agents radius inside movement comp and it changed nothing

dense owl
uneven cloud
hollow bluff
#

or maybe there is but I dont really understand what all of the parameters mean. I can also not find any documentation on the parameters

uneven cloud
celest python
celest python
uneven cloud
# celest python Like?

"Everytime the Blueprint VM evaluates a function, it just runs a code to invoke the C++ function." This section is pretty misleading. Someone on my team went through the code that BP uses to add to a variable. Get, add, and set. It was several PAGES of C++ code.

uneven cloud
#

It is several pages. I'll look at it again today to see what exactly it was doing.

Hah. Didn't realize you wrote that.

celest python
#

I've been working on a tool automatically transpiles BP to C++ for a while, ended up memorizing everything in ScriptCore.cpp burn

#

So I thought I could write something about my adventures back at the day

#

though like my AI article its one of the articles I dislike, because when I wrote that I was still naive

dense owl
#

Yeah, well, now that it’s “feature complete” when is release? 😛

celest python
#

creator of fluid ninja live gave me access to his plugin

#

been trying to compile it since a week

#

and its not going well haha

uneven cloud
dense owl
#

So casting to the native parent class is cheaper?

#

Ig it makes sense less code to load

uneven cloud
#

It does not create a hard reference to data. So it's cheaper in the memory sense, which is what is bad about casting in BP.

celest python
dense owl
uneven cloud
celest python
uneven cloud
celest python
#

I'll rewrite it when I'm available then, thanks for the feedback

harsh storm
dense owl
celest python
#

Casting to some class with insane amount of references is also fine (in terms of casting as an operation), its just it makes BPs loading at runtime very slow but the cast itself will still run at the same speed of casting to a native class

wanton compass
# uneven cloud Why do you need invokers? It's the most expensive option. Modifiers only allow...

Huh, intriguing. I was under the impression that small invokers were more performant when the world scale gets too big, or at least I think that's what my coworker said.
Are multiple dynamic navmesh bounds really more performant than invokers? If so that could spare me a lot of trouble.

When the geometry changes, only that single navmesh bound that it changed in gets rebuit, do I assume correctly?

uneven cloud
wanton compass
lyric flint
#

I made an ability system but i don't know how to apply the dmg to the ai enemy damage script i did

dense owl
#

Apply damage , on damage taken

tough tulip
#

So whilst using the debugger, I can see that due to me rechecking if we are still chasing the right target (After move to start > delay > Stop all movement > run EQS > move to start), it is creating a queue of MoveTo gameplay tasks. Is there a way to invalidate/remove these from the queue? After reaching about 10 in the queue the AI starts moving very slowly and jittery (likely because it is trying to figure out what to actually do).

tough tulip
dense owl
#

You shouldn’t be doing this way tho

#

Just use a service

#

And have your decorator observe on bb key change

tough tulip
#

Right that is what I initially did, but I couldn't find a way for a service to run the EQS task

dense owl
#

That is, if you’re using a BT

dense owl
#

Task didn’t work well for me

tough tulip
#

Here is the setup:

dense owl
#

Right click your selector

tough tulip
#

For more context:

dense owl
#

Yep

tough tulip
#

I might very well, and this has taken many hours of research, be an idiot 😂

#

The strange thing though is that I can only select "SelfActor" as the blackboard key it outputs into 🤔

#

So if I understand this correctly; The service will check every x seconds if its conditions are met. If it is, it will output the result into the key you provide, and will run the task beneath the selector right? If it returns false, it will run back up to the root node?

tough tulip
#

This is my problem at the moment:

dense owl
#

I mean I have another selector above it but shouldn’t make much difference

tough tulip
dense owl
#

Should be Actor

tough tulip
#

Yep that was it