#gameplay-ai

1 messages · Page 5 of 1

cursive wave
#

The end of the task means the work to be done is done, in a way. You adjust the speed and say you're done, but it may take 10 seconds to come to the player. Think of it this way: you want the player to fly and then run the attack task. In such a case, it will run the attack task before it reaches you.

#

Casting pawn to character. And casting is expensive

rose bramble
#

i am just aware to use something in Every tick

rose bramble
cursive wave
#

Your npc is flygin right?

topaz raptor
#

How does AI perception work with a nav mesh that is only generated around invokers? I have added an invoker to the player and an AI npc. When the nav mesh areas generated by the two invokers are not connected, the AI npc does no react to sound events from the player. When the areas are connected, the npc does react

rose bramble
cursive wave
cursive wave
cursive wave
# rose bramble yes. gravity set to 0

For example this video: https://youtu.be/IyJKrvy9afo

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

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

▶ Play video
cursive wave
cursive wave
cursive wave
uneven cloud
#

No. I'm guessing that the box component regens the nav mesh as the agent moves, invalidates paths of nearby agents and does collision. There's a reason why that is not how avoidance is done.

storm zephyr
#

yeah it's a shame because rvo and crowd following components have a lot of issues and i was trying to find a way to get some basic avoidance

harsh storm
uneven cloud
celest python
#

Instanced Structs doesnt show up on BT node instances... thanks Epic CB_elmoburn

celest python
#

trying to use FInstancedStruct as a variable

#

with EditAnywhere

brittle lynx
celest python
#

I actually hadn't have a question was just venting to void but my AIs are spawned from pool by data assets and data assets has FInstancedStructs to determine behaviors of them. I wanted to have a decorator that checks if data asset has X type of instanced struct that equals to provided one from details tab

brittle lynx
#

They need to be instanced structs because you want the array to contain different types of structs?

celest python
#

yep, with that way I can achieve modularism

#

each enemy can have any type of behavior

#

so I could have a single BT with HasDataStruct decorators on top of RunBehavior nodes

#

with only one single selector

brittle lynx
#

Why not just a single RunBehaviorDynamic node where the subtree is taken from the data asset?

celest python
#

because enemies can have multiple behaviors too

#

like something can be both tank and a bull

#

first I thought of a procedural BT where I use arrays and data-driven simple system but I thought it'd be overkill

#

and probably too much boilerplate to write

#

but now actually thinking about it, to somehow support FInstancedStructs I still need to write some boilerplate so maybe I can consider that idea again

#

basically each data struct also will contain the BehaviorTree associated with the data and priority will be array order

#

I'll have some instanced UObjects as decorators

#

and do very simple BT logic maybe not even BT, will just check conditions and if any index lower than current index is true I'll just switch to that BT

#

this way I can even decide which behavior will be more prior thinkblob

keen crow
#

why can't I open up this debugging tool in some levels? it works fine in testing maps but in more complex where AI spawn on dynamically streamed levels (via ULevelStreamingDynamic::LoadLevelInstance) it just won't open even though I'm standing right next to my bots and I can see in vislog that they are actually running

topaz raptor
topaz raptor
brittle lynx
#

@celest python What I typically do is a dataasset with a TMap from GameplayTag to BehaviorTree asset. All AIs have the same top-level behavior tree with a bunch of RunBehaviorDynamic nodes in different places for different parts of the behavior. The data asset populates those from the TMap.

hearty niche
#

Has anybody used AI with world partition here? When the NPC is too far the controller disappears when I do an AI debug.

keen crow
#

how can I get information about current navmesh in editor? like how many tiles does it have, etc

uneven cloud
uneven cloud
celest python
#

Do you remember how did this end up zoombapup? Been trying to test detour crowd since a week, I can say it just doesnt work 😅 I set different values to make pawns avoid each other but they always stick closer. I guess they only avoid each other when they face each other. RVO was making pawns slide horizontally without checking direction of other agents unlike crowd. So I might need to implement a flocking algorithm inside of the crowd manager

#

Never tried implementing one yet, but it looks so easy to do. Also it looks very cheap on cpu. Just not sure how it would work with crowd manager

hearty niche
celest python
#

That sounds so cool, will refactor into something similar. Thanks

hearty niche
#

I would like to know more about this one.Plus how could I displace enemies that are standing?

uneven cloud
hearty niche
uneven cloud
crude jolt
#

in the Nav Link Proxy, is it possibly to automatically copy the coordinates of the Simple Point to the Smart link?

supple sigil
crude jolt
supple sigil
hearty niche
misty wharf
#

Hot damn, an actual AI system update?

#

Had to do gameplay tags via names before :P

verbal shore
#

Same haha, finally they did it.

haughty coral
misty wharf
#

Still it's something lol

tawdry crag
#

With the Navigation System -> Supported Agents in project settings, I'm having some difficulty understanding how to set any actor to be a specific NavAgent.

It seems that the supported agents spawn get a NavData class spawned for them, and Links can filter what agents use them (which I guess affects what navmesh actor the link affects). But there's nothing for connecting a character to an agent. Are you just supposed to set the "Preferred Nav Data" in the CMC and that's it?

olive prism
#

Can anybody help me? My enemy does not move towards me

charred lava
olive prism
charred lava
#

In your FindPlayerLocation task. The last node "Finish Execute"

olive prism
#

Wow

#

Thanks a lot!!!!

uneven cloud
uneven cloud
celest python
harsh storm
#

"GameplayBehaviors" 🤔

supple sigil
#

Do EQS Queries return items scored 0? (even if it filtered out others)

celest python
#

I guess math behind it allows that

supple sigil
#

Because I have a EQS Query that when it performs a search, it may filter out all but 1 item sometimes. and if there is only one item, then said item's score is always 0.00

quaint oxide
#

I want to calculate a shortest path to any point within an area, rather than to one specific point.

For example, a unit in an RTS wants to cast an ability at a target that is somewhere on the other side of an unpathable chasm. If the ability has enough range to reach the target across the chasm, I want the unit to walk up to the edge of the chasm and cast across, rather than try to find a path to walk all the way around the chasm.

Is anyone aware of any existing solution for this, or would it require digging into recast/detour to write custom pathing functions?

uneven cloud
hearty niche
uneven cloud
hearty niche
hearty niche
uneven cloud
hearty niche
fathom sun
#

I'm thinking about creating some AI entity that has to follow some path (just some connected points in space) that was already defined (you can think about it like an AI for TDs, but a bit more complicated), but it'll also be able to do something else depending on other entities (for example it may attack or move to some enemies if they're close enough and also reachable), but after they're done doing something apart from moving to the final destination it'll continue to follow the path from the closest point relatively to the current position (i.e. the entity can be agroed apart).
I thought that I should make these entities pawns, but the thing is that I have to implement my own movement component since there is none for pawns as far as I know, and it's one of the problems I'm facing atm.
Another problem is the definition of the path to follow - what instruments should I look at in order to achieve this? What the right way(s) of doing it?
Can someone give some advice, please?

floral mango
#

there are various movement components you can use, flying/floating/vehicle etc, or just roll your own. They don't have to be as complex as the CMC

#

For the path, might want to look at the ZoneGraph, or roll your own with splines/waypoints

fathom sun
floral mango
#

using a Character will get the basics working. Depends how many entities you want.

fathom sun
ocean sleet
#

I have been making a basic boilerplate AI for my boss character. Using the Unreal Manny for the Skeletal Mesh and Using the ABP_Manny for the animation controller. My AI behavior works as I expect it to work but animations are not running and I am tired of troubleshooting this.
Can someone hop onto VC with me to help me with this?

balmy ginkgo
#

If I set my pawn to fly instead of walk, the Simple move to Actor stops working.
Flying basically sets the gravity to zero and the same happens with walking if you set gravity to zero.
Dose this mean this is an AI bug if gravity is set to zero?

floral mango
fathom sun
opaque coyote
#

So I have made a Spline Based path following system for my NPC and now I wanted this system to be behaviour tree based ? any suggestion where to begin ?

floral mango
fathom sun
#

So path follower is just something that commands the direction to follow, right? If so, doesn't path finder call RequestDirectMove on a movement component that inherits UNavMovementComponent automatically?

floral mango
#

might want to start with a base from UPawnMovementComponent

fathom sun
#

Yeah, I did start from it

floral mango
#

yeah, I can't remember what the standard path follower is called, think it's just UPathFollowingComponent

fathom sun
#

And I did manage to compute the velocity, the first problem I've faced though is that the entity can walk in the air

floral mango
#

yeah look at UPathFollowingComponent::TickComponent to see how it feeds the movement component.

floral mango
fathom sun
#

btw after rewatching the CMC class implementation I saw that there is some function called SlideOnGround or something like that

#

So it may make the character move along the floor

floral mango
#

the CMC includes a lot of extra stuff like jumping, crouching, walk, run etc that seem simple but all add many layers of complexity, which is why it's such a beast. If you just need something basic to follow a path and stay aligned with the ground, should be pretty simple.

fathom sun
#

uhh, I'll try to look more into that a bit later, and tell you what I got

#

Thanks though

terse bear
#

What are the benefits of setting the MovementMode to MOVE_NavWalking instead of MOVE_Walking?

#

I used MOVE_Walking and had some MoveTo tasks in my tree and the character works fine

harsh storm
#

NavWalking is cheaper to calculate

#

Only works with navmesh iirc though

terse bear
uneven cloud
uneven cloud
# balmy ginkgo If I set my pawn to fly instead of walk, the `Simple move to Actor` stops workin...

It's not a bug. When navigating, the AI controller projects the points on the nav mesh to determine if the AI can find a path. Failing to find a path is incredibly expensive, so this is used as an early out.

There are ways to make this work properly, but I'm not sure if it's available to BP. I believe there is also flying navigation plugins in the marketplace, but I don't know about the quality of them.

uneven cloud
restive tendon
#

Hi everyone, i want to ask for help, I want to have two navmeshes in my game and one box inside player's character, I want first navmesh to be affected by char, so that it cuts navigable area, but the second navmesh i want to ignore that box. Is it possible? The goal of that idea is to send first navmesh (that is affected by box) into GetRandomPointInNavigableRadius to get points in navigable radius but outside the box, and second navmesh(that is not affected) i would like to use for AI, so that they can walk inside box near character.

uneven cloud
restive tendon
#

EQS will allow me to implement what i described?

uneven cloud
#

It will get the behavior you want. Instead of using get random location, you can get a reasonable location.

hearty niche
deep bramble
#

Can the EQS be tuned to filter the resulting actors by tag?

restive tendon
#

I never worked with EQS. My goal is to spawn enemies outside of all players screens and not outside of navmesh and not inside of some static objects. If EQS allows that to be implemented easily then i'll learn it. So the question is will EQS help to implement it easily?

hearty niche
#

Do you want to avoid these actor locations or just consider something which does not have the tag?

deep bramble
#

I have a CTF game, with multiple flags. I want the AI to use EQS to find the nearest flag with a specific tag.

#

I have it already setup with a behavior task to find the flag.

hearty niche
#

You coukd do a get actors of class and only return actors which don't have the tag.

deep bramble
#

but maybe eqs is better?

uneven cloud
deep bramble
#

I can right click the EQS composite and add a test, but its for Gameplay Tags not actor tags.

#

Maybe I can read an enum value directly from the actor found using EQS?

hearty niche
deep bramble
uneven cloud
hearty niche
deep bramble
hearty niche
#

Eqs context is bp btw

#

correct me if my approach is wrong here @uneven cloud

hearty niche
deep bramble
#

I've done some overrides with blueprints before, but when I click to browse to the EnvQueryContext_Querier it doesn't show where its coming from.

#

So where do I go so I can I override it?

uneven cloud
#

I've never tried to use the context for filtering, so I'm not sure if that would work.

hearty niche
#

click the querier dropdown it should give a create new option

deep bramble
#

nah its just this

hearty niche
#

Just create a new bp look for eqs context

deep bramble
#

ah ha

hearty niche
#

now override the function needed

deep bramble
#

bingo! now I can use Actor has tag

#

thanks @hearty niche

uneven cloud
#

If that doesn't work, I can write a test for you. It'd take maybe 10min.

hearty niche
# deep bramble thanks <@428266140385411075>

anytime. Might wanna switch to registering your points of interest in game mode (make an actor array variable) or something and query from there as get actoes of class/get actors of tag is costly if run often.

Your points may not change often and having the values cached would be helpful

uneven cloud
#

Actors of class isn't that costly in a packaged game. In the editor it goes through all actors, but in a packaged game it uses the object TMap

hearty niche
deep bramble
#

It runs once at the start for up to a max of 4 AI characters, then it runs again if they successfully captured a flag and begin to query for the next one.

#

So in other words it doesn't run that often because AI characters won't be capturing the flag all that often. I do however expect them to die much more frequently.

hearty niche
deep bramble
#

Up to 4 times in the beginning of a match, then maybe once every 20-30 seconds after that.

uneven cloud
hearty niche
balmy ginkgo
uneven cloud
#

The engine stores all objects by class in a TMap. It doesn't iterate through all objects to get you an array of actors of the same class. Unless you are in the editor.

Storing and querying from a singleton is cheaper is some cases and only marginally better in others.

hearty niche
#

Just clearing out theory here. Normally, I would sphere trace in radius and get my objects of interest.

uneven cloud
#

It depends. If you are storing it an an array by class, it wouldn't really make a difference.

If you can have any class be a pickup (usually via a component) then it would be cheaper, unless you used the object iterator on that component.

If you have a large world and store them in an octree, then it's significantly cheaper because of the spatial partitioning of the octree.

hearty niche
#

You got any docs on octrees and querying from them? I have heard people mentioning interactible objects are done in octrees.

uneven cloud
#

I have never seen any documentation specific to UE. Epic has one as a built in data type, but it takes a bit to set up. I used the navigation system one as a guide to make a generic object octree. The smart objects also have one that is a lot easier to follow.

mortal umbra
#

is there a way to make EQS run faster? what i mean is that it cancels the prompt if a new winner is selected?

#

because now it feels really janky, the AI moves to a winner and only when it has arrived it will move to the next winner

uneven cloud
mortal umbra
#

@uneven cloud both give the same result i think

uneven cloud
tawny forge
#

is it possible to query the NavMesh to get a spline of the path from point A to B on the NavMesh?

uneven cloud
hearty niche
fathom sun
uneven cloud
fathom sun
#

wdym the function? What function?

uneven cloud
#

The function in the AI controller that requests a move from the path following component.

#

I would recommend using that, but if you don't want to for whatever reason you can look there to see how Epic does it.

fathom sun
#

@uneven cloud Uhh, I actually want an AI not to just go from point A to point B, but to go through some other points in between, in order to be able to define movement of an AI on a level, but I'm not even sure if I'm looking at the right thing atm

uneven cloud
fathom sun
floral mango
fathom sun
floral mango
#

well, you'll either need to wrangle the interactions with the move component a little so it doesn't stop at each waypoint (which the path follower does, use it for reference), or you could construct your own path and give it to the path follower to follow and let it take care of it

fathom sun
#

But how can I give a path to the path follower?

floral mango
#

you need a FNavPathSharedPtr as @uneven cloud said. It's a shared ptr to an FNavigationPath. Then you can just add your path points to it.

fathom sun
#

And I need to just call MoveTo using it, right?

floral mango
#

you'll be able to call UPathFollowingComponent::RequestMove

fathom sun
#

ah, yeah, thanks, I'll try it

floral mango
#

or AAIController::RequestMove, which does the same

fathom sun
#

@floral mango I managed to request a move from C++, but now the problem is that the final interface in my behavior tree is different, with MoveTo nodes in it I had on success and on failed wires, but there is no such behavior with RequestMove, how should I handle it?

floral mango
#

have a look at the BTTask MoveTo node to see how it handles it. You may want to duplicate that node and put your custom path follow behaviour in it

vivid drift
#

My ai needs to slow down a lot when moving through tight spaces like doors. Any way around this?

#

Or just generally around edges and corners

fathom sun
floral mango
fathom sun
trail pelican
#

hey, anyone could help me with this? for some reason I don't have nav mesh on my landscape

#

Only on 2 squares

fathom sun
#

I thought if MoveTo takes a place to move at, then I may give my BTT the path it has to follow

floral mango
fathom sun
floral mango
#

yeah, you can get the owner controller from the task

fathom sun
#

Ok, gotcha, thanks

versed stump
#

Hey people! I had a question about the EQS system in unreal, which I've been working with a bit on some projects. And one issue that I've come across a few times now is they way I want to set up my enemy AI with the EQS system. So basically my question is about the runmode that EQS uses. Its an enum that holds 4 choices; single best, single from top 5%, single from top 25% and single from all results. I've wanted to modify this percent value for some different reasons, but I cant quite figure out how to make a custom enum for this thing. Has anyone else done it or know of any way really to change/modify it. Feels a bit wrong for me to have to set up the scoring and such around these set values instead of tweaking them for more precise results.

uneven cloud
celest python
#

you can also tweak one of the bools in CMC

#

there is a function determines if velocity should be snapped when new path received or not

#

that function is virtual but in base class it just checks a bool that I dont remember its name

uneven cloud
uneven cloud
celest python
#

oh yeah, it was bRequestedMoveUseAcceleration

tawny forge
#

How can I set default values for the RecastNavMesh that is automatically generated when you use Build Paths? I tried changing the values in Project Settings then deleting the RecastNavMesh and then Build Paths, but the newly generated RecastNavMesh has different values from what I set in Project Settings.

uneven cloud
#

You do have to be careful about nav agent settings. If your AI has a capsule radius of 40, the agent settings have to have an agent radius greater than 40. You can override using the capsule in the character movement component's agent settings though.

tawny forge
#

Thanks, adding a Default agent in project settings and changing its values worked. Still not quite sure what this Default agent is though, how do I assign it to my AI?

uneven cloud
#

The reason why this is is so you can have different nav meshes for different sizes of AI. If you have 3 different sizes of AI, say a small, medium and large, and you set it up properly they will be able to move in different ways across the level. So the large AI won't try to navigate to places it will get stuck at.

#

Epic hard coded a default one so navigation would work without having to set it up if they are using a normal human sized NPC.

There are agent settings in the character movement component. When the AI uses the navigation system, it finds the best fit agent data for it's settings.

tawny forge
#

I see, that makes sense now. Thanks!

uneven cloud
#

You're welcome!

Just to note having multiple nav meshes does cost memory, so it's best to group them together. Small differences like a radius of 40 and a radius of 50 is not going to be noticable for the player in terms of what kind of geometry they can navigate around.

slender holly
#

Is there a way to prevent AI-controlled pawns keep pushing player pawn while keeping the collision enabled?
I want to have a collision between AI pawn and player pawn, but just prevent AI pawn somehow end up pushing the player upon colliding...

hearty niche
#

How do I make an AI turn in place to align to an object? Like moving towards a bench aligning before sitting down?

tawdry crag
#

How do the Data bindings in EQS work. I've just tried setting up a min distance binding as a query param, but it's unclear how I push values to that? I had assumed it would be in the BT: there's a "Query Config" that takes a param name, but it's disabled in the editor.

keen crow
tawdry crag
keen crow
#

I'm not sure whats going to happen in that case. Maybe the default value will be used, maybe backup manual value. You should test it

tawdry crag
#

Alright, thanks for the help

keen crow
# hearty niche How do I make an AI turn in place to align to an object? Like moving towards a b...

In theory you could use bt task RotateToFaceBBEntry, but imo it works horribly. What I did - I had interactible actor providing transforms like which direction a character should face when starting interaction and where should the character be. Then I made a couple of custom tasks to interpolate npc location and rotation to those provided by the interactible actor and when those finished - start the actual "interaction" (montage)

fathom sun
#

I'm playing with sight component, and after an AI containing it kills a player, the AI stands at that point until his age time doesn't expire, is there some native workaround or I have to handle it myself?

uneven cloud
uneven cloud
fathom sun
uneven cloud
uneven cloud
fathom sun
#

nope, it still doesn't

#

btw just to make it clear: when my player dies I set ignore on every channel on his capsule component, so the sight will not see it. To detect whether there are actors I use GetCurrentPerceivedActors preceded by a RequestStimuliListenerUpdate

uneven cloud
#

You don't need to do call request stimuli listener update. That's a rather expensive call and only should be done when changing sense config or team.

The player should unregister as a stimulus source to the perception system when it dies. I would check to see if that is happening.

fathom sun
#

How does it have to unregister itself though? I thought it would be automatically undetected when it cannot be seen by the sight component

uneven cloud
#

The perception component has currently sensed and known targets. Known targets are recently sensed and has not expired.

It really depends on how you are selecting a target from the perception.

#

Unregistering removes it from the known targets as well as the sensed targets.

fathom sun
#

But how do I do it?

uneven cloud
#

It depends on how you are handling death. When it dies, it needs to unregister with the perception system. There is a function that is called something like Unregister Stimulus Source.

I prefer using the stimulus source component instead of auto register, so it can listen for a death delegate and handle it.

fathom sun
#

But if I'm gonna use AIPerceptionStimuliSource, will the sight component detect both capsule component and the stimuli source?

uneven cloud
#

I turn off auto register pawns in the project settings.

The stimulus source only registers and unregisters it's owner actor to the perception system for the senses you want. Perception is not detecting it.

fathom sun
#

I can't find the auto register pawns in the project settings, is it called something else?

uneven cloud
fathom sun
#

Thank you very much, I'll try to make it work with stimuli sources instead

#

btw the source should be in the controller object, right?

uneven cloud
#

The source can be on the character.

fathom sun
#

Is there a perfect object to put it in, or it depends on the context?

uneven cloud
#

It depends. I prefer having it on the character. But I also have fixup for team affiliation checks to use the controller and not the pawn.

#

I don't remember if the perception system handles that. We use team affiliation for other things as well.

fathom sun
#

Gotcha, btw do you have something practical and open source in mind in order to see how other people implement such systems?

#

Or some material to learn from in general, except the official docs

uneven cloud
#

GDC Vault has a lot of good content, some of it free. The Game AI Pro books are also free online. Unreal Fest has some good talks that are free. Epic does a lot of live streams and videos and they have a learning portal. Googling questions can also get good results.

Outside of that, I'm not the best person to ask. I've been working professionally in UE for over 10 years.

celest python
#

there is a general "what kind of mindset you should have to build AI systems" video

#

from an ex-ubisoft developer worked on Far Cry series etc

#

explains how terrible was their experience back then and how it gotten better over the time by learning from mistakes

fathom sun
#

Thank you very much, I'll follow this content

#

@uneven cloud btw I finally made it working, thank you very much! I spent several hours today trying to make it work without the stimuli! It's such a shame that the official documentation about AI perception doesn't even mention the existence of these config parameters that changes so much

uneven cloud
fathom sun
#

Yeah, it really didn't 😛

celest python
uneven cloud
celest python
#

Replication framework and reflection* stuff is most liked features among the people I've met that used in-house engines before

uneven cloud
#

I worked at one major studio where only 1 person could add data for designer to use in the editor. If I wanted something exposed to them, it took 2 months and it was always wrong.

celest python
#

That sounds horrible 😄

uneven cloud
#

I lasted only about 6 months there, before going back to UE.

celest python
#

I wonder did they manage to ship something? 😅

harsh storm
#

For all UE's faults - it's one of the better ones out there. Let that sink in 🙃

celest python
#

Yeah I keep hearing horror stories from every other engine

#

I seriously wonder how some studios able to ship things

#

Even godot has some quirks.. what to say 😄

uneven cloud
fleet trout
#

Is it a bug that in pure blueprint, AIPerception Hearing works only if in "Detection by Affiliation" has "Detect Friendlies" checked?

#

For every other sense, "Detect Neutrals" work, except for hearing.. smh

harsh storm
severe tangle
#

Can I use EQS for AI to move to some PointOfInterest object? This PointOfInterest object would need to be found first, then set as a variable and EQS would find a path to this variable.
Because so far I wasn't able to find a way how to set up a variable that would be used by EQS.

uneven cloud
opaque sparrow
#

Hey guys, how do I know if a task has switched within a task? Basically I have a toggle for AI aiming that I enable in the ExecuteTask. However I have to disable aiming when the task switches. But OnTaskFinished and AbortTask is never called when the Aim task was switched. This is what I currently have:

#
EBTNodeResult::Type UBTTask_Aim::ExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory)
{
    const AAIController* Controller = OwnerComp.GetAIOwner();
    AShooterCharacter* AICharacter = Cast<AShooterCharacter>(Controller->GetPawn());

    if (AICharacter)
    {
        AICharacter->StartAim();
    }
    
    UE_LOG(LogTemp, Warning, TEXT("Execute Task!"));
    
    return Super::ExecuteTask(OwnerComp, NodeMemory);
}

void UBTTask_Aim::OnTaskFinished(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, EBTNodeResult::Type TaskResult)
{
    Super::OnTaskFinished(OwnerComp, NodeMemory, TaskResult);

    const AAIController* Controller = OwnerComp.GetAIOwner();
    AShooterCharacter* AICharacter = Cast<AShooterCharacter>(Controller->GetPawn());

    if (AICharacter)
    {
        AICharacter->StopAim();
    }

    UE_LOG(LogTemp, Warning, TEXT("Finished Task!"));
}
uneven cloud
opaque sparrow
novel pilot
#

Anyone else have an issue where AI don't move in UE5 Editor unless playing in PIE/Single Process?

uneven cloud
opaque sparrow
#

Do I have to create two task like StartAim and StopAim and add StopAim to every other Sequence/Selector or is there a better approach to resetting the aim state for the AI?

#

seems very convoluted. I guess i don't really understand how Behavior Tree is suppose to work when it comes to state management

uneven cloud
novel pilot
#

AI must be broken in UE5 for simulating servers

opaque sparrow
severe tangle
#

Why does my AI keep moving to a wrong Z axis position? AI first finds random Point of Interest, then gets its location and radius in order for GetRandomPointInNavigableRadius to generate random location. Then I set this location as target location for Move To node. This target location always outputs correct position of point of interest on all axis (x,y,z). But AI sometimes just moves to a different Z axis position, meaning he will go to a different floor inside of a building to reach its destination.
I've been stuck with this for quite some time and I do not understand why is this happening, when target location isn't the actual location AI moves to..

uneven cloud
normal mesa
#

Simple question really

#

if I have an AI, how would I make it look at another actor, that isn't eye level?

#

How would I make it look up (pitch) at another actor?

#

Setfocus, does not appear to shift the pitch, or at least while also moving to the actor?

#

Any help would be really appreciated :)

celest python
#

Humanoid character?

normal mesa
#

Sure yes

#

I don't want to tip the character over just have the control rotation apply pitch

celest python
#

You would go with IK and animations to rotate the arms to head towards target

#

for a shooter AI that is humanoid

normal mesa
#

No, no, no

#

I don't care about visually here

#

I literally just want to have it set the pitch

#

up

#

or down

#

just to the target

#

(Visually is already done with the control rotation)

celest python
#

override UpdateControlRotation

#

on AIController

#

call GetFocalPoint();

#

find rotation to it

#

apply desired rotation

#

by using FaceRotation on owner pawn

normal mesa
#

So override the C++

celest python
#

yep

#

not exposed to BPs iirc

normal mesa
#

It's crazy that's the only way?

#

😂

celest python
#

yep

#

welcome to AIModule sobglasses

#

not much of a work though

#

pretty easy

normal mesa
#

That does indeed sound easy

#

providing it works

#

I already tried overriding "SetControlRotation()" and it just ignored it 🤣

celest python
#

Wait

#

Actually

#

you might not even need to override

#

enable bUseControllerRotationPitch

#

or* bUseControllerRotationRoll

normal mesa
#

Why roll?

#

For the record that's not enough

#

I've tried that too

celest python
#

Is bOrientRotationToMovement in CMC enabled

#

Because:
NewControlRotation = (FocalPoint - MyPawn->GetPawnViewLocation()).Rotation();
it already uses a 3D direction to find a new control rotation but FaceRotation only rotates yaw

celest python
normal mesa
#

Yea it's not on, EG ❎

celest python
#

if doesnt work, debug

#

by both drawing lines to target rotation and seeing values on FaceRotation

#

because it works for me

normal mesa
#

Maybe it's this

#
if (NewControlRotation.Pitch != 0 && Cast<APawn>(GetFocusActor()) == nullptr)
{
  NewControlRotation.Pitch = 0.f;
}```
#

Seems kinda dum...

#

I'll just override and remove that part perhaps that's the issue

#

I'm trying to get it to aim at an actor and not a pawn, so maybe that's why it won't pitch up

celest python
#

oh my god

#

tech debt is real

normal mesa
#

Hmm?

celest python
#

imagine not allowing rotating pitch to an actor in an engine that suppose to support every type of shooter game xD

normal mesa
#

Yep

#

haha

#

for sure it's so dum right

celest python
#

UT Engine™️

normal mesa
#

Hopefully even if it's moving to it will now look up...

uneven cloud
#

Because most games do look at separately from control rotation.

celest python
#

Why though?

uneven cloud
#

It's usually driven by the animation team. Focus point is the center of the actor, when look at generally wants a specific socket.

#

You have so much more control that way. The AI can move in one direction and look at something else, with constraints.

#

If I remember correctly, the anim instance (base class for the anim BP) has functionality for it.

celest python
#

Ah, true

uneven cloud
#

You also typically don't want the full body to rotate to look at. Usually just the upper body or just the head.

severe tangle
uneven cloud
#

In UE5 they added a new generator for perception targets and I believe some new tests. A lot of games have shipped using it.

celest python
empty fossil
#

i never noticed but: whenever you create a blackboard it has SelfActor key. Is it populated automatically by possesed pawn? I'm using it and all works fine, but I realized that i actually never set it 😄

#

huh 😄

#

indeed it is

#

cool beans

lament maple
#

Anyone know why a Behaviour Tree might get stuck on "Rotate to face BB entry"?

#

Checking "use controller desired rotation" on the enemy fixed it 👍

#

Actually no it didn't fix it 😄

#

This seems to have fixed it though

rancid wing
#

alr

#

so anybody know how to get a boolean value from a bt to a blueprint?

#

this is what ive come up with so far

#

but I have no idea what to put in for the Key Value

#

pls @ me

low iris
#

how do i fix something like this with navigation?

misty wharf
# rancid wing pls @ me

Drag from the pin and type in "make"... it should pop up "make literal name" or something like this, use that and fill in the BB key name into the field

rancid wing
#

Yeah I solved it literally minutes ago

misty wharf
#

heh :)

rancid wing
#

Thx though!

mortal umbra
#

what is a good AI tutorial which doesn't have 30 minute long videos but short and condensed videos?

#

i know Ryan Laley's videos

#

but they aren't that good

#

are there any others?

meager imp
#

what would you say is a good project to practice AI?
A stealth game? a zombie shooter game?

celest python
#

Depends

#

It might sound weird but I'm working on a arcade zombie shooter game with minimal AI but I ended up writing 10k lines of custom AI code

#

So in my opinion focusing on a single AI character rather than a whole "AI system" is the best practice

#

So a stealth game with single enemy AI that chasing player would be a cool practice imo

celest python
#

Anyone knows why would BlackboardComponent->GetValue return a null value even though it's actually not?

#

I've been trying to debug this for a few days, I'm pretty sure it's not null

#

even gameplaydebugger displays the actual value

#

but whenever I try to access, it's null

uneven cloud
celest python
#

yep

#

TargetGoal.ResolveSelectedKey(*Asset.GetBlackboardAsset());

#

I'm debugging the source code to see if its actually returing a valid value or not but surprisingly VS debugger is not able to display all values

#

Cant see the FWeakObjectPtr value of RawData

#

But RawData is not null either, so I assume something happens during FWeakObjectPtr conversion

#

Oh wait.. finally managed to see what FWeakObjectPtr's value is. GetValueFromMemory<FWeakObjectPtr>(RawData) returns nullptr

#

Why though.. it doesnt make sense thinkblob

#
    const bool bValidKey = BlackboardComponent->IsValidKey(TargetGoal.GetSelectedKeyID());
    ensure(bValidKey);
    const uint8* RawData = BlackboardComponent->GetKeyRawData(TargetGoal.GetSelectedKeyID());
    ensure(RawData != nullptr);

I used ensure() to check if data is valid too, it doesnt break

hearty niche
#

Any idea how I could make sure AI avoids the road and only moves on the pavement. At the same time, Traffic AI makes sure cars move on the road.

tawdry crag
#

Edit: Solved: You have to specify the ItemType in your generator's constructor

I'm trying to write a EnvironmentQueryGenerator and for some reason the EQS system refuses to use it, because it has a "broken template"

class PROJECT_API UGTAIEnvQueryGenerator_Cover : public UEnvQueryGenerator
{
    GENERATED_BODY()
protected:
    virtual FText GetDescriptionTitle() const override;
    virtual FText GetDescriptionDetails() const override;
    virtual void GenerateItems(FEnvQueryInstance& queryInstance) const override;
};```

it fails in the `UEnvQueryManager::CreateQueryInstance()` around line 909 `if (InstanceTemplate->Options.Num() == 0)`. It seems the "options" are the generators you drag off of the EQS Root and it's not recognising mine as vaid for some reason - If I replace my custom generator with a built-in one then it shows up there and runs the query

Log reads
``` LogEQS: Error: Trying to spawn a query with broken Template (generator:invalid itemType:MISSING): EQS_CoverTest_AllMatching, option 0
LogEQS: Warning: Error creating query instance for QueryTemplate: EQS_CoverTest - Owner: BP_EQSTestPawn_C_1```

I'm going to keep digging, but if anyone has been through this before and has insights, that would be helpful
#

Slightly more info. When I enter UEnvQueryManager::CreateQueryInstance(const UEnvQuery* Template, EEnvQueryRunMode::Type RunMode) the passed-in template has the correct option, but then the system tried to find an entry in the cache, and finds a broken one with no options and decides to use that

hearty niche
#

How can I set priority in case of overlaying nav modiifer volumes

celest python
#

Isn't it awesome BTNodes doesnt wrap texts by default 🥲

uneven cloud
uneven cloud
celest python
#

I ended up refactoring system directly to avoid wasting time

hearty niche
naive valley
#

can u guys give me a small summary on what blackboard and behavior tree are , thanks in advance

uneven cloud
uneven cloud
hearty niche
#

The other thing is I want some npcs to be able to mkve on the road. Like say a police npc can walk on the road but the civilians avoid it and only go there as last resort.

uneven cloud
# hearty niche nope pavement and roads are combined afaik and currently the art team uses it so...

You can set the nav area on the mesh itself, if I remember correctly. Depending on how they are set up you can do some tweaking there.

With nav areas, you can do all kinds of functionality. There are a few built in ones, but you can also make your own. You adjust the cost of using that area as well as entering. So you can make the sidewalk be low cost and the street be higher cost.

Then you can use filtering, which can change how AIs use the nav area. You can change the costs or exclude areas completely.

plucky sun
#

I've created a UEnvQueryTest in cpp. I've assigned it to an eqs queryand eqs query behaviour tree node. My UEnvQueryTest_Custom::RunTest() is never hit, i've set a breakpoint. Is there anything obvious I could be missing?

#

With the debug visuals all locations are green with no scores, but shows the query is running

#

Apologies I had some part unhooked and figured it out

hasty badge
#

Why is navmesh being dumb here, and how to fix it?

#

there are no visible or invisible objects here

plucky sun
#

whats that thing floating above it

#

if you move it does the bad navmesh section move with it?

#

if so could be capsule height related

#

Do Behaviour Tree Services continue to tick (interval) throughout the lifetime of the BT? Or only if its section of the tree running?

uneven cloud
uneven cloud
hasty badge
#

I restarted unreal, moved the objects a little and it was gone 0_o

plucky sun
#

Is there any way to tell my already-checked-for-runtime-generation navmesh to update? During a specific moment I want it to update faster than it is

mortal umbra
#

@uneven cloud what do you use to plan your AI?

#

or do you just go for it in UE5 without preplanning anything?

uneven cloud
mortal umbra
#

@uneven cloud do you have a link?

uneven cloud
mortal umbra
#

@uneven cloud thanks

#

i don't think that is something i need to use as i am a single developer

sudden citrus
#

it's nice for diagrams, I really like that it supports emojis which sounds silly but if you scale them up enough they function like modern cliparts

#

never heard of people using it for planning though... trello perhaps

brittle lynx
plucky sun
#

I solved it, I actually had removed the test from the query at some point during debugging

plucky sun
#

How do I stop a nested behavior tree? I'm using Run Behavior Dynamic. I've tried all sorts of things like setting the dynamic null, restarting the brain component, forcing a fail response from child. It just keeps ticking

opaque coyote
#

Yo does anyone has this ai series

north cape
#

Is there a way to force a behaviour tree to immediately fire a task or service, bypassing the general timer? Alternatively, to instantly and temporarily disable the behaviour tree for a few seconds?
The context is having the AI stagger/stunned from being damaged (should immediately stop any other behaviour)

hearty niche
#

My AI does not seemt to be getting culled despite not being in line of signt. I am facing the AI but there are boxes in front of the player. Stat AI still shows a lot of AI being rendered

fathom sun
hearty niche
#

For some reason my AI is not moving.

I spawn 160 npcs with identical behaviors but some of thr npcs don't move.

hasty badge
#

Is there something I don't understand about BT's? Why BTT_Shoot task never starts? The focus task is completed with success, so why doesn't Shoot receive execute?

celest python
#

did you call FinishLatentTask

hasty badge
#

no, what's that?

celest python
#

a function to finish current task and let BT process execution logic

hasty badge
#

oh I'm so dumb, it's supposed to be a sequence, not a selector 🤡

#

it... still doesn't work?

hasty badge
celest python
#

inside of your BTTask graph

hasty badge
#

I can't find it in the right click menu, do I look for it somewhere else?

celest python
#

Is there any relevant function name starts with "finish"?

hasty badge
#

doesn't seem like it, I also searched all possible actions and still can't find it

harsh storm
#

Finish Execute

harsh storm
tawdry crag
#

What's the sensible way to set up initial values to a blackboard? My AIController doesn't have a valid blackboard component until after I have started my behaviour tree, which is too late

celest python
#

Maybe a root selector service

#

but wont work for dynamically running behavior trees

harsh storm
tawdry crag
#

It looks like this is working. Telling it to Use Blackboard creates the component, so that seems to be the simplest way to get started, though I might look into some way of incorporating it into the tree itself at some point

celest python
#

Not sure if its the best way but I do this UObject driven

#

I have an UObject that has a reference to BB and I have a function SetupBlackboardKeys that I set values inside of it

#

each AIController has its own type of that Uobject to init blackboard

#

then I run behavior tree

#

but I'm going to move it to BT later on because I realized BB values must be behavior driven

tawdry crag
#

BB values must be behavior driven
Is this for replication, or?

celest python
#

no, it's because I have a modular system that I only use a single AI class and init them with data assets, so I dont have the opportunity to get benefit of inheritance

#

and for example single AI can use multiple behavior types, like a zombie can be a Tank and Ranged at the same time, I had to decouple the BB and it's data from gameplayframework

hallow drift
#

how should I change the nav mesh at runtime?

#

I want to add some mechanics that will add or remove static actors

hearty niche
#

@hallow drift

hallow drift
#

I'm checking rn, it should do the trick

hearty niche
#

that and you might probably need invokers

#

How can I apply a nav modifier area on a spline road. Nav modifiers volume only gives rectangular shapes

hearty niche
uneven cloud
hearty niche
#

How could I have the nav modifier area on non rectangular surfaces. Nav modifier volumes are cubiods.

hearty niche
misty gale
#

Cant the roadmesh itself define what nav-area it is?

#

Thars how i made my spline roads work atleast

hearty niche
#

I mean that area should have a different area type like how navmesh modifier

crude jolt
#

When using AI Prception Sight, how do i use the Sight Age? I want my AI to forget my player when the sight age is reached. Is there something that gets called when the AI looses it's sight target?

uneven cloud
earnest zephyr
#

I'm trying to decide whether to use Blueprints or Behavior Trees for an enemy AI I'm working on. The enemy should do different things every frame, depending on what state it's in (chase, patrol, etc. The usual stuff). What advantages would BT's have over Blueprints for something that's running every frame, constantly taking in information like desired movement location and stuff?

uneven cloud
earnest zephyr
plucky sun
#

Hey I'm trying out smart objects, is this a bad idea. I'm also finding that in my level the smart object component attempts to register itself before USmartObjectSubsystem::SpawnMissingCollection . Is this a known issue / evident that I've set things up incorrectly? I'm not using world partion

plucky sun
#

yeah looks like components register before world subsystems begin play without world partion, but the other way around with world partition

#

oh okay so if you're not using level streaming and you're not using world partition to do the same, then there's an editor button to press . If your smart objects aren't working and you're following the docs try this button:

#

hmm seems like smart objects are only designed for static locations? I think perhaps these are not for me

uneven cloud
misty wharf
#

Oh good thing I never bothered with those then if they don't even work for the most basic of basic things like that...

#

Don't work for dynamically created objects ????? that's like why did you even include it in the release

plucky sun
#

well they probably need it for world partition and matrix where there's lots of things that ( guessing here ) can't all use eqs/perception at once in a mostly static ( benches ) world

#

i don't think i'll end up with enough actors to need a system focused around it

stuck comet
#

how to make AI aware if our ally getting hit ?

#

can i use Damage Sense for that?

hearty niche
misty gale
#

must be marked dynamic obstacle

hearty niche
# misty gale

I don't have the navigation option. Does this have to be done in BP?

misty gale
#

this is done in the mesh viewer itself (if thats what its called)

hearty niche
#

Oh like that

#

It's greyed out

hearty niche
misty gale
#

yepp

#

or

#

you can have a different collision channel for it 😛

misty gale
#

Using spline and ISM's

#

(and some faulty logic)

#

(unrelated but noticed i could upload above 8MB, niiice )

potent bane
#

Is there a way to temporarily interrupt a MoveTo? I'm trying to do a knock back when damanaged but the ai/pawn just powers through it and keeps moving like nothing happened

celest python
#

lock resource

#

then unlock

#

or apply root motion force

potent bane
hearty niche
celest python
#

check RequestMove()

misty gale
hearty niche
misty gale
#

Exactly

#

I did the inverse. Everything was quite expensive. Then roads were cheaper, and had cheap transition cost, compared to moving back to off-road, which had a relatively high transition cost again

#

Different road qualities ment cheaper and cheaper etc

weary holly
#

@potent bane did it work? It just stops movement, I hoped the pathfinding system would abort too

weary holly
#

👍

keen crow
#

hey there, have you found an answer to this question?

soft mantle
#

Hi! does anyone know why my "Vector" variable is not being set?

#

I'm even trying to hard-code it to see it working

charred lava
# soft mantle

Is that "FindRandomLocation"? You need to set the Vector with the TargetLocation key in the Behaviour Tree. In the details window for FindRandomLocation.

charred lava
# soft mantle

Vector is set with "SelfActor" and not "TargetLocation"

potent bane
celest python
#

a marketplace plugin iirc

#

flat nodes

soft mantle
#

Flat Nodes plugin, it's free.

soft mantle
soft mantle
charred lava
soft mantle
#

it's set to "None" and i have no other option

#

oh got it, thanks!

#

btw, i'm just figuring out AI and my setup is local multiplayer do i need to take anything extra into account?
As far as i know, the AI Controller runs only on server, so it should be all the same, right?

uneven cloud
plucky sun
#

Anyone play with state trees yet? I couldn't even figure out how to change the runtime parameter bags lol. They look really great tho I'm sad I can't use

#

Also wow that's the most complicated code I've ever seen for a state machine. Tree or not

celest python
#

People in #mass is more familiar with it

#

its meant to be used for general purpose things but I guess it has some bounds to #mass indirectly one way or another

plucky sun
#

I'm look forward to it in 5.1 but I guess I'll roll my own for now

uneven cloud
#

I looked into it a bit, but going to wait until 5.1 because it's so incredibly rough right now.

#

Not a fan of the concept that they wrote a new AI system that can't use any of the other AI systems (like EQS) and is probably the most design unfriendly system I've ever seen. Which is actually saying a lot.

thorny jay
uneven cloud
#

The path is not going to be the "best one," because it has fewer options, but it's significantly faster. I use it all the time for HasPath, because the most expensive navigation quarries are ones that fail.

blazing pecan
#

So I'm dealing with a pretty specific issue. AI characters seem to like taking the shortest path, which is fine, all well and good. But I have a character with a pretty large hitbox, but it still manages to get through areas I do not want it going. I'll send a screenshot of my navmesh.

uneven cloud
blazing pecan
#

Characters this big really should be going around this.

blazing pecan
#

This is news to me.

uneven cloud
#

Yes. I would group them up such as small, medium and large, because it creates separate nav meshes for each type.

blazing pecan
#

Is this in a different menu seperate from navmesh? Probably in project settings yeah?

uneven cloud
#

Then when it tries to path, it finds the best fit for the agent settings in the character movement component.

#

Yes it's in the project settings. I think the navigation section at the bottom.

blazing pecan
#

data layers section?

#

Theres two options here, Navigation Mesh and Navigation System.

uneven cloud
#

I never remember which one it is. I just know it's the last option.

blazing pecan
blazing pecan
#

Thanks for the help.

uneven cloud
#

They haven't moved them. It in navigation settings -> agents (at the bottom) and adding to the supported agents array.

You need to make the agent data based off the agent settings in the movement component. By default the radius and height is based off the capsule. If you make the radius smaller than the capsule, they can't navigate.

blazing pecan
blazing pecan
uneven cloud
#

Yes.

blazing pecan
#

Interesting, so I've created a new layer, set radius to 10, and my characters is also 10, but isn't moving.

#

New settings.

#

Got to make sure what I had working works before moving on to bigger agents.

uneven cloud
#

It needs to be larger than the radius. So I'd make it 11.

blazing pecan
#

ah, thanks.

blazing pecan
#

Or hold on, so character needs to be bigger than the agent radius?

blazing pecan
#

got it working

#

ue5 is weird sometimes

blazing pecan
#

Yaaay

#

That works. My hope is that my team thinks my AI setup is so bad I'm never allowed to do AI again.

Thanks for giving me the right directions @uneven cloud . Much appreciated! Not sure if there is some way I can credit you on here like an award but eh.

uneven cloud
hasty badge
#

Is there a way to know which AI sense was triggered? For example I want an enemy to react differently between hearing something and getting shot

misty gale
#

Doesnt it provide sense info?

hasty badge
#

this is all the info that you can get from stimuli that I know of

#

it also has Tag value but I've no idea how to use it

misty gale
#

Try printing it

#

See if it has a value

hasty badge
#

iirc it's just empty

misty gale
#

Hmm

#

Weird

hasty badge
#

yeah it just says None

#

I assume you can assign something there bit I've no idea how

#

stimuli source has no option for that

misty gale
#

Weird if theres no info about the sense by default tbh

hasty badge
#

huh there's a GetSenseClass function, I'll try playing with that

#

yea that must be what I'm looking for

misty gale
#

Is that from the stimulus struct?

uneven cloud
hasty badge
#

can I do something about it? I've never worked with the code in ue4

misty gale
#

You could make a cpp function lib

#

That calls the struct function?

uneven cloud
#

Do you know C++ at all? You could do it with a Blueprint library function.

misty gale
#

seems its already exposed

hasty badge
#

yeah this right here works, but I got another problem now, ReportDamageEvent doesn't update target perception

#

nvm it does...?

#

did it ever happen to you when you do something the first time and it doesn't work, change it, doesn't work, change it back, and it suddenly works?

celest python
#

Usually when I'm burnt out or very sleepy

hearty niche
#

How can I pause a behavior tree? I want to be able to pause behavior on far off agents for optimization

celest python
#

lock resource

hearty niche
celest python
#

yes

#

AIController->LockResource

#

or BrainComponent

hearty niche
#

I only see an option via anim instance

celest python
#

braincomponent has resource lock interface too

hearty niche
#

Anything else I can do to optimize far off NPCs?

celest python
cerulean bough
#

Wild, I never knew about that actually. My question is how do you decide which nav mesh each different type of agent uses?

celest python
#

Anyone also having the issue typing something to "add decorator" tab doesnt show anything

keen crow
#

remind me pls is it possible to force nav mesh to be visible in game (be it PiE or standalone) for debugging purposes?

celest python
#

show navigation

#

on console

keen crow
# celest python `show navigation`

sadly, doesn't work. can it be due to my levels (including those with navmesh volumes) are loaded by ULevelStreamingDynamic::LoadLevelInstance? Also I can't open visual debug (the one that is opened by apostrophe) for my mobs that are spawned in these levels that are loaded in the runtime

uneven cloud
# misty gale seems its already exposed

This only checks if this specific stimulus is a specific type. Not if a specific sense is currently active or known. It will break down if the AI sees something and then a sound event comes in. The sound event will trigger this event, it will fail with sight sense regardless if the AI is still seeing it or not.

celest python
#

quick sanity question: when we abort a run behavior, does it keep the state of decorators etc?

#

if I have a cooldown that is 60s, and aborted after 30s, then run the behavior again after 30s would cooldown finish or would decorator wait another 30s

misty wharf
#

Seems that would depend on the implementation of the decorator 🤔

celest python
#

iirc decorator class functions are const

#

so I'm not crazy about its not saving the state

misty gale
#

If the sense wasnt active it would trigger the stimuli update , would it 🤔

uneven cloud
misty gale
#

Ah, ok. Havnt played to much around with it yet, remember it was a hasstle even to get the sound source correct with sneaking etc

#

Hard to evaluate the distance that a sound at a given strength can be heard

uneven cloud
#

Yeah I don't use OnTargetUpdated at all. I just use OnPercetionUpdated and trigger an EQS query.

paper herald
#

Is it possible to adjust the grid orientation in EQS queries? If I have my character on a tilted axis, can the EQS grid compensate for orientation of the "generate around" context?

earnest zephyr
#

Hopefully fairly simple question. I'm writing my own Move To task, since I need it to be in 3d and such. How can I make it so the task doesn't end until I reach the destination, and also slows down when near and stuff?

soft mantle
#

on a task you have 2 things for that:

  • Receive execute AI
  • OnTick
#

On receive you should do "Move to location/actor/ and set the "Execute finish" coming out of "success"/"failure" of that move

#

so the task keeps going while it's moving

#

and on "Tick" do all your validations (like adjust speed base on distance, if target is out of range, etc)

#

If someone has the website to copy/paste node graphs i can share you one

earnest zephyr
#

Hmmm, but if it executes finish then doesn't it move on? I want it to continue to tick until it's reached the target, unless I'm not understanding the OnTick event for Tasks

soft mantle
#

Yeah it does, but you only go into that code once movement it done

earnest zephyr
#

aha. I think I'm getting it now

#

thanks!

tawdry crag
#

Trying to understand decorators in Behaviour trees and I'm kinda flummoxed. This should be the simplest set up: Testing a boolean Blackboard value. My understanding is that this should only allow the sequence to run if the value is set? But no combination of settings makes it have any effect on the execution of my tree. What am I missing?

celest python
#

probably you need a root selector

#

and under some conditions root level decorators are not accepted

tawdry crag
#

It looks like if I add it to the first node on the sequence then it works

#

Let me try the root selector

tawdry crag
celest python
#

np blobthumbsup

earnest zephyr
#

New problem... How does one set some starting values in a Blackboard? I'm trying to have them exposed in the Pawn, so I can set them in the scene, then calling the AIController->Blackboard but it's not working

celest python
#

you are trying to set bb value on null controller

earnest zephyr
#

ah, right, I should have to specify "self"?

celest python
#

plug "self" node to there

#

yep

#

also ensure you call this after setting up BT

#

and BB

earnest zephyr
#

Thanks! 😄

wet stratus
#

My AI has BT entries to patrol the area (walled in navmesh test area) but it sits there doing nothing until I give it a literal nudge (physics). I'm currently shooting it (AddImpulse) to get it to start patrolling, but whilst amusing is not practical.
Any ideas?

uneven cloud
wet stratus
#

When I start, all the EQS points around the AI are blue. As soon as the pawn is hit by bullet (and knocked back) the EQS points are then green.

tawdry schooner
#

Expected Behavior:
The actor moves to the patrol point, idles for a few seconds, then goes to the next point

Actual Behavior:
the actor goes to the next point without any wait time

probably a dumb question, any idea how to fix this?

charred lava
elfin hinge
#

Hi. I'm trying to make system where AI tries to find point around player which is closest to AI, but at the same time try to slightly avoid other AIs. So that they do not overlap + it surrounds player slightly (priority is to go for the player with shortest straightest path).
I managed to get closest points from AI to Player, but it currently does not ignore other AIs and I'm not sure how to do it. Help would be appreciated as I have no idea how to combine these behaviors.

plucky sun
#

Use an overlap test @elfin hinge

elfin hinge
#

@plucky sun I tried with custom overlap channel as well, didn't seem to work.

plucky sun
#

Were your points filtered out?

brittle lynx
elfin hinge
#

No they were no

brittle lynx
#

This should filter out locations that are too close to other AI characters

elfin hinge
brittle lynx
#

Just make sure that the Querier itself is not included in EQC_OtherAICharacters

elfin hinge
#

@brittle lynx It looks like that it did work! Thanks a lot. "at least 100" was the issue why it did not previously

tawdry schooner
#

I currently have this in my "pet" controller, when the pet sees the player, it will update the key for its blackboard, I want to also update the key for another "Master" blackboard as well, but i cant figure out how

#

There are several "Masters" but only some have "Pets", and the pets should only update the player key to their specific masters

tawdry schooner
#

The pets master is stored on the blackboard as well

uneven cloud
tawdry schooner
#

i have 2 actors, a "Pet" and "Master" that use the same blackboard, when the pet sees a player it updates the blackboard for itself only, i want it to also update its master, but no other masters

uneven cloud
#

You'll need to get the pet's master by getting the actor from the blackboard using Get Value As Object.

While you can directly set it by getting the master's blackboard, I highly recommend making a function or event so the master object can set it

keen crow
#

Is dynamic nav mesh generation much more expensive rather than static if I actually don't have any movable actors that affect navmesh? I think I have a problem with nav mesh and level streaming that may be fixed by enabling dynamic generation but I'm not sure what is the cost of using the dynamic generation

tawdry schooner
uneven cloud
uneven cloud
tawdry schooner
uneven cloud
tawdry schooner
#

oh ok, i was thinking something like that initially, i just had no idea what nodes would do that lol, thanks!

tawdry schooner
uneven cloud
keen crow
# uneven cloud What is the problem with navigation streaming? Dynamic regen is a rather expens...

For some reason on some streamed levels NPCs can't move over some medium size locations (approx 20 sq meters). Visual logger shows that either pathfinding eqs tests fail or some FImpl:: SomethingSomething fails. Debugging both pathfinding and MoveTo goes well deep down to navigation guts where the path is calculated at polygon level but debugging works horribly there so I can't figure out what's the problem. I was hoping that maybe turning on dynamic navigation generation could fix the problem but I'm still concerned about the performance. I'm loading the sublevels with ULevelStreamingDynamic::LoadLevelInstance

tawdry schooner
mortal umbra
#

there are no good tutorials for AI

#

:/

terse bear
#

can I have a run behavior node as a main task for a parallel node?
like the main task will be another sub-tree

north oriole
#

Hey guys. I'm using behaviour tree for ia of my enemy. Is there a way to give one-time orders to the enemy from other actors?For example, once the player reaches a place and hits a box collision, an enemy spawns and an immediate order to move to a certain place is given. Once the place is reached, it acts by itself as normal trough the tree

keen crow
#

Another way could be that you build your ai bt in a generic manner : make a task-evaluator that takes in some set of blackboard keys like where to go, what eqs to run, what actor to interact with and put this task into some core sequence, so that it runs after "completing" each generic subgoal. That task, however, should also communicate with some quest system so that it could set the provided bb keys appropriately

north oriole
keen crow
#

Never seen any. I'm just sharing my own experience here

#

I'll try to draft something on paper for you, maybe that could help you

#

Something like this

north oriole
slow sphinx
#

Anyone familiar with the MiniMax Algorithm? For the life of me I can't figure out why mine don't work. It seems to be keeping the first move it runs across every time....the thing is I've fairly sure I have recreated the algorithm just like the example I seen from a Javascript version....

Here is the Log

LogBlueprintUserMessages: [GM_TicTacToe_C_1] Final Move: (0.0,1.0)
LogBlueprintUserMessages: [GM_TicTacToe_C_1] Player: Computer Move: (2,2) CurrentScore: 10 Depth: 0
LogBlueprintUserMessages: [GM_TicTacToe_C_1] Coords: (0,2) Score: 10
LogBlueprintUserMessages: [GM_TicTacToe_C_1] Move Over
LogBlueprintUserMessages: [GM_TicTacToe_C_1] Player: Computer Move: (0,2) CurrentScore: 10 Depth: 0
LogBlueprintUserMessages: [GM_TicTacToe_C_1] Coords: (2,2) Score: 10
LogBlueprintUserMessages: [GM_TicTacToe_C_1] Final Move: (0.0,2.0)

Blueprintue.com doesn't read Enumerators so all of those fields will have enumerator0 or whatever written in them....basically the Max sets the AI move, Calls MiniMax with the Player as Input and then sets the move back to Empty....the for loops check to see if the positions are empty. On Best Move it's Initialized as Minimizing Player with the Player as input. On the Check win it returns -10 if the Player Won, 10 if the Computer Won, and 0 if no one has won.

Best Move Function
https://blueprintue.com/blueprint/d1q6y66b/

MiniMax Algorithm
https://blueprintue.com/blueprint/-c57s-x7/

This one Checks for the Winner
https://blueprintue.com/blueprint/e08q5vo_/#comment-1463

#

I know it's a lot but if anyone has a clue I would be very grateful for any leads on this...I've been stuck on it for going on 4 days now and have rewritten the algorithm 3 times from scratch....

hearty niche
#

any tips on optimizing crowd ai? I reduce ticking components and turn the skeletal mesh completely off at far ranges. Navmesh walking is on. Capsule colliders are turned off too.

What else can I do?

fathom sun
#

What should be called after UAIPerceptionComponent::ConfigureSense() that has been called on object runtime (i.e. after all the initialization)?
If I don't use the function after the initialization at all, then perceptions work fine, but if I do, then it doesn't. I need to edit my senses over time, so I have to call it on runtime.

uneven cloud
fathom sun
uneven cloud
#

UAIPerceptionSystem::GetCurrent

fathom sun
# uneven cloud UAIPerceptionSystem::GetCurrent

Thanks, I found it. The problem still persists though.

So, if I don't configure the sense ever again after the initialization, then my actor that's implementing IAISightTargetInterface is constantly updated by the sense system, and its CanBeSeenFrom function gets called every time as well.
However if I do configure after initialization, the function gets called only once, and by using the AI debug thing, I see that the circle that's pointing the detection point doesn't move with the character, but stands at the first detection location.

My current code to change something on runtime is

SightConfig->SightRadius = Range;
    
PerceptionComponent->ConfigureSense(*SightConfig);
    
UAIPerceptionSystem *AiPerceptionSystem = UAIPerceptionSystem::GetCurrent(GetWorld());
if (IsValid(AiPerceptionSystem))
{
    AiPerceptionSystem->UpdateListener(*PerceptionComponent);
}

Any ideas how to fix it?

uneven cloud
#

I had to go look at the code. There is also RequestStimuliListenerUpdate() on the perception component that really just calls it on the system.

I would step through the code in the sight sense to make sure that it's getting updated.

fathom sun
misty wharf
#

blackboardbase is just a convenience

#

you certainly can do the access in the others too but blackboardbase just implements a bunch of functionality that's commonly used

#

you can have as many blackboard keys for your tasks as you want, there is no limit on that

#

just make a new property with the appropriate type

slow sphinx
#

I figured it out....man, it took me 4 entire days and I ended up rebuilding the entire algorithm from scratch 4 times, once for every day...and spent the rest of the day trying to debug it.

Here are my scores for the Minmax algorithm. My Wins are on the left

Round 1 = 0:1
Round 2 = Tie
Round 3 = 0:2
Round 4 = 0:3
Round 5 = Tie
Round 6 = Tie
Round 7 = 1:4
Round 8 = Tie

It's not unbeatable, but I'm also limiting it to how many moves ahead it can look and there may still be a slight bug in it somewhere

obsidian igloo
#

anyone know how to separate a hearing stimulus from a sight stimulus?

umbral marlin
#

With blueprints, how do you access the pawn that being is being controlled by the AIController? I read GetPawn should work, but that targets PlayerState… any ideas?

obsidian igloo
# storm sail the tag

I found this to work. the tag only outputs none, I couldnt find a way to add a tag to a visual stimulus, but I know you can get a tag from a hearing stimulus

keen crow
#

are there any performance losses in enabling "Generate navigation only around navigation invokers"? Should navmesh generation be dynamic in this case? In my case I need navigation to be generated only in some NPC areas in a relatively big world and I was thinking it could be good to make a spawner a navigation invoker but I'm not sure how expensive this feature is

opaque coyote
#

Hi all I have made this NPC spawn system by it trigger on run the game so is there any way to make it area base trigger NPC spawn system
do I need to look into Foliage system or this area wise trigger system can be done on this BP ?

fathom sun
#

@uneven cloud Apparently the config initilization went wrong, I initilize config values with some other variables. I did it in the constructor, but by moving it to OnPosses() instead solved the issue.
The actual issue was that the config said that nothing has to be targetted, so it just didn't assign a new value to TimeUntilNextUpdate, and it had max float instead. That's why it didn't update.

blazing pecan
misty wharf
#

I'll use the blackboardbase in cases where the functionality it has is useful, otherwise the regular one

uneven cloud
uneven cloud
keen crow
uneven cloud
uneven cloud
keen crow
#

those sublevels i am loading are kinda islands in terms of shape, and those islands were rotated 180 degrees after loading the sublevel with navigation. alas, the navmesh didn't rotate with the level actors

#

my coworker reminded me that I can check out the navmesh in simulation mode and it was litteraly like navmesh wasn't rotated, i.e. pieces of navmesh floating in air and such

uneven cloud
primal surge
#

Hey would anybody be able to answer a basic question about Behavior Trees for me

#

For some reason, in my sequence, is constantly plays the task here and never gets to the selector. I dont understand why

keen crow
#

so we actually ended up enabling dynamic navigation since we don't have any movable actors that affect navigation during gameplay because we really need an ability to rotate those islands at load time

primal surge
uneven cloud
primal surge
#

yes

#

this is what i am trying to do

uneven cloud
#

What is the variant that you are currently testing?

primal surge
#

1, friendly roaming

uneven cloud
#

Is the blackboard value what you expect? Is it going in the branch you expect? Is it failing on find player?

primal surge
#

for some reason its not getting the correct values

uneven cloud
#

Are you using a blackboard selector key to set the blackboard in the get variant task?

primal surge
#

Overall though, that logic should work if everything is set up right?

uneven cloud
#

You'll likely end up with a rather large tree, but yes it should work.

plucky sun
#

Hey can anyone explain why this EQ test has undesired behavior? My expectations that all items not on the island are filtered out. Left hand side: (correct) When using Filter & Score I get the expected results. Right hand side: (incorrect) When using just Filter I get unexpected results. There is only one test and no other differences between the two other than filterscore mode, and I'd prefer to just filter and not score.

uneven cloud
plucky sun
#

ahhh

uneven cloud
#

It only filters out until it finds the best result. They are sorted by score and then starts filtering.

plucky sun
#

i thought filtering happens first so that scoring is optimized?

uneven cloud
#

It's been a long time since I've dug into it, but it auto sorts the tests based on expected cost. If you have a high cost filter only, it will be sorted last so that it can early out.

plucky sun
#

okay thanks for the info i'll do some more investigating

#

okay yeah if I put it as first test filter only, and then a scorer below it I get expected results

#

thanks again

plucky sun
#

i just gotta say env queries are sick

celest python
misty wharf
#

You just haven't used them enough to run into the frustrating weird design decisions that prevent various usecases which seem very common

#

I mean EQS is still good but it has a bunch of weird things about it that you sometimes have to work around :P

celest python
#

yes sad

keen crow
#

does anyone know any good websites like hackerrank to do some ai stuff like they have here? I've recently started doing it for fun but I'm wondering if there is anything better and/or prettier and/or interesting

silent drift
#

How are AI in NPC and enemy usually implemented in 2D games?

#

I'm thinking about making the NPC and enemy have different 'lane' they can move to. So they will not collide with each other.

#

But some of the task in behavior tree feels more catered towards 3D implementation

#

Like the task 'move to' will account the 'Y' axis too, and will make the sprite rotated which normally not something that 2D games expect the character to do right?

misty wharf
#

There's a bool you can set to true to make them instanced

#

Forget what it's called but I recall it had some comment which made it clear'ish - and you can check how the builtins are implemented, some of them muck with the properties

#

I forget what the specifics were but even non-instanced nodes are kind of instanced, but there was some bit where it worked a little differently

uneven cloud
#

You can set it to be instanced in the constructor, but you'll lose the perf gains from not instancing every node of the tree for every character.

BT nodes have node memory which you can use to save data. You can look at the built in move to task to see how it works.

obsidian igloo
#

this might be sort of a noob question, but I have these zombies and I want them to chase the player or other pawns, search the last known position and then roam around again if unsuccessful. If they walk in front of one another, the one in the back loses visibility and goes searching, is it possible for them to just ignore each other entirely? I cant seem to find a good solution for this lol.

opaque coyote
uneven cloud
uneven cloud
dusky mist
#

HI! Im looking into making a vampire survivor kind of a game. This means TONS of enemies (1000 is my goal). My first thought was that i should drop the idea of using acutal AI, and just develop my own simple movement component, so i did that, and used the Move component to blueprint. After this I've tried learning the profiling systems, and found out that the movement component was the biggest hurdle to my performance. So actually i found the best solution was to use the "projectile movement" instead. This seems super light, and has helped performance alot! I am doing around 400-500 enemies without going below "unplayable" fps, but i still feel like im far from a 1000.

Any tips on how to achieve a 1000 enemies or more? I've looked a little into MASS, but im only working in blueprints and the documentation on MASS is very hard for me to understand and use.

You can kind of see how it functions now here: https://www.twitch.tv/videos/1608903434

opaque coyote
uneven cloud
opaque coyote
#

okay

uneven cloud
dusky mist
uneven cloud
# dusky mist Hmm alright. Whenever i was trying to look for "niagra as enemies" content i cou...

Displaying thousands of characters on-screen in real-time has always been a challenge - until now. Unreal Engine's Niagara visual effects system opens up doors to go far beyond what was previously thought possible and this presentation by Epic's Joseph Azzam showcases how you can utilize the power and versatility of Niagara to create massive cro...

▶ Play video
dusky mist
#

I've watched that entire video 😄 But i guess ill try again. I might understand it better now. I just felt like it was alot of "presentation" and not alot of "tutorial". But ill give it my best. Thanks alot @uneven cloud

storm sail
dusky mist
dark gust
#

need help

blazing pecan
#

Also, does anyone know why my move to player isn't working in my behavior tree? I'm not quite sure how to go about this.

#

Actually ignore me

#

Maybe putting it on the correct branch output would help 🤣

ripe geode
#

hey i i m making swimming animals but only on surface

#

how i can generate path point on this swimming surface

#

when this surface is overlaping pwans

#

Can i increase distance to generate path point from pawn when he is flying?

#

because when my pawn is above 2-3 meters he is not finding paths points

misty gale
celest python
#

you cant have inheritance by assets but you can use Run Behavior Dynamic node

#

with injection tag

granite robin
#

Welp, this is going to be the thing that kills me I guess

#

Someone explain why that is failing , I'm right next to the target

deep bramble
#

Probably due to the nav mesh making it impossible to reach the target location.

dusky lodge
#

Is there a function that returns the closest point on a NavMesh to a given Location?

lyric flint
#

I'm having trouble with the AI not being constrained to a plane. I have it checked in the pawn but it moves all around and doesn't stick to a single axis. is there anyway I can constrain the AI?

uneven cloud
uneven cloud
#

Are you level streaming the map?

#

You can use level streaming for navigation.

#

I have never not used level streaming for the server in a multiplayer game. If there are no players in an area, it should get unloaded.

#

Navigation data has a memory cost as well.

#

I don't fully simulate bots in areas the players aren't around, because it's a waste of cycles. Games are smoke and mirrors and there are cheap ways to approximate things.

#

It entirely depends on your game, your target hardware and the density of your map.

#

I don't know of any tutorials, but it's not terribly complicated. However world composition is a bit more frustrating to work with than world partition.

  1. Place a nav mesh bounds volume in your persistent level. It doesn't even have to touch any of the world, it just needs to exist.

  2. You can either make your bounds volume in the persistent level cover the entire map or put them in your sub levels.

  3. With the persistent level set as current, build navigation. The nav data will be saved to your sub level and the recast actor in the persistent level.

  4. If navigation builds when you have a different level selected, delete the recast actors and repeat #3. If you turn off auto regen in the project settings, this will happen less often.

#

With world partition, you don't have to worry about what level is selected. The nav mesh is cut up the same way that the world is.

real arrow
#

Is the Run Behavior Node broken in UE 5.0.3? Once control flow enters the sub tree I can't seem to get it back out and the subtree itself was just a refactor of a previous set of nodes that worked, did not alter anything

real arrow
#

tried using the visual AI debugging tools and it seems to just hang on move-to tasks that wouldn't normally hang, and I have all flow routes setup so that it should properly finish execute if anything goes wrong or after a set amount of time

real arrow
#

Glass Beaver has also achieved like millions of AI onscreen before, but he developed a custom GPU rendering system for it

#

It's all pretty hard tho. Have tried myself to get hundreds of AI in a game, and there's really no easy way, you just kinda gotta get down and dirty and learn how to correctly profile

earnest zephyr
#

(Gotta love it when the process of going to type in my question helps me figure out the answer 😛 )

paper vortex
#

Hi guys, do you know why this is happening, i'm not understanding how to fix this. In testing map the AI works fine walking inside navmesh, but in another map, the navmesh appears to push AI away from the ground. This second map is a world partitioned map.

uneven cloud
vast relic
#

I already made one for projectiles and it can handle like 10k projectiles in flight no problem

#

Struct Projectile
blah
blahblah

ProjectileSubsystem
For each Projectile in ProjectileArray
Projectile.Velocity = whatever
Line trace
Projectile.Position = whatever
etc etc

Something like that. Do the data transformation in a tight loop instead of haveing a million ticking things.

dusky mist
vast relic
#

What I'm talking about is instead of doing this:

Thing1.Tick -> DoStuff
Thing2.Tick -> DoStuff
Thing3.Tick -> DoStuff

You instead do:
Subsystem.Tick -> ForEachThing -> DoStuff.

#

If this is your first project and you're new to programming probably don't start with trying to do thousands of entities running around.

#

Sort of like an ECS framework.

dusky mist
#

Aaah okay. Would that be possible to do in blueprints ? Or is that most likely a c++ thing @vast relic ? ☺️

vast relic
dusky mist
#

Alright. Thank you for all the info ☺️

fair plaza
#

When moving an ai to an actor via move to location or actor / move to actor / simple moveto, does it not fire a finished event when the target is reached within the acceptable radius? Not using a tree, just using BP directly in the controller.

#

Works fine with a vector location, but the ai seems to continuously try to reach an actor if its specified, and never stops

paper vortex
uneven cloud
vast relic
#

It's simple enough to have a structure representing projectiles/entities and updating a few k of them in a tight loop in a Subsystem.

uneven cloud
#

Subsystems aren't available in BP. Reinventing the wheel is even less of a good idea. Mass has it's issues, but there is a lot of built-in functionality.

harsh storm
#

I agree with Adriel here. Doing a subsystem with a loop is more than sufficient for what they were asking for. No need to over-complicate things and confuse potential beginners.

brittle trellis
#

what is a good way to implement Movement similar to StarCraft 2 in Unreal engine ? any material or anything is really appreciated

celest python
#

A random loop wont solve any problem though, it needs to be ordered and if entity count is huge, logic needs to be seperated into smaller composites so instructions and data would fit in smaller CPU cache

#

Even mass is barely able to handle 2k from what can I see in demonstrations

#

a regular loop doing random calls wont help on its own

celest python
storm sail
#

@fair plaza it likely never reached the acceptable radius

fair plaza
#

That was my thinking at first, as well

storm sail
fair plaza
brittle trellis
#

RTS Units gets stuck together, ue4 avoidance is working but it is not the best

eternal halo
#

Do smart objects require us to make our own MoveToSmartObject task? When I use the built in FindAndUseSmartObject my AI just slides to the smart object instead of using its walking animation

silent drift
#

Why can't i call the parent function of perception update?

real arrow
#

and here is the sub behavior tree

#

it should be equivalent to what is currently connected under here:

#

so my question now is, is run behavior (containing execution flow X) equivalent to just actually connecting execution flow X

#

execution flow X being any execution you can connect

hallow drift
#

hello there, how can I get an AI follow a path with limited turn rate, kinda like a car?

#

also please ping me in case you reply to my question

uneven cloud
uneven cloud
uneven cloud
silent drift
hallow drift
uneven cloud
uneven cloud
charred lava
silent drift
#

but it doesnt let me call the parent event on the child

uneven cloud
#

You need to create a new event. Then call that when On Target Perception Updated triggers.

silent drift
#

the first one?

#

or create custome event?

uneven cloud
#

Create a custom event

silent drift
#

Okaay! Thank you

eternal halo
celest python
floral mango
celest python
#

biggest problem is rendering, rest can be solved with moderate difficulty

#

of course unit count matters

#

good luck reaching 1k units without years old engineering

floral mango
#

I have several thousand NPCs running in editor at the moment, and this isn't even an RTS 😛

celest python
#

do you render them all?

#

and do they run their AI logic while moving and updating animations etc

floral mango
#

Yes. Like I said, not using the main GameFramework classes, making extensive use of Mass etc.

celest python
#

It's fine, I'm working on a arcade twin-stick shooter (without mass), I'm trying to reach 50 enemy characters + 4 player characters, they are all running animation and being rendered in the camera, I was barely able to reach 60fps on a GTX1050

#

I think animation part is going to be solved with animation sharing plugin but rendering is still my main bottleneck

floral mango
#

you have to remember that ACharacter and associated stuff was originally designed for small arena shooters, and was never really meant to scale. You do need to get more creative to have a lot of complex characters.

#

But that's just a limitation of the basic GameFramework, not the engine

celest python
#

Yep, so far switching to navigation movement mode and aggregating it's tick helped a lot, though I wanted to roll my own networked movement component too but adding root motion support was too difficult

#

And I couldnt find anyone did it before too, so I gave up and decided to continue with CMC

charred lava
#

What did go wrong? The Behavior Tree Debugger doesn't highlight any Decorator that it failed or something 😫

celest python
#

hmm, I remember this happened to me too, but cant remember how I solved

charred lava
#

:/

celest python
#

at worst case you might try removing saved folders but it would purge everything u saved so far

#

because I assume this is related with some cache issue

charred lava
#

I backup my saved folder and if it doesn't work, I just put it back. Let's see 👀

#

didn't help :/ But thanks for the suggestion Eren

charred lava
harsh storm
#

What's that?

earnest zephyr
#

Hopefully quick question. I'm doing a sphere-trace from a Task, and I have "Ignore Self" turned on, but it's still triggering. Does it only work if the function is called in the objects' Blueprint?

celest python
#

it has a hidden pin you cant see named "worldcontextobject"

#

its hidden in BPs

#

UE sets it to current graph's owner object behind the scenes

#

if you are calling it in a task, it will use the task as "worldcontextobject" and try to ignore it

#

so you have to use the array

#

IgnoreActors one

#

and plug ur owner character ai

hallow drift
#

how do I prevent an AI controlled character from strafing?

celest python
#

disable bCanStrafe on movement task and set orient rotation to move to true in character movment component

silent drift
#

Is there a way to get navigable radius with some parameter? Let's say I want a navigable point that Y coordinates is 100

uneven cloud
harsh storm
#

Anim sharing plugin is great. It's how I got like 400 animated characters on screen.

earnest zephyr
#

Does anyone have more information on the new "State Tree" in 5.1? How's it different/better than a Behavior tree?

celest python
celest python
#

its introduced with 5.0, so not new with 5.1

earnest zephyr
#

Thanks

#

Trying to decide if it'd suit my needs better than a Behavior Tree. Hard to know what sort of things should go where

harsh storm
#

I'd say stick with BT for now.

#

Far more battle-tested

celest python
#

yeah state tree is definitely not suitable for actual development right now

#

but i assume for small things like day/night cycle (as mentioned in docs) it can be used

#

since scope is small

prime nebula
#

this old pin links to a youtube playlist that had its videos set to hidden, only one titled "Channel Update" remains.

harsh storm
#

Holy necro dude. That thing is like 4 years old, lol

celest python
#

lol

#

but it was pinned