#gameplay-ai

1 messages ยท Page 171 of 1

glossy monolith
#

Hi does anyone can redirect me to a tutorial of some sort about a basic ai for a 2d platform for a monster moving left and right and don't fall from the platform? thanks in advance

mint terrace
#

Navigation Invokers are working as expected in UE5 for me. Is your Navigation Generation (still) set to Dynamic

night relic
#

Mmm I found something interesting, the ai character with the invoker that doesn't work is built at runtime.
Now, if I add to the scene a bluprint of the same class with the components already included, now the invoker of the other guy starts getting the navmesh generated

#

Like if the nav system doesn't notice that invoker is there until I add another one at editor time.

mint terrace
night relic
mint terrace
#

In my case I have added the NavigationInvoker component to my actor's C++ base class in the regular way-- perhaps the issue you're seeing is only when adding it as a BP component?

#

shouldnt be different though

#

pretty sure the only thing ive done is

NavigationInvokerComponent = CreateDefaultSubobject<UNavigationInvokerComponent>(TEXT("NavigationInvokerComponent"));
NavigationInvokerComponent->SetGenerationRadii(3000, 5000);
#

that, plus "generate around invokers" and also "Runtime Generation" "Dynamic"

#

that last one was what I was asking about earlier

#

its also easy to think its working if you have navmeshbounds still, because unless you tell the editor not to ("Update Navigation Automatically"), itll still generate it, and itll still work regardless of whether your invokers are working

night relic
mint terrace
#

ahhh- so it probably was pre-existing navmeshbounds that made the ones work in editor ๐Ÿ™‚

night relic
#

I guess this setting didn't exists in 4.27?
I don't remember to have touched it before

mint terrace
#

pro tip here-- hit ' (apostrophe) while facing a character, and hit zero on your numpad to pull up the view of what navmesh the character sees

#

there's a lot of tools in there, this one just tells you what is happening on the navmesh for that character at runtime

mint terrace
#

no at runtime

#

assuming you are using the normal playercontroller/character systems, it will use the center of the main player camera to pick an actor and let you look at some things related to that picked actor's controller -- like navmesh, behaviortree, eqs, etc

#

obviously only useful with a player controlled camera

night relic
#

' does nothing for me

mint terrace
#

youd need to be in PIE or standalone (unpackaged) but otherwise it should work

#

I don't think these show up in packaged builds by default

#

(assuming you are using the standard character possession system)

night relic
#

Semicolon triggers some debug info, but ' does nothing, either PIE or standalone

mint terrace
#

maybe its " lol

#

for me its ' though-- i have no idea why itd be different-- this is* a UE4 project upgraded to UE5 like yours was

night relic
#

Ahh cool, it's the keybind that doesn't work, via cmd EnableGDT does it

mint terrace
#

i think they changed it to shift+' (")

night relic
#

I'm going to bed, thanks for the help!

mint terrace
#

Glad to help!

charred lava
#

Anyway of extending the debug view for EQS tests? For example showing a debug line trace for every item for the EQS trace tests?

misty wharf
charred lava
#

Okay, I'll have a deeper look. Thanks zomg

wary ivy
#

hmm

#

EQS queries don't consider "actor visible in game" or anything like that at all?

misty wharf
#

Huh?

#

You could write a test which checks the flag I guess but it doesn't do that by default

wary ivy
#

yea I'm thinking about my inventory system and I figured I could just keep everything as an actor and hide, disable collision and disable ticking on the actor if it's in someone's inventory (without attaching it to the owning pawn)

#

but since EQS doesn't care and I want to use it I guess I'll go back to the drawing board

rugged spear
#

Hey folks, I have a simple behaviour tree which just navigates the character to a position, but this position is constantly changing. To make it work, I set Observe Blackboard Value, but that makes the character stop and start again each time the value changes. How can I make the target change smoothly?

wary ivy
#

actually I can just set my items to WORLD_MAX on Z axis to move them "away" from the game world in case some EQS uses a query of "get actors of class around querier within distance"

#

that should do the trick ๐Ÿ˜„

misty wharf
wary ivy
#

the problem is that if I pick up an item in my game the actor actually stays at its old position in the game world (ticking, collision and rendering disabled) until the player either equips it (then it's attached to pawn) or when it drops the item (then world location of the item is set in front of pawn). EQS queries still pick up the item from the position where it was prior to picking it up, even if ticking, rendering and collision is disabled on the item actor.

#

Like, the EQS querier goes near the spot where the item was, then the get actors of class inside radius generator would get the item's pos

#

on the ground

#

instead of nothing since it's picked up by someone

misty gale
#

How come you wanna keep the actor during that time?

#

What purpose does it serve to be in the world if it really only is data in an inventory?

misty wharf
#

Depending on how they are implemented it can make sense. For example to hold actor specific data

misty gale
#

Fair enough, but in this case it seem to add trouble to another system :p

#

Could be worth it tho, idk.

wary ivy
#

I ended up using actors because that way I can use actor components for handling them

#

for example my inventory is just an actor component that stores any kind of actor that has an item component

#

that way every actor can be an item and I can even change that during runtime by adding and removing components from actors

#

and it's easy to place them in the world too ๐Ÿค”

#

in editor

misty gale
#

I mean, yeah id use actors aswell, i just havnt had any reason to keep them alive after i pick them up ^^

wary ivy
#

I might end up turning them into uobjects but then I'd have to reconsider how to handle the whole actor component thingy :\

misty gale
#

Its not super obvious to me how thats very beneficial over regular interactable hieriarchy or interface

#

Toggling it on and off should be a breeze

#

Just destroying it, and spawning the same class again..

rugged spear
misty gale
#

Usually its a very fixed set of interatctables/pickups anyways (not like you suddenly decide to put a powerplant in the pocket)

ocean wren
#

Evening all

#

whats the word?

#

What a week and its only monday ๐Ÿ™‚

misty wharf
#

Anyone have any clue why my AI's might be getting stuck on this edge? Navmesh largest step height = 35, character largest step height = 45, so since the navmesh is generated across it, and the char's step height is higher, shouldn't they be able to cross it just fine? ๐Ÿค”

#

(the height of that step is about 25 units)

ocean wren
#

collision hitting the capsule at weird angles?

misty wharf
#

Maybe, but from what I understand it shouldn't matter because it has the whole step up thing in CMC ๐Ÿค”

opal crest
#

It's probably collision in some way. Maybe you have collision on for your AI mesh, and it's sticking out of the capsule?

misty wharf
#

Checked it, and although it had collision on the sprite component I turned it off and it had no effect

#

I guess I'll have to add some breakpoints into the CMC code for stepping up and see what it's doing there

tardy wolf
#

Is there a way to make floating pawn movements turn when moving around? Or do I really need to use character movement for this invisible reference object?

nimble smelt
#

What's the best way to "pause" a behavior tree, say for something like a robot that gets temporarily powered off?

tardy wolf
nimble smelt
tardy wolf
#

On tick.

#

In the actor I want rotating.

#

I'll double check my nodes but I'm sure I copied them exact.

#

Only difference is the speed, I just set that to 10.

nimble smelt
#

That might actually be your problem, mine is set to 360

tardy wolf
#

I'll try that but even at 10 the values themselves weren't changing at all

#

Nah, still not rotating.

misty wharf
stray violet
wild citrus
#

What does it mean when the AI seems to trigger BTT_FindWeapon over and over but a breakpoint on the code inside never triggers?

#

The AI itself completely freezes/breaks infinitely

mint terrace
#

do you mean that breakpoint on the node to the right of BTT_FindWeapon- if so then BTT_FindWeapon is failing. Sequences stop at the first failure.

wild citrus
#

no sorry, a breakpoint on BTT_FindWeapon triggers but any breakpoint inside on the code (to see why it fails) does not

celest python
#

It could be a bug too

#

Happened me on 4.26

wild citrus
#

this breaks

mint terrace
#

id normally say it was a blackboard condition decorator but there isnt any

wild citrus
#

eg. this would not (inside BTT_FindWeapon)

wild citrus
#

4.24 I believe

misty wharf
#

Sometimes the BP debugger needs you to have the specific instance selected for it to break

#

Which can be an issue with things like bt tasks :P

wild citrus
#

I tried all of them, no dice

misty wharf
#

Best to just print the data you want, the debugger is unreliably anyway

mint terrace
#

i wonder if this one is firing?

wild citrus
#

Gotcha, just wanted to check if I was being a dum dum ๐Ÿ˜„ thank you

#

ah that's interesting

misty wharf
#

the execute AI should fire always if the node actually executes

#

abort fires if it gets aborted after it has activated

mint terrace
#

yeah the debugger really is squirrelly in here

wild citrus
misty wharf
#

if a decorator causes the branch to exit or such

wild citrus
#

ah, right

misty wharf
#

finish execute with false will just result the node counting as failed

wild citrus
#

I dont think that's it but thats really good to learn

misty wharf
#

Yeah you usually don't need to deal with the aborts for tasks, unless your task is asynchronous and doesn't finish immediately on execution

#

abort is useful if you are waiting for an event, so that you can unbind your listener

wild citrus
#

that makes sense

#

wish I knew about that earlier haha, somehow missed it

mint terrace
#

its not that the debugger never works though

#

im seeing good fires on BT tasks testing here

misty wharf
#

Yeah it works most of the time for me as well :P

mint terrace
#

yeah

wild citrus
#

usually it works ok but I've noticed when it gets stuck in a loop like this it never does (and thats when I wanna debug the most haha)

misty wharf
#

bigger problem is that it often doesn't show any of the values when you try to inspect them so it's a bit useless for that

mint terrace
#

one caveat here

#

the way blueprint debugging in general works (in my experience), is that if you have a breakpoint somewhere, and you continue, and the very next breakpoint would be the same breakpoint, it will not break

#

it should but it doesnt

#

if you then add a second breakpoint and then hit continue, continue, continue, it alternates between those two as expected

#

bigger problem is that it often doesn't show any of the values when you try to inspect them so it's a bit useless for that
almost entirely useless yeah

#

its a yahtzee moment when it works

wild citrus
#

very true ๐Ÿ˜„

#

Lately when I inspect values I get a full on crash about 1/10-20 times... painful

mint terrace
#

ouch

#

curious what the crash is

#

I'm the crash curator, it seems (windows 11, rtx 3080ti, ue5)

#

feels like I've seen everything by now

raw basalt
#

Does anyone have an up to date AI melee attack system. I followed this one and the AI just never attack. Been stuck for hours. https://youtu.be/HuH3MTWGDNk

We have now got animations in place for the melee attack and now we are going into the behaviour tree to add the behaviour to the NPC to attack us when we are near them.

Link to Attack animation: https://1drv.ms/u/s!AvfMAVHw1KCio4EleOT4cnppOaPSUw

Support me on Patreon and get access to videos early, join our developer community on Discord, get...

โ–ถ Play video
raw basalt
#

Fixed it, I remove the simple parallel that is in the video and swapped it with a selector. If that's not the right way, please correct me. Thanks!

dapper spear
rigid wyvern
#

anyone have tips on optimizing ai? I plan on having groups of ai within my game and the max being around 30. But it really starts to tank frame rate.

celest python
#

Always profile first

#

And prove the overhead

#

Later on you can create a strategy to optimize

lilac solstice
#

Hello everyone - I am running into a wierd issue with what should be basic AI perception stuff.

I have an NPC BP (BP_SkeletonNPC) with a base npc class (BP_BaseNPC) that has the AIPerception component on it. The component has been configured to use sight, I have enemy/neutral/friendlies checked, etc.

My player character has a base class (BP_BaseChar) as well, with the AIPerceptionStimuliSource , set to Sight and auto registered as well.

When I am in debug mode, I get the image below registering when I enter into the radius of my NPCs vision

However, for whatever reason, these events do not seem to trigger on BP_BaseNPC and I cannot quite figure out why that is.

Any thoughts on what step I may be missing on just getting a simple perception trigger to print something?

rigid wyvern
# celest python Always profile first

This would be my first project using a fair amount of ai. With that in mind, trying to test and add to systems that interact with the ai is proving difficult at 20fps. I was just hoping to know if there is a setting or something I have overlooked that improves ai and the use of behaviour trees

celest python
#

You can run ~50 AI without any serious bottleneck in UE

#

most culprit would be movement component and rendering characters

#

If you get 20fps with 30 AI, you did something wrong at somewhere

#

Profiler will show that error

#

Behavior Trees generally very optimized, even with very complex and confusing tree structures

#

Especially when you do it with C++, they become invisible in profiler

#

Generally perception can become a pita from what I can see in this di,scord

#

To optimize movement cost, you can end up writing your own movement component or just use FloatingPawnComponent for non character classes

#

For more than 50 AI, pathfinding can cause serious bottleneck too, if you are not moving to an actor and to a location (vector)

#

It requires some C++ and a few workarounds

rigid wyvern
ocean wren
#

Perception really isn't that hard.. I guess it might be worse if you're only doing blueprints

#

Dammit, I was looking for some 3D models of navy ships so I could do some visualization stuff and there really aren't any nice looking free 3D models, which is surprising

#

You'd think someone would have photogrammetried a ship by now ๐Ÿ™‚

vernal pivot
#

is it possible to make AI sight not work in the dark?

celest python
#

There was a convo about this a few months ago

#

Search for keyword "thief" in this channel

wanton peak
#

hey, question about ai.
I duplicated my UE_Character and created another IA controller for it. In there I am just making the character move to a different point with "AI Move To" node. The AI is moving, but not walking or running, just literally dragging it self to the other point. Am I forgetting something? Do I need to do something to trigger AI Animations?

funny thing is that when the AI is idle, the idle animation is active. But not the walking or running

uncut pasture
#

hello guys
i have a pawn which contain a simple mesh that simulate physics
when i made this pawn as ana AI and giving it floating movement component it start teleprting and lagging during its lovement .
so any idea for a good movement component to this type of pans or any good settings to make it move without that lag

ocean wren
#

No, you're on your own with that

topaz inlet
#

hi, so I've started looking at aiperception, and from what Ive seen OnPerceptionUpdated (using sight) should only update when entering the viewcone, and once when exiting. However I get it every frame. What could be the reason for this? I'm using a pawn, not a character, it's for a spaceship, so the character contains a lot of things I don't need.

ocean wren
#

I can't remember the details, but maybe its OnPerceptionEnter / OnPerceptionUpdated / OnPerceptionExit??

#

Updated maybe just increases the perception time

#

If I recall, I used it to allow for the perception to build up and used a threshold to activate proper perception

#

Its been a few years since I used it

topaz inlet
#

those events do not seem to exist. I have only OnPerception Updated, On Target Perception updated, and on targetperception info updated.

#

I'm using blueprint only..my c++ is very rusty ๐Ÿ˜›

opal crest
#

IIRC, It's OnTargetPerceptionUpdated that has the behaviour you are looking for

ocean wren
#

yeah, you're not going to get very far that way

#

The perception system definitely needs you to read the code to get the most out of it

#

And honestly, needs a bit of C++ code to wrangle it too

topaz inlet
#

Yeah, it looks like there is some weird behaviour with affiliation also..

#

and I cant set itusing blueprint anywhere..

#

as I can see..

ocean wren
#

The affiliation thing is just a integer comparison with the Team ID

opal crest
#

Yeah, two pretty fundamental bits need C++ (teams and the location to cast a ray to to confirm visibility)

ocean wren
#

But you have to implement an interface

#

Aye, I made mine use random bones on the skelmesh sampled so that it wasn't always the torso ๐Ÿ™‚

topaz inlet
#

well, to confirm visibility, cant i just use the "stimulus successfully sensed"?

#

I can use center for this, I will use this for some quite small enemy spaceships.

opal crest
#

Hah, that's clever. I had to use it since on most of my pawns, the actor location was bottom middle.

#

Yeah, if your Actor Location is center, the default implementation has what you need.

topaz inlet
#

another thing, can I assume that "Info last sensed stimuly array" from Get Actors perception should only contain the senes defined in the AI perception component?

#

I seem to get 3 array values, even though I have f.ex only added sight.

#

or, sight and. hearing in the current test.

#

this one

#

Just testing to see what sense I get, and the odd thing is that it reported index 0,1 and 2. Even though I only have 2 senses added. So, I wonder if I'm doing something wrong ๐Ÿ™‚

opal crest
#

I haven't used that call (I've always been able to get away with just using the delegates/events), so I'm not sure. It's my guess that you're getting the last three stimus events regardless of the sense.

#

They could all be sight, but reporting the last three updates.

topaz inlet
#

heres the printout

#

and the senses

#

so, I would have expected, 0 - True, and 1 False.

ocean wren
#

Try printing out all of the info for the stimulus.. age and whatnot.. might give you some ideas whats going on

opal crest
#

That index is not index of the sense, but index of the stimulus i.e. the action of sensing something

topaz inlet
#

(I've just started with this, so I might be missing some things..)

misty wharf
#

use the stimulus updated events unless you need to get that data from some other place

topaz inlet
#

I see, so it does not correspond with te sense. how do I get teh sense then?

misty wharf
#

the events fire when the stimulus status changes, eg. visibility or a sound was heard

topaz inlet
#

well. the status seems to change every frame.

misty wharf
#

you can use get sense class on the stimulus object to get the specific sense class it came from as well

topaz inlet
#

since I get a steady stream of printout

misty wharf
#

Are you running it on tick or something?

opal crest
#

If you're using targetperceptionupdated, you'll get a struct with the stimulus class associated.

#

You can then select based on that to see what sense was triggered.

topaz inlet
misty wharf
#

I would recommend using the other event, it's much simpler to work with

#

it gets called once per updated stimulus if any updates occur

#

target perception updated, as epigraph mentioned

topaz inlet
#

okay, I will try that. Really appreciate the help ๐Ÿ™‚

misty wharf
#

for sight events you will get one event when target becomes visible, and one when it becomes hidden... for any other events, you will get them once when the events occur

topaz inlet
#

yeah, this makes sense.

real tree
#

Hey guys I'm having a verry hard time with BTs. I'm trying to check if my AI is already parrying with a service, it's working normally and set the "AlreadyParryingBool" Goes to "TRUE" and then after the animation stops the "Parry" value of the AI comes back to False, But even if the "Parry" Comes back to "False" then the "AlreadyParryingBool" set by the service keeps failing as if the "parry" bool was still "True"

tryed to see if the "Parry" of the AI comes back to false, with a print string, but even tho it keep failing so my AI parrys once, and never come back to "false" state.

#

so when the string gets printed it returns "false" but the Ai refuses to parry again and the "IsAIParrying" returns True even if I'm running the service twice to set the value back to false

misty wharf
#

It's a bit hard to say since there's a lot going on in that, but it seems the state isn't being reset for some reason

#

Does it print the expected number of times? eg. after parrying once, when it should reset, does it print the values then as expected?

real tree
#

Yeah since I putted it on main selector, i'm getting "False" value every 1-2 sec. and I tchecked with breakpoint it does to all the way to "set blackboard value as"

#

also when I try to hit the AI it returns false into the service, but the bool never returns to False for some reason

opal crest
#

If you remove the IsAIParryingDecorator, (maybe replace it with a cooldown, just to test), does the AI parry more than once?

#

The decorator won't get updated unless the BT activates that node.

real tree
#

Oh yeah if I remove those conditions, it just parry every single hit and is really hard to kill but never attacks as long as I attack too ^^

the main selector is allways getting fired, the ai keeps moving and attacking etc... Just stop parrying so the main selector running the service should refresh the decorator ?

#

Or maybe I need to put a task to refresh the decorator ?

opal crest
#

๐Ÿ˜„

#

Yeah, if you add a task to the left of AiParrying that sets your parrying key, it will probably work.

#

It's not great since the right pattern is to use a service here, but I can't see how that's failing.

real tree
#

I've been having to deal with so so many weird issues I could never actually understand it lately it's like I'm barely able to set a value from true to false peoperly everything keeps failing xD

#

allright it's getting worst xD

#

So I've done this task that also gets fired and still dosent trigger my "AIParrying" Back to "Not set" (False)

opal crest
#

Set a breakpoint in the BT, and doublecheck that AiParring? is set to false in the BB.

real tree
#

BB value check

#

where do you want me to place a Break point ? on AIParrying ? task

opal crest
#

Yeah, Try there (and if it doesn't get yet, on the sequence above)

real tree
#

Yeah It gets fired since my AI does really parry me, just once

#

Maybe I missed something is the parry task itself

opal crest
real tree
#

The other task you see on the right side is not pluged yet, it's a starffing task when the AI is not attacking

opal crest
real tree
#

I'm looking into my parrying Task maybe I failed something

opal crest
#

I would put RefreshParrying under the sequence node 34, left of the AIParrying, to be really sure we're updating, but it does feel like a regular debug session is the solution.

real tree
#

Now It's Spamming hard "Refresh" when I attack, and never going to parry if I put it after, it never gets fired again and parry once only

#

and thats also really weird since it's a "Sequence" that is supposed to try to execute the entire sequence, but never does

misty wharf
#

If you have a sequence where a sub node has a decorator which fails, the sequence itself will fail

real tree
#

yeah but it'supose to display the red mark to say it failed, and it didnt, like the refresh was constantly running

wanton peak
#

Can I access a variable of the BP_Character from the AI_Controller? If so, how? thanks

misty wharf
#

get controlled pawn and cast it to whatever

opal crest
wanton peak
real tree
#

I went for a simple task to replace the service etc...

#

Looks to be working a lot better but I ran into another issue x)

#

but I think it's no longer AI related and this might do the job when I checked my entire parry system

#

I have to say that setup a full directionnal melee AI and player is not begginer friendly for the AI work xD

#

allright thanks guys for helping, i did not find my issue, My ai is tanky AF and parry 95% of every hit, but we are getting there ๐Ÿ˜„
I'm off for night seeya

worn sandal
#

can i make a behaviour tree check a bool if true or false?

misty wharf
#

Blackboard decorator does it

#

set = true, unset = false

rugged talon
#

is there a way i can get the stimulus location of only certain characters ? i want the character in this controller to go to my heard location but it goes to its own

uncut pasture
#

hello guys
what is the best movement component for pawn class that contain static mesh ( simulating physics)
because floating mov comp made my ai lag while moving and act like teleporting
thank you have a good day

misty wharf
#

There is none

#

The builtin movement components all assume a kinematic pawn (ie. non-physics simulating)

#

You can try making your own movement comp, or handle moving directly in the pawn

main talon
#

I'm trying to make a drag and drop mechanic for placing ai pawns in the play area at runtime. The issue I'm having is as soon as I pick up a pawn and drop it, it no longer moves around on the nav mesh. Anyone know how to get around this?
I've considered destroying the original ai pawn on drop and spawning a new one but that feels wrong

misty wharf
#

Really depends on what the problem is that's causing it... it could just be your AI logic getting confused when it gets moved like that

main talon
#

At the moment it's only a sight perception in the ai controller, and a rotate to faceBB key, and a task that spawns a projectile. Best I can tell it's losing sight of the nav mesh when it's picked up and doesn't pick it up again when it's dropped back to the map

misty wharf
#

How are you moving it if that's all it has?

#

also sight perception has no relation to navigation

main talon
#

It's just supposed to rotate at the moment.
Does it before pick up, doesn't afterwards.
And I only mentioned sight as thats how it's getting the look at target

lyric flint
#

is it possible to rebuild navmesh at runtime?

ocean wren
#

yes

ocean wren
lyric flint
misty wharf
#

there's an option for it in project settings, runtime navmesh generation or something

lyric flint
misty wharf
#

How did you determine it's not working?

#

If it's set to dynamic, changing anything which has "can affect navigation" enabled will trigger the navmesh to regenerate for the affected areas

lyric flint
#

and also AI doesnt move

lyric flint
#

when i move the location of the nav mesh bounds volume then it reload the navmesh

#

but i cant do that while playing

misty wharf
#

Try it with something that will actually try navigating

#

The navmesh visualization mode doesn't always update

#

If it doesn't regenerate the navmesh, you would probably have to ask the navigation system to do so, there's probably a function for it somewhere in UNavigationSystemV1 or something along those lines

lyric flint
misty wharf
#

Not sure, I guess you could try the obvious ones like rebuildnavigation or something but most features don't have console commands out of the box

nimble smelt
#

Hey I've got an AI moving a pawn with FloatingPawnMovement, pretty simple just gets the location of the player's actor and uses the MoveDirectlyToward node. The problem is, it misses if the pawn has physics motion when it starts moving, it doesn't seem to realize that it won't be moving where it thinks it will

#

Is there any way to fix this or make it better at compensating for the physics?

misty wharf
#

It kinda depends on how you want it to behave

#

If you want it to go where the player will be once it reaches the player, then you need to calculate the position based on the player heading, and move there instead of towards the player

nimble smelt
#

no no the PLAYER isn't moving. The AI pawn is moving

misty wharf
#

Ah so it's using simulate physics?

nimble smelt
#

yeah

misty wharf
#

Yeah none of the movement logic really works with simulate physics

#

zero the velocity before you start moving, that would fix it at least

nimble smelt
#

That would probably look super weird though. The goal here is to have a missile that gets kicked out by a kinetic launcher, then activates its rocket and changes direction

misty wharf
#

Ah

#

One way to do that would be to keep updating the movement direction over time as it changes its heading

#

so that you store the target position, and for example on tick update which direction the target point is relative to you, so that way it would adjust its heading over time but should still go through the point

nimble smelt
#

The problem is I dont control the movement direction right? That's determined by FloatingPawnMovement and MoveDirectlyToward, I just give them the target point and it goes

#

Huh this gets a LOT better if I use SetVelocity on the floating pawn movement instead of physics

misty wharf
#

Yeah it probably does, as said the movement comps don't really like physics :)

queen fjord
#

Anyone know of an alternative to the AI move to behavior tree node? When I set the key to player, the ai updates and follows fine but it is very stiff. If I create a custom move to and have the ai get a random point within a distance to the player, the ai doesnโ€™t update while it moves like it does when moving to the player so the ai goes to the previous location first.

raw basalt
#

Is there a way for AI to see through meshes so they can run to the player? I have them set to spawn in a building and I want them to run out and attack the player wherever the player is, like a spawn point. However, they can't see through the building to attack the player.

misty wharf
#

if you want them to always know where the player is, what do you need sight for?

#

you can just get the player pawn location and have them go there

raw basalt
#

I am using AIPerception to see the player

#

but I can see how that would work

misty wharf
#

If you have nothing that would block sight then there's not much of a reason to use perception :)

raw basalt
#

True, very new at this lol

misty wharf
#

fwiw, you can set the sight trace channel on the geometry to ignore if you want it to be seethrough

#

I think the channel is visibility by default, it's configurable in project settings

raw basalt
#

Gotcha I'll look at that, thanks for the help!

raw basalt
sinful nest
#

Hi there, I was wondering if someone here could kindly help? I'm using the "Event Blueprint Update Animation" but it defaults its target to "Anim Instance" the code I'm trying to replicate has its target as itself - please see the attached image. Top img my NEW Animation BP while the one below illustrates the example I'm trying to replicate. I don't understand how they managed to target itself like that? How would I get it to target Anim BP Chicken?? Please help, thank you.

charred lava
#

Anyway of using parameters exposed to the outside within EnvQueryContext classes? I want to have something like EnvQueryContext_BlackboardKeyLocation where I can set the BlackboardKey as a parameter.

undone heron
#

hi, in this behavior tree task I'd like to get a variable from the for each loop, how would I go about doing this?

misty wharf
#

Huh?

#

The same way you would normally do it? Not quite following

undone heron
#

I have a boolean variable in the BP Bar Chair (the one im getting from get all actors of class

#

trying to check the value of that boolean for every spawned actor in the game

#

(occupied being the boolean)

misty wharf
#

Note that it says "Actor Object" in that selector

#

which hints that the pin you're dragging from is of type Actor

#

so you'd need to cast it to your particular class first

undone heron
#

like this?

misty wharf
#

Does it work?

#

If yes, yes.. if no, no :)

#

lol

undone heron
#

alright, thanks haha

uneven quest
#

Hi, I need some quick help with the navmesh. Even though I set the agent radius and height to 1 and 50 in my project settings, the recast navmesh always defaults back to 35 and 144. Is there any way to change that?

#

All the other settings seem to be fine, it's just these two

pseudo radish
#

Is there a way to reference BTTask with blueprint? I'd like the pawn BP to call "Finish Execute" but I can't figure out how that's done.

keen crow
#

Does it worth to use state trees in a new project? The feature is still experimental and I'm only starting to getting into it. Is there anything significant missing about it?

celest python
#

No idea but its commonly used around #mass territory so unless you go very further with implementations it should be fine

#

From what I can see (as someone havent used it yet) its just BTs integrated into FSM logic after each selector composite. If you need similar logic you can get LogicDriver's lite version and have a BTTask creates a SM and runs in while selector is active

#

Should be pretty much equal without some fancy integration

keen crow
#

#mass ? what does the AI framework have to do with that data things?

celest python
#

#mass is not just data things, its UE's ECS system and involves some crowd simulation

#

And state tree is suitable for crowd simulations

#

hence its used on city sample / matrix demo

keen crow
#

I was thinking about it as a better tool for a small town citizens activities like work/sleep cycles and stuff

celest python
#

Yeah I think StateTree would be a good choice

#

I'd guess in #mass general approach is using selectors as LOD index and update behaviors based on that

#

You can use same logic for time of the day instead of LOD index

pseudo radish
misty wharf
#

What are you using this for?

#

Seems like a reasonable way to solve that particular problem but just wondering what the eventual purpose is :)

undone heron
#

hi im creating a tavern management game to get familiar with AI. However I can't find any tutorials on how to make ai have day night routines etc. Does anyone have some sources for me?

misty wharf
#

There's really nothing special to it

#

You create some way of tracking ingame time, and then have the AI look at the clock when it chooses things to do

pseudo radish
# misty wharf What are you using this for?

I'm using this ai for an enemy that attacks the player. The task calls the pawn bp to perform an attack when appropriate (ie close enough). This worked but the behavior tree had no way of knowing when the attack ended. So the interface helps fine tune the behavior tree flow

misty wharf
#

Oh

#

Was it you who I was talking to about something like this a while back? ๐Ÿค”

#

I vaguely recall suggesting using an event dispatcher to someone having a problem like this

pseudo radish
#

I don't think so? I don't think I brought this up with anyone anywhere until today

misty wharf
#

Ah okay, yeah just wasn't sure :) Anyway I would try using an event dispatcher instead, that would make it a lot simpler

#

Basically have an event dispatcher in your character class, such as OnAttackEnded

#

You can broadcast it from the character when it finishes an attack

#

and in your BTT, you can bind an event to it, and when it fires you unbind the listener and finish the task

#

you'll also need to add an abort event to the BTT which removes the event listener

pseudo radish
#

Yea I thought about using event dispatcher that way, but the unbind thing could make it complicated. I might still try it though! Thanks for the suggestion!

misty wharf
#

that's all you need for it :)

#

it works pretty well for any kind of actions your characters can do which take some time to finish

pseudo radish
#

I see, thanks!

sage flint
#

Hi! Question about EQS, if there are few generators connected to the root node, how does EQS picks the generator to use?

celest python
#

From left to right first iirc

#

If one fails, it executes second one

proper pawn
#

quick sanity check: I'm trying to create a behavior where a commander unit can issue a flanking order for some of the grunt units. I'm using EQS to see if there's a good flanking spot, and one of the queries I want to use involves scoring negatively when the point is already in proximity to allied units

for this query, is it correct to assume that iterating through the world's actor list is going to be perf-limiting - so I'll need to do something like keep a list of units relevant to the encounter or a spatial partition of some sort so I'm looking through a much smaller list of data on each query?

sage flint
ocean wren
crystal sequoia
#

Hey, I'm having issues with my floating pawn movement component - simplemovetolocation doesn't respond to any acceleration/deceleration value changes

quick current
#

Hello, can someone know a way to allow AI to move in direction but always faced to Actor ? Using Behavior Tree I done this but It doesn't work. I have another solution : manually rotating the mesh in the actor direction but I don't find it very elegant x).

atomic hill
#

Hey, anyone knows how to run two behaviortrees on one AIController?

I'd like to have two bt independantly of eachother on one AI. By using the run behavior and parallel node it is not as dynamic enough,because by using the parallel there is a dependancy between the main and the side track (when main track is done it either waits for sub or restarts it)

So I think two bt would be best

Anyone did that before or knows how I can achieve running two types of tasks in parallel that work indepenant of eachother?

ocean wren
#

I'd advise you not to try that with the current BT implementation, because it doesn't do parallel's properly

#

What you could do, is have components on your AI class that does something and simply signal those from your BT

#

Whats your use case?

misty wharf
#

In theory you could do two BehaviorTreeComponents in the controller... but yeah from what I've looked at the code, there are places in there which assume a certain structure and it might start behaving erraticly

#

Definitely seems like a better approach would exist :)

atomic hill
#

Well I'm working on an rts ai. My idea for it would be that one bt is in charge of building structures and another in building units.

But yea as it is not that possible I'll think of something else

ocean wren
#

Just have multiple actors with different BT's then?

#

But if you're doing an RTS, then maybe using the new Mass ECS and StateTree's would be a good idea

atomic hill
#

Thats what I was also thinking about. i'd also need to manage squads of units and for this I thought of using seperate actors each with one bt

ocean wren
#

I did a bunch of squad stuff using multiple actors and it was a good pattern to use. I used FMessageEndpoint to connect them via events and I'd recommend that approach.

atomic hill
#

Awesome thanks for the tip

#

Ecs and statetree is not an Option because game will be released with 4.27

#

And would require a big rework to make existing systems work with that

ocean wren
#

You could always back port it. I doubt the ECS stuff uses anything 5.1 only

#

But yeah, having actors coordinating via events is pretty handy. You can feed debug commands up and down the chain of command and its all relatively clean to do

#

Add some debug logging for the event handling so you can catch anything weird

atomic hill
#

Are those actors you used aicontroller or an empty actor with a btcomponent?

ocean wren
#

A mixture of things really

#

Some with BT's and some with my own utility#

atomic hill
#

But were they aicontrollers or just an actor with a btcomponent? Would the second be better for this as they dont have a lot of overhead?

ocean wren
#

Having a controller is basically the only way to use BT's, I wouldn't worry about the overhead, its just memory really

#

Your biggest overhead with an RTS is in the Units.. which wouldn't have a BT anyway

#

Units would just have a command following system really..

#

And you'll soon learn that it isn't AI that's a limiting factor ๐Ÿ™‚

atomic hill
#

Alright thanks for the explanation :)

mint terrace
#

today i learned special care must be taken to avoid calling Unpossess on the BT-driven AI controller as a result of a behavior tree task. (seems obvious when i say it like that but it was a bit of an indirect cause and effect). If you do it, the cleanup phase of the behavior tree will run a processing step, and since you are already in a processing step, you crash the whole game

#

in my case i deferred the unpossess until the next frame, not sure if theres a better way /shrug

pseudo radish
#

Anyone know if a bound event in a BTTask gets unbound automatically when the task finishes or aborted?

misty wharf
#

I don't think they do

pseudo radish
#

Just tested, yea they don't, damn.

misty wharf
#

maybe look at AITasks

#

I'm not 100% sure but they might have that sort of support

ocean wren
#

Been playing with Dall-E today.. man its good

misty wharf
#

ask it to draw a picture of Duke Nukem chewing gum

#

I want to see what it does

#

lol

ocean wren
#

These large ML models are going to have a huge impact in 5-10 years

#

piloting prompts is definitely interesting

misty wharf
#

Wait is that the output for "Duke Nukem chewing gum" lol

ocean wren
#

It has issues with text ๐Ÿ™‚ I guess it was trained on some weirdo art sites

#

that was "duke nukem chewing gum, digital art"

misty wharf
#

haha

ocean wren
#

Ahh, it looks like there's some brand that appears like duke nukem to the model

#

I asked it for duke nukem chewing gum, 3d render and it showed a bunch of packets of chewing gum as 3d models ๐Ÿ™‚

#

with weirdo names

misty wharf
#

I guess it can't quite figure out what "duke nukem" is supposed to mean

ocean wren
#

The term "chewing gum" probably appears more in packaging than in games you know what I mean?

#

Here's "duke nukem, digital art"

misty wharf
#

Hmm I guess that's not it, they are vaguely similar characters I guess

#

what's the output for Arnold Schwarzenegger? :D

ocean wren
#

haha.. I think you have to give it more conceptual stuff than specific people.. so "body builder" or "blonde bodybuilder" or something

misty wharf
#

I need to check how to get access to this

#

Ah it's just a waitlist

ocean wren
#

Hows this one then: "A portrait of Arnold Schwarzenegger riding a Shiba Inu"

misty wharf
#

haha

#

What if you just describe duke, like.. "Blonde macho man wearing sunglasses, a red tank top, blue jeans and combat boots" or something lol

ocean wren
#

worth a try ๐Ÿ™‚

misty wharf
#

it's interesting that it got arnold's physique but none of his actual features otherwise

ocean wren
#

Its way too addictive.. I've been literally generating concept art for the last three days

#

So it generated some red tank top men.. but you kind of need to tell it not to do photographs ๐Ÿ™‚

#

That was with "digital art" added

misty wharf
#

Those are actually not bad lol

ocean wren
#

Hmm, so there's interesting.. this: Blonde bodybuilder wearing sunglasses, a red tank top, blue jeans and combat boots, digital art

misty wharf
#

:D

#

You got femduke

ocean wren
#

Figuring out how to tell it what you want is really quite interesting

misty wharf
#

I guess it just goes to show how much the word "blonde" carries a gender identity with it :P

ocean wren
#

like some terms overpower the scene entirely

#

Added the word male to that prompt:

misty wharf
#

heh

#

okay... what does it output for "portrait of tim sweeney"

#

lol

#

need to keep it vaguely on topic

ocean wren
#

You can honestly get some really amazing artworks out of it though

misty wharf
#

yeah it looks pretty great

ocean wren
misty wharf
#

I'd love to use that to generate video box art for my game but that's not really very realistic lol

ocean wren
rugged talon
#

is there a way to lock the sight angle of a spawned AI to the original direction ? ive made a sentry ai but the sight follows the turret. i want the sight to face one direction because right now if i set focus it follows me so i cant leave the cone of sight

ocean wren
#

I guess I need to find a webp viewer ๐Ÿ™‚

misty wharf
rugged talon
#

aaah so there is no option to lock the sight angle in bp

ocean wren
#

Can you tell I went a bit mad with the Simon Stalenhag prompts?

#

I mean seriously.. given I am just incapable of the patience that art requires, this is truly transformative

#

I did try some Ian McQue too

#

The goddam thing can do pixel art too ๐Ÿ™‚

#

I think I need to stop now and watch a movie or something ๐Ÿ™‚

opal crest
#

It's absurd how good this is.

ocean wren
#

Pretty much transform plenty of creative jobs

#

Once we can do it with video

#

And then do it realtime

dusk pewter
#

In the basic BTW and bb setup, I am trying to pass a point based on the actor's spawn location.
Basically I want it to wander around it's spawn location.
I can cast in the service to my controlled pawn and get the data but I was wondering if there was a way to get that data from the actor directly in the bb

misty wharf
#

I would just assign it into the BB when it gets spawned

#

In my fps project I have it set up so that as soon as the AI controller possesses something, it sets the pawn's position as the spawn location in the BB

ocean wren
#

Yeah, just set the BB value on spawn

dusk pewter
#

Where would you set it? In the actor? Or the aic?

#

That's the part I am struggling with. Who sets it? Pawn, controller, service?

ocean wren
#

Which one do you think?

dusk pewter
#

The game instance

ocean wren
#

Why there?

misty wharf
#

the ai controller would probably make sense because that's what is supposed to manage the AI logic anyway

#

when you possess something it probably shouldn't have moved much from where it spawned

bleak raven
#

How to make navmesh respect very low ceiling? In this case, wall with gap at bottom. Enemy is unable to crouch.

#

To be clear, actor height in Navmesh and Navsystem setting is 144 and walls all have same collision settings

bleak raven
#

Enemy is hopelessly stuck and thats very annoyng, shouldnt that sort of thing like properly working NavMesh work out of the box? I am trying to mess with settings, without much success so far

dusk pewter
#

@bleak raven add a navigation mesh blocker

#

And place it there

bleak raven
#

I can check if it works but I shouldnt have to put that sort of thing in first place... I mean, for example this works without problems:

#

I cant believe navmesh just flat out ignores low ceiling.

#

is there any other way? for example, I dunno, for given mesh separate collision used for navmesh and separate normal collision?

#

Huh! Looks like navmesh DOES take ceiling in account (easily checked by lowering these walls with gap at bottom), but I cant find where to change acceptable height of ceiling.

vivid drift
#

@bleak raven It's a bit obscure but in project settings you can define the properties of nav mesh agents. Including how wide they are (capsule radius), tall they are (max ceiling height), and slope stuff. The engine will, under the hood, assign characters to these agents based on the shape of their capsules if memory serves. If you have multiple agent definitions, you'll actually generate multiple nav meshes (I think... I don't remember if you need to explicitly tell it to do this). You can color them differently and offset them to make it visually clear.

So like... if you want one nav mesh for your normal characters and one for your giant fatties that don't fit everywhere, they can each have their own

#

If you only need one type of agent then just adjust the height and it should adapt to your ceilings as needed

bleak raven
#

it seems to ignore Agent Height completely

vivid drift
#

Odd

bleak raven
#

solved issue, it was actually embarassingly simple - NavMeshBoundsVolume's brush was too small height-wise kappa

wild gyro
#

I made hexagon path finding but now I need a to make my own avoidance does anyone have any guide or suggestion algorithms?

wild gyro
#

Unreal Engine 4โ€™s pathfinding and navigation system gives all users a robust and easy to use system for adding AI controlled characters into their games. With the default settings, navigation is static preventing changes at runtime. Dynamically generating the nav mesh (Navigation Mesh) and adjusting it during runtime has very little documentatio...

keen crow
#

How do I run a state tree inside AIController? For BTs there's a RunBehaviorTree but I cant find anything similar for ST. Also the StateTree property in the UStateTreeBrainComponent is propected and there are no public setters ๐Ÿค”

charred ruin
#

I want to do my AI logic in C++, anyone know the difference between UBTService, UBTService_BlueprintBase and UBTService_BlackboardBase?

misty wharf
#

Not much

#

BlackboardBase has some default stuff in there for using BB, but you can use BB from UBTService as well, BlueprintBase is the baseclass used for BP based services

charred ruin
misty wharf
#

if you're doing them in C++ you don't really need to use BlueprintBase, but if you use the blackboard then using BlackboardBase would probably make sense

dusk pewter
#

I have 2 behaviors split by a sequence and each have their own sequences with a decorator.
How can I get it to only do 1 downstream sequence and not the other?
I tried with an enum and it works if the enum is set to 0. But any other index just stalls at the first sequence with a failure in the decorator.

misty wharf
#

if you want to only execute one sub-branch, a selector would probably work best

#

a sequence executes nodes until one of them fails, a selector executes nodes until one succeeds

#

so if you have a selector with two (or more) sub-branches, you can put a decorator on them to choose which one to go into and it will only ever execute one of them

dusk pewter
#

@misty wharf thanks that worked!

charred ruin
#

Is there a tutorial/website that shows best practices when it comes to designing AI / behavior trees? What do you do when behavior trees become too massive and hard to maintain?

ocean wren
#

refactor them ๐Ÿ™‚

#

You can use subtrees and things like that

#

but in general, I tend to break my AI down into different systems.. I don't try and build everything in a single BT

#

for instance threat evaluation I use a utility system

#

squad control I use a multi-layer BT with different actors in a command heirarchy

#

Some stuff I use a simple state machine for

haughty coral
tardy wolf
#

Okay gonna ask here though its not strictly behaviour trees, but there seems to be ongoing support in Blueprints chat.
I have a pawn using the AI MoveTo node, is there any way I can trigger an event when it reaches a path-point as well?

#

Or failing that in Blueprint, is there anything I can do with behaviour trees to achieve this?

vivid drift
#

This pin executes when it gets within Acceptance Radius of the target

#

@tardy wolf

#

you could also achieve it with a behavior tree fairly easily using a sequence node.

tardy wolf
waxen anvil
#

Doe's the MoveTo node in Behaviour Tree not apply mesh animations?

tardy wolf
#

No idea, I haven't looked into the internals.

vivid drift
#

@tardy wolf Probably best off getting the path points and then breaking your ai move to to go to each one individually

tardy wolf
vivid drift
tardy wolf
#

I didn't think about that honestly

waxen anvil
vivid drift
#

@tardy wolf Use Find Path to Location Synchronously to get these points.

#

I do this to make a little path indicator. But be aware it could change as they move around and what not.

tardy wolf
#

I think I'm already using that to draw the path. Interestingly that's one of the reasons I wanted the "has reached path-point" event, to remove the segment that's no longer needed.

vivid drift
#

@waxen anvil Move to just tells the actor to move. If movement naturally triggers an animation then the animation will play.

waxen anvil
#

Well I'm using the same default character and anim bp that UE5 Projects come with. So I'd assume thats the case but my AI just slides around

vivid drift
#

@tardy wolf I redraw on tick so that the path render starts under the unit' feet. but check to make sure enough time has passed, And the target has changed OR the unit has moved far enough.

tardy wolf
#

Aah, yeah I'd rather not be doing something like that on tick if I can avoid it.

vivid drift
#

@waxen anvil I don't actually remember how it works by default. Check the animation bp. Is it grabbing the velocity of the character and setting animations accordingly?

tardy wolf
vivid drift
#

It's not that expensive. I actually trigger much much less often than tick. Mind you I'm doing this for < 10 units at a time.

#

specifically I trigger, at most, 4 times a second.

waxen anvil
#

Turning on Should Move and changing ground speed works

#

Same with changing the velocity

mint terrace
tardy wolf
#

Probably, yeah.

mint terrace
#

I do wish the gameplay debugger could show the path segments though

alpine rover
#

is using EQS on walls possible? or is it all limited to the navmesh

mint terrace
#

pretty sure all (or most) of the builtin generators are pushed onto the nearest collidable floor (not even sure its the navmesh)

#

you could generate EQS points in a 3D space if youd like

alpine rover
#

awesome. thansk

#

thanks*

bronze cape
#

Hi guys. Do you know, why service vars have "instance editable" check box, not "editable", and why i can't assign them to blackboard value but just set them in BT?

wild gyro
#

Hi guys,
How can I do a pathfinding when target also moves. I am using a* but result is not consistent and since my board is a hexagon they do back and forward move which is not what I want.
anyone know any article related to his topic ? like I saw there is multi agent pathfinding but I don't know how to use them

charred lava
#

Any way of extending the AISightSense cone shape with another shape, like a sphere around the AICharacter?

misty gale
#

Cant you do two sets of senses?

#

Long sight and shortsight?

#

Doesnt give the cone but almost similar result anyways

charred lava
#

That is one solution, but still, I would like to use another shape.

misty wharf
#

If you want to do a custom shape you need to do a custom sense for it

#

You might be able to extend AISense_Sight and modify how it checks, haven't looked at it that much though so not sure

#

If not, creating a custom AISense subclass would certainly work

charred lava
#

Okay, I have a look into it. Thanks you both Squize and zomg.

ocean wren
#

Yeah, I did my own sense calculation.. proximity, sight, concealment etc. Basically wrote a simple utility system on top of the perception system.. so the perceptions were the inputs and then some maths were used to figure out the final sense scoring function

#

Things like dot product with forward vector scaling the sight sense so that things off to the side are less percieved

#

use a curve for the scaling so you can basically manipulate it as a set of summed/threshold curves

#

Things like being sat in a bush reduced the perception.. or laying down, or not moving etc

#

Wrote an extension to the visual debugger so that the perception values were visibile in a graph

#

Helped a lot

charred lava
#

sounds nice

keen crow
#

๐Ÿค” is there any chance combining BTs and STs would be possible since they are both managed by respective UBrainComponent descendants? I'm still starting to get into the ST and currently I think it'd be great to have STs for selecting some global NPC states like interacting with a smart objects, reacting to player or other NPCs, getting into combat, and have the BT's to handle the actual sequence of actions in combat or maybe following along the player

misty wharf
#

Sounds like it could be a reasonable method yeah... but if they are using the brain component on a controller, I don't know if it'll work

#

I guess you could have on of them be the default brain comp and add the other one as another

#

and hope that they built it in such a way it doesn't make assumptions about what's what, BT definitely does some assumptions about being on an AAIController subclass and such, but maybe it doesn't look at the BrainComponent prop

slate oxide
#

Does anyone know why the apostrophe key WOULDN'T bring up the AI/Perception debugging menu? Because I've pressed it half a million times now with some pawns running around in a scene with AIControllers attached and nothing happens when I do.

misty wharf
#

iirc it may be affected by your keyboard layout

#

on a US layout it pops up from ' at least if you are currently possessing the player pawn and you have a HUD

#

if you're not possessing something that has a valid HUD, I think it might not show

slate oxide
#

that did it

#

you have to be possessing a pawn

#

i was simulating the scene

#

thank you very much

waxen anvil
#

Could I make it so the acceptable radius has different values for when to start moving and when to stop

#

I want it to stop moving at 100 and only start moving if the player is 200 away

misty wharf
#

Handle it separately I guess

#

You can check distance to player and then trigger movement

slate oxide
#

I'm having a ton of trouble w/ registering/binding the perception system event callback. Here's where I setup my perception component in my AIController class:

#

It seems to work because I can see the debug visualization as expected:

#

Unfortunately, the call back function is never called. Here is its definition:

#

any help is appreciated.

slate oxide
#

Ok, figured it out. If anyone is wondering: ConfigureSense() needs to be the last thing called.

brave olive
#

Hey ai gods can you help me understand something, im making a racing game I know@cliche but would it be possible to use a nave mesh envoker for the ai cars spawned in? So they can read the road? Most people use a spline and ray cast for objects in the way but I want to use nav mesh. Any tips would be great

bleak lance
#

I have put an nav modifier here

#

but still my AI keeps going there

#

how?

#

Update: So i realised that on floor underneath and on second floor i also have nav meshes so the AI probably uses them, how do i stop that?

keen crow
#

Are state trees evaluators instantiated or are they sort of BT's cpp uninstanced nodes? So far I'm thinking about them as a hybrid of BTs services and decorators . I'm doing a state tree dependent on the time of day where the time of a day is divided into 4 gameplay tags (morning, noon, evening, night). I get it that I can override the Evaluate function but in this case I'll have to query the custom DateTimeSubsystem to give me the day time tag which seems redundant because the tag will change only once in 10 minutes or so. What I'd like to do is to subscribe to the subsystem's delegate that the time tag changed but I'm not sure this is the intended way of working with the evaluators. Also can evaluators tick time be set like in BTs services?

#

Ok so even if I were to subscribe to a delegate in EnterState override I'd still have to get the FStateTreeExecutionContext& out of somewhere in the delegate callback function to update the state property which changes the active state. Now how can I do that from an evaluator?

wintry flint
#

Dear diary server, my NPCs correctly move to the location of the line trace I hit on.

Only problem is if that target is a pawn which is actively moving, the NPC will move to where the line trace hit and then when he gets there he has a lightbulb moment and moves towards where the target pawn actually is.

#

I have this service node preceding the Move To task, set to update in intervals of 0.2s

#

The 3 move nodes is to specify different acceptable radius (and later, Move To Interactive Actor will become its own sequence.)

Move To Pawn also has Observe Blackboard Value set to true

spring inlet
#

set a reference to the actual target actor instead of it's location

#

and use the move to task with update goal

wintry flint
#

All things currently configured on MoveToPawn

#

I get the impression I'll have to make a custom task rather than using the built in MoveTo

spring inlet
#

actually that should work tho

shy hare
#

hey guys , why "AiMoveTo" can give "Aborted" as a result ? my ai isnt moving , navmesh is there , ai controller is set but function still fails

spring inlet
#

if your tasks are executing correct

#

@shy hare try to increase the acceptable radius to half the capsule size of your character

#

if you trace on the ground it may think that it can't reach that point

shy hare
spring inlet
#

whatever, try to increase the radius, try to bump the z-offset up

shy hare
spring inlet
#

ok, maybe it doesn't work with the vehicle movement stuff

#

i'm not familiar with that, so good luck ๐Ÿ˜„

shy hare
shy hare
misty wharf
#

try with visual logger enabled

#

it tends to contain some more information on why moves fail

wintry flint
#

Starting to realize what my issue was earlier - turns out that my Behavior Tree only updates what the command target type is (and hence updates the resulting move to type) when the move action is successful.

#

So if I moved my guy to a location, he will believe that he's still moving to a location when I set a pawn as the target

#

Also works the other way around; if a pawn was his last target, he'll still move to a location as if it were another pawn until the move action finishes

lone stump
#

your first move to that checks if it's pawn should use pawn as target, not location @wintry flint

wintry flint
#

State of the BT:

#

Service node:

waxen anvil
misty wharf
#

If that's a question, yes

waxen anvil
#

Is it a built in decorator or will I have to create a custom one

misty wharf
#

Can't remember, I guess you'd just need something that checks distance to something else

waxen anvil
#

I'm pretty sure there's a get distance to node

neat heron
#

Howdy, if i wanted to impliment a dectection system where the ai determines if you are Visible based on how many bones in your skeletan are visible (if 7 out of 14 visible, you are Seen), would that be workable with the built-in Stimulus AISense-Sight ect system, or would take some totally custom solution?

#

I can see it working as "if you see someone via AISense-Sight, then check what you see to check if thier bones are visible", but the issue of how the target is initally detected seems like it'd be an issue here, as it seems to detect your character's root or middle or something (haven't dug too deep here)

misty wharf
#

With C++ you can customize how the sight check is done, which would allow you to consider the visibility of each bone individually, and return a lower stimulus value

#

this is done via the IPerceptionSightTargetInterface or something along those lines

neat heron
#

That's a good point, i had made a note of how i'd need to do some C++ to make a custom sense node, but i didn't really put 2 and 2 together there.

#

A custom sense for this would let me keep the default SIght for maybe basic stuff, but have a special heavier one just for the player that does the bone check.

#

no idea how that'll turn out but it's a start, much appreciated.

misty wharf
#

Yeah it's pretty simple to do, you can just add the interface to your player pawn and implement the function for it

neat heron
#

Excellent, i'll keep that in mind and try that out pretty soon.

obsidian igloo
#

Hey everyone, Im having issues with my AI perception, its facing a single direction even tho the capsule is being rotated and is also set to orient to movement. does anyone know a fix to this?

obsidian igloo
#

ope figured it out, I disabled tick on the controller, but enabling it again fixed it lol

ocean wren
keen crow
#

Is there a MoveTo task for state trees or an easy way to make one?

wary ivy
#

state trees? You mean the one that's used with mass?

#

I don't think so considering mass doesn't even support navmeshes yet

keen crow
wary ivy
#

I think I have only seen them used with mass so far ๐Ÿ˜„

#

but I have no idea

keen crow
#

hmm if it is only for mass why is there a UStateTreeBrainComponent for AIController then... ๐Ÿค”

wary ivy
#

I'm probably wrong here

copper kraken
#

Hello, would you happen to know of a bug or something like that, that could "corrupt" AI navigation ? Because something strange is happening on my levels. My AI works fine on some maps and on others they sort of Teleport far away to the navMEsh boundaries and even outside but only when they try to move. I thought it was a code problem but it works fine on other maps and even on new ones I create to test. And i can't find what can be the cause of this situation.

#

To give you an idea, all the AI were spawned together in a regiment like formation and only the AI that were in attack range are still just in front of me while the others had to move and somehow TP far away like the ones i encircled in red.

misty wharf
#

What are you using to move them? Do the AI's affect navmesh when placed?

copper kraken
#

When placed no

#

I use a custom movement component as well as a custom moveTo task

#

The thing is that they work fine on some maps and on others they just glitch like this

misty wharf
#

There's really nothing builtin that would make them teleport when trying to move afaik

#

If navigation is messed up... they simply don't move

#

So I would think the problem is in your custom movement comp, perhaps it's getting 0 as movement input and screws it up or something

#

(or in the custom moveto)

copper kraken
#

If that was the case it would bug on all maps no ?

#

I will recheck

misty wharf
#

hard to say

#

you can also try using visual logger and seeing if you get any useful output into it

copper kraken
#

ah I forgot to add something, the AI unlock themeselves when the game lag (<15IPS) and bug again if it picks up

#

so they move normally again on the bugged maps if the framerate drops.

ocean wren
#

There's plenty of reasons why you'd get a bug that might occur on specific levels but have nothing to do with them. You'll have to break out the debugger and figure out whats going on

#

I doubt its anything anyone can help with until you narrow down a test case

neat heron
#

Quick question, is there anything in EQS outta the box that lets me sort location priority based on elevation? IE, Cat AI; find the player, and always try to be higher up than they are, so make movement choices largely based on elevation.

#

I know there's plenty of other ways to get an AI that data, but curious if there's something simple i'm missing.

misty wharf
#

Maybe try using a Distance test with test mode set to Distance Z or Distance Z absolute

#

that would at least give it relative to position of the querier for example

#

or you could probably use it with a custom context that always returns a point at the floor height or whatever, so it would be comparative to the floor

neat heron
#

All good points, i'm just finishing up some unreal courses On EQS and need to dig into such weeds. I'll take a gander at those.

#

if all else fails, i can prob just get normal eqs navigation info and then write something somewhere that checks all those points in releation to the player, adn then passes on one that's higher.

misty wharf
#

yeah you can for example get the results from the query and manually find the highest ones

#

or you can write a custom test to do it as well

opal crest
#

I'm pretty sure DistanceZ will do what you need. But if you're working with C++, writing Custom Tests is very doable if your needs get complex.

neat heron
#

I'm rusty with C++ but i'm certainly not against it, just trying not to write anything that the editor itself already does.

The Unity instinct of "the editor doesn't give me anything, i need to make everything" can lead to alot of wasted effort if i'm not careful.

opal crest
#

That's good practice in Unreal. There's definitely a lot in the box.

neat heron
#

Yeah, big pro and con really. If you wanna do something, there's prob a tool or data structure already in place somewhere. But that can also lead to overcomplication if you try to use it ALL, or not knowing when to stop looking.

unity doesn't give you shit, so just write whatever ya gotta. It's both maddening and freeing.

opal crest
#

I have often got to the point with Unreal where what's there is so close to what I need but not quite, and changing it becomes a whole adventure.

neat heron
#

god, i can imagine.

neat heron
#

Yup, looks like Distance Z did it. I actually hadn't even noticed the Test Mode Distance vector option before, so thanks for pointing me in that direction.

#

Question, what are some good use cases for changing the Projection Data trace mode? Swapping from navigation to Geo By Channel mdae it alot easier to get higher-up locations on the navgrid.
i take it the navigation trace mode is tied into using Navigation Filters, which are... i guess like AI Agent nav profiles??

neat heron
#

Sorry, another question
Any idea why the pawns in the content example navmesh demo wouldn't be moving? the level script seems to grab them and give them somemoveto orders via target points, but nobdy actually moves in the demo.

misty wharf
#

navmesh could be missing, sometimes it won't autogenerate and you have to press build->generate paths

#

you can check that by using P to visualize navmesh (make sure the viewport is focused when you press it)

#

if navmesh exists, could be the points are invalid, or some other reason... visual logger tends to have more debug info for navigation if you enable it

wintry flint
#

Dear diary server, today I learned about "Is Blackboard Value of given class"

#

This probably would've saved me some labor if I knew about this a week ago

mint terrace
#

(anticipates answer, lol)

wintry flint
#

And a bunch of booleans for decorators to work with

mint terrace
#

just watch out for deleted actors that blackboard still references, behavior tree doesn't take kindly to it

wintry flint
#

Clearing focus should help with that, right?

#

Or alternatively, just setting focus to something that isn't the actor about to be deleted

#

Be it by setting the focus to self or something else.

#

Could see that being acheived with an interface

mint terrace
#

the most important part is: clear the blackboard value referencing invalid actors (due to deletion)

#

I think this is most important when you are observing the blackboard value

#

unlikely to be an issue if you don't observe

#

(observation causes blueprint tasks to continuously realize new values of the blackboard value you have passed in)

stuck slate
#

Hello, Ive got a problem with my AI detect player. i was trying to make the AI sight (detect player) smaller but its still detect him even far away. even when I went for 0 in the radios box for some reason its still detect him

misty gale
#

O.o

#

If the origin vector is the pkayers location, then yes it will

#

This probably isnt how id try and adjust ai sense config

stuck slate
#

I was just following guides. 90% of them show it, and its not working

#

i did put a bool as a decoration , but its not working

misty gale
#

Bad guides then ๐Ÿคทโ€โ™‚๏ธ

#

How are you detecting the player? Using AI Perception component?

shadow furnace
#

That's just getting a location near something

misty gale
#

Theres a sight module there

stuck slate
stuck slate
misty gale
#

The code shown has nothing to do with the initial detection tho..

#

Depends on your setup, but usually it should not ?

stuck slate
#

this is the find one

#

Follow one

#

and this is the main

#

the IsPlayerInRange is badname but goes for attackRange not the detect

mint terrace
#

this all seems pretty complicated when the sensing component works fine without any eqs

thorny pasture
#

Is there a way to offset Stimuli source location?

ocean wren
#

sensing and EQS are entirely different systems for different things

misty wharf
thorny pasture
# misty wharf It's a vector, just offset it?

My perception system doesnt detect it because Stimuli is too low on the ground. I want to offset its location on z axis. As far as I know it's location is set to the root of the actor and I dont know how to offset it

misty wharf
#

what sense is it for?

thorny pasture
#

Sight

misty wharf
#

you can implement IAISightTargetInterface and customize how the check is done

misty wharf
#

๐Ÿ‘

exotic merlin
#

Hello, I<ve got an issue with the Perception system ...

#

it worked previously and suddenly it's not

#

Do you have any idea of what could go wrong ?

#

I've debugged the sight sense of my AI pawn and it's activated

#

I even debugged the standard C++ register as source to check if something was wrong and I couldn't fnid anything

#

my pawn has:

#

and the AI pawn has

#

it's enabled ...

misty wharf
#

If you enable the gameplay debugger does it draw the perception sight line towards you?

exotic merlin
#

lol.

#

i just reset the affiliation in the AI pawn, put t all back and MAGIC

#

XD

#

they were all selected but for some reason it wasn't working

misty wharf
#

Yeah by default it treats everything as neutral iirc so it needs to have the affiliation set up correctly

#

Oh, that's interesting ๐Ÿค”

exotic merlin
#

the only thing that ha^pened is reparentnig

#

so I guess it broke something somewhere

#

sorry for bothering you all

#

lost 1.5 h -_-

short obsidian
#

Rubber ducking works ๐Ÿ‘

misty wharf
#

Reparenting can do all kinds of fun things

neat heron
#

Howdy, i'm planning a project where you have a team and can swap to them, with an AI taking over for a character not under player control. Are there any fundamental choices i should make early on to ensure that the player and the NPCs are more or less treated the same by the game? (where to put input, what should be on pawn vs controller, ect)

I read that there's some specific framework you want to use if you are making a bot that's meant to simulate a player (like AI being player 2 in a co op game's SP), but i can't really remember what it is. Playerstate? no idea.

#

Kind of a broad question, but i know you can run into gatchas pretty easily with this kind of thing and i'm not yet familiar with the Unreal's myriad of bespoke Types for things/rigid seperation of things.

misty wharf
#

You would probably want to keep input etc. in player controller

#

And make it so that you don't do any actions directly in it either, instead on input you call functions on the pawn

#

This way for your AI, you can simply have the AI controller call those same functions to achieve the same result

neat heron
#

That sounds right, I'll see about doing that. Much appreciated!

exotic merlin
#

what about using a AI controller for both player and AI ?

#

AI Controller is esentially a child class of AController and this way also you can have some shared behaviors

mint terrace
#

ooh I literally do this

#

not ai controller for player, but switchable party etc

mint terrace
#

Use a common Character base class for all the characters you want to switch between at least

#

I go overboard here, but it can be costly, by pushing a lot of logic down into the base character class and using it for all characters, NPCs, enemies, the player itself

#

It has the net effect that I can just possess any character in the game and play as them and it all works, inventory, everything

#

menuing, equipment yadda yadda

#

But when it comes to AI for this specifically, its not that difficult: PlayerController provides the Character input, and AIController provides the Character input. You would just want to unpossess and repossess the characters as you switch, properly destroying and spawning the controller actors as needed

#

It has the net effect that I can just possess any character in the game and play as them and it all works, inventory, everything
This can be really nice for setting up/testing animation blueprints and actions for new character meshes, testing gameplay abilities etc. In my project, I can just set the PlayerCharacter override on a test map to any character in the game and it works

#

Instead of inheritance, you could also use interfaces and have many implementations that share the same mechanism for talking to them as well, this has some nice benefits, but requires a bit more planning to pull off without getting a bit stuck into corners

#

The really nice benefit there is you have much more control to remove unnecessary logic and streamline performance later on in the process without having to conditionalize the base character class or such. But again, more up front design work to get a good result in my opinion

#

In terms of "getting it right early", its fairly easy to tutorial yourself into having 10 characters with 4 different base classes in Blueprint

#

Before you know it, you want to be able to have enemies follow the patrol point system you've devised for your NPCs, or have NPCs be able to fight you

#

(definitely projecting literally my own challenges)

#

Anyway, @neat heron if you have any specific questions I'd love to share any insights I've gained doing a pretty similar thing

cold harbor
#

Hey

#

I'm having trouble with my navigation mesh

#

it seems to only want to apply to certain parts of my tilemap.

#

my nav mesh bounds engulfs the entire tilemap

mint terrace
#

oooh fun 2.5d

cold harbor
#

is there like a max nav mesh settings I should be altering?

mint terrace
#

there is a max slope setting

#

I suspect that's the issue

#

and of course the nav mesh volume needs to encompass the surfaces to generate on but I suspect you've got that buttoned up

#

probably that big yellow volume thar

cold harbor
#

I have max slope setting to its highest number

#

plus it doesn't seem to be affecting flat surfaces

mint terrace
#

are flat surfaces in that underground area receiving navmesh?

cold harbor
#

Nope.

#

initially I thought it might have been a way I set this up, maybe nav mesh is generated by aiming raycast down so they only detect the top, but the bottom is generated for the first area while the top isn't so it cant be that

#

I then thought maybe there was a maximum amount of navmeshes that could be generated and I was going above

#

so I tried moving my nav mesh about

#

but even when I move it to the side.

#

it still doesn't generate new paths.

#

wait

#

I've fixed it.

#

Worst part is that I don't know how.

#

The only difference I can find is that there's a new extra recast navmesh default

mint terrace
#

maybe nav mesh is generated by aiming raycast down so they only detect the top, but the bottom is generated for the first area while the top isn't so it cant be that
It's not that

#

I then thought maybe there was a maximum amount of navmeshes that could be generated and I was going above
Not that I'm aware of, and for a small level like this you should be totally fine

#

so I tried moving my nav mesh about
Before some other ideas I have, do Build -> Build Paths just to check

#

I've fixed it.
Awww darn it I shouldve just read the whole thing

#

The only difference I can find is that there's a new extra recast navmesh default
These get made for you. If you delete them all and do Build -> Build Paths (or move a navmesh volume, assuming that youve enabled Update Navigation in editor preferences), they will come back

#

Typically there's only one, but I do think thats not a hard and fast rule

#

My other idea was to check collision using

#

little known fact, but navmesh generates on top of meshes which are setup to collide with Pawn

#

sounds like its not your issue if some jiggling of the handle got it to work ๐Ÿ™‚

cold harbor
#

I swear I pressed build paths before and nothing happened.

#

Well it's working now and that's what matters.

mint terrace
#

its technically no different than just moving a navmesh bounds volume* or another collidable mesh when you have "Update navigation" ticked in Editor Prefs

cold harbor
mint terrace
#

nahh thats a great use for it

#

not lazy

#

2D is really just 3D with all the Z multiplied by zero iddnit

cold harbor
#

this is my first time using unreal engine

#

using it for a university project.

mint terrace
#

nice, it's much fun

cold harbor
#

where one of my pitches for a game got selected to be a project a team could work on

mint terrace
#

my friend is a uni teacher doing unreal courses in australia

#

good luck on the project, always nice to see 2.5d get some love

atomic field
#

Hi, my move to task is not rotating the Ai. I checked and use controller yaw is true. i dont understand why is this happening.

mint terrace
# atomic field Hi, my move to task is not rotating the Ai. I checked and use controller yaw is ...

if you leave it as default it will navigate to the target based on its max rotation speed etc. You can set that max rotation speed to zero to turn in place with no time required, or have it set to something appropriate and massage it to avoid situations where its impossible for the actor to reach the destination. There is also "Set Focus" that turns the AI directly toward a target which is easy to miss

#

max rotation speed is a setting on character movement component, "Set default focus" (my bad) is a BT task

atomic field
mint terrace
#

welp, check the max rotation on the character movement component

atomic field
#

so i didnt find the Max rotation in UE5 but there is rotation rate. which in z is already set to 360

mint terrace
#

Cool, and whats Orient Rotation to Movement set to

atomic field
#

false.

mint terrace
#

try that one

#

you will probably need to untick controller desired rotation for that

atomic field
#

yep! that works! thanks a lot

mint terrace
#

๐Ÿ‘

atomic field
#

just turning it on worked.

mint terrace
#

ehh i guess its because the AI controller isnt giving you a rotation anyway

#

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

atomic field
#

i guess so.

mint terrace
#

this just tells it to try to rotate it toward the forward axis of whatever X/Y controller input vector is given to it

#

adhering to rotation rate

atomic field
#

oh i see. Thanks again tho.

#

it was wired cause when i used rotate to face bb enrty that node didnt work as well and the BT got stuck at that node

mint terrace
#

yeah Set Default Focus is good to know for that, often you want them to do something while continuing to turn to face the player even as they whip around to the back of them or whatever

#

not just be consumed with the act of rotating toward the player

atomic field
#

yeah true!

cold harbor
mint terrace
cold harbor
#

Though I'm growing less sympathetic with him.

#

Since we've had six weeks to do stuff.

mint terrace
#

ahhhh

#

team dynamics I guess

ocean wren
#

The age old student problem ๐Ÿ™‚

cold harbor
#

and I just did some image reverse searching and found that all his images are just already existing images with artistic filters put over it

mint terrace
#

can't choose your coworkers either, well mostly

cold harbor
#

and any original art looked like it was done with the shape tools in MS paint

ocean wren
#

Your tutors are probably interested in seeing how you deal with issues exactly like this... at least I am with mine ๐Ÿ™‚

cold harbor
#

I'm like 75% sure I'm gonna just kick his work off the project.

mint terrace
#

yeah that would be plagiarism I'd think?

#

I guess it depends

ocean wren
#

Ok, so then how do you deal with that professionally?

cold harbor
ocean wren
#

ditching poor work is fine, its how you approach the issue and resolve it

mint terrace
#

or rather, properly licensed copyrighted content

#

nothing is copyright free

#

maybe broach the subject of the art direction, see if he can tweak it to better fit with the project

ocean wren
#

So for instance, you might adopt a "sign off process" and then just not accept work that doesn't meet the quality threshold

#

But you have to do it consistently, so it doesn't just happen to one person

cold harbor
#

Like the backgrounds I showed before, it said it could be used in free and commercial products. Didn't say anything about crediting them but I'm gonna do so anyway to be safe.

ocean wren
#

Usually you'd have an art director signing off on art anyway

#

But student teams often don't have people specifically for those roles

cold harbor
ocean wren
#

Yeah, honestly its not unusual to have some people on a team not.. really engage

cold harbor
#

Honestly, We're supposed to be a team of 5 people, but one guy didn't even show up and then there's the background guy

#

so really, we're only working with a team of 3.

ocean wren
#

See it with indie "teams" all the time.. a handful of people working and a team of 15 on the list ๐Ÿ™‚

#

Just learn what you can from the experience

#

I've had a few similar experiences on professional games (although never quite that bad, because we'd sack people doing nothing)

#

We did have people on the team where their work was sub-par and we had to be honest about it

#

They moved into doing marketing artwork instead of in-game stuff

#

Students really don't like the discomfort of having to be honest with others though, which is understandable.

misty gale
#

One should always be honest about it

#

No sugarcoating

#

No "im affraid to offend them" kinda thing

#

Professional and constructive feedback should always have a place. And if a person cant handle the truth, then.. well. Sucks to be them

#

It's important how this feedback is communicated tho, as zoom points out. Straight up trash talk feedback is just fueling the wrong fire

cold harbor
#

@mint terrace Okay, We're given two grades; the grade of the final project and another grade of our individual work, I'm gonna inform him that unless he gives us backgrounds that fit the style and are original, we won't be including his current backgrounds in the game.

opal crest
# misty gale One should always be honest about it

There's a really important line between plain, helpful and truthful feedback and being a jerk. Teaching a module on giving feedback prior to assigning groupwork is something I wish would have happened in school.

misty gale
opal crest
#

Totally. Assuming Positive Intent is necessary skill in whatever you're career you're in. That should probably be taught too.

ocean wren
#

I always felt better when we got people from industry in, because those guys were brutal, but explained that everyone got the same brutality and it wasn't an attack on someone's worth. For some reason having someone from industry do it makes it OK ๐Ÿ™‚

#

When I do it, I'm being mean ๐Ÿ™‚

#

well, according to some colleagues ๐Ÿ™‚

#

Part of the reason we give group projects is exactly to navigate some of this stuff and to learn some production practices (things like CI/CD, source code control etc)

#

Weird how many companies mention source code control in their job ads. Given that pretty much everyone uses it. You'd have thought it was a given.

#

Lots of them mention Jira/Confluence etc. Which I find a bit weird, like you couldn't learn them really quickly.

opal crest
#

I have literally taught git to 75% of the people I've helped hire. Not just how to, but what it's for, and what source control is. And not just new grads. That's gotten better recently, but it's weird how you can tell who has had a good job before by things like that.

#

Every company uses something different, and even if they use Atlassian stuff, they all use it differently. Can't see the point of teaching that.

ocean wren
#

Its usually so that students have the right bullet points on their CV for the HR people

#

All of my students will be using git next semester, mainly because that's how they'll be graded (part of my plans to get them to do some TDD)

#

Some of them already use git, so it'll be fun to watch the rest ๐Ÿ™‚

lyric flint
#

Is using behavior trees neccessary for NPCs? They seem way too overly complicated to me, cant i just use Blueprint Macros instead

misty wharf
#

You sure can

#

If you don't find BT's useful, don't use 'em

#

They are very convenient for dealing with sequential AI logic like doing task A, task B, task C, having conditions for those, etc., but if your AI works in a way where BT's aren't so helpful then you can certainly use some other approach as well

minor relic
#

Hi guys, what is the best way to implement an AI pet, which in the future can help its owner.

mint sundial
#

when my actor dies...the nav mesh doesn't update correctly (this actor is an obstacle) I'm using Dynamic Runtime Generation and it works great with movable obstacles for example. What can I do? Thanks!

misty wharf
misty wharf
mint sundial
#

i would test it destroying a basic actor...ty

mint terrace
#

Main reason dynamic navmesh obstacles with characters isn't sufficient is that generation isn't fast enough to treat typical characters as obstacles for the navmesh

#

Dynamic generation tends to be about not pre-generating the navmesh before runtime (made standard with Navigation Invokers as of 4.26 or so)

atomic field
#

Hi, So my Ai controller that I am moving via the Move To node in the Behavior Tree does not rotate. I was able to rotate the character via turning on Orient Rotation to Movement but my controller is not moving which makes it so that my AI Sight perception cone does not rotate. Even my set default focus does not work. I don't understand what this is happing it was working fine yesterday.

atomic field
#

So i made a new Controller, Character & Behavior Tree and the character rotates Just Fine.

#

i compared all my values and they are basically identical.

misty wharf
ocean wren
#

You kind of want things to pause anyway, because stuff appearing on the ground in front of you would cause you to pause too ๐Ÿ˜‰

rugged talon
#

would the actor being overlap method to pick up items be the same for AI characters as it is for main character player ?

misty wharf
#

It can be

rugged talon
#

how would the process be ? this is how im doing but for some reason the branch for my ai character randomly activates which i dont understand and it doesnt activate when the ai walks over the pickup item

misty wharf
#

I have no idea what that's intended to do

#

It looks like you're comparing if it overlaps with the player and choosing the branch based on that

rugged talon
#

so basically what i want it to do is that if i overlap it does something else and when ai overlaps it does something else

#

but for some reason when my ai overlaps it does nothing]

#

so i wanted to know if thisis even correct

misty wharf
#

Based on the picture it doesn't look correct :)

#

the Other Actor value is the actor that you overlapped

#

assuming this logic is within a character class that you're using for player and ai chars, to determine if the current character is the player, you can check if the controller which possesses it is an AI Controller or not

rugged talon
#

aaah

#

@misty wharf this is in a different bp class which is for my pickup itmes

#

so when it overlaps it gives the item for which the bp is then dissapears

rugged talon
misty wharf
#

Ohh I see, so this is actually inside the pickup itself

rugged talon
#

yes

misty wharf
#

Right - in that case the Other Actor should indeed be the character so that part is correct

rugged talon
#

hmmm

misty wharf
#

And I think your comparison to get player character should also work

rugged talon
#

player pickup works but not for my ai

misty wharf
#

I would assume it's because of the cast in the second screenshot

#

Because you're casting the player character to the third person character

#

so even if an AI overlapped it, it would still do the rest of the logic on the player

rugged talon
#

i want the ai to pickup the item for me . so i just want it to overlap and pickup if either i overlap it or the ai

#

so i put the checks

misty wharf
#

Oh I see

#

It's a bit hard to say tbh. Try putting some prints in there to see which branch of the code gets activated, or to print out any of the other values you're checking

#

This should give you a better idea of what's happening when the pickups occur

rugged talon
#

ok i wil try that

#

thanks

#

i was just a bit confused bcuz as the ai is running around it suddenly randomly overlaps sometimes so i will check why that is happening

neat heron
#

@mint terrace Oh btw, thank you very much for the large amount of info a few days ago. I got distracted and forgot to respond, but i'll def keep alot of what you said in mind. alot of it was stuff i thankfully was already aware of, but getting confirmation that other folks doin' the same thing also are on the same page in encouraging. Much appreciated!

mint terrace
#

np

neat heron
#

Question about Mass AI, i haven't really touched it much but if i was interested in a game where you fight like, 500 3d enemies on screen at once (or some large-scale RTs thing), would that be where i want to start as a... framework?
I know most examples on the learning portal have been for traffic or landscape items, so is it more for scenery/basic stuff or can you put more complex AI onto it?

#

(if this is way offbase onwhat the system is, aplogies, i've got some reading mateirals on antoher screen but i haven't really dived into it. Planning to do that today.)

is it anything like the unity EQS system?

patent hornet
#

depends on what approach to your AI Pawns you take

#

with Characters and CMCs you will have a hard time running even 200 AI

mint terrace
#

Why do nav invokers still require a navmesh bounds volume?

spring inlet
neat heron
#

I know that two Earth Defense Force games where made in unreal 4, games which put a focus on massive amounts of Dudes and largescale env destruction. So large numbers are clearly viable, it's largely about how you do it i guess.