#gameplay-ai

1 messages Β· Page 135 of 1

sturdy iron
#

and switch to meele fighting

warm dagger
#

Tried converting my 4.26 project to 4.22, I setup everything exactly the same, yet the behavior tree is really buggy. AI perception doesn't seem to update the same. Were there major changes to AI perception between 4.22 and 4.26?

pine steeple
#

why you change from 4.26 to 4.22?

warm dagger
#

Trying to add compatibility for a project I plan to release as a marketplace asset.

#

Going to try it out in 4.23 and 4.24. Might be the engine version that has some issues, or might be I didn't copy everything over correctly.

warm dagger
#

So the problem with 4.22 is it gets stuck on "Rotate to face BB entry". It is supposed to rotate to face the player and the correct BB variable is set during the time it gets stuck. Not sure what is causing it to hang up....

pine steeple
#

yeah that bt task was broken

#

for a few version

#

i made my own version of it, which is a lot better and handles different focus's

#

(for SetFocus)

rigid portal
#

Hiya. Is there a way to make AI go up things?

#

To go down, my bot just falls. How would I make it climb a ledge, or a ladder?

#

Is it just a climbing animation?

#

The bot gets to a link, then I have to some how get it to the top of the link, ya?

pine steeple
#

yes you have to do that logic yourself

#

root motion montage or you do it programmaticly

rigid portal
#

Ok cool, thx

#

Is there a waiting at proxy link event/state?

#

and how would I go about interrupting a path? say the bot is going from point A to point B, and falls into a hole.

#

When it comes out, how do I tell it to not go to Point B? is there a interrupt function, or do I just set the MoveTo to where it currently is?

meager imp
#

I have maybe a silly question about selector nodes in BTs...
If a selector has two options, and no decorators or other thing limit the options...

Will it always default to the leftmost one? or will it randomly pick one? πŸ€”

simple crest
#

everything in BT's is always processed left to right

meager imp
#

so for random desitions my "random" service is kinda the correct approach πŸ˜›

pine steeple
#

all stuff is Left to right, Selector will run till some task returns success or it reaches end. Sequencer will run till something returns failed or it reaches end.

warm dagger
#

AI perception, specifically sight, also seems a little weird where it doesn't pick up on things until they are directly in front of them, but then works perfectly fine other instances, heh. May be related to the rotate task messing up the behavior tree flow.

warm dagger
#

Ahah, a little bit of debugging and I see that the AI Sight is not rotating with the character. How do I set it to rotate in 4.22?

#

Hah, WTF, tick was disabled in the AI Controller and that was messing things up.

#

Tested if that fixed the rotate task, but it didn't, however my own rotate task works perfectly.

opal bolt
#

Searching for a guy with knowledge of "supported agents" and corresponding multiple ReCastNavMesh: How do get a specific RecastNavMesh of the multiple nav meshes of a specific "supported agent" to use it as "nav data" parameter passing to navigation functions. Working on BP most of the time, but if someone knows a solution for CPP, I can expose it to BP by myself. Someone experienced with "supported agents" and multiple RecastNavMeshes?

pine steeple
#

can't do that in BP

#
ANavigationData* UKaosGameplayStatics::GetNavData(AActor* InActor) 
{
  const FNavAgentProperties* AgentProps = nullptr;
  UNavigationSystemV1* const NavSys = USolsticeObjectLibrary::GetNavigationSystem(WorldContextObject);
  //Works for Controller and Pawn
  if (const INavAgentInterface* AgentContext = Cast<INavAgentInterface>(InActor))
  {
        AgentProps = &AgentContext->GetNavAgentPropertiesRef();
  }
  return (AgentProps ? NavSys->GetNavDataForProps(*AgentProps) : NavSys->GetDefaultNavDataInstance(FNavigationSystem::DontCreate);
}

``` @opal bolt
coral spire
#

Hi. Anyone knows how to check if BB key is invalid? (c++)

#

Both IsVectorValueSet and IsValidKey returns true when in reality it is invalid.

#

nvm, figured it out πŸ˜„

opal bolt
# pine steeple ``` ANavigationData* UKaosGameplayStatics::GetNavData(AActor* InActor) { cons...

Thanks. Do you have any idea how to get specific Nav data without passing the actor as parameter? E.g. checking for example for names of the "supported Actors" on a RecastNavMesh, which is assigned in project settings.
I can get all RecastNavMeshes of all supported actors simply by using GetAllActorsOf class with searching for RecastNavMesh. But then I stuck. Is there no possibility to check the RecastNavMesh result array for a specifc supported actor or a pawn class? Not even on CPP level?

My goal is at the moment, to get the navigation data ("nav data" in BP) without having tp spawn the actor first. For example, to get a location of BP node "Get Random Reachable Point", which has a input parameter "nav data". I want to use it to get a location for a specific "supportet agent" (specific AI pawn), before spawn the actor.
For that, I would have to choose the related RecastNavMesh out of RecastNvMesh array, which fit to the "supported actor" I need.

pine steeple
#

you can just get the classdefault

#

of that actor

#

for example

#

then you can just supply the class of actor you want to spawn, and it will return the navdata

#

@opal bolt ^

opal bolt
#

ah, mom

#

I see you changed to "TSubclassOf<AActor> InActorClass"
But the body is the same, you use "Cast<INavAgentInterface>(InActor->GetDefaultObject())"

#

I think the part "Cast<INavAgentInterface>(InActor->GetDefaultObject())" I have to change to make use of InActorClass

#

simply like this? "Cast<INavAgentInterface>(InActorClass)" ?

#

@pine steeple ^

pine steeple
#

yeah sorry

#

fixed it

#

wait let me fix that functiona gain

opal bolt
#

of course, you have my full attention πŸ™‚

pine steeple
#

there i fixed the function

#

in header, put this UFUNCTION(BlueprintPure, Meta = (WorldContext = "WorldContextObject", Category = "Navigation")) static class ANavigationData* GetNavData(const UObject* WorldContextObject, TSubclassOf<AActor> InActorClass);

#
{
  UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
  if (!World || !InActorClass)
  {
      return nullptr;
  }

  const FNavAgentProperties* AgentProps = nullptr;
  UNavigationSystemV1* const NavSys = Cast<UNavigationSystemV1>(World->GetNavigationSystem());
  //Works for Controller and Pawn
  if (const INavAgentInterface* AgentContext = Cast<INavAgentInterface>(InActorClass->GetDefaultObject<AActor>()))
  {
        AgentProps = &AgentContext->GetNavAgentPropertiesRef();
  }
  return AgentProps ? NavSys->GetNavDataForProps(*AgentProps) : NavSys->GetDefaultNavDataInstance(FNavigationSystem::DontCreate);
}```
#

and the fixed function

opal bolt
#

@pine steeple UK I have to thank you thound times. I would never get the solution alone I think.
I am still wondering why there is no BP exposed function for that, because nearly all BP nodes which work with Navigation use "nav data" as bp node input parameter. And when someone use "supported actors" (so have multiple RecatNavMshes) of course it is very, very relevant, on which nav mesh you want to search.

pine steeple
#

yeah i have no idea

#

i had to make my own stuff for that

opal bolt
#

thanks a lot! I will try the function later. But I am sure it will work.

real arrow
#

does anyone here do their BT tasks in C++?

pine steeple
#

i have a mix of both

#

BP for simple tasks, c++ for more complex/involved tasks or tasks that do not require an instance

#

as all BP tasks are instanced and costs a bit of memory

lyric flint
#

Well I'm glad I got this ExecCalc working

pine steeple
#

wrong channel? πŸ˜„

lyric flint
#

o lol yah

#

I like the ai channel too haha

pine steeple
#

πŸ˜›

jagged needle
#

Does anyone know how "Move To Location or Actor" works?
More specifically, what does Project Goal on Navigation do, and how can the Async Task reference be used (Can it be used to call an Async function which will execute while the controller is executing the movement)?

timber relic
#

hey is there a way to make AIMoveTo choose randomized paths ?

#

as in its not taking the optimum routes but acts a bit drunk

pine steeple
#

@jagged needle the task reference is just to that movement task, nothing more. Project to navigation will project the Goal location to navmesh before attempting to move. If it fails, the move will not happen

#

@timber relic not really

timber relic
#

:/

pine steeple
#

you would have to do that by adjusting costs by overriding the navmesh class in c++

timber relic
#

oh i can adjust costs using modifiers and query filters

pine steeple
#

yeah but then you need to use modifiers everywhere

#

for those costs to apply

timber relic
#

hmm that might be good enough for my case since its very simple

#

thank you

jagged needle
#

Thanks for clearing that up, @pine steeple

timber relic
#

hey im trying to change StopMovementOnFinish via blueprint

#

how would i go about that ?

pine steeple
#

in the Move to Task?

#

if so you can not

bleak gazelle
#

If I want to make a new SpawnAIFromClass function in my BPFunctionLibrary so I can set parameters that would normally be SetOnSpawn, does SpawnActorDeferred mess with AI in any way or am I free to use it to set variables before finishing the spawn and then handling the controller and behavior tree?

pine steeple
#

that is the purpose of SpawnDeferred

night panther
#

Hi I am trying to use behaviour trees. I need to return the location of the Terminal

sturdy iron
#

Hey there, noob question. How do I handle "patrolling" in a way that lets say cars are moving alongside road but if player stays on their path they try to move slightly to avoid the player BUT their movement will be restricted tostay on the right part of road

night panther
#

trying to use a service. last couple days I can not figure out what I am doing wrong

#

tried doing it through a task

#

not sure.. I should cast to from event receive AI and grab the actor location and set it as a blackboard vector

#

right?

#

but my cast always fails

#

I can get it to move randomly

#

like find and move to a random location

#

just not a specific task location

#

I tried it with a task

#

but it fails

#

is this just completely wrong?

#

Can finding a location only work with perception in a behavior tree?

#

If you point me to a up to date tutorial about Custom Locations. No Patrolling or nothing. Like going to a location and performing a task. I got it to work earlier I have no idea why I am having so much issue now

#

oo nvm I figured it out playing around with the AI controller

civic girder
#

hey yall, I'm new here so excuse my newness but I was wondering if anyone here knows anything about creating an AI similar to the one in this video at 4:00. https://youtu.be/2qB3CNvOoGg?t=240 He even shows his math but I don't know how I'd translate it into blueprint. Any help is appreciated, thanks.

night panther
#

If anybody reads mine. The thing I was messing up was Get Actor Of Class

#

instead of Cast to

#

@civic girder There are lots of tutorials on patrol and attack. Or do you mean the zig zag part

civic girder
#

just the zig zag, im good for patrol

#

only need attack phase

night panther
#

Not sure. Good luck

civic girder
#

all g thanks anyway

visual parrot
#

Is the nav volume on the persistent level?

thick surge
#

Hello guys I'm trying to check if my player can reach a location, initially the path is block by geometry but then it opens to the ai. there is a does path exist node on the behavior trees, but I'm not using trees so any other alternative ways of doing this ?

uneven junco
#

is it a code project or blueprint only?

#

c++ lets you directly compute paths via the nav mesh

ocean delta
#

i'm starting to create the AI components of my game, and some of the courses i'm taking are using behavior trees with EQS graphs. this tech is experimental, and all of this kind of looks like it can be done with just CPP, some enumerations and a state machine setup. to anyone who's worked with this before, should i just go the CPP route?

solemn jasper
#

does AI get activated at a certain distance from the player or is all AI in the map active at all times

unborn jungle
#

When EditableTextBoxes have focus and the player presses escape to cancel entering text, it leaves the player with no control over their pawn or the UI until escape is pressed again: how can I fix this?

#

Input events don't fire because the editable text box has focus when inputting text

patent hornet
#

@unborn jungle the #gameplay-ai is an odd choice, but you need to react to the first escape and remove the keyboard focus from the textbox

nova prawn
#

This is a tree for a "base unit" I have 3 types of Units in my game at the moment and was hoping I can use this 1 tree in every type of unit, As units will all share similar Move, Attack, Run etc.

#

GetRandomLocation and MoveTo works but then it skips back to GetRandomLocation ignoring the Wait command

torpid juniper
#

selector runs until something succeeds. You probably want Sequence.

nova prawn
#

I just tried the sequence node and it looks like it gets stuck on GetRandomLocation now and never moves to the Move To node

#

Just keeps flickering between Root and GetRanomdLocaiton

torpid juniper
#

That's probably because GetRandomLocation isn't succeeding. Make sure it calls finish execute with a success. We know it wasn't succeeding before because it was getting past that on your selector.

nova prawn
#

Ahh i,ll check it. πŸ˜„

#

omg... I think i just spotted it...

torpid juniper
#

Finish Execute success πŸ™‚

nova prawn
#

Doh forgot the checkbox...

#

lol thanks for the help πŸ™‚

#

Ok next thing is to fry my brain with trying to work out how animation blueprints work. :S

#

My unit just kinda floats around atm without walking lol

torpid juniper
#

Easier than AI imo. The only big brain moment for me on anim graphs is understanding that you can put a state machine inside a state to nest transitions.

e.g. walking vs. idle might be nested within Alive vs. dead; and so a transition from alive to dead overrides any stateful change in walking and idle.

#

I'm having a tough time getting the design feel right for event driven responses to things in behavior trees.

E.g. I have a general setup for an animal to wander around, flee when it sees humans, or attack. But now I want to make it so that if you hit the animal you can knock it into a stagger state. That feels like something that shouldn't be handled in the behavior tree. So what do I do? Handle it in the controller, and push a state change to the blackboard that triggers a task that again calls some functionality from the controller? Feels gross.

#

Also, it feels like a lot of my tasks end up being wrappers for calls to logic on the controller.

unborn jungle
gritty peak
#

so i am making a tower deffense game where enemies spawn in waves. I got it to work great however i have ran into a recent problem were some of the same enemies i spawn dont move or do anything. most of the enemies are fine but just a couple that spawn in the wave dont move / get stuck at spawn point. When i try to just spawn that wave and not the earlier waves everything works perfectly half of the time and the other half it fails. I dont know whats wrong or how to debug /recreate it consistanly any ideas?

pine steeple
#

Stuck in ground? Using crowd avoidance?

gritty peak
#

@pine steeple The ai controller is using "DetourCrowdAIController" And Its not so much they are stuck in the ground more like they just choose not to move. I have an agro range on them to chase and attack my player if close enough if not walk on path. The ones that get stuck half the time chase me if i get close and the other half dont when i get close to them to check whats going on. I almost feel it just happens when a lots going on in the scene but i dont think that makes sense. I tried adding a delay in the spawn but that did not help. may be i am spawning them too high off the ground? Any ideas?

pine steeple
#

if you spawn over 50 the other wont move

#

there is a 50 limit

visual parrot
gritty peak
#

@pine steeple there is a apwn limit? since when ? That might explain my issue. Now i got to think of a way to fix this without rebalanceing my entire game. Probubly a longer spawn delay between waves.

pine steeple
#

since for whenever πŸ˜„

#

you can up it

#

but be warned without optimization running a lot of AI will soon eat your performance

#

Max Agents

gritty peak
#

Oh @pine steeple thank you so much it was driving me mad. I checked and it is 50. i bumped it up to 65 for some breathing room, i think the final spawns of the wave were getting stuck so this is probubly it. Will have to of cource play test to get the number just right.

strange kestrel
#

Anyone know what the "Grid Path AI Controller" does? How does it differ from the other AI controllers? Can't seem to find any information about it πŸ€”

pine steeple
#

@strange kestrel it uses the UGridPathingComponent

#

not something i have looked at or had dealings with, but the comment says ```/**

  • Path following augmented with local navigation grids
  • Keeps track of nearby grids and use them instead of navigation path when agent is inside.
  • Once outside grid, regular path following is resumed.
  • This allows creating dynamic navigation obstacles with fully static navigation (e.g. static navmesh),
  • as long as they are minor modifications for path. Not recommended for blocking off entire corridors.
  • Does not replace proper avoidance for dynamic obstacles!
    */```
#

from what i can see it will use a Grid that you define whilst in that grid's area, outside of it, it will use regular path fidnding

strange kestrel
#

Hmm interesting, thanks for the info

manic karma
#

ya'll

#
MaxPerceptionDistance = Cast<UAISenseConfig_Sight>(OwningController->AIPerception->GetSenseConfig(UAISense::GetSenseID(UAISense_Sight::StaticClass())))->SightRadius;
#

Is there a better way πŸ˜‚

rigid portal
#

I would like my AI bot to walk when entering a triggerbox, then continue running when it leaves the bounds. Is setting the max walk speed the best/only way to do this?

misty wharf
#

guess it depends on how you want it to work... you could have a walk mode bool that is used to toggle speed, or some other such solution as well

timber relic
#

Can someone tell me why the navmesh is not generating on my spline mesh or rather only in fractions

#

i can change my agent radius to something very small then it generates fully but it still only generates in straight lines

#

not to mention that my actual actors in game just run off the path and fall xD

timber relic
#

turns out the way i added the mesh to the spline wasnt very good, i tried an approach based on spline distance and now it works wonderfully

outer girder
#

Is there a way to limit the displayed size of nodes in a BT when having very long parameters? It's really triggering with >30 chars

pine steeple
#

unless you modify the node in C++, no, but you can hide the properties via checkbox

#

tho this hides all params

dusk kelp
#

Guys, I want my AI to see through other actors (with perception system). How can I do that? Rn actors breaks line of sight

pine steeple
#

without c++, that is not possible

#

with C++, its possible

dusk kelp
#

Im using c++ so let me know how πŸ˜„ Or where I can read about it, cant find.

pine steeple
#

so you want it to always see your player for example?

dusk kelp
#

Kinda yes. I have some objects that should be visible in any case

#

For AI

pine steeple
#

i mean, without C++, you COULD change the trace channel

#

and setup a custom trace channel

#

which avoids certain actors, but if you want to do your own tests/traces whilst trying to perceive the player, your player C++ needs to implement the IAISightTargetInterface interface, and override virtual bool CanBeSeenFrom(const FVector& ObserverLocation, FVector& OutSeenLocation, int32& NumberOfLoSChecksPerformed, float& OutSightStrength, const AActor* IgnoreActor) const override;

dusk kelp
#

Hmm, interesting, will try to use it rn

#

Wow, thats exactly what I wanted, thanks

outer girder
#

@pine steeple thanks for the info

lyric flint
#

Can I make a custom event like ''event begin play'' or ''event tick'' from a behaviour tree task?

pine steeple
#

@lyric flint i am confused, you want what?

lyric flint
#

nvm I figured it out πŸ˜„

pine steeple
#

ok

lyric flint
#

hey

pine steeple
#

right, so show me your exact task

lyric flint
#

spaghetti haha

pine steeple
#

yeah let me fix that for you

#

here

#

@lyric flint

#

if you want to know what ClosestFoodLocationKey is i can explain

#

these are the variables i use

#

what it looks like in the behaviour tree

lyric flint
#

closestfoodlocationkey is the blackboard key I guess?

pine steeple
#

yes

#

its using the special BlackboardKeySelector property/variable

#

this

lyric flint
#

Ah yea, I use that too πŸ˜„

pine steeple
#

yeah and make sure you tick the eye

#

so its exposed in the BT Tree

#

but this should work

#

i tested it and works fine for me

lyric flint
#

How do I specify what is food or not?

#

is that in the bp somewhere?

pine steeple
#

its in that class filter

#

in the overlap

lyric flint
#

Ah

#

what if you have multiple diff types?

#

like how does it filter?

pine steeple
#

well food should all be derived from food

#

all food should be food

lyric flint
#

how do I specify that?

pine steeple
#

what do you mean?

#

this will get all actors in that radius that is of the class Food

lyric flint
#

I dont understand how the filter works, Can you assign a class to an actor?

pine steeple
#

actor is a class

#

this is food, see it says blueprint Class

#

Food is the class of this Actor

lyric flint
#

Right but what if you have 2 or more types of food? πŸ˜›

pine steeple
#

then you make children of food

#

and that will still work

lyric flint
#

Ah I see πŸ˜„

pine steeple
#

Steak is a child a food

#

so if i search for class Food

#

i will also get Steak

lyric flint
#

Ohh, didnt know itd work like that

pine steeple
#

yeah that is the good thing about inheritance

lyric flint
#

Let me copy your homework and see if it works πŸ˜„

#

@pine steeple how do I set ''my pawn''? lol

#

nvm was bugged

lyric flint
#

@pine steeple i copied what you did but for some reason the blackboard key isnt recognized?

pine steeple
#

what you mean?

lyric flint
#

in the behaviour tree

#

the task

#

cant select the key?

#

fuck me forgot the eye

#

πŸ’©

pine steeple
#

lol

lyric flint
#

hm still doesnt work tho

pine steeple
#

what is the issue?

lyric flint
#

idk lol

pine steeple
#

?

#

so its failing

#

you do know you have the task open

#

and select the ai from the dropdown

#

and see where it is failing?

lyric flint
#

huh?

#

cant really tell

#

doesnt do anything

#

only when the actor dies it goes to ''is not valid''

#

oh hold on I think i might have found the issue

#

it almost worked once?

#

Im so confused right now haha

#

I think it find the location now

#

but im not sure

#

it gives coords

#

but it fails

#

omg

#

its the

#

succes tick box

#

fuck me man

#

@pine steeple it works πŸ˜„

pine steeple
#

nice

lyric flint
#

thanks a lot man! appreciate the time you spend on me πŸ™‚

pine steeple
#

its cool πŸ™‚

lyric flint
#

do you mind if i can ask some questions about the bp you gave me? I dont understand some of it

pine steeple
#

I work with the AI system on a daily basis for work so i know how it works πŸ™‚

#

sure go ahead

lyric flint
#

the part after the sphere overlap

#

why do you set closest distance and closest food?

#

nothing connects to closest food so what does it accomplish?

pine steeple
#

it uses the sequence node

#

so when it gets to the end, the next number on the sequence fires

#

this was purely to make the BP clean

lyric flint
#

Ah okay πŸ˜„

pine steeple
#

so 0 will fire, it will set Closest food to null

#

ah wait you are on about nothing connected to Closest Food

#

that will empty it, set it null/invalid

#

as tasks are instanced, it could remember it from last time

lyric flint
#

ah I see thanks!

pine steeple
#

anytrhing else?:)

lyric flint
#

For now no πŸ˜„

#

im just sabbling into making simple ai villagers, Its really fun haha

#

dabbling*

pine steeple
#

well enjoy lol

ocean delta
#

anyone have any experience dealing with multiple actors on the same navmesh and getting them not to constantly collide with each other?

pine steeple
#

You can try using rvo or Crowd avoidance

ocean delta
#

Oh my god thank you dude

#

This was driving me nuts

ocean delta
#

the documentation on detour crowd controller is pretty sparse. and i'm just having tons of issues with nav mesh. how do other games set up their nav controls for their ai? is it all custom?

strong wraith
lyric flint
#

Is there a way to abort a sequence and prioritise another one? My AI will not eat when hungry unless it goes trough all the other sequences first even tho its first in line

patent hornet
#

if its in a sequence, not really

#

first one that fails will return fail and exit the sequence

lyric flint
#

so the wait task is pretty bad then I assume?

patent hornet
#

simplest model for what i think you're trying to do

#

is have a service or controller decide on an action

#

have the actions ina selector

#

and each gated with a decorator

lyric flint
#

I got this so far

#

very simple

#

but when its hungry, Id like it to drop what its doing and eat

pine steeple
#

make the IsHungry decorator abort lower priority

lyric flint
#

thanks πŸ˜„

timber relic
#

seems like a common question but is there a way to make AI Move To a little less "perfect"? (with blueprints)

#

right now my guys are doing a perfect goose step

pine steeple
#

not in blueprint

#

you could try using crowd avoidance and adjusting speeds dynamically

timber relic
#

thank you i will look up crowd avoidance

hollow prism
#

I'm not sure if there is a solution for this, but how do you launch AI enemies that are using Blackboards? We have similar AIs that don't use blackboards and we can launch them with no problem, but the more advanced ones don't budge. I even tried repossessing them with the dumber AI controller before launching them and they still refuse to be launched.

lyric flint
#

@pine steeple it stopped working? Any idea?

#

Cant figure it out lol

#

it probably fails getting the actors

pine steeple
#

it is not finding any food

lyric flint
#

there is tho, I tried making it find something else but its the same issue

#

and its odd cause I didnt change anything lol

pine steeple
#

probably changed your collisions

lyric flint
#

yup that was it haha

lyric flint
#

lol everything just stopped working

#

im kinda done

#

this is just dumb

lyric flint
#

??

visual parrot
peak sentinel
#

Hey guys, sometimes my AI gets stuck or does "rapid switches" between two tasks in the Behaviour Tree... Any clue why that is?

pine steeple
#

its failing to move

#

MoveTo task fails, then exits the sequence, then the BT starts again, and it repeats

peak sentinel
#

because its not finding a way to the waypoint maybe? so navigation issue?

pine steeple
#

or its stuck in ground, no navmesh, etc

#

Visual logger is a great tool

#

for AI related stuff

peak sentinel
#

It was indeed a navigation issue... Turns out that sometimes the nav mesh is not strechtched out over the entire level. I spawn my level elements^^

pine steeple
#

Will tell you why your BT is failing, why AI can not move, etc

#

so in the future, that tool will be indispensable

peak sentinel
#

yeah, will check it out as soon as i need it i guess πŸ˜… Any clue why that navigation problem happens?

pine steeple
#

no idea really, maybe you need to switch it to dynamic?

peak sentinel
#

.. it was already on dynamic. Is it possible to make a static navmesh inside a BP?

pine steeple
#

no

peak sentinel
#

alright, i guess i have to look at invoking then now^^ thanks for your help πŸ™‚

visual parrot
peak sentinel
#

@visual parrot It turned out to be a navmesh generating issue. WPs are working^^

visual parrot
#

πŸ‘

rapid ridge
#

anyone has a behavior tree service example with c++

noble hearth
#

Can anybody hit me up with some AI behavior tree wisdom?

#

I'm trying to add a node to my moveto action in a sequence that checks if a condition is met before running that movement. how would i do that?

#

I tried compare bbentries but this involves me setting a random blackboard value up for this

noble hearth
noble hearth
#

Can someone tell me the difference between perform condition check and perform condition check ai in a behavior tree decorator?

visual parrot
#

have you tried placing both nodes down to see difference?

pine steeple
#

Ai node just has convenience outputs of controller and pawn

noble hearth
#

@pine steeple i see thanks. @visual parrot I have and saw no real difference between the two other than ai node has a convenient controller input

pine steeple
#

They both get called same time

noble hearth
#

the thing is the descriptor says that only the best one will be called which i find odd

pine steeple
#

Yeah if you have two and it's an ai controller it will call the ai node

noble hearth
#

"only the more suitable one" will be called

#

you can have behavior trees for non ai characters?

pine steeple
#

Kinda bit tricky but yeah

#

Was never fully finished

noble hearth
#

i see, i can't personally think of a single application for that though so i see why they dropped it

pine steeple
#

We actually use it in the red solstice 2

#

We use BT as a mission system. It works and is easy to use.

#

We cheated heavily on that

noble hearth
#

hmmm so like a mission tree i guess huh

pine steeple
#

Yeah

#

We made special c++ asynchronous tasks and nodes for the game designer

#

They can just slap nodes into a BT to create a linear mission

noble hearth
#

ok i can see the use in that then, when you say asynchronous tasks do you mean like player can finish A then C and come back to B in the sequence?

pine steeple
#

That is possible but our missions are mainly linear story based

noble hearth
#

Well i appreciate the insight into the behavior tree

noble hearth
#

Quick question about common Ai practice. So say i'm making a diablo-esque game. How would i handle AI? Currently i'm setting the ai controller culling to 2500 which is outside the view of any player. i'm assuming for the server an AI that's just sitting doing nothing is not really expensive right?

#

I ran a test and i'm easily able to handle 300 in a tight zone but i'm curious how that would work. Would i need to destroy and spawn actors in a ontick event checking if the player is say 5000 units away from the spawner or something?

warm ibex
#

Does anyone have a good tutorial or blog or article or great video they found extremely useful to creating complex behavior trees in UE4?
I'm so exhausted on the waves of "this is how you do things with behavior trees"
and every single time its just setting the EQS default settings on a tree node or the easiest AI imaginable in any game of 'walk to position' or 'patrol' lol

I'm trying to get a further grasp of how people are managing complex AI with behavior trees.
Before I decide to just create my own brain process and skip the behavior tree.
But they worked hard on a flexible AI system which comes with some great and neat debug features so I'd like to give them a good shot before just doing a Finite state machine through a custom BrainComponent

patent hornet
#

@warm ibex complex AI with the built-in BTs usually comes to making several BTs for behaviors

#

and then using the run behavior tree tasks

#

anything else is unmanagable

#

@noble hearth if you feel like you should destroy an Actor on Tick, you should had had never spawned it in the first place

#

creating and destroying actors isn't free

meager imp
#

does anybody know if the cooldown tag decorator means that the cooldown is shared gamewise (AKA between different actors) or if each actor has their own tag cooldown? πŸ€”

warm ibex
# patent hornet <@!243120317390782474> complex AI with the built-in BTs usually comes to making ...

thanks for the info.
So considering a state machine brain wouldn't be a re inventing the wheel approach in UE4s case.
I didnt want to start going down that path right away. Wanted to give UE4 BTs a chance.
But at the same time as I'm starting to try to use it more and seeing how people are using them, they feel meant for small tasking.
Then hoping to tons of different trees maybe.
It almost feels like trying to force mini states without a state machine lol
So then really just make an AI brain that runs a state machine and we're all set I think?
I'll give it a shot trying to more or less think of an AI State as a Tree itself maybe.

meager imp
pine steeple
#

@warm ibex BT's can be pretty complex

#

this is my Hunter Monster

#

and it runs sub trees

#

πŸ˜„

#

BT's are really really good

#

people just get confused on how to use them

warm ibex
#

awesome! yeah see this is what I was picturing like a web of webs.
I'll keep looking for a handy article/tutorial/video it'd be nice to delve deeper into them.
I really just see people doing examples of 'MoveTo' or quick patrol.
Then say they're useful lol
These images would be the first example I even see of someone going deep with them.
I see how much UE4 really did for nodes and the BTs and how approachable they are when it comes to debugging or analyzing them.
So I can see how much power is behind them I've just been having no luck with finding more elaborate breakdowns on them lol.

pine steeple
#

yeah i mean i have been doing this for over 2 years

#

i know BT's like the back of my hand

warm ibex
# pine steeple yeah i mean i have been doing this for over 2 years

Cool cool, also as far as the things to do safely from within a BT node.
The BTTask Move To that's in code I was looking at it.
It mainly focused on commanding the AIController to ->MoveTo(
Which then manipulates the Movement component.

How have you found useful to track if a task has started?
I was considering just keeping like a
CharacterCoreComponent of some sort and just having flags 'IsSearching' 'IsJumping' ext ext
But those basically live not on the blackboard.
Also in the case of controlling the components I was thinking it might be good to send events to components rather than directly change info on the component.
What have you found to be useful in your experience with BTs so far.

pine steeple
#

i mean the move to task makes sense

#

i use gameplay tags for states, i made some custom bt decorators for gameplay tags, this really helps keeps things organized, i also use states for certain AI (like hunter)

#

these services just pull the values

#

Hunter is one of the more complex AI

#

he can go inside vents, jump down from ceilings, climb out from side vents etc

#

can break down doors, stalk you, etc

warm ibex
#

got it, so more or less you could run a selector and a sub tree 'per state' as an approach.

If you're in a subtree is it basically having you come off the main tree or does it always come back to the main root to go down to the subtree

pine steeple
#

always goes back to root

warm ibex
#

ok thanks, and as far as the Behavior tree asset does the sub tree end up having its own data or can I possibly push the same data to the sub tree

pine steeple
#

have to use the same BB or a BB derived from the root BT

#

and data is shared, the subtree is just run as a sub instance of the main tree

#

that is also the nice thing about sub trees is you can use a derived BB inside it, if that is your thing

#

not something i personally bothered to do

#

he is an example of Gameplay tag determined nodes

warm ibex
#

very clean, niceeeeee.
I haven't touched gameplay tags yet.
or the Gameplay Tasks

things to look into

pine steeple
#

yeah i don't mind making BT's tho they can be time consuming at first

#

but once you have your core Services, Tasks and Decorators down

#

it becomes easy

warm ibex
#

Yeah that's been my mentality toward the UE4 tools.
I might be good with c++ and making shell things.
But there's a whole engine here, no need to re invent or come up with a easier solution when you can just take some time to embrace something that's taken years to make really powerful.

pine steeple
#

i probably have over 180 BT Tasks lol

#

reckon some of them are dead tbh

#

need to through them

warm ibex
#

haha niceeeee, I do AI & gameplay all day at work.
But its not UE4 but I love to learn so UE4 behavior trees studies.
Then to see what crazyness I can do once I get UE4s flow down.

#

Thanks for the infos, very inspiring stuff, good luck on the BTs!
And thanks for your time

pine steeple
#

np

warm ibex
#

@pine steeple as you set sub trees do they automatically exist (data wise)
or do they load when you arrive on it for the first time.
I figure all sub trees within a main tree get loaded when the main tree gets spawned.

pine steeple
#

they get loaded

#

firs ttime

warm ibex
#

I see service examples of like finding the player or setting values.
Is this a preference thing? Or should we be avoiding setting blackboard values inside of the tasks?

misty wharf
#

it probably depends on exactly what you're doing... services can run parallel to tasks

#

nothing says you can't assign bb vals in a task- but for flexibility, it might be a good idea to offer it as a parameter so you can choose which bb value it uses

pine steeple
#

Tasks and services make sense for adjuting BB values

#

Decorators don't make much sense

warm ibex
#

has anyone used
void AddEnumFilter(UObject* Owner, FName PropertyName, UEnum* AllowedEnum);
If so the third param It seems it doesnt like me directly passing my enum type
UObject filtering passes a TSubclassOf<UObject> AllowedClass); and that's basically MyActorClass::StaticClass()
What is it for enums?

pine steeple
#

@warm ibex ChosenMovement.AddEnumFilter(this, GET_MEMBER_NAME_CHECKED(UBTService_CivilianData, ChosenMovement), FindObject<UEnum>(ANY_PACKAGE, TEXT("ECivilianChosenMovement"), true));

#

or you can use the new style

#

StaticEnum<ECivilianChosenMovement>()

#

which i should replace mine with

warm ibex
#

new hotness it is.
when you get your value from the blackboard for an enum
GetValue<UBlackboardKeyType_Enum>
I see we have
UBlackboardKeyType_Enum::FDataType
is this uint8 the literal enum value that I'll just have to cast to my enum class type?

nova prawn
#

If i have a parent AI Controller and 3 types of unit can they all be passed through 1 AIController or would I need to create Children of the Parent AI Controller?

#

I have a BP_BaseUnit which then creates 3 types of Units which Inherit from this because they have similar things such as Health, State, Value, MoveSpeed etc, Hope this kinda makes sense. lol

misty wharf
#

You can have them all use the same controller class yes

#

A controller is created per-actor, the class just defines the type of controller, not the instance

nova prawn
#

Hmm i cant seem to make it work.

#

If i put the unit state to Idle using a Enum then it sets all the other units to idle.

misty wharf
#

How exactly are you changing its state?

nova prawn
#

I set a Variable in the Controller called UnitState and then during Play I was changing the UnitState by selecting a new dropdown option

misty wharf
#

if you go into play mode and search for controller in the world outliner it should show one per ai character

nova prawn
#

Ahh ok i,ll check thanks !

#

Doesnt seem to create an instance of the controller for each unit on the field?

shadow isle
misty wharf
# nova prawn 2 units same controller

Note it says controller class. A class is a reference to the type of the controller. The controller is created using that class... if you search in the outliner for BaseUnitAIController, you should see a number of them equal to the number of AI units

nova prawn
#

So when i set the state to Idle at the start ALL units will be idle and then during play if I change the Unit State then the tree will refelect in that dropdownlist i guess.

misty wharf
#

It depends on where you change it... if you change it on the specific spawned controller instance then it should only affect that particular one, and if you select the same instance in the BT editor while playing, it should show how its state has updated

knotty dawn
#

jfc

fair zealotBOT
#

:triangular_flag_on_post: Gamescammers#6929 received strike 1. As a result, they were muted for 10 minutes.

#

:triangular_flag_on_post: Gamescammers#6929 received strike 2. As a result, they were muted for 1 hour.

pine steeple
misty wharf
#

Nice one, didn't know about the memory function since I always did them in BP's so far :D btw the code samples have encoded & chars into &

pine steeple
#

yes i am looking at the plugin

#

to fix that πŸ˜„

wind coyote
shadow isle
#

indeed, but if I set Runtime generation to static then it doesn't do this weird behavior...

wind coyote
#

is that good? you can do that or add a delay

shadow isle
#

a delay? sure, but that's a hack, i'd like to know why it does this behavior in the first place

#

maybe EQS and dynamic generation don't work well together

pine steeple
#

EQS and dynamic gen work fine

#

but it looks like your using navinvokers

#

those i am not sure off

shadow isle
#

the moveto node (with dynamic on) just skips quickly and back to wait. With dynamic off, the moveto runs appropriately.

pine steeple
#

@shadow isle can you run the Visual Logger

#

and see exactly what is happening?

shadow isle
#

i will look into that. thank you.

ocean delta
#

back again with another stupid AI question. both of these AIs are using the detour component with RVO disabled. if an actor's target location is blocked by another actor, the actor just walks in place endlessly. is there no unreal mechanism to fix this or am i going to start having to do some freaking math?

ocean delta
pine steeple
#

they should move around

#

you using detour/crowd avoidance right?

ocean delta
pine steeple
#

for the spiders?

ocean delta
#

when i use ECrowdSimulationState::Enabled they don't move at all

#

yes

pine steeple
#

well if they are all obstacle, they wont avoid each other

#

why was they not moving with enabled?

ocean delta
#

i haven't yet figured that out

pine steeple
#

you know how to use the visual logger?

ocean delta
#

nope

#

how do i do that

pine steeple
#

turn on enabled, and see what visual logger says

#

Window -> Developer Tools -> Visual Logger

#

press start in the visual logger, and it will start recording

ocean delta
#

ok gimme a few minutes

pine steeple
#

it should act a bit like that

ocean delta
#

oh my god bro

#

i fucking wish

#

ok let me check

#

do you have ECrowdSimulationState::Enabled?

pine steeple
#

yes

ocean delta
#

dude what the hell

shadow isle
#

thank you

pine steeple
#

show me the result of visual logger

#

so i can get some idea what is going on, so we can fix it

ocean delta
#

one moment

#

never used this

#

uno momento

pine steeple
#

its really easy, and brilliant for debugging AI issues

ocean delta
#

OMG

#

this window is

#

INCREDIBLE

#

why did i not know about this!!!!!!!!!!!!!!!!!

pine steeple
#

yeah i might put it on my blog

ocean delta
#

LogCrowdFollowing (Error) Invalid navigation data in UCrowdFollowingComponent::SetMoveSegment, expected 0xEA47D600, got: 0xEC05C100

pine steeple
#

now, do you have multiple navmeshes?

ocean delta
#

i just need to set the correct nav mesh!

#

yes!

pine steeple
#

yeah crowd avoidance only works on the first navmesh

#

its a limitation 😦

ocean delta
#

i deleted the second navmesh and it's still happening so i have to figure out how to set the first navmesh

pine steeple
#

should be automatic

#

did you delete the instance from level?

ocean delta
#

i did

#

i only have the original navmesh

pine steeple
#

and from your project settings?

ocean delta
#

let me check

#

oh wait

#

do you mean the agent?

pine steeple
#

under Supported Agens in Navigation SYstem

ocean delta
#

i have two agents

#

let me delete one

#

OMG

#

IT WORKED!!!!!!!!!!!!!!!!!

#

YOU BEAUTIFUL PERSON

pine steeple
#

so what i do in our game, is the AI on big navmesh, is set to Obstacle Only

#

so the ones on the crowd avoidance navmesh, can avoid them

ocean delta
#

DUDE HELL YES

#

this is going to help SO MUCH THANK YOU

pine steeple
#

np have fun πŸ˜„

cerulean coyote
#

Hey guys, working on a project with a bunch of AI, we're trying to implement EQS now. Anyone have some good resources on it? Aside from documentation

pine steeple
#

There is a few youtube tutorials on it

ocean delta
pine steeple
#

i use them extensively in our game, they are brilliant

#

our AI's "Aggro" system uses EQS to determine its target

#

that is how flexible they are

#

bit like this

ocean delta
#

@pine steeple so the spiders are properly avoiding each other, but now they're getting stuck like there's some kind of "friction" that's stopping them. is this something to do with the nav agent radius?

pine steeple
#

that could well be

#

we kinda fake colliders, and if legs clip, so be it 🀷

ocean delta
#

of course

pine steeple
#

also there is option like slow down at goal

#

and velocity whilst avoiding

#

which you can tweak

ocean delta
#

yep looking at that

pine steeple
#

these values we found work well for the avoidance

ocean delta
#

poorly documented unfortunately

pine steeple
#

if that helps

ocean delta
#

let's try it!

#

it's about the same so that means there's something wrong with the actor itself

#

thanks for sending that over! im gonna keep it with those settings

lyric flint
#

What is the best way to make stealth AI, for games such as Metal Gear and Spliter Cell?

pine steeple
#

Program them to be stealthy?

#

that is a really broad question really

lyric flint
#

Nope, behave very smartly

#

Not to be stealthy, maybe I should have written better

pine steeple
#

General run down is, Use perception, if player makes a noise, investigate the noise location, etc

#

patrol the last known location for X time, before giving up search

#

notify other AI close by you heard that sound, that kind of thiing

lyric flint
#

Right

pine steeple
#

if player is spotted in sight cone, then you attack them

#

UE4 has AI Perception system

#

which would be perfect for this

lyric flint
#

I am using Character Interaction update 3 which has something I always wanted

#

Just wanted to make it slightly better to suit stealth genre

pine steeple
#

yeah, for things like crouching behind barricades, you would need a system to detect nearby barricades (EQS query for example) then trigger when near barricade to go to crouch, that stuff

#

there might be some YouTube tutorials on it, but yeah the basics of this sound pretty easy to flesh out, fine tuning would be a lot harder

lyric flint
#

Yup, that's what I am finding hard

#

I have instant detection and long range

#

Pretty much making it Dark souls of stealth games

#

Also, the way I am designing the level, maybe I need to tweak a few things to make it presentable

#

For combat, it is perfect for what we want, behaviour like terrorists in training camps

#

Open assault, rush the player

pine steeple
lyric flint
#

Thanks, I guess I'll have to check some videos and try myself, trial and error until I get good result

mighty mesa
#

hello guys. i need help to make an AI random movement and catch the player but without using the movement component. Any idea? thx you πŸ™‚

lyric flint
#

@pine steeple any idea for a decorator to see if theres nearby objects?

#

or is there an easier way to skip the task?

warm ibex
#

would anyone know how to set a blackboard value as a bitfield?
basically an int used for bits just want to store it on the blackboard.
I figured worse case there isnt a masking type and I just store an int and check on it through composite decorator checks

fresh remnant
#

Is using "Wait Blackboard Time" a good way to implement weapon firing timing for behavior performance?

pallid trout
#

Move-To Patrolling AI stops for a bit after reaching target point

#

The next target is already calculated but still it pauses for a frame and starts over

pine steeple
#

@lyric flint use the visual logger, Window -> Developer Tools -> Visual Logger

#

it will tell you why the AI failed to move

lyric flint
#

i did

#

got no idea lol

#

It has a location

pine steeple
#

you need it to fail

#

so the visual logger can record it

lyric flint
#

ah lol

#

must be this then?

#

this

#

@pine steeple

pine steeple
#

Invalid path

lyric flint
#

wich means?

pine steeple
#

it tried to move to somewhere off navmesh

lyric flint
#

ah

pine steeple
#

if your tree is blocking navmesh and the location does not have navmesh

#

ie you move to center of tree

lyric flint
#

thought the acceptance radius would fix that

pine steeple
#

then that point is not on navmesh

#

you can try turning on Partial Path

lyric flint
#

cause it works for the berry bushes

#

theyr off navmesh

pine steeple
#

yes, i have experienced the same thing before

#

somethings work

lyric flint
#

what is partial path?

pine steeple
#

we fixed a lot of these issues by using EQS

lyric flint
#

the problem with turning off affect navigation is that the ai just walks into it lol

pine steeple
#

it means move to the closest point we can get on the path, if we can not reach the goal

lyric flint
#

where is that option?

pine steeple
#

should be on the moveto task

lyric flint
#

ah

#

its already on

pine steeple
#

yeah you know about the real time gameplay debugger

#

press the ' key and select your AI

#

you can see what path it wants, and stuff

#

visual logger also maps in the level the locations

lyric flint
#

i know about the visual logger kinda

#

no idea about the real time debugger

lyric flint
#

turning off can affect navmesh fixes it but eh

pine steeple
#

yeah

#

so you need to move to a location near the tree

#

not directly on the tree

#

could be the center is too high

#

you need to maybe set the move location Z lower

lyric flint
#

that seems silly theres gotta be an easier way

pine steeple
#

well there is a height limit to path finding queries

lyric flint
#

rvo avoidance only works on what? other ai's?

pine steeple
#

yes

lyric flint
#

hm I got a workaround but its weird

#

I mean I know why the bushes work even with navmesh

#

@pine steeple do you know to make the navmesh tighter?

spark kiln
#

Is there a way to tell an AI to move toward a topographical location? Without specifying height?

spark kiln
#

I just want to tell it to move back and to one side a few feet, but I don't want to worry about whether it's uphill, downhill, flat, etc.

fresh remnant
#

What's a workaround for adding structs in Blackboard without me saving off everything I need as actual blackboard key/values...? Is there one?

warm ibex
#

@fresh remnant
I was thinking you could potentially make a component and just keep reading off it but you'd have to keep accessing that component every time you want to reference some data. But if you store stuff in one component it doesn't necessarily stop you from just keeping relevant data in their relevant components.

Not sure the correlation between blackboard and UE4's networking but you dont necesaritly need to be saving everything on the blackboard.
You can even look at the MoveTo task behavior it just sends commands to the player controller which sends a command to the pathing component which has its own info already stored inside that component.

Blackboard is more or less direct information that's needed most of the time.
Or just storing away everything you feel needed specifically for that BT.
But it can definitely be a balance.

fresh remnant
#

@warm ibex yeah I think my usecase falls exactly in the middle in this case where I'm trying to pass a struct between different AI tasks and requires a few elements (Vector, and some integer ids). Didn't want to make components or manager just for that, but still want it encapsulated so it makes more logical sense. So in the end I just created the different blackboard key values and pass them along individually.

old adder
#

Is there anyway I can make the EQS filter out location that is already taken by other call of EQS?

#

So that all EQS does not return the same location.

pine steeple
#

pass in the results to the second EQS?

old adder
#

Ah, I mean by I don't want the EQS run of different AI to return the same location. Anyway I can pass other AI EQS result into EQS?

pine steeple
#

well your AI can store there EQS location in your AI Manager/Director

#

other AI eqs queries will just block them with a test

#

and you clean that out routinely

#

which is what i do

old adder
#

Thanks, I will try that.

old adder
#

How do you actually communicate between AI Manager and EQS? Do you have like custom EQS class that has the pointer of the AI manager or access to it via the AI? Or you use custom EQS Manager?

pine steeple
#

i have a static, i can pull from anywhere

#
    UFUNCTION(BlueprintPure, BlueprintAuthorityOnly, Meta = (WorldContext = "WorldContextObject", CompactNodeTitle = "AIDirector"), Category = "Level|LevelManager")
    static class UAIDirector* GetAIDirector(const UObject* WorldContextObject);```
old adder
#

Ok, it work perfectly!

#

Thanks Kaos!

lapis sigil
#

Hi, do you rather use the UE Ai or implement algos like GOAP yourself and would that have advantages?

patent hornet
#

GOAP doesn't quite work out of the box with Unreal

lapis sigil
#

so if i want more complex behavor i cant go with the internal api

#

what about pathfinding? are meshnaves ok, or for more complex do i have to implement my own pathfinder?

patent hornet
#

you can run BTs from BT tasks

#

the crowd avoidance and RVO could be better, but normal pathfinding is solid, once you get familiar with navigation system options

#

you could run GOAP with unreal BTs, it just won't be super-simple

lapis sigil
#

are dynamic nav meshes very performance intensive

#

since i have a tile renderer

#

@patent hornet GOAP can write my own api its not that bad

#

but if the internal is great i can go with that

patent hornet
#

they are okay when configured correctly

#

if you decide to blow up half your level and regenerate navmesh all at the same time, you will feel a spike

lapis sigil
#

can i bake it at runtime only once? like render the tiles and update the mesh

#

for sure thats possible, i think i will go that way, i have no moving env

#

i just want to get sure that performance/quality is scalable

#

for mobile as well

patent hornet
#

took us quite a while to get the navmesh behaving, but we do have large procedural destructible levels

#

as long as you don't generate the... "ground" at runtime

#

you can have your navmesh packaged with the level just fine

lapis sigil
#

i do generate the groundtiles

#

floortiles

#

but only once, that cant be a problem? @patent hornet nothing is moving too from the tiles

#

navmeshes look quite solid so far, but i dont have the exp

patent hornet
#

probably not, especially since you can delay the game start

lapis sigil
#

yeah sure

#

i can give you feedback later

#

thanks for all that information @patent hornet

patent hornet
#

unless you have RTS type controls

#

you only need to have navmeshes and pathfinding server side

#

you can even get away with it with RTS controls, but the game will feel less responsive if it needs to wait for server to start moving

lapis sigil
#

@patent hornet ok, i understand, to you have any recommendation for multiplayer service / api to use?

patent hornet
#

not developing for mobile here, so no idea

lapis sigil
#

not sure if i will publish to mobile, i just want to have everything to make it possible at least

pallid trout
near jetty
#

my recomendation for AI is that the default BT is actually quite nice

#

coding the tasks themselves in blueprint is super nice thanks to being able to use Delay nodes and the likes

#

but other than that... no, not very usable

#

and the unreal BT is super basic so it breaks down the second you try to have something remotely tricky on it

#

while it works super well for typical "enemy AI" where the AI follows a rigid pattern, it breaks down enterely on complicated cases. For example its nowhere near good enough to have a decent PvP bot for a arena shooter

patent hornet
#

it can still do it

#

run EQS service for which BT you want to be running and run it

#

the service would be pretty complex

#

but it would work

lofty sail
#

how i can make a if node in the behaviour tree ?

pine steeple
#

Decorators and Selectors

lofty sail
#

like how i can make the behaviour tree to know if a boolean is true or false, like if it's false execute a task and if it's true execute a another task

lyric flint
#

call the boolean in a decorator

pine steeple
#

Decorators and Selectors @lofty sail

#

even this is possible, this basically an if statement

lofty sail
#

thx

sick badger
#

How do I make an EQS task that gets a random location around my character and moves to it? I'm having a hard time trying to get this to work. Tried to follow a tutorial but it was outdated.

(@ me when you reply please)

pine steeple
#

@sick badger show me what you have.

sick badger
#

So "Run EQS Query" I have unplugged because I had tried to copy it over from the "AI Behavior Toolkit" (marketplace) Behavior tree into my new one that i'm using with a different AI system, but it's not working.

The new one I tried to make from scratch is the "RandomLocation" Task.

#

In that Task I tried to copy what the tutorial I found said, but the problem is I seem to have nothing to set the blackboard value key... I already made a vector called TargetLocation in my blackboard but I don't know how to use it here.

#

@pine steeple

pine steeple
#

you need to make a property of the type BlackboardKeySelector

sick badger
#

how do i do that?

pine steeple
#

in the Variables section, click Add, and search for BlackboardKeySelector

sick badger
#

and name it like my blackboard key?

pine steeple
#

name it LocationKey

sick badger
#

ok

pine steeple
#

then click the little Eye next to it

sick badger
#

then plug it into those two nodes?

pine steeple
#

yes

#

in the Key pin

sick badger
#

right

pine steeple
#

ah you already had a key in that first picture no?

sick badger
#

i had it on the blackboard but not inside the task

#

character's moving around now! thanks!

pine steeple
#

cool, if you want to look at why the eqs failed

#

we can do 🀷

sick badger
#

oh one more thing

#

I have a float for "Wait Blackboard time" But I want to make it work with a range between two floats, is that possible?

pine steeple
#

not in the default implementation

#

but you can make your own task

sick badger
#

ah ok

waxen ore
#

hey guys, is there a way to make my Enemies detour each other when they're chasing me? Cos currently they're just stacking one behind the other struggling to get to me..

fresh remnant
#

@waxen ore use the crowd avoidance maybe? Detour crowd following component for ur character movement component

waxen ore
#

You also mentioned Detour crowd following component, not sure what this is as I it seems like there is no such component I could attach to my enemy blueprints

fresh remnant
#

hmm it would be a c++ thing maybe

#

Yeah actualyl the AI crowd Controller uses that

#
       : Super(ObjectInitializer.SetDefaultSubobjectClass<UCrowdFollowingComponent>(TEXT("PathFollowingComponent")))```
waxen ore
#

I see, I temporarily used RVO avoidance but this is unreliable as it may push characters away from the navmesh making them stuck

fresh remnant
#

yes RVO doesn't care about being on navmesh unfortunately

#

so you have to have someway to force them to get back to the navmesh

#

if you're doing BP, it's probably going to be a bit harder to make sure they're not off the Navmesh, what I did was I overrode the velocity they tell me to go if I know I'm going to be off the navmesh. I'm not sure what other folks do to keep them on with RVO on

#

You might have to deal with it after the fact, once they are off, to get them to move back in by forcing their velocity to move to a nearby nav point

#

like detect when they are off the navmesh, I believe that's possible with BP, and then find a point on the navmesh closest to the character location, then go into a state where you slowly walk them back during Ticking

waxen ore
#

Yeah that’s definitely an option. Thanks for the advice!

fresh remnant
#

few gotchas on RVO: max 50 crowd movers at a time unless you up the limit in project settings, problems with tile size depending on how large ur whole map is that u have to set up in the Navmesh options, also doesn't pay attention to walls/collisions unless u register them as blockers for the RVO

#

but navmesh should be fine mostly for the pathing stuff, they just stray off when they need to veer away from something

waxen ore
#

So I think using AI crowd detour controller for my enemies would be a better choice right?

#

I just wasn’t able to see yet where are the settings to tweak avoidance parameters in that crowd detour ai controller

fresh remnant
#

Are you using the regular character movement component?

waxen ore
#

Yep

fresh remnant
#

Character movement in unreal is a mess imho πŸ˜„ .so in your enemy's movement component if you select it in your character's blueprint, you should see some RVO properties in the details panel

#

alongside the "max walk velocity" etc settings

#

there's also RVO settings in Project->Crowdmanager

#

I set my max agents to 1000 πŸ˜„

waxen ore
#

Wow

#

I really don’t need that many enemies πŸ™‚

fresh remnant
waxen ore
#

I will have 3-7 enemies max

fresh remnant
#

oh great, then that works well

waxen ore
#

Thanks a lot man!

fresh remnant
#

What am I not understanding about Behaviors here?:

  • The first task runs and returns "success"
  • the second task goes to "In progress"
    -then the first task runs again? Why does it go back to the first task?
#

actually second task does finish with success, but I couldn't catch that onExecute, something else makes it finish. But whhy does it restart 1 before going to task 3 still?

#

so the order goes like this:
Task1(sucess)->Task2(sucess)->Task1(sucess)->Task2(sucesss)->Task3(success)

timid fox
#

i can't get ReportNoiseEvent to register with the AIPerception component on the AI controller

#

i only get sight updates

#

tried different numbers for loudness and range in ReportNoiseEvent node.. can't see anything in the visual debugger

#

also don' understand why there are sight events for the AI pawn, there is only one actor with the perception stimuli source component in the scene because by default every pawn is registered as a sight stimuli source (need to change a setting in .ini)

patent hornet
#

pawn does need to call some MakeNoise function

#

for that to work

#

don't recall what it is exactly

timid fox
#

ReportNoiseEvent

#

i do that in the players character bp

#

also tried in the controller and level bp

#

.. i've looked at a couple of tutorials and they show exactly what i did..

pine steeple
#

does you ai have sight set?

#

is your team boxes all ticked?

#

cause unless you implement the team interface, you need to at least allow neutral

timid fox
#

yeah, i have all the affiliations ticked .. as seen in the screenshot above (have them both for sight and sound)

pine steeple
#

interesting

timid fox
#

forgot to set the instigator in the ReportNoiseEvent call ... 🀦

pine steeple
#

that could help πŸ˜„

uneven junco
#

Hmm. I added a AIPerception component in blueprint, then after playing around a bit I added the component also in C++. Then loaded the editor, deleted the component added from blueprint. Problem is I gave the C++ one the same name as the blueprint one, so they co-existed. When I deleted the blueprint added component, it also broke the C++ added subobject. I can get the C++ added AIPerception to work if I rename the variable and the subobject name, but I really want to use the original name. πŸ˜… Any tips?

#

I tried removing the component in C++ and resaving the blueprint hoping that cleared up any old data, but even after resaving it without the AIPerception component and then adding it again in C++, the component remains broken, except if I create it under a new name. Weird stuff.

#

Oh... that makes sense. The characters that were placed in the map still had old data.

#

Never mind, that was it!

heady raft
#

Hey !

I'm working on a grid base game, and I'd like to implement my own pathfinding without a navmesh (partially because the level is procedural and I don't want to have a massive, dynamic navmesh). My issue is, i can't find a way to make my character move toward a location without a navmesh or an AI controller, as I really don't want to use theses tools.
Is there a simple way to just input a location and have my character run in a straight line toward it ?

uneven junco
#

Yes, Character->AddMovementInput πŸ™‚

#

You would have to turn the location into a direction first

#

AIController->SimpleMoveTo is a good one as well (never mind this one, it still uses nav mesh)

#

Or AIController->MoveToLocation with bUsePathfinding = false

heady raft
rapid ridge
#

is it possible to make an environment query request without an AI querier?

pine steeple
#

kinda..

#

a lot of work though

strange kestrel
#

So I have an issue where I'm trying to make a character a dynamic obstacle. When a character moves, I need it to update the location of the obstacle to the new location of the character. My issue is exactly as explained in this post: https://answers.unrealengine.com/questions/914190/navigation-around-pawns-that-are-dynamic-obstacles.html. However, I really don't want to use detour crowd AI controller since that has issues such as units slowing down. And also ROV is not an option since I can't have units pushing each other around. Anyone got any suggestions?

strange kestrel
#

From research it seems I might need to use grid path AI controller, but that has really limited documentation :/

uneven junco
#

Since the nav mesh isn't automatically updating because bCanEverAffectNavigation is set to false, try manually triggering an update with the static function
UNavigationSystemV1::UpdateActorInNavOctree

#

or maybe UNavigationSystemV1::UpdateNavOctreeAfterMove

keen crystal
#

Any idea why my character doesn't move all the way to target? I'm using Move To Location. It seems like the bigger I make the character capsule radius, the less accurate the move is.

#

I don't want to shrink my character capsule, because I need units to not overlap in the same grid

uneven junco
#

Acceptance radius -1 will cause it to use the capsule's radius as "stop on overlap" radius

#

So specify some small positive value to make it more accurate

keen crystal
#

ahhh ok thanks, I'm not sure that behavior is documented or I just can't read

#

setting the acceptance radius to 1 still does the same thing

#

so that's not it

#

perhaps I'm doing this wrong? do I need a capsule for navigation and a separate capsule for collision?

waxen ore
#

Guys I need to have 4-5 enemies creating a circle around the Player while attacking him, but currently they're just struggling to get to him stacking behind each other doing some ugly sliding. I tried turning on RVO avoidance with radius of 500, weight 0.5 but they still just slide and slide. Please help!

waxen ore
#

I want those blocked enemies, to detour attacking enemies in left or right direction finally getting to the Player

pallid trout
uneven junco
uneven junco
#

The fact that AcceptanceRadius == -1.0f will cause internally that agent radius is used is not documented indeed. I just double checked and it actually takes 10% of the root component's bounding cylinder.

#

so 10% of radius is normally used

keen crystal
#

haha wow thanks for looking at the source for me

uneven junco
#

It's np I'm working on movement stuff as well so it was good for me to double check what -1.0f did

#

I'm out of ideas though for your issue

keen crystal
#

ah ok

#

it's stop on overlap

#

I thought I had it unchecked!!!

#

thank you πŸ™‚

uneven junco
#

ah great, np

cosmic heart
#

I'm new to AI and at first I watched quick tutorial which used pawn sensing but then watching some more I learned about EQS and AI perception and right now I'm very confused, which one should I focus on the most? Is one of them significantly better than the others, maybe one of them is outdated or should I mix them up? I also see all of them doing kinda the same thing but just in a different way. I know that EQS is still expiremental and probably will stay this way but I read that it only needed some UI polishing.

high moth
# cosmic heart I'm new to AI and at first I watched quick tutorial which used pawn sensing but ...

I can't understand what are you talking about. They have very different purposes, where AI sense is usually used to determine the target and EQS - to determine which way it is best to approach found target. EQS is used for finding stuff in examples, but, as for me, never on practice it is used for that. So, which one you should use is depending on type of AI you're doing, but if you're doing common "Shooter guy", then you're likely to use them in conjunction

lyric flint
#

hi, i want help for a very best cover mekanizm 😦

uneven junco
uneven junco
# cosmic heart I'm new to AI and at first I watched quick tutorial which used pawn sensing but ...

Generally AI Perception is helpful for triggering things, i.e. when things should happen. For example when an enemy comes into view, AI Perception can trigger an event node where you can handle the reaction in. EQS is a supportive tool for determine what to do or how to do it, like when you know now is the time to change positions (for example, the enemy walked out of line of sight - detected via AI Perception), EQS is helpful for choosing a good new position.

livid token
#

πŸ‘‹
why doesn't my navmesh get affected properly by the simplified box? The left part after the empty line should be all out of bounds

tardy abyss
#

could anyone help me with a few ai?

#

im looking to have deers and crows the roam around

#

and react to player movement

winged stag
#

@lyric flint check out tom looman's udemy course

#

@tardy abyss 4 legged animals like deer are hard because they don't pivot on the spot like humans do. This means that when the nav agent makes them turn, they look pretty funky. They ideally have a 'turn radius.'

warm ibex
#

Hi peeps!
I am just looking over decorators and services.
Started looking at layers of a service class objects by studying UBTService_DefaultFocus
Inside this function

  • UBTService_DefaultFocus::OnBlackboardKeyValueChange(
    I came across
  • AAIController::SetFocus(
    So I was wondering if anyones utilized FFocusKnowledge?
    -AAIController
    FFocusKnowledge FocusInformation;
    Reading through code calls in AIController it looks like it is to call a focused actor?
    But there's more to that since there's focus & priorities so I figured maybe someone here has utilized that FFocusKnowledge more whom might have more info its usage.
pine steeple
#

its just a layered focus system

#

higher priorities take over from lower priorities

#
{
    typedef uint8 Type;

    const Type Default = 0;
    const Type Move = 1;
    const Type Gameplay = 2;

    const Type LastFocusPriority = Gameplay;
}```
#

take this for example, Default is lowest priority, then Movement is second priority, but Gameplay is the highest priority so its focus is the one that will be used.

#

you can make more, like i have 2 extra focuses that are higher priority to Gameplay

#

then you can use ``` /** Set FocalPoint for given priority as absolute position or offset from base. */
virtual void SetFocalPoint(FVector NewFocus, EAIFocusPriority::Type InPriority = EAIFocusPriority::Gameplay);

/* Set Focus actor for given priority, will set FocalPoint as a result. */
virtual void SetFocus(AActor* NewFocus, EAIFocusPriority::Type InPriority = EAIFocusPriority::Gameplay);

/** Clears Focus for given priority, will also clear FocalPoint as a result
 *    @param InPriority focus priority to clear. If you don't know what to use you probably mean EAIFocusPriority::Gameplay*/
virtual void ClearFocus(EAIFocusPriority::Type InPriority);````
#

to set and clear your focuses.

#

then AAIcontroller, inside UpdateControlRotation, it calls, GetFocalPoint, which gets the highest priority Focus, and applies rotation to the control rotation to rotate to that FocalPoint.

#

@warm ibex ^

warm ibex
#

hmm okkie, thanks @pine steeple

pine steeple
#

That went over your head didn't it ? @warm ibex

warm ibex
#

@pine steeple nope nope I got it its an ordering and we can manipulate the order. helps AI with prioritizing.
was just asking in case there was a part of it i was really missing.
This just cleared up what I was understanding.

pine steeple
#

nice

forest adder
#

does anyone know how to handle flying enemy pathfinding over pits?

#

think a landscape with a sunken pit, and I want the flying enemy to be able to fly over it... navmesh wouldn't be able to make a path over said pit, how do you do that?

glass onyx
livid token
#

Does anyone know why my BlockAll, BlockingVolume seems to be hollow. I'd like to fully clear the navmesh within its insides

gusty jetty
#

Hey All, I'm just getting started with Navmesh, and it's being really mean to me : /

#

At 1:30 in this youtube, you can see the dude running off in the wrong direction for no apparent reason 😦

#

What's all that about?

cobalt palm
#

Hello. Im trying to make an AI pawn tank that when it can see the player, it will move to them and shoot. However I have tried using AIPerception and PawnSensing and neither of them work as I cant attach them to the turret at the top. Does anyone know of a way to do this?

pine steeple
#

So you are trying to use sight?

cobalt palm
#

Correct.

pine steeple
#

Yeah so the sense sight in default form is ok for humanoid pawns

#

i assume your BP only?

cobalt palm
#

Yea.

cobalt palm
pine steeple
#

yes

cobalt palm
#

The problem with that is I want the "cone" for his sight to move with the turret at the top. Whereas right now the AIPerception move only with the forward rotation of the whole pawn

pine steeple
#

yeah that is the issue, it also does a line trace from the pawn, and that will not be at the turret height

cobalt palm
#

hm.

pine steeple
#

we ended up making our own detection system for turrets

#

but it depends how complex you want it, do you need Perception system complexity or just fire at closest target in cone you can see?

cobalt palm
#

Alls I need is say the turret rotates around and sees the player, I then just want it to move to and shoot the player. So almost like if the turret can see the player, set a variable to true which will fire the move to and shooting events.

pine steeple
#

i would probably not use perception system for this, but make your own system. Without C++, perception would not be viable (its lacking a lot in BP)

#

if you are using behaviour trees, this could just be a simple BT Service

#

that flips a blackboard bool

cobalt palm
#

Hm. How would I make my own system to what I want. It would need to check if it can see the player then make sure nothing it in between the player so that it doesn't go to the player if its behind a wall?

nova prawn
#

Hi, I am using a Move To in a RTS style so click a location and move to that but my "units" are overlapping each other, Whats the best way to stop them doing this?

pine steeple
#

@cobalt palm i cheat a bit, i get targets in range (how you get this depends on your system), then i check to see if they are within cone forward of turret, then finally do a line trace from turret to pawn. If everything checks out, we have a target

cobalt palm
pine steeple
#

correct

cobalt palm
#

Ok cool. Ill have to see how to make the cone. Now do I make a custom BT task with this?

pine steeple
#

i would likely use a Service

#

which constantly checks

#

should work

cobalt palm
#

Now I assume I could just change the location to the turret of my tank

forest adder
# glass onyx Could try using NavLinkProxy

The problem with that is I need it in a general way since the pits could be massive, and enemy track a moving target so they need to take the shortest path from any given side

#

Proxy you must pre determine the location from and to, no?

livid token
#

is anyone familiarized with this error log ?

 LogCrowdFollowing: Error: Unable to find RecastNavMesh instance while trying to create UCrowdManager instance 

Every change i make to the crowdmanager logs it, and even though i have my controllers set to use UCrowdFollowingComponent it's not being applied as well

lament linden
#

Hello everyone, my code does not compile when I add a UAIPerceptionComponent to a Pawn in C++. Does anyone have an idea?

#

I just added these two lines to my Pawn inheriting class in C++, and that is enough to throw this error

#

UPROPERTY() UAIPerceptionComponent* AIPerception;

pine steeple
#

missing AIModule in your build.cs file

lament linden
#

Damn. Let me try and I'll post here. Thank you.

#

That was my problem. It does work on AIController without the AIModule. But I need the module to use it on Pawns. Interesting, thanks again.

tardy abyss
#

an anyone help me set up a bird flock that reacts to players and other animals?

wide kraken
#

Hi!
I have started working on AIController for RTS-like pawns, using the AI Perception.
But I can't find a way to access (get/set) the senses config within the Controller Blueprint. This stuff.
How can I access it within a Blueprint event to modify?

lament linden
#

Hey! Are you trying to set each property individually through blueprint graph?

wide kraken
#

For now - to understand how to access those properties, and how they match with 'stimuli' I get with OnPerceptionUpdate, so I better understand limits of what can be done.
Ideally - yeah, I'd want to adjust vision cone and sight during gameplay, for example.

lament linden
#

I am afraid that can't be done trivially, because SensesConfig of AIPerceptionComponent is EditDefaultsOnly

#

I am not sure if it can even be done :/

wide kraken
#

I see. Can they be at least 'read' somehow so I can extract individual value?

lament linden
#

There is a workaround.

#

Here is my setup, but I am currently experimenting and I am not sure if it will work 100% at the end.

wide kraken
#

(sorry my C++ is a decade rusty, so I stick to BPs for now).
I could think of having different perception setups and switching between them, if necessary. But would still want to 'read' values so I could for example debug them visually (that vision cone), or use for in-game visualization.

lament linden
#

I have a C++ class that extends from Pawn. In that class I have the AIPerceptionComponent.

misty wharf
#

you can update the senses config in C++, for example like this

void UCppHelpers::SetVisionHalfAngle(UAIPerceptionComponent * perceptionComponent, float newHalfAngle)
{
    UAISenseConfig_Sight* sightConfig = Cast<UAISenseConfig_Sight>(perceptionComponent->GetSenseConfig(UAISense::GetSenseID(UAISense_Sight::StaticClass())));
    if (sightConfig != nullptr) {
        sightConfig->PeripheralVisionAngleDegrees = newHalfAngle;
        perceptionComponent->ConfigureSense(*sightConfig);
    }
}
lament linden
#

I'll let @misty wharf write, maybe he has a BP solution.

misty wharf
#

I don't recall there being a BP method for it, that's why I use the above for example

#

you can use similar simple methods to also access values from it if you can't find a BP method to do so

lament linden
#

Since SensesConfig is not exposed to BP, I think all answers would require C++ one way or another

wide kraken
#

I see, thanks guys!
Writing this method down. I was hoping to make everything in BPs, but this is second time in a week I ran into things being restricted to C++ sometimes.
Starting to understand why everyone is seeking C++ programmers and not just BP guys who drag n drop nodes πŸ˜„

misty wharf
#

you can get away with doing mostly BPs but on occasion you need to write small helper funcs like this :)

cobalt palm
lament linden
#

I'll ask the basic questions first, did you set the Blackboard keys when you added this task to the BT?

cobalt palm
#

Yep. The only thing that isnt set right away is the TargetActor (so the player) but is set with the player is in view as you can see at the end

pine steeple
#

@cobalt palm did you set your aborts up properly?

#

for when the state changes?

#

the way you want to design the BT, is high priority stuff on the left lower on the right (for states)

#

then with your aborts, you can control executing say Movement State to enter combat state

cobalt palm
pine steeple
#

can you show me?

cobalt palm
pine steeple
#

that will not work

#

so do this

#

make another Selector from your Selector

#

and put your state decorator in that

#

let me show you

#

like this

cobalt palm
pine steeple
#

now make another selector from your first selector

#

for non combat state

#

and put a wait node (say wait 5 seconds)

cobalt palm
#

Still doesnt move to me. Let me check the VisionCheck again

lament linden
#

@pine steeple is that because the service will not execute if the selector aborts?

pine steeple
#

the service will just keep restarting

#

as the bt will be bouncing

lament linden
# cobalt palm

@cobalt palm can you click on your BTS and show its properties like in this image?

pine steeple
#

could enable Tick on Search Start

#

tho really needs another state to hold the bt alive, instead of bouncing executions

cobalt palm
lament linden
#

The blackboard keys

#

Does it not fit in the image

cobalt palm
lament linden
#

No, I mean when you placed your service on the Selector node

pine steeple
#

@cobalt palm did you set your bt up like this now

lament linden
#

You should click on it and set the blackboard keys