#gameplay-ai

1 messages ยท Page 103 of 1

terse pilot
#

They should be the same

#

Buuuuut they're not

ocean crystal
#

screenshot more to the left

#

such that the random node and the first draw debug are visible

#

(just realized that you had that screenshot above, gg me)

#

@terse pilot So they're in different spots because of how pure nodes are evaluated in BP.

#

that function is being called twice

#

pure functions are called once for every input pin that uses them in any way

#

So you've got two input pins referencing the random reachable point function

#

even though they share the wire

#

If you want to use the same point twice, I'd suggest moving this graph into a function and using a local variable to store the first output, and then using that local variable to do everything else.

terse pilot
#

howdy, @ocean crystal

#

ah, pure functions as opposed to ones that require sequence flow connections'

ocean crystal
#

indeed

terse pilot
#

I learned something new about BPs

ocean crystal
#

the way it works is along the exec wire functions are compiled in order

#

any time there's an input pin, it grabs everything back "upstream"

terse pilot
#

I assumed when it compiles down it would pass along a pointer value

ocean crystal
#

Yeah, that'd be one way to do it.

terse pilot
#

hmm but okay, now that you describe it it makes sense

ocean crystal
#

They don't.

terse pilot
#

thanks that helps a lot; i'll test with your observation in mind

ocean crystal
#

np

terse pilot
#

okay, that was it

#

"today I learned"

viscid oasis
#

I think I'm over thinking this but here goes;

#

I'm trying to make it so a character is only detectable if it's within a FOV of an enemy - so a cone-like shape. I set the BB value for this target by doing a multi-sphere trace and finding the closest pawn that is of my class. After setting that value I then pass it to an EQS test, setting a custom context test that takes my BB value of actor and passes it as the single actor.
I then do a points: cone from a querier (so my enemy) and do a trace to the context (in this case my BB target).

so a few issues;
a) I can't test whether this is working
b) since I'm setting a value in my BB target, I then do a decorator test to see if the BB value is set; However this is set regardless when I use my multi-sphere trace. If my EQS test fails, it doesn't update the BB value and so it's as if nothing has happened

terse pilot
#

just checking - are you using the AI Perception node?

viscid oasis
#

@terse pilot no, I'm not.

#

Though I could; I haven't dug into that too much.

acoustic tulip
#

@fluid sequoia Thank you very much. Can I ask if you are familiar with the difference between GetRandomReachablePointInRadius and GetRandomPointInNavigableRadius? Maybe in which case we should use which.

ivory willow
fluid sequoia
#

@acoustic tulip GetRandomReachablePointInRadius finds the a nav poly within Extent and then randomly searches for a connected navpoly within the search radius. GetRandomPointInNavigableRadius appears to be an outdated implementation of the same idea but avoids using DtNavMeshQuery functions. You can find both function implementations in RecastNavMesh.cpp. If you want to look deeper into the hierarchy of the navigation system, it goes in order of abstraction from ANavigationData to its subclass ARecastNavMesh which uses the once private wrapper PImplRecastNavMesh that instances and uses DtNavMeshQuery. DtNavMeshQuery has lots of nice comments explaining how its functions work, so worth reading through it.

viscid oasis
#

oh man I should've used AIPerception

#

actually whats the diff between AIPerception and AIPerceptionStimuliSource?

glass pilot
#

First one is a Component used to give your bot Perception, like touch, hearing, sight etc while the secondary one is used to Register Actors as Perception sources, aka they can be seen/heard etc. (All though I've never used the later one & I still have my AIs senses firing). Might be worth digging into source about the StimuliSource if you want to know all the features it brings.

viscid oasis
#

Hmm okay

#

Maybe it's for none pawn actors or something; like a projectile might be a hearing / seeing stimuli ?

glass pilot
#

Yeah that is most likely one of it's primary features if I would have to guess

viscid oasis
#

ugh

#

man, I should've just read up on AIPerception stuff before getting into EQS

#

Got it working perfectly within 2 minutes.

terse pilot
#

yup super useful

glass pilot
#

Always worthwhile to do system checkups before diving into new areas ๐Ÿ˜„

terse pilot
#

did exactly what you were describing; i only first tried it a couple days ago

viscid oasis
#

Well, now I know both

#

It's the hardest lessons that teach you the most.

glass pilot
#

Yeah. There is actually quite a few classes that isn't well know around UE4.
Like BehaviorTree, there is another option called PawnAction (Like PawnActionBlueprintBase) if I remember correctly, can't remember anything specific about it though.
Might be pre-BT stuff

#

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

viscid oasis
#

๐Ÿ™ƒ

sage schooner
#

Everything in this image is a spline mesh, but I get inconsistent navmesh generation as you can see. They all have the same settings, all have collision, exist in the same nav volume, but some generator nav and some don't. I've tried just about every conceivable setting... any ideas?

terse pilot
#

could it be a scale issue? how big is it?

sage schooner
#

The volume? its quite large, it encompasses the whole level (but its not a giant level)

errant maple
#

Does BP/behaviour trees work well enough for AI or should I consider getting into C++ for that?

viscid oasis
#

From what I've read - Behaviour tree I believe is fine, it's just a GUI for AI. Tasks, services etc should probably go into CPP depending on what they're doing.

acoustic tulip
#

@fluid sequoia Thank you so much for the reply. I'll read through those functions. : )

viscid oasis
#

Does an AI Perception have to live on an AI Controller ?

elfin socket
#

@viscid oasis No but if you're doing multiplayer in your project then it's better that way because the AIC only exists on the server so the clients won't have to waste computer speed on it.

viscid oasis
#

yeah that makes sense; though in my case I'm thankfully single player.

#

What's tripping me up is that the AI Perception is based off the Forward Vector of the actor (I presume it's the actor)

#

However the default skeleton's 0 rotation is, in fact, facing 90 degrees.

uneven tide
#

Hi there, is it somehow possible to use blueprint macro / function libraries in behaviour trees?

latent bolt
#

what aproach should I take if I want to make part of my behavior tree different for different levels?

elfin socket
#

@uneven tide I think you can use BPFLs and macro libraries in service bps and in task bps

#

@latent bolt I would make a service that would check the level name and then assign a blackboard variable accordingly, which I can check in a decorator to affect behavior

patent hornet
#

there is also a task RunBehaviourTree

#

so you could have different subtrees for different levels

sage schooner
#

Anyone had any luck with building navmesh on splinemeshes consistently?

sudden drum
#

Side scroller AI jumping... can't achieve it

#

having the hardest time

#

using navlinks and all

#

sometimes it'll just fail in a blocked state

#

if it started the new moveto task and was already on the lft or right of the navlink

viscid oasis
#

Should I initiate a cool down for AI behaviour in my BT tree or just as a separate task?

ivory willow
#

AI Perception must be on AI Controller

minor bobcat
#

Could someone ELI5 what the Recast NavMesh class is? I understand what a NavMesh is, but I'm not sure how that differs, and how it relates to ANavigationData.
I'm pretty new to AI code with UE4/C++

ocean crystal
#

Recast is the lib

minor bobcat
#

So it's just an implementation of a Navigation Mesh, with ANavigationData being a more abstracted base class ?

ocean crystal
#

Aye

minor bobcat
#

Ah, I was way overthinking things then, does Recast in this context refer to anything then? Or is it just the name of the Library arbitrarily?

fluid sequoia
#

Recast/Detour is the name of the lib

#

Although yeah it's a confusing name when it's used in the class name too

minor bobcat
#

Ahh, Thanks @ocean crystal @fluid sequoia it appears I was way overthinking things haha

ocean crystal
#

So you're saying Recast in the class name isn't some nomenclature thing to strongly associate it with the lib @fluid sequoia?

dim quest
#

Hello, I'm fairly new to this server so I apologize if I am putting a question like this in the wrong place. If I am, please direct me to where I should be putting this. I'm currently working on a Fire-Emblem-style strategy game in Unreal 4. I have a basic game all set up with turns and commands all figured out and working, but translating controlling units from players to AI is proving to be hard to wrap my head around. I understand I can make an AI controller that acts as a brain to the units, but am unsure of a few things, and was hoping some people on here could help. My current plan is for the AI controller to run through a list of AI units, each with an assigned "order" variable that's an integer starting at 1 for the first and so on. First the controller would start running when its turn began, look for the unit with order 1, tell it what behavior to run, run the chosen behavior, and then increase the order variable of choice to move to the next unit. My questions are, does this seem reasonable?

#

opps

ocean crystal
#

fine choice of channel mickey, dw

dim quest
#

other questions were does a behavior tree end? and can I make this trigger off a unique event such as a turn ending

#

lol meant to hit shift+enter

fluid sequoia
#

@ocean crystal Well first time around reading RecastNavMesh makes me imagine it might be some reinterpretation of existing navmesh but it's really just the Recast library NavMesh ๐Ÿคท

#

Once you read around the source code it's not so confusing lol

#

Although I will say that the class names seem a little irreverent to the different functions of Recast/Detour

ocean crystal
#

Ah, I thought there might be something I missed.

fluid sequoia
#

Nah nothing complicated, but it pays to stay on your toes

ocean crystal
#

@dim quest not to make you feel ignored - that seems like it could work, and you can have all manner of things triggered from a BT.

#

Really it comes down to understanding what the tree is and how you can fit it within your intended implementation.

fluid sequoia
#

@dim quest Your idea seems reasonable, you will just need to possess your units with a master controller, issue your movement command, and once it completes unpossess the unit and go to the next in the list

ocean crystal
#

For instance, you wouldn't want to do a "one-off" in a service. But it'd be just fine in a task

#

Eh, I don't think that'd work unless the possession stays with the pawn

dim quest
#

I guess the explanation of behavior trees is kinda confusing to me

ocean crystal
#

it might stop movement when you depossess. But its turn based so you can just defer that.

dim quest
#

like you can use a blackboard to store variables, such as the selected unit and the current order variable right?

ocean crystal
#

Yeah you can do that

dim quest
#

i should clarify that units are all instances of the same character object with different variables

#

so how exactly does a behavior tree work? I understand it works similarly to a flow chart, in that you go from top to bottom, ask it questions along the way, and have it perform actions based on the answers to the questions

#

sry i'm kinda a beginner when it comes to AI

ocean crystal
#

its effectively a state machine.

you set up the states in a visual graph and can include rules governing when a state is valid (decorators), the things that should be active while a state is "active" (services), and end nodes which usually correspond to actions (tasks). Each frame, the tree is processed and if a state becomes invalid, finishes, or is cancelled the tree will handle that accordingly. Services and tasks can be notified about these events, and I think decorators can as well.

You can add your own BTD, BTS, and BTT (abbreviations for the aforementioned concepts) types as you would a normal BP or C++ class.

dim quest
#

ok, thanks, but is there a way to tell a tree to "stop" altogether? Like when an AI unit has moved and attacked or finished it's turn another way, can I tell the tree to stop so I can move to the next unit?

ocean crystal
#

I don't know if you can, but you can explicitly start one, so I think there'd be a stop as well.

#

its easy enough to set one up that only does anything if there's a valid current unit, and then null the current unit

dim quest
#

I just don't want a tree to start, run, and then when I go to the next the old one is still running, sounds bad for processing speed and might cause issues if I try to start it up again.

#

hmm, that's an interesting idea, make a scenario of halting the tree if a unit has done everything it can during it's turn

#

So, for these units, say I have a variable called "has moved" and "has Attacked", would I be able to have the decorators use those to determine if a character has moved or attacked on a turn?

ocean crystal
#

you're at the point I'd suggest trying it out.

static stratus
#

@dim quest you could set up one-off BT instead of looping one

dim quest
#

how?

static stratus
#
if (mReactionBTAsset && !mReactionComponent) {
        mReactionComponent = NewObject<UBehaviorTreeComponent>(this, TEXT("BTReactionComponent"));
        mReactionComponent->RegisterComponent();

        mReactionComponent->StartTree(*mReactionBTAsset, EBTExecutionMode::SingleRun);
}
#

weird formatting

#

rpobably wrong tag

#

here we go

#

so you just need to put in flag EBTExecutionMode::SingleRun

#

so instead of using RunBehaviorTree function you start it yourself

dim quest
#

is there a way to do this with the nodes? and not with C++ hard code?

static stratus
#

does not look like it

#

function is not exposed to BP

dim quest
#

i guess my next question would be how to add this in if I have done everything else using BP's and why the RunBehaviorTree node has a connection that leads out if it never "finishes"

static stratus
#

not sure what you mean about connection, why it doesn't halt until BT is finished?

#

You'd have to make a function to start one-off BT execution in C++ and expose it to BP, then just call it whenever you need AI to process BT

dim quest
#

huh, ok

static stratus
#

you'd probably need delegate of some sort to tell when its done though

dim quest
#

what do you mean?

static stratus
dim quest
#

i have variable that can be conditions on the unit that are used already to tell the player controller that the unit can't be used, that they're turn is over

#

their

flint trail
#

let's say I have a base skeleton NPC (enemy) and several derivatives (skeleton archer, footman, knight, etc.). They are different, but have the same base AI underneath. How can I organize my Ai to draw from base AI (basic idles, walking, attacking, searching fro player, etc.), but so that I could add additional tasks/services for each of the derivative enemy types ? (I am using blueprints and behavior trees)

#

I am not sure if making child behavior tree and child AI controller is the same thing as making child blueprint.

flint trail
#

anyone ?

patent hornet
#

you have a Task RunBehaviourTree

#

which will return success or failuire like any normal flow control node when executed

#

so you can wrap derivative specific logic in those

#

and just swap the BT asset you're using for that Task, i believe (haven't tried that, but it should work)

flint trail
#

@patent hornet right, but that's done in BP.. I am guessing there is no way to make a derivative Behavior Tree and I'd have to have unique tree for every character ?

floral mango
#

well, how would that work? You can't just 'inherit' a behaviour tree....it's not a structure that lends itself well to that paradigm

#

re-usable sections of BT are a logical way to do it. I don't use UE BTs much, but it's how we duplicate functionality in BTs in the engine I'm working in

floral mango
#

making readable and maintainable behaviour tree structures in large projects is an art form that few have mastered though...

ionic quartz
#

hello

lyric flint
#

Hey, How can I change behavior of AIPerception? I can't see nemies

#

But still

#

I haven't sources, so I can't trace logic of enemy/friend recognition

barren yacht
#

@lyric flint what are you trying to do?

glass pilot
#

There is pinned messages in this channel that will get any beginner of the ground, I would advice looking at those first and foremost

barren yacht
#

@glass pilot the stuff explained in that series is crazy detailed and feels unnecessary to accomplish what @lyric flint is trying to do

glass pilot
#

He is trying to add Senses to an AI, I would assume he is fairly new with AI because of that & Suggested a very good beginner tutorial (that is pinned for a reason)

nimble perch
#

im pretty sure the animations have the right scale as well

glass pilot
#

It has to do with Additive Animation. #animation is the right channel for those type of questions

lyric flint
#

So if a point is covered by nav-mesh and not reachable

#

allow partial path will move the actor close to the point

#

If a point is not covered by navmesh, allow partial path will do nothing

#

is this true?

static stratus
#

@lyric flint I believe it should find partial path even outside of navmesh, it projects a point (that is outside) onto closest navmesh polygon's edge. But I didn't check if it is the case, so I might be wrong.

sudden drum
#

guys

#

I have a huge issue with proxylinks

#

When a MoveToTask is executed and the agent is already on one of the links.... it remains stuck there

#

if it needs to use the link of course

sudden drum
#

the task fails with Blocked

ivory willow
fast cosmos
#

I'm trying to implement flying AI based on DON's plugin and this tutorial: https://youtu.be/gCd-_3jB-70, however I must be missing some secret sauce, since my pawns don't move an inch

#

Also, my pawn is using Floating Pawn Movement

#

Does the DON 3D Navigation require 6DOF to function, or..?

fast cosmos
#

Okay, so, RunBehaviorTree returns True, so that one works

#

And now DoN's plugin threw Access Violation at me

#

It's the FlyTo BehaviorTree node that crashes Unreal

fast cosmos
#

Noone out of the 4170-something people online knows the solution?

fast cosmos
#

Yeah, I tried stumbling around in the example project. I seem to have everything set up in the same way.

#

And yet, no cigar.

#

Looks like EventAddMovementInputCustom doesn't fire.

#

Looks like it's being fired from the plugin itself, so can't really check what are the conditions for firing it, or throw in some PrintStrings...

#

But the rest of the setup I have is nearly identical to the working setup, so...

#

Looks like the log finally sheds some light!

#

DoNNavigationLog: Error: Invalid input parameters received. Actor: P_Enemy_Orb2_30 CollisionComponent: Invalid

#

Now, fixing it is another matter...

#

Guess I'll try my luck tomorrow, maybe someone who can help me will magically appear by then ยฏ_(ใƒ„)_/ยฏ

ivory willow
#

And then, suddenly, 270 subscribers! Almost 300! ๐Ÿ˜„ https://www.youtube.com/user/Xptohz3

wraith eagle
#

Revisiting a node during pathfinding. Am I going to have to write a completely different pathfinder?
For example, I start on one side of the wall that doesn't fully block the floor, leaving a walkable gap. If I want the path to go up and over the wall, the node on the other side of the wall will be the same as the starting node, due to the gap left at the side, and thus will not be used by the pathfinding that doesn't allow node revisiting.

fluid sequoia
#

@wraith eagle If you could draw an example in mspaint it would be easier to visualize. However I don't think you need to worry about this edge case unless it is already an issue in your game. Consider that the pathfinder may just partial path to a node adjacent to the beginning node and then do another pathfind query that is then allowed to path over the original beginning node.

wraith eagle
#

Amazing drawing, I know haha. But yeah, start at X, path to O. In this example it's probably faster to run around, but as you start adding more blocks alternating the side of the gap, it becomes a winding path that gets really long, so climbing and going a more direct route should be faster

fluid sequoia
#

@wraith eagle Assuming you're trying to calculate relative path efficiency (e.g. an AI should take the long way around and stay on the beginning plane if it is faster than climbing to a higher level) you can add nav area modifiers to adjust the path cost for climbing.

wraith eagle
#

@fluid sequoia the climbing stuff is all done with the paths generated dynamically during the build phase, in a way similar to how it is done in the Unreal Tournament project, so the NavMesh stuff is slightly different to the base UE4 implementation. Everything works fine if the Nav Poly that the goal is on has a direct path to the higher levelled path, but if there's a poly from the original node between the wall and the goal poly, then the AI character will ALWAYS run around, no matter how much I modify the cost of climbing

fluid sequoia
#

Oh ok, this is more technical then

wraith eagle
#

yeah, it's a bit of an annoying one. I think I'll just have to figure out some modifications to the pathing algorithm. Right now it doesn't recheck any nodes at all, so as soon as it sees a link to a poly that is a part of a node it has already visited, it just goes "Nope, visited that one" and skips it, so up and over will never work unless the goal item is touching the wall

fluid sequoia
#

I was thinking that you could just start a new pathfind query to toss out the old visited nodes, when needed

wraith eagle
#

maybe. I'll keep looking

fluid sequoia
#

I'm still having trouble wrapping my head around why it doesn't work precisely lol

wraith eagle
#

I'm sure I'll find a way eventually. Pathfinding isn't the most fun code to be staring at haha

fluid sequoia
#

@wraith eagle If you're looking to work around it directly by just preventing the beginning node from being added to the closed list then you can modify DetourNavMeshQuery in a source build

real vault
#

Is there some documentation that explains thoroughly what the AI controller and the behaviour tree + blackboard do? and how they work with eachother?

elfin socket
#

@real vault Absolutely, dude! Just a sec I'll link you to some videos

real vault
#

Thanks a bunch man ๐Ÿ˜ƒ will give it a watch

elfin socket
#

Those two things are probably more than enough for what you need

#

I recommend watching the second one first

#

@real vault Also next time you want to ask about some basic concept, look it up on Matthew Wadstein's youtube channel. He has videos explaining everything one by one

real vault
#

Alright thanks ๐Ÿ˜ƒ will start with the second ๐Ÿ‘

elfin socket
#

<@&213101288538374145> do you think we should pin that second video, the "Getting Started wth AI" thing, to this channel?

stone anvil
#

good idea! pinned

long verge
#

Hi guys, does anyone know how to work with the max age feature of AI perception?

#

Say I let my AI "flee" from mee to a hiding spot, how do I let it return to normal after a certain amount of time?

#

Is there another way besides setting a delay with the value of the max age?

#

As in, isn't there just an event that gets fired upon losing sight for instance?

patent hornet
#

should be some OnTargetPerceptionUpdated

#

very little is exposed to BP tho

long verge
#

yeah saw it, found a workaround already

#

I think its still not fully implemented yet

warped elm
#

hi, I have a strange behavior with AI attacks where if i don't look at the AI, it won't fire at me using engine 4.16.3

#

as much as i like them not shooting me in the back, i'd rather they did ๐Ÿ˜‰

terse pilot
#

eyy gang - just wanted to verify a finding here. I have a basic rotator lerp from A -> B on an AI guy. In an empty scene, it goes from 100 fps to 50ps when a replace a rotate on tick to a lerp rotate on tick. Is that expected? I know lerps aren't particularly performant but that seems pretty drastic

#

just a basic tick

#

Can you change the AI tick rate? (like forcing it to only happen 10 times a second).

#

i know i can change tick rate of normal BPs

pine steeple
#

why not just make a timer to run every .1 second

#

lerping on tick is pretty bad

warped elm
#

i would think its more dependant on the number of child object on the rotator

#

or the # of objects being lerped

minor wolf
#

I couldn't figure how to make it MoveTo a location just by jumping, so I faked the jump with a timer

pine steeple
#

you using behaviour trees?

#

you could have a notify in your montage that when he jump you then set a bool called MoveRabbit to true, when he finished jumping, set it to false

#

and check that bool inside your BT

#

but i am just popping ideas ๐Ÿ˜„

minor wolf
#

The notify in the montage would be class

#

IF I had any animation in ๐Ÿ˜„

worn yarrow
#

is anyone here familiar with UAITask

#

i'm lookin at AITask_moveTo

#

i see the basic logic but I have a few specific questions :

  1. where is the logic on adding new BP node that has m ultiple exec pin.
  2. I see the Delegates but what class exactly are binding those dleegates? e.g OnRequestFailed.Broadcast(); . something in the native must be using it , i'm unable to find any info on it
  3. is there a good template to create AI Trask from?
gilded tree
#

Im aiming to create AI that procedurally spawns around the world and patrols within a certain range of that location. Any suggestions on how to achieve this is most welcome. I already got the patrol section covered for a single non-procedural area covered, but that code would need tweaking to set a specific range for each AI to patrol within.

minor bobcat
#

So I want to do some experiments with this AI idea I have in UE4, and what I need to do at the moment is add some information to the generated Nav Mesh that I can then change at runtime.

From my current exploration of Detour and Recast, I think I need to put something into dtNode* and dtNavMeshQuery::findPath (in order for it to then access the additional data Im plugging in maybe?).

So I get I need to make a struct that derives from dtNode and put in my extra data, but I'm not sure where to go from there, is that even the right approach? Any ideas?

#

It's been a while since Ive done C++and even longer since delving into UE4 so Im not too confident in it right now haha

fluid sequoia
#

@minor bobcat Writing additional metadata to dtNode seems like the correct approach, also correct that dtNavMeshQuery handles the intrinsic pathfinding. I suspect then it may be easiest to child class dtNode and dtNavMeshQuery and then use the extended dtNavMeshQuery functions in an extended RecastNavMesh class (which would copy all of the implementation from PimplRecastNavMesh).

#

This would of course require a source build to edit the detour stuff

#

I'm curious about which class(es) handle generating new navmesh as I haven't gotten around to inspecting that part of Recast/Detour, so if you implement anything with it, pls send me a ping :)

minor bobcat
#

@fluid sequoia Will do! Thanks for the heads up, Im most familiar with C# so forgive me if this question is dumb, will I run into issues with dtNode being a struct if I want to change a value in it? Since they're immutable? Or can I get around that with a pointer

fluid sequoia
#

@minor bobcat You can freely modify struct members, structs are just ever so slightly different classes

minor bobcat
#

@fluid sequoia Ah awesome. Im getting some weird errors right now you might know more about actually?

G:\Unreal Engine\Epic Games\UE_4.19\Engine\Source\Runtime\Engine\Public\AI/Navigation/RecastQueryFilter.h(10) : fatal error C1083: Cannot open include file: 'Detour/DetourNavMesh.h': No such file or directory

Im also getting an intellisense issue with

#include "Runtime/Navmesh/Public/Detour/DetourNavMeshQuery.h"

class ClassName : public dtNavMeshQuery

saying that incomplete type is not allowed on the base class declaration. I'm struggling to find much online that matches this situation

fluid sequoia
#

@minor bobcat The recast/detour files are accessible only in source builds so you need to pull the UE4 source from github

minor bobcat
#

Ahh, that makes sense

#

Thanks for all your help :)

fluid sequoia
#

np

molten gust
#

Guys

#

any tutorial to make a enemy in 2d plataform sprites?

#

using some AI

grand atlas
#

So I was making a player controller class(let's call it base controller) and as I added functionality to it, I realized that the AI would also need a lot of the same functionality. So I made a child of the base controller intended for the Player and the base controller for the AI. But that does not seem to work with the AI controller class - it does not accept the base controller class. No controller is spawned.
So how do I make an AI and a Player controller with a lot of similar functionality? Do I pretty much have to make two copies, or is there a way to use inheritance?

fluid sequoia
#

@grand atlas Does your game have the player issuing commands to their character, e.g. click a location and your character paths there?

grand atlas
#

A lot of the similar functions would be an FSM, goal oriented action planner and dialogue. Maybe more stuff.

#

But yeah, there's also some of what you mentioned, issuing commands to the character.

fluid sequoia
#

It may be more suitable to have a player controller that controls an intermediary pawn, which itself is attached to your player character that has an AIController

#

If there's any requirement for the character to use the navigation system then that's the best method

#

As well, regarding having other behavior like dialogue and such in a parent class of the controller, it may be more suitable to implement that behavior in a parent Actor instead.

grand atlas
#

Hm, i'll have to read up on design choices. Thank you for the input.

minor bobcat
#

Hey guys, I'm getting the following error:

G:\CloudStation\GitHub\UnrealEngine\Engine\Source\Runtime\Engine\Public\AI/Navigation/RecastQueryFilter.h(10): fatal error C1083: Cannot open include file: 'Detour/DetourNavMesh.h': No such file or directory

whether I'm attempting to build the project through Source Code or Epic Games Launcher

#

any ideas?

fluid sequoia
#

@minor bobcat Make sure that the Navmesh module is included in your dependencies

#

namely the build.cs

minor bobcat
#

@fluid sequoia What should I be adding?

PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay" });

I tried adding NavMesh to no avail

fluid sequoia
#

Navmesh not NavMesh

#

I think ๐Ÿค”

minor bobcat
#

Aha! Thank you!

lyric flint
#

How friend/enemy system works?

#

Because I can't find any info about it

#

This doesn't work

#

And why in AI case controller must inherit AAIController interface and in player case Character must inherint AAIController?

#

I mean, where I can read about such rules and guides?

lyric flint
#

2 hours. Ok.

worn yarrow
#

hi guy s... any EQS user here?

#

i'm trying to use Generator : Pathing Grid but I found no way to provide context to generatr path to

viscid oasis
#

You probs need a custom context query

worn yarrow
#

this generator is provided by epic

#

assuming it doesn't work out of the box , if i were to make a custom context query . i still need to plug it in to whatever that process the context

#

TArray<FVector> ContextLocations;
QueryInstance.PrepareContext(GenerateAround, ContextLocations);

#

this suppose to works... however it seems to only use GenerateAround

viscid oasis
#

oh you doing this in cpp?

worn yarrow
#

i'm acutally doing this using classic eqs method...

#

there's a node provided by epic

#

but this thing.... suppose to generate grid along path of querier TOWARDS 'something else'

#

there's no way to provide what is the 'something else'

#

i assume those have to be context based on what i'm reading in the cpp

#

but then still there's no way to provide it

viscid oasis
#

Yeah I dunno mate. I'm away from UE at the moment

fallow gull
#

Hello guys, Is the AiPerceptionStimuliSource component useless?
Wether I have one or not, the pawn that has the AiPerception component will always detect him. Or I'm doing something wrong

viscid oasis
#

I always thought the APSS was more used for other objects and not pawns / characters

#

i.e. a stereo being turned on.

fallow gull
#

Oh okay. I get it. thank you.
Is there a way to "filter" some pawns?

viscid oasis
#

I'm relatively new to AI stuff, so I'd verify anything I say

#

On my OnUpdatePerception is where I do my filtering logic.

#

i.e. checks the players stealth level - if > 3 (or whatever) ignore.

fallow gull
#

Okay yeah. I'd do the same. But I wonder if there's a way to filter before actually detecting it? ๐Ÿค” Like not seeing the pawn at all so it doesn't fire on update perception.
It's okay for now, I'm not in the optimizations yet, but it would be cool to know.

viscid oasis
#

Yeah, you and me both

lost tiger
viscid oasis
#

..er.. some kind of animation and then set the character's speed?

#

Very broad questions.

minor bridge
#

I'm going to buy the asset, but i've promised myself that i will accomplish at least the ia logic

glass pilot
#

Strafing can be done in a lot of ways when it comes to AI. I would suggest looking at tutorials, I believe there is quite a few out there.

#

And if you are planning to create the AI logic before buying it you are just making it unnecessarily hard for yourself. Rather learn from his than struggling yourself.

#

Isn't that the number 1 reason we purchase Assets in the first place? ^^

static stratus
#

I used SetFocus approach with blending idle/walk/run animations based on direction @minor bridge

#

I believe its done other way in there, might be wrong

glass pilot
#

Mort likes using EQS

static stratus
#

ah yeah and EQS around target

#

in an arc

lost tiger
#

it's hard to do that AI mechanics ... how it moves and then it attacks ?

static stratus
#

you could make it as a sequence, MoveTo, Attack

#

put a timelimit on MoveTo can be a good idea

glass pilot
#

I'm well aware. Mort is an acquaintance of mine.

static stratus
#

however if you have charge attack of sorts I'd roll custom combat system, like abilities plugin but more specific for the task

minor bridge
#

@glass pilot EQS seems too complex for what i try to archive. Do you think its necessary in any decent ai or its something to use in some specific cases?

lost tiger
glass pilot
#

It's way to user specific for anyone other than yourself to answer. It all depends on how "Advanced" you want your games AI to be

#

you don't really need EQS to make advanced AI either btw, just to add to my previous comment.

ocean crystal
#

For this particular case (strafing) I wouldn't use EQS.

#

You could technically make impressive AI without any of the AI framework. I wouldn't want to though.

glass pilot
#

Fully agree. It's all just tools in the end

ocean crystal
#

I'd say practically you only really need the tree. EQS and Perception are great assists though.

#

Strafing would be a service

minor bridge
#

I'm trying to think a case to use EQS (I just know that its used to interact ai with the environment dinamically)

ocean crystal
#

Or a modifier to a move task

glass pilot
#

Indeed a service is the way to go imo

ocean crystal
#

Make a town and have your guy want to eat someting lol

glass pilot
#

I personally got EQS running inside my service, but as I said. It's all just tools, to really get somewhere I would suggest : Try create the basics, keep developing on those, come back when your stuck.
This channel will be of a lot more help once that point is reached

minor bridge
#

Could you guys explain me how SetFocus can be used to accomplish the strafe?

#

(from the SoulSharer's message)

ocean crystal
#

Set focus should manage the rotation, then you just apply motion to strafe

static stratus
#

it will rotate controller to the focus direction

#

and controller will send rotation to pawn

#

iirc

ocean crystal
#

^

#

Well the pawn pulls but the same idea.

static stratus
#

Ill show my BT just for refence of how I do it, but there are many ways to accomplish this

#

when I SetFocus to None it resets it

#

meaning it will stop facing direction of the target

minor bridge
#

thankyou ๐Ÿ˜„

static stratus
#

there was a question about attacks too, I turned to something like this in my prototype so far, far from perfect, but gets the job done:

#

it picks out of 3 attacks based on constant weights atm (custom selector)

floral mango
#

have they finally added some utility features to the BT?

balmy junco
#

Hi ! I'm begin BT with UE4. I made some BTTask class in C++ and I believe that all same task use the same instance of the class. Is it normal or I did something wrong ?

swift pulsar
#

Does anyone happen to know the best way to provide a default value for a FAIDataProvider property in an EnvQueryTest? I don't see any way to set the value by normal means. I'd like to provide sensible default values for the test which can still be overridden by the designer.

floral mango
#

@balmy junco I'm only just looking into UE's BT implementation, but that's not an uncommon pattern. The engine just creates one instance of the BTTask, and each 'instance' in the node graph is simply that one, with a different memory struct passed in.

floral mango
#

has anyone tried the HTN Planner btw? I just noticed it's in 4.19

static stratus
#

@balmy junco you can use bCreateNodeInstance = true;

#

however its better for performance to store data in memory structs instead

balmy junco
#

Ok, I understand ! Thx

#

Oh !

static stratus
#

if you're doing prototype I won't worry about it

#

Blueprint tasks/services/decorators are instanced by default

balmy junco
#

Ah !

#

This explains some things

#

Thanks for explaination !

static stratus
#

@floral mango they didn't add utility stuff yet, the ones I have are custom made

cyan kernel
#

Hey, can anyone take a minute to help me see why I would want to use the programming logic of the behavior tree instead of just straight-forward blueprints? I took some time to understand how they work but I have yet to really dig into the possibilities. I like to think I'm an outside-the-box thinker, but I just can't see why you would want to do things like this. For example, if your AI runs out of ammo and fails a check, that's only one of several decorators on a task, it seems like you'd really have to go out of your way to keep track of the fact that that is the decorator that failed, therefor reload, rather than moving away or crouching or whatever other failchecks are available. Like I just don't see (yet) how this system is superior to basic branches and enumerators and such on a blueprint without the tree. But I wanna know what you realllllly need to use this system for, so that I can make proper use of it, and not just do things I could otherwise have done in basic BP.... if that makes sense ๐Ÿ˜ƒ thanks

floral mango
#

I think you need to understand behaviour trees in a bit more depth...they aren't just node graphs

#

like each node also has a state, in progress, succeeded, failed etc, and combined with control flow nodes like Sequence/Selector (those are just the most basic) give you a very nice framework for managing AI in an easy-to visualise way

#

Not that BTs are the only way of doing things...but they haven't become ubiquitous in the industry for no reason

cyan kernel
#

That's definitely the tree I'm looking to bark up... but you can get those succeeded/failed/etc nodes from AI Move To without using the behavior tree, or do you mean something else? Is it purely an organizational framework, or is there optimization benefits, or logical processes that aren't handled in BP?

floral mango
#

you can use gameplay tasks without behaviour trees yes, but they are separate.

#

easy to organise, plenty of control, easy to read. Sure you can write your whole AI in a blueprint controller but it's likely to be horrible to read compared to a behaviour tree

#

and the BP editor doesn't give you the stateful visual debugging

pastel gyro
#

How would one go about creating an AI system for people to get on or off a train when it arrives?

fluid sequoia
#

@pastel gyro It's dependent on the AI system of the game as a whole but I would probably have the AI add themselves to a pool of "people waiting for train" and have a service to notify all of the pooled AI when the train arrives, where you can then run whatever other behavior to actually get on ๐Ÿค”

minor bridge
#

How can i access the Ai controller/pawn in a composite? i want to compare the distance between the player and an enemy and it seems that "owner actor" from "Perform condition check" its the placement position and not the actual enemy position

#

This does not work because "Owner actor" returns the placement position of the enemy and not the actual position.

pastel gyro
#

@fluid sequoia Ahh yeah! That makes sense actually. Time to go do something like that ๐Ÿ˜ƒ

molten gust
cyan kernel
#

So anyone else who can weigh in on what advantages the behavior tree system has over just using blueprints alone? I'm not doubting, I'm just not seeing it yet..

ocean crystal
#

if modeling your behavior as states would be helpful to your design, you don't have to go make a representation of a state machine.

#

And it makes it a bit easier to reuse stuff IME

cyan kernel
#

What do you mean modeling behavior as states? I mean I kind of know what you mean cause I've been making a really complex animBP but moreso out of necessity than purpose

#

(moreso using states because of necessity rather than purpose_*

glass pilot
#

Tbh, I'd say Behavior Trees offers a simple solution to a otherwise very advanced system (Artificial Intelligence)

#

They are easy to learn, easy to use, easy to debug, doesn't cost anything extra (if anything might improve performance)

cyan kernel
#

I appreciate the convo btw, been puzzling over this for months tbh

glass pilot
#

They also implemented BTT / BTS / BTD and EQS. With all these functionalities exposed to us in this manner pretty much anyone can create advanced AI in UE4

#

(Not even mentioning the combined power when adding PerceptionComponent and so forth)

cyan kernel
#

do you guys know any good examples like videos that discuss higher level concepts?

#

involving the behavior tree, tasks/delegates etc

#

the sequencer/selector

glass pilot
cyan kernel
#

yea I just finished all 35 videos of Wadstein's WTF is for all the nodes, and his AI videos, and the UE4 livestream videos on the subject to a degree

#

I guess I just have a mental block like what's something that would be hard for you to do in just BP that the state machine makes simple?

glass pilot
#

Well, if you wanna build appreciation for BT/BB etc I'd say try create a simple AI, like one that hides or something, do it in both BP and BT.
I've never been good at explaining why something is better to use than something else. All I can say is thanks to the current system in place I have some very advanced AIs running around ๐Ÿ˜„

cyan kernel
#

hmm good point, I've done some simple ai in BP so I guess just try to do it in BT instead

#

is it feasible to make some basic NPC behavior like patrol, interact, etc, the way I'd want to in BP alone, and then when something complex happens like combat, just run a behavior tree that would take over from there?

glass pilot
#

No idea, do you already have patrol and such in BP? I guess most people got patrol points and systems like that outside of BT & just tell the BT to go to next patrol point once one is reached

cyan kernel
#

well I wanna do some basic stuff for an NPC like he just lives in a tavern and spends his day getting out bed, going to the bar, and drinking there waiting to be talked to (multiplayer btw) so I don't really want him... thinking, or doing anything crazy, but if enemies attack the town, I want him to branch off and do some fleeing/hiding behavior

#

so the first part I feel like would be totally weird to do with a state machine

glass pilot
#

I'd say that be perfect for a BT to handle, just create an enum with States like `Sleeping - Drinking - Moving(between the 2?) - Combat (Triggered when town is attacked) - Social (If someone talks to him, trigger animations etc?)

#

Then specify what it's supposed to do during each of those states in branches

#

Drink - Loop Twice -> PlayAnimation(Burping) -> Drink->Loop 3 times -> Go to bed just an example here lol

cyan kernel
#

right

#

so you would use a selector?

#

and just check the time of day or whatever

glass pilot
#

You could use a Decorator if it's a simple check of bIsTimeAfterLunch?, if you wanna continuously check something a service would fit the need better

#

If I put it into context for you.
If my AI is in Combat state I might have a selector with a Decorator attached that checks if Target is alive (Target would be a Blackboard Variable),
then I have a sequencer withtasksuch as AttackType selection followed by attack tasks, the sequencer have a Service attached that checks distance between Target and itself, if to far it might charge, if to close it might flee

cyan kernel
#

how do you do that bold highlight thing btw?

glass pilot
#

` apostroph i believe it's name is

#

can also do *

cyan kernel
#

๐Ÿ˜„ thanks! and yeah that context definitely helps me see.... tbh I was sort of not understanding how you'd even pull of normal "if/then" stuff using the BT/BB

#

around the 'letter' yea

#

hmm

#

oh this guy

glass pilot
#

๐Ÿ˜„

cyan kernel
#

yeah that's not an apostrophe per se

glass pilot
#

You see English is my third language so I got a free pass on that hehe

cyan kernel
#

๐Ÿ˜„ nice

#

so for stuff like.... actually triggering the BT to change states, you would have a normal actor BP with its interface being interacted with from any player at any time, and the services on the BT are constantly/regularly checking those variables to see if its behavior should change?

#

hmmm

#

for its input?

glass pilot
#

Yeah there is a lot of stuff going on through BP too, but BT never checks any BPs. What you do is use the AIs Controller to call the BB and then update the values in there, when the values is update the BT will notice directly.
Usually the things that changes are through Enums since.. Enum is awesome when using BTs, makes everything easier. Unfortunately im not currently working on my project, but if I had to put it in context again this is a function within my AIController that triggers when the AIPerceptionComponent picks up any noise.

{
    if (!Blackboard->GetValueAsObject(TargetKey))
    {
        if (Blackboard->GetValueAsBool(NoiseHeardKey))
        {
            SetBTStatus(EAIStatus::Investigate);
        }
        else
        {
            SetBTStatus(EAIStatus::Patrol);
        }
    }
}```
cyan kernel
#

I guess I just was imagining the BB/BT as running exclusively without anything happening on the actor's normal BP

#

but I could have my event overlap and all of that happen on the bp, which changes variables on the bp, and the bb/bt picks it up automatically to process the change

glass pilot
#

Indeed, but there would need to be quite a few overlaps to get it working. Once BT is setup it will look clean and works as intended all the time. Unless your AIs walks around with an Overlap collision attached to them for stuff like Social state. In BT you would simply switch the enum once someone clicks on the AI and he would switch his behavior instantly to what you desire him to do

cyan kernel
#

right on

#

Ok since somebody mentioned the fact that behavior trees are used across the industry, I'm watching some general purpose behavior tree video and I realized what was confusing me

#

when one of the tasks under a Sequencer fails, how do you know which task failed?

long verge
#

hi guys

deft sedge
#

would I post about Nav meshes and level streaming here?

void stump
#

i was wondering maybe someone give me an awnser but how smart can game ai be because most of the time i think they are "overrated" and the people try to make them look smart even tho they are not. ๐Ÿ˜ƒ

deft sedge
#

@void stump as smart as you can program them to be, BUT this also comes at the cost of using processing power

void stump
#

how about behavior based on multiple variables ?

deft sedge
#

I'm not sure what your question is. Thats what AI is

void stump
#

yeah but in most games it seems like for example ai always enages the same way instead of for example behaves diffrently by the amount of players for example

#

is it simply "lazyness" then ?

deft sedge
#

you could partially chalk it up to laziness and partially chalk it up to time and budget.

#

hardware resources could play a factor there too

#

smoothness of transition could be another thing

#

and also desired gameplay and or the ai character itself is not meant to be omnipotent

#

could you give a game example you are referring to?

#

@void stump

void stump
#

oh there are tons

#

for example in division

#

and i have to say they are pretty advanced compared to other games tho

deft sedge
#

ubisoft is know for their ai

void stump
#

well in Rainbow Six Siege they are pretty "bad"

#

have u see them aiming and the diffrence between the difficultys

#

i think its not a god way of "first shot always misses"

#

good*

#

and they straight up look like a Aimbot user

#

i mean yeaah "doh" they are bots... but even them u can give them some kind of "humanity" xD

deft sedge
#

you have to consider that super smart ai aren't always the most fun to play against. They have access to a lot more information about the player and the game world and can react a lot faster and make choices a lot faster. Dumbed down ai can be intentional for sake of gameplay as well as other reasons mentioned before

#

for the division a lot of work went into that AI system and it can't necessarily just be pulled into a different game even if it is the same engine.

#

The division was made around it's single player while siege was made around it multiplayer. Both kinds of AI have vastly different needs to interact in those environments

#

not to mention a smart ai AND multiplayer is going to tax the hell out of a system as well as the things needed to be in place for AI to work with all players during multiplayer is a lot of checking and rechecking and always assuming that it's incorrect

#

so the simpler route is best sometimes

void stump
#

realy even for now days pcs ?

deft sedge
#

AI is taxing for sure

#

I'm a dev who works in all game fields besides music and from the AI development I've done so far I can say that you can't have very many smart AI without specific conditions being met.

#

Just getting 30 zombie AI in a level who wander to random locations, can see the player and get his location, can hear the player or things tagged as audible, and then also avoid geometry etc based on a navigation mesh has been a challenge without altering engine code.

#

The division has some very skilled coders with access to the source of the game engine as well as in house documentation on what does what within the engine etc is how they got to that level

#

our current day PC's are great at rendering a lot of stuff, our CPU's are still pretty taxed if we throw many entities all with their own complex logic network

#

you can alleviate some of the stress by multithreading in some possible situations but that is also risky if you don't have proper data management.

#

my own personal prediction is that we will have smarter ai by the time 6-8 core processors running with 4.0 Ghz base clock are commonly found in pc's.

#

Now, consoles are a different story because they have a uniformed architecture so it's easy to do some hacky work arounds for stuff and know it will always work because they are all the same console.

#

pc's may have superior graphics but they actually have to work a lot harder to get those graphics because of the architecture and how many differences in the available hardware there is out there

#

I'm a pc master race kind of person myself, but you have to appreciate what an Xbox playing dead rising can get on screen in terms of AI. A lot of them have logic trickery going on behind the scenes that ranges from disabling "thinking" to have a leader zombie do all the thinking and passing it to the nearest AI

#

theres a lot of trickery with blending things in with the crowd too

#

BUT STILL, thats a lot of stuff to have going on there.

#

if you think about things like RTS games, those AI don't all think or have logic. they are usually squaded together and have one invisible brain that handles it all.

#

We are moving into a new age of AI though with things that are being accomplished with neural networks and kind of in a way prebaking responses to situations

#

and then Data Driven Design is up and coming

#

I know this is a Unity video, but you could most likey achieve the same thing in UE4 with some tweaks and the use of Skookum

#

it's a lot to consider, but I think you are not aware of all the things that go on behind the curtain of the game on screen

void stump
#

Starkium i saw something being done on a Military Simulation where u could let a "headless" client connect the server wich was basicly another machine wich then handled workloads for ai for example over the network could we not load AI stuff on a Game that runs on dedicated server do the same ?

reef mist
#

can anyone help me with Ai hear sensing?

floral mango
#

@void stump well that's what happens for a lot of games. The Division, as you mentioned it, the AI runs entirely on the server

#

the main reason you don't see truly 'smart' AI in games, is that playing against really smart AI is frequently not fun. At all.

void stump
#

im not only talking about being "smart" but also do "random" stuff based on diffrent events that happend or how late it is for example i belive skyrim had AI for example who got in their houses at night at rest and stuff like that

floral mango
#

there are games that do that well, like AC Origins, there are GDC talks on their meta AI system you can look up

#

gotta remember with AI, that just the boring stuff like pathfinding chews up huge amounts of your resources

static stratus
#

@void stump read up game ai pro books, there are sections dedicated to that matter, you can browse open pages of 1 & 2 books on their official site

static stratus
#

its pinned in this channel btw, check it out

deft sedge
#

@void stump a dedicated server could do a lot consider that servers have a ton of CPU cores for you to leverage

void stump
#

soo in theory i could load all the ai handling on diffrent cores and let the server handle them instead of the user

floral mango
#

well, just putting things onto different threads isn't that straightforward

#

but running AI on the server rather than clients is pretty standard

rancid ember
#

Quick question in regards to navmeshes.. If I were to have destructible meshes/environments in my game world would that screw up AI pathfinding or does the navmesh update accordingly?

marble kernel
#

@rancid ember navmesh at least can be set to dynamically update. pretty sure fortnite uses it & you can find some dev videos talking about it.

rancid ember
#

@marble kernel Ah sweet, thanks mate. ๐Ÿ˜ƒ

harsh nova
#

When creating an AI character is it wise to switch between controllers in case you have different kinds of behaviours for your AI character ? Like say I want my character to just follow a path but when there is a distraction for him I would change the controller to make him do another set of behaviours.

floral mango
#

that's what behaviour trees are for

harsh nova
#

What do you mean ?

floral mango
#

you want to switch behaviour based on some kind of input? That's precisely what behaviour trees are for

harsh nova
#

No I want to switch between controllers when you have different behaviours =p

#

Or just create a behaviours tree with different set of behaviours and do not bother with controllers ? Just one controller would suffice ?

floral mango
#

you don't need to switch controllers

#

if the question is....how to have my AI do one behaviour, then switch to another one upon some stimulus.....then behaviour trees will do what you need

harsh nova
#

Thanks ๐Ÿ˜ƒ

floral mango
#

you could do it by switching controllers, but you'll quickly just end up building a finite state machine...which you'll run into the limitation of pretty fast

#

it's worth learning behaviour tree/blackboards. Once you get the basics, it's a very easy and quick way to build out AI beheaviour

harsh nova
#

Alright, then I guess one controller and one behaviour tree can cover almost all the AI stuff needed for an actor or character, thank you @floral mango ๐Ÿ˜ƒ

#

ALmost

harsh nova
#

Is it possible to have a behaviour tree working without a Blackboard ?

viscid oasis
#

I mean, it doesn't have to use BB Variables I guess?

harsh nova
#

Yes

#

Let's say a BT that does not require any variables to be handled would not feel the need to have a Blackboard assigned to it ?

viscid oasis
#

hmmmmmm no idea

floral mango
#

you don't have to use a blackboard

tropic socket
#

@deft sedge Hasn't Ryzen already achieved this?
The 2700x you can actually undervolt and STILL get all 8 cores running at 4ghz

#

something like 1.225v which is 0.175 below stock

#

6 core cpus have been in consumers hands for not too expensive prices for a while now but most opt for 4 core merely because nobody thinks you need a 6 core cpu to game

#

so its kind of this limbo where if devs aren't using more cores, nobody is going to buy a higher core cpu unless you're some kind of content creator yourself. But if the consumer base doesn't have the higher core counts, you can't build your game around it without scaling to the lower end.

obsidian raft
#

It does not explain much but I figured out pretty much everything but this node...

#

there is like 30 different ones but nothing seems to connect. anyone knows what the name is?

#

it was a equal object, It did not connect cose I forgot to break the hit result first ๐Ÿ˜ƒ fixed

deft sedge
#

@tropic socket I suppose just having an AMD CPU with more cores is an advantage in this respect regardless of clock speed. Pains me to say it though. I have a feeling something wouldn't work right constantly trying to multithreads on an AMD CPU, I don't know what, but its just a weird feeling.

#

also I'm an intel fanboy

#

if AMD keeps up the good work though I may build something with their stuff

tropic socket
#

Intel has had 6 core cpus for a while but only recently 8 core

#

Intel isn't doing so hot atm

deft sedge
#

6 is bare minimum in my mind to for everyone to start taking advantage of multithreading

#

and no they aren't

#

a lot of top dog company's aren't right now

tropic socket
#

it'll be an interesting next half decade. ill hold onto my 7700k and gtx 1060 until things calm down

#

multithreading is kind of a bitch though with shit like mutex locks and race conditions

#

but devs are starting to get better with it

deft sedge
#

there is multithreading exposed to blueprint already. Some guy made a simplified system for it thats only $5

#

IDK what i should do with my 3770k and 980 ti classified

#

I feel a little dated

floral mango
#

Every AAA game will be making extensive use of multithreading, it's not like it's new. Modern open world games like make excellent use of multiple cores, because they have workloads that lend themselves well to it

#

Because you've got layers of AI and other ancillary systems that are ticking away in the background and can update the game periodically.

cyan kernel
#

can anyone help clarify for me which components are to be used for sight/hearing on AI characters? pawn sensing and/or ai perception?

#

and if I need pawn noise emitter on characters or if I can just trigger a fire noise event without?

#

Somebody told me pawn sensing and the pawn noise emitter were phased out / not necessary on characters?

ocean crystal
#

You should be doing AIPerception, although you can still use pawn sensing

cyan kernel
#

so that's correct then, don't need to use the emitter for player character to make noise, just the fire noise event?

ocean crystal
#

IIRC @cyan kernel, the noise component interacts with both systems.

#

But yeah, use the perception noise thing

cyan kernel
#

lol ok ๐Ÿ˜„

flint trail
#

any good tutorials on AIPerception (but not for C++) ?

flint trail
#

never mind

flint trail
#

hmm.. found one but it's C++ ๐Ÿ˜ฆ

ocean crystal
#

High level stuff is probably useful.

#

Also if you're doing anything more than setting up the component you'll probably have a rough time of it in BP.

flint trail
#

@ocean crystal how come? Isn't AIPerception exposed to Blueprints / BTs fully ?

ocean crystal
#

Go make a new AISense, then

#

And you also can't programmatically configure a sense from what I could tell.

flint trail
#

hmm

#

so, what would be the best way to make AI to see/hear (if not hear then just see) player or other AI without using AIPerception ? (using blueprints and BTs only)

ocean crystal
#

Well that sounds like you can just use AIPerception.

#

You'd literally just be configuring a component and using that behavior.

flint trail
#

aye, cool

proud dew
#

So iv'e set up an AI using perception, behavior tree and blackboard. Works perfectly. The problem is if I add any more of the same AI to the scene, only 1 works the rest just stand there, even though it says they are running the correct behavior tree.

#

it seems like the service to select enemies is just only working for one, which is strange

viscid oasis
#

@proud dew you don't have them sync'd via BB do you?

proud dew
#

@viscid oasis Nope, got it fixed, it was in my target service, dunno why but it just was only giving one AI a target for some reason.

flint trail
#

How do I make AI jump from the floor to a platform, using BT? I got nav link proxy set up, but not sure where to go from there.

flint trail
#

anyone? ๐Ÿ˜ฆ

acoustic spruce
#

@solid wind ^^

flint trail
#

๐Ÿ˜ฆ

silk vapor
#

@everyone

flint trail
#

why tag everyone?! :/

cyan kernel
#

well hey folks.. I'm messing around with using AI Move To on my player characters to walk up to an object automatically. Just curious if I have to have an AI controller possessing the pawn, and if so, if I have to have the Player Controller Un Possess the pawn before the AI takes over? I'd like to be able to interrupt/cancel the AI behavior, especially if I want to use this just for general click-to-move behavior

viscid oasis
#

Possessing will automatically Unpossess a pawn IIRC

cyan kernel
#

hmm didn't seem to be the case with the way I was doing it, but just realized I could save a reference to the pawn and repossess whenever I hit movement keys on a controller with no possessed pawn ๐Ÿ˜ƒ

viscid oasis
#

๐Ÿ‘Œ

flint trail
#

I am back with that AI jumping question... How do I make AI jump from the floor to a platform, using BT? I got nav link proxy set up, but not sure where to go from there.

glass pilot
#

There is a lot of info in this channel covering it & even a tutorial by the looks of it

#

Use the search bar in the top right and search in: ai followed by jump

flint trail
#

ahh, I see.. Thanks

flint trail
#

ok, so far jumping tutorials either involve bizarre hacks (making step height huge) or use of triggers (why?!).. And a lot of Blueprint code. Isn't there a way to make service or something and have AI jump when it gets close to nav link proxy ?

lyric flint
#

What is the best AI technique for turn-based strategy games like Heroes of Might and Magic. Utillity system? Machine learning? Monte-Carlo Tree Search or MIn-Max wtih Alpha-beta pruning? Maybe somebody has an article, or a film (maybe from GDC) about creating AI for such a game. It seems to me that the utility system is a good and sufficient method in this case, but I'm not sure.

silk vapor
#

Any way of an ai detecting if a player is dead or not?

#

Or targeting different enemies based on threat level or distance?

patent hornet
#

yes to all of the above @silk vapor but you need to put in your own infrastructure for that, no out of the box solution

flint trail
#

back with my jumping question.. Is there a way to determine that AI is close to nav link proxy and then make AI jump?

fluid sequoia
#

@flint trail If you want to include behavior in a navlink then you need to make it a smartlink so that it can trigger an event for your pawn/character

#

I've heard that UT4 handles jumps by creating navlinks during the navmesh generation stage. Generating jump guidance in real time would likely require writing a new pathfinder and pathfollowing component.

#

Rama did a tut on doing physics calculated jumps in real time although the solution is a bit of a hack. There's a lot of ways to approach the problem, it depends on what end result you need.

flint trail
#

All I want is for AI to jump when it either bounces between random points (path_corners, so to speak) or when it pursues player.

#

(for now jump height will be fixed; eventually I'd need to find height of the ledge and adjust jump height)

#

currently I implemented for AI to walk between path corners, randomly (path corner is just a BP actor). For testing, I placed one to a platform that hangs not too far from the floor. AI approaches it and just waits there as if it actually got to the path corner. Then goes back to whatever other point it picks.

#

I guess I could have a trigger set up so that AI crosses it and that would make AI jump, but then I'd have to make sure AI always crosses it, no matter from what side it will approach the platform

fluid sequoia
#

yeah, the easiest approach is using a smartlink that goes to the pathcorner from the ground and giving the smartlink a jump event so that your character can get to the pathcorner.

#

When the actual path is generated from navigation polys, the pathfinder sees the navlink/smartlink and assumes that you've handled how the character will actually make it from A to B and so creates a final path with a disjointed poly (e.g. the path ends at the smartlink and begins again at the pathcorner)

#

If you need an AI to jump around fixed locations then that's the fastest way to handle it.

#

Getting AI to jump around arbitrary geometry is a lot trickier since you have to rewrite the pathfinder to understand how far your character can jump so that it generates a path with disjointed polys, and then you have to rewrite the pathfollowingcomponent so that it can calculate the necessary jump force and direction to make it across disjointed navpolys. I've been wanting to try this myself since I don't think there's much documentation on the subject ๐Ÿค”

flint trail
#

Is there a built in way for AI to understand what "ledge" is ?

fluid sequoia
#

yes actually

#

detour/recast pathfinder has a concept of ledges and perching on them

flint trail
#

is it exposed to BP ?

fluid sequoia
#

oof, sadly not

flint trail
#

๐Ÿ˜ฆ

fluid sequoia
#

the only BP exposed solution is smartlink

#

But entirely new behavior is source built only

flint trail
#

so basically I am forced to place some BP actor or trigger and when Ai is close to that BP actor or crosses trigger volume, run some BP code to calculate jumping height and distance and make AI jump ? (and same for jumping off the platform)

#

sadly I don't do C++

fluid sequoia
#

Yeah, 'basically', although it's a special type of trigger called navlink

#

which essentially acts as a bridge between two points A and B on the navmesh, even if they would be otherwise unreachable

flint trail
#

what do you mean? I didn't see any volumes/bounds when I placed nav link proxy

fluid sequoia
#

If the pathfinder tries to go from A to B using the navlink it triggers it impliclity

#

or specifically a smartlink

#

normal navlink doesn't send any events

flint trail
#

I saw point A and B, enabled smart link and made it bi-directional, but I didn't see any vo;lumes around each of the end points

fluid sequoia
#

It doesn't use volumes, it is triggered by the very pathfinder trying to use it to jump between two disjoint navpolys

flint trail
#

(I see in some videos there are transparent cylinders around end points, which I assume trigger volumes, so to speak)

fluid sequoia
#

actually scratch that, I don't remember whether you need to include trigger volumes

flint trail
#

hmm.. How does AI know where to jump then ? Let's say my ledge is 100 meters long and I only have 1 smart nav link proxy set in the middle. AI approaches somewhere in the first 2 meters of the ledge. How would it know it can jump ?

fluid sequoia
#

yeah handling a ledge is a big pain, the UT4 solution would be making a ton of equispaced navlinks across the surface of it

#

if you're doing it by hand then you would just have to place a few by hand

flint trail
#

so AI needs to be close to smart link in order for AI to know it can jump ?

#

do you recall what event in BP corresponds with smart nav link proxy ?

fluid sequoia
#

Take a look at the documentation here, you can use ReceiveSmartLinkReached in BP to handle the jump and then passback to normal navigation with ResumePathFollowing

flint trail
#

can't find anything in docs about respective BP node :/

#

AI is one of the worst and undeveloped area of UE4 ๐Ÿ˜ฆ

flint trail
#

f#ck it, I'll just leave jumping functionality out for now..

#

although thanks anyway

flint trail
#

@timid island any chance we can have AI training stream (in the very nearest future preferably) going over basic AI that idles, walks between random points, jumps on/off platforms using smart nav link proxies using Behavior Tree / Blueprints and no C++ ? If more content is needed, perhaps using AI Perception to react to player and chase player (involving jumping on/off platforms), and then run away from player to a random designated spot on the level (again, no C++ involvement) ๐Ÿ˜Š

#

@supple tree ^^

timid island
#

Great suggestion

#

Let me chat with Amanda, and see if that is something we can get on the calendar. No promises, but we'll take a look into it!

flint trail
#

thanks

grand atlas
#

What methods would be used to have an AI go through a door? If the door is closed, how would the pathfinding be aware that a door is not a thing that blocks movement?

#

Is the "trick" to just not have it block the navmesh generation?

fluid sequoia
#

@grand atlas This case is a good implementation for smart navlinks. A navlink will pass between the two sides of the door and form a complete path through the door. When a pawn/character navigates to the door, it activates the smartlink and does some behavior to open/step through the door (e.g. fixed animation), and once it has reached the other side continues with normal navigation.

grand atlas
#

Ah I see. Thank you, I'll have to read up on navlinks then.

flint trail
#

@fluid sequoia "When a pawn/character navigates to the door, it activates the smartlink" << how does it activate smartlink ?

#

there gotta be a BP function that checks if player is near by smart nav link

#

for me, smart nav link proxy does nothing if I simply use it to connect areas.. there gotta be some BP code involved and I can't find anything about that online

#

๐Ÿ˜ฆ

#

interesting

#

(although I think it involves C++)

silk vapor
#

@patent hornet well I just finished the ai detecting if the target is dead or not

coarse lantern
#

Hmm, is there any resources that goes into detail(dont think tutorial style) how modern AI is created? I'm having trouble getting believability into my AI(I'm going for enemy AI similiar to Dark Souls/Bloodborne) and while it's not that bad to get enemies to attack, I find it hard to get my AI to the "next level" so to say

foggy moth
#

@coarse lantern - alot of it is dependant on animations.... play some animations to fill gaps between events... other things to consider is randomizing MoveTo paths... and intervening those and applying a TakeCover task for anything ranged... so when the AI is attacked - or move to attack.... they dont stand there in the wide open saying "i'm gonna hit you sucka".

Alot of it is just process design - in my own projects/experience.... you have to think storyboards of encounters - and how you want them to behave.... then program it out. Nothing is automatic unfortunately

#

on top of the animations - playing some audio too - voice overs like "Hey look what we have here..." on an encounter initiation... adds alot of believability and sells the AI too!

coarse lantern
#

Walldiv, thats great feedback! ๐Ÿ˜ƒ

little oriole
#

I've been stuck for a while trying to get AI to work with the AISensingComponent ... I have an AIController that implements everything that needs to be done in C++ and I registered the Player Pawn but the OnPerception delegate, after it was bound, is not being called...

#

Anyone have any ideas?

fresh ridge
#

hey, i have some questions about ai relating to building in c++ vs bp, using the current behavior tree system would it be worth building tasks in cpp or what would I gain?

flint trail
#

now I got two questions - #1 is how to make him stop before he jumps and after he lands, and then continue moving toward the goal; #2 is how to make him stay still (and play turn in spot anim) until he turns to face direction of movement (after the wait at the goal is over and he bounces back to another goal)

#

(I am just getting into AI and BTs, so the BT I made is basically by following one of the simpler tutorials and building on top of that)

#

thanks beforehand

reef mist
#

I have a question.

#

On see pawn (pawn sensing) is only 1 time or happen everytime AI see the player?

#

its like happen 1 time for me

viscid oasis
#

Check your range.

grand atlas
#

Is it possible to disable or othervice manipulate navlink components during runtime? What i have is a door that affects (nullifies) the navmesh, but the character can pass through since it has a nav link. What I'm trying to achieve is effectively a locked door, and if the door is locked the pathing should ignore this nav link to find another way.

grand atlas
#

Hm, destroying the component when locking and attaching a new one when unlocking works.. but feels so dirty.

#

Preferably, the character would walk to the locked door (so I guess the navlink would have to be there) to realize that it is locked and then the pathing ignores that navlink.

grand isle
#

Is GenericTeamAgentInterface unstable? I'm experiencing some inconsistent bug. Thinking about ditching it.

twilit crystal
#

Anyone got some free time to run some advice with me?

lyric flint
#

Hi, I'm relatively new to AI and I'm reading the first edition of Game AI pro and I've been reading up on both utility systems and GOAP. If I was thinking of creating rimworld / dwarf fortress esque AI where the AI has personal needs but also has to work on tasks assigned by the player, would GOAP with some utility worked in be the best choice? And how difficult would it be to implement such a thing using only blueprints?

foggy moth
#

i gotta thank you for dropping this GOAP reference.... totally new to me but i love what i've read thus far! Going to be doing this in my project that i'm working on now - also a TopDown builder game.

grand atlas
#

Hehe, I'm also going at with with a "builder, personal needs" game, attepting GOAP.

foggy moth
#

some very interesting ideas/concepts here!

lyric flint
#

My main worry right now is how I want to handle the tasks being assigned

floral mango
#

@lyric flint @grand atlas there is a HTN planner lurking in the engine if you want to give a planner a go

#

or you can attempt to finish up my GOAP plugin that you're no doubt found if you googled the subject ๐Ÿ˜›

lyric flint
#

I did see a few come by, ill take a look at the HTN planner and a premade GOAP one :D

#

Thanks

coarse lantern
#

I'd love to have some kind of resources that go into AI consideration/design theories. It's hard to find "inspiration" from tutorials which are basically all "how to make it move and shoot"

stiff pawn
#

hey guys, i have a question about setting up some simple movement for a pawn with a FloatingPawnMovement component. I have a super basic level setup with a floor brush and nothing else on it. I set up a nav mesh on it that looks good. however, when I set up my pawn to, for example, move to my player pawn, it always fails with a "Blocked" result after 3 or 4 seconds, despite nothing i can see blocking it?

#

it moves towards me as expected, then just stops with 'blocked'

flint trail
#

what am I doing wrong ? (I have Print String that tells me that value of the bool changes appropriately)

wild mortar
#

If anyone could share their experience, what do you store in your BlackBoard?

#

I'm having a debate on whether I should store my variable in the BB or in my controller BP

#

And would like to see some good example of a functional, well organized BB with a mindset for optimization (avoiding bottleneck etc...)

#

Thanks in advance ๐Ÿ˜„

patent hornet
#

@stiff pawn use VisualLogger to record the session (Window>Developers>VisualLogger)

#

it will record any changes in AI/BB or Pathfinding, as well as all Pathfinding requests, which you can easily view later

#

a guess tho: whatever "me" is has bAffectsNavigation = true and is effectively removing a small piece of navmesh surrounding it, in editor it will be visible when you hit P to display the navmesh

#

@wild mortar mostly stuff that i want to access from BT goes into the BB

#

decorators can check for a BB value out-of-the-box

wild mortar
#

I have read that BB value does not replicate through network

#

thus, it is better to make sure BB are just cached/replicated state from the BP

#

Thus my thinking is instead of setting the BB value directly, the data flows from BT -> BP (controller) -> AIC -> BB. Is this assumption of mine true?

patent hornet
#

that depends, i rarely have a cause to replicate something AI Controller is using to make decisions

wild mortar
#

Oh, but to pass data from BP controller

#

since BP cannot access the BB directly

patent hornet
#

service nodes have a conventient way of setting the BB

#

in BT

#

and they are usually used to do just that

wild mortar
#

Does the data flow from BTS -> BP -> BB?

patent hornet
#

as they are pretty detailed and there is one for each element of a BT

wild mortar
#

i.e, grabbing the data from the BP via the service to pass it down to BB?

foggy moth
#

@wild mortar that is the case if you program it that way yes

#

you can set variables in your Pawn class - retrieve those vars in the BTService/BTTask - and set BBoardKeys from those variables... so you can navigate your BehaviorTree with these BBoardKeys

#

SErvices - are meant to run on TICK

#

Tasks are individual behaviors - ran per behavior node

#

IE: MoveTo is a task

wild mortar
#

I see, this clear up a lot! I have seen some people making "Setters" task instead of service, which is why I'm having a major confusion. I think your explanation clear it up for me.

patent hornet
#

i really do recommend watching the WTF videos

#

as they do cover the obscure bits that are not documented as well

foggy moth
#

i have a freally good vid series - 1 sec

#

lemme grab it for you

patent hornet
#

so even if you just haven't done AI in a while, they are a good refreshener

foggy moth
#

this got me REALLY FAR into AI

#

really good series - its 3 years old but still covers ALOT of the still-relevant concepts

wild mortar
#

This is great. Does this series also cover how to influence the AnimGraph instead of calling play montage like the other AI tutorial?

foggy moth
#

well that requires you to better understand animation pipeline as well....

#

because i'll be honest - PlayMontage is quite commonly used

wild mortar
#

Since I'm also transition from manually calling montage play into using the animgraph.

#

My thought process is

#

to use service or task that update the BP Controller

foggy moth
#

AnimGraph is useful for things that are repeatedly done - locomotion for example... but i dont build AnimGraph state machines for absolutely EVERYTHING....

#

i very much have a mix of both AnimGraph SMachine + Montage behaviors

#

montage is meant to override the animgraph

#

as well - you can blend it (UpperBody/LowerBody)

wild mortar
#

I see. So does calling the montage from a task an ok practice in general?

foggy moth
#

Paragon has an EXTREMELY COMPLICATED animation workflow.... you should look it up

#

i do that yes

#

and if you need to set bools form your tasks for AnimGraph SMachines - you can appropriately do so

wild mortar
#

Oh, from my experimentation so far

#

I have not been able to grab the ABP instance directly from a Task

#

but rather, I had to pass the data into the BP, then in the ABP's update, get the new data and apply it

patent hornet
#

you're not meant to

#

ABP has a reference to Pawn its animating

foggy moth
#

@wild mortar - that is the correct way to do it

#

specially if you get into MP and need to replicate animations graph via bools

crisp bone
#

Oh my fucktard. Where do I turn off AI strafing? I'm such an idiot - I can't find it.

patent hornet
#

movement component?

foggy moth
#

aye should be the MComp

#

perhaps even the controller (not in the editor atm)

#

but i assume the mcomp

patent hornet
#

yeah, it is a bit too specific to be in a controller

wild mortar
#

Awesome, thanks guys @patent hornet @foggy moth that was extremely helpful!

patent hornet
#

also, AnimGraph runs on separate thread

crisp bone
#

MComp?

patent hornet
#

so accessing stuff directly from there, instead of using BlueprintUpdateAnimation can result in warnings at best

#

your AI Pawn's MovementComponent

#

i do not think your question is actually related to AI, but movement in general

crisp bone
#

I don't see it in the CharacterMovement component inside the Player Character

#

(err sorry Enemy_Character I've made)

patent hornet
#

i am also not in editor

crisp bone
#

Damn. That sucks. There's nothing that returns a hit for "Strafe" in the CharacterMovement component search bar.

patent hornet
#

try Character class defaults

crisp bone
#

No, it's in the fucking Behavior Tree

#

Fucking fuck. Well, I'll have to remember that from now on.

#

Hmmm... shutting that off actually doesn't work.

#

Guess I'm not asking the right question?

#

So my enemy has a limited turn rate. Very slow. Just the way I want it. But when I have said enemy start accelerating - it's completely independent from what DIRECTION the enemy is facing. So it'll run at me with its ass while the rest of the model slowly towards me.

wild mortar
#

@foggy moth I just went through the tutorial you sent and it was super helpful looking at his blackboard. It seems like he has a very solid example that is has just the necessary bit. I will combine this and the advice from @patent hornet 's service video to make a workflow such that I will keep all the animation code inside my ABP, and have service tick to check for BP's data and pass it down into my BB, and make sure BB data are a copy/reference only and not the source.

#

Let me know if my conclusion above seems like a reasonable practice.

crisp bone
#

Basically I want movement to follow rotation instead of the current movement is directly towards the player regardless of direction enemy is facing.

elfin socket
#

@wild mortar Also check out the pinned messages for other good, recommended tutorials!

flint trail
#

What am I doing wrong? (The bool values are being set correctly)

wraith eagle
#

Is there an easy way to ignore any polys within the level geometry when getting a random point on the nav mesh?

#

I'm getting my AI to run to random points within the level to just test how well they can move around, but they keep getting given points within the level geometry, which obviously can't be reached

acoustic tulip
#

@wraith eagle Which function did you use to get a random point? If I understand your question right, you should be able to use GetRandomReachablePointInRadius to get a point which is on the navmesh and reachable.

errant maple
#

What's the best way to get an AI's distance to the player (behaviour trees)?

flint trail
#

make a service that gets the distance

foggy moth
#

it doesnt necessarily have tobe done in a service.... anything that you want to do it in will work... Task/Service/Blueprint

#

EQS

#

theres many different ways - dependant on your project needs & the time you want to poll the information

flint trail
#

@foggy moth PM ?

stiff pawn
#

So, still working out what's causing AI to throw the 'blocked' result. Here's what visual logger shows me. Not sure how to interpret this. The line you can see is the AI pawn's starting position on the right end, and the goal location is in the middle of the green cube. What should I be making out from this visual representation? The nav mesh looks completely unbroken.

patent hornet
#

looks like its treating the starting location the same as destination

#

acceptance radius for MoveToActor is not how close their locations get, or their root capsules

#

its the distance from 2 closest collision shapes, one on each Actor

#

and btw, even WidgetDisplayComponents have enough collisions on by default

#

to cause issues

stiff pawn
#

if they were getting close enough to their 2 closest collision shapes, wouldn't it report Success rather than Aborted or Blocked?

#

but yeah, these actors only have some static meshes (one is a sphere that's used for some get overlapping actors stuff, and has its channel set for that purpose) and a billboard, and they're all set to not affect navigation

#

everything else has collision off. in the level, literally nothing even has collision except the surface the pawns move on.

#

thanks for you assistance btw ๐Ÿ˜ƒ

#

is there some kind of limitations on how small a pawn can be and still use a nav mesh properly? these are really small, like 1.2 tall or something like that.

#

also, is there a guide somewhere about what all the default shapes and colors mean from the visual logger? the official docs basically have nothing about it that i could find, except on how to add custom ones.

patent hornet
#

you have navigation testing actors for in-editor... well, testing

#

just set one to reference the other and they will debug draw a path

#

you can play with their nav agent properties also i think

#

you can also pull a current path from the AI Controller directly, which contains array of Vectors call PathPoints, and just toss a DrawDebugSphere at each one

stiff pawn
#

thanks, i had no idea about navigation testing actor. i'll play around with a couple and see what i can see

#

does a red line between two nav testing actors indicate no path found?

flint trail
#

how can I abort Move To besides having a decorator with "observer aborts" set to "self" ?

#

like, AI moves from source to goal and I need to stop it anywhere in between

#

It seems that once Move To kicks in, it keeps rolling until the goal is reached

flint trail
#

nm, kinda sorta figured it out

snow harbor
#

Would binding an event in a BT Task be a good way to know when a task over time has ended? Anything I need to know about unbinding events or would that be handled for me?

fierce oyster
#

How to fix this on the 4.20p5 ? Anyone a tip ?

#

2>STrackerBot.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class TSharedPtr<struct FNavigationPath,1> __cdecl UNavigationPath::GetPath(void)" (_imp?GetPath@UNavigationPath@@QEAA?AV?$TSharedPtr@UFNavigationPath@@$00@@XZ) referenced in function "protected: struct FVector __cdecl ASTrackerBot::GetNextPathPoint(void)" (?GetNextPathPoint@ASTrackerBot@@IEAA?AUFVector@@XZ)
2>STrackerBot.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class UNavigationPath * __cdecl UNavigationSystemV1::FindPathToActorSynchronously(class UObject *,struct FVector const &,class AActor *,float,class AActor *,class TSubclassOf<class UNavigationQueryFilter>)" (_imp?FindPathToActorSynchronously@UNavigationSystemV1@@SAPEAVUNavigationPath@@PEAVUObject@@AEBUFVector@@PEAVAActor@@M2V?$TSubclassOf@VUNavigationQueryFilter@@@@@Z) referenced in function "protected: struct FVector __cdecl ASTrackerBot::GetNextPathPoint(void)" (?GetNextPathPoint@ASTrackerBot@@IEAA?AUFVector@@XZ)

pallid mica
#

Has anyone here worked with the UCrowdManager for large groups of agents?

shrewd swan
#

Is it possible to create ais for a pvp game hat fill unfilled matches?Just want to know if this is viable for the future

fluid sequoia
#

In some ways I feel it has become a lost art, lol.

shrewd swan
#

Ok. Just wondering, since I want to create a pvp focused game and was wondering about filling.

pallid mica
#

If you are only interested in the "filling" part, then yeah of course.

#

AIControllers have a Boolean in c++ to enable a PlayerState for them

#

From there on, if you spawn an AI, it will count as a player.

#

If you keep track of them, you can remove them when a player joins and spawn them if one leaves

#

@shrewd swan

#

The logic is something you've to add though

shrewd swan
#

Alright Iโ€™ll keep that in mind. I know just about nothing and have been following tutorials to try and get where I want to go. Thanks for letting me know itโ€™s plssible

flint trail
#

so I got my AI jumping.. However, once I made the level a bit more "advanced" and added more AI to it, weird things started to happen. Some AIs just walk off the cliff and some jump over, as expected
Any idea why it could happen ?
I made a base class for AI characters, which uses BB and BT. Then I made a child character off the base class and that's what on the level, walking around.

flint trail
#

oddly enough, if I delete simple links from smart nav link, the issue goes away (I tested for maybe 5 min and no AI fell off the cliff; while with simple links present 2 or 3 AIs would be gone in the first few minutes)

viscid oasis
#

maybe your AI is so smart that they've realised all life is futile and they've decided to end themselves? In short, you've created nihilists.

flint trail
#

lol

#

I've read somewhere that AIController doesn't work well with start links and that detour AI controller should be used.. Not sure what to think really.

viscid oasis
#

detour AI?

plain mica
#

Anyone know what the state of AI perception is in 4.19? Its hard to find proper documentation on it - has it been deprecated?

icy night
flint trail
#

Is there a built-in Task to have AI to face target actor before running Move To?

flint trail
#

anyone ?

coarse lantern
#

@flint trail isn't that the Focus task?

flint trail
#

no idea, but I'll check. Thanks @coarse lantern

coarse lantern
#

Still doing my early steps into AI, but I found the WTF Is? videoes very nice

#

Didn't know services were a thing until I watched them ๐Ÿ˜„

flint trail
#

that's what I did at first, but after I dug a bit deeper I found that some of his AI vids are flawed. Kinda teaching to do things wrong way (or maybe because older version was used; or both)

viscid oasis
#

@flint trail oh, like what?

flint trail
#

some minor stuff

#

@viscid oasis how do you make AI turn on the spot?

viscid oasis
#

Lemme dig up the code

#

do you mean like rotating via a lerp or literally rotating in a spot?

flint trail
#

What's the difference ?

flint trail
#

I mean, regardless, character will turn on the spot.

#

I actually tried RIterpTo yesterday and it looked like it worked (but I was half a sleep, so I need to test it when I am not half asleep) ๐Ÿ˜€

#

The rest would be setting an anim to play in the AnimBP

#

I only asked because I don't know if there is any other way to turn character gradually. All BT built-in tasks snap angles and don't offer options for gradual rotation.

covert carbon
#

hello guys i am doing navmesh cuz its not working when loaded sub-level then using console show navigation i cant see green area. whats wrong? ๐Ÿ˜ฆ

#

i tried P-level added nav bound and actors then deleted sub-levels navs still not working

#

(Btw already setted dynamic runtime)

foggy moth
#

@covert carbon - are you ensuring that your NavMesh encapsulates your landscape/staticmesh that is your "FLOOR" ?

covert carbon
#

yeah

foggy moth
#

typically done by setting its X, Y, Z sizes manually

#

in editor (NOT IN PLAY MODE) hit P key

covert carbon
#

i know before working on One Level. But then Added sub-level now not working

foggy moth
#

if that doesnt show up - hit G key (GameMode - still NOT IN PLAY)

#

have you done the level streaming setup?

#

the other contents of the SUBlevel map show up?

covert carbon
#

yeah Load level system done

foggy moth
#

then i'm unsure.....

#

i dont do level editing unfortunately ๐Ÿ˜ฆ

covert carbon
#

kay i trying some idea

foggy moth
flint trail
#

right, but isn't it C++ only ?

#

I only work with Blueprints ๐Ÿ˜ฆ

#

and feed a timeline into alpha

#

@foggy moth ^^ would that be the same thing as FRotator ?

foggy moth
#

again - this is a variable of the CharacterMovementComponent - which is (near)fully accessible/exposed to blueprints

#

you should eb able to select the CMC and find the RotationRate variable in it

flint trail
#

ooh, I see

fluid hollow
#

So I have this behavior tree, and for some reason, once it finishes one full sequence, it stays at the root.
all the selectors currently line up to go straight down the BT, as seen in the pic. All the conditions pass, and yet, it just stays at the root. Any ideas?

snow harbor
#

Seems like there's not very good docs on the perception component and a lot of stuff out there's out of date. :/

#

So is the setup to use on Target Perception Update and store the stimulus and keep comparing it to the previous stimulus to see if it's better or to discard it...? Basically?

#

So i had assumed that the update would get called again when the target has expired but it never does, also it appears the Age in the stimulus is always 0, but the Expiration Age reads the max value, do you have to manually set a timer and manage the expiration yourself?

foggy moth
#

@lofty void - i too code almost 100% in c++ and find that i do all the Services and Tasks as much as i can in C++... the behaviir tree is solely graphical interface to piece it together... unless someone from epic is gonna come here and say otherwise.... ive not been able to find one resource that says otherwise.

Same is said with animgraph for state machines workflow

viscid oasis
#

@foggy moth you do your EQS stuff in CPP too?

#

e.g. context tests

worn yarrow
#

hi have anyone figured out why Navmesh is being force to build regardless of dirty at the beginning of runtime?

#

a small dirty , would rebuild entire world for some reason

#

asked this a long time ago.... nobody seems to have an answer on it

snow harbor
#

For AI Perception, what does strength even mean? No matter what I do every perception event stimulus always seems to be Strength: 1

#

Okay, so the Loudness for Make Noise does affect strength, but how do you affect strength for Sight sense? Like say, certain things on sight should take higher priority. Perhaps a big enemy is more priority than a small one. Or a closer one is more priority.

foggy moth
#

@viscid oasis - i'm moving towards EQS C++ systems yes - my project i'm currently on i'm actually JUST NOW doing an EQS system for some actors code

flint trail
#

Is ESQ exposed to Blueprints?

foggy moth
#

EQS as far as I can see is mostly exposed yes @flint trail

flint trail
#

Nice

wild mortar
#

If I use the RunBehaviorTree node from within a Behavior Tree

#

which BlackBoard does it use?

#

Will it create its own instance of blackboard based what has been assigned

#

or will it carry on with the blackboard from the behavior tree that called it?

wintry compass
#

Hey, all! I'm not new to unreal, just pretty new to ai. ๐Ÿ˜„ I have made some pretty simple ai before, nothing fancy; enemies that will follow me and attack when they get close enough. I have been trying to figure out how to make a pet/taming system, but I haven't been able to find any sort of advice or tutorial. If anyone has advice or knows of a tutorial that would be great! Thank you!

foggy moth
#

@wintry compass - for starters - the player would own the pet after its tamed/spawned... so you'd have direct access to its class and RPC events as well (MPlayer). As for the AI - i wouldnt see it having much AI behavior tree - unless you put it on Aggressive.... anything Defensive would react on the Player's TakeDamage() script in my opinion.... unless the pet itself drew aggro (NPC Sight/Sound from enemies) and would react accordingly.

I guess just planning out your scenarios would be best..... you can program it quite easily if you think about what you need to do & when

#

@wild mortar - Behavior trees can run on top of eachother... and you can also stop them via Code - UBehaviorTreeComponent::StopTree() - however this isnt apparently exposed to BP's so you'd need to write up a custom function BlueprintCallable to pull this off.... It says nothing about RE-INITIALIZING any blackboard after doing this - so i guess play around with it.....

I unfortunately dont have experience with doing different BTrees - though i like hte idea and probably will try to adapt this workflow sooner than later ๐Ÿ˜ƒ

#

Good luck!

wild mortar
#

Cool, thanks @foggy moth

wintry compass
#

Okay, thank you so much! That sound really good! @foggy moth

waxen junco
#

hey could I get some help with something simple please

#

basically Id like to essentially reverse the ai move to script, so that it runs away instead

#

any help?

heady arrow
#

Just get the away location and use move to for that

wild mortar
#

I'm very new to EQS in general

snow harbor
#

How can you make a decorator only run once and not repeatedly while it's children are running?

snow harbor
#

In a decorator, what's the difference between Observer Activated vs Execution Start and Observer Deactivated vs Execution Finished ? The documentation is vague.

#

As far as I can tell they seem identical; both get called every time that branch of the tree is reached / left.

snow harbor
#

Nevermind, I think I get it now. Hopefully someone can confirm. I never understood the point of a Decorator that doesn't abort, I thought it would basically completely ignore the result of the condition check if Abort was set to none. My best guess was maybe you want to do some check which can maybe end up setting some values but doesn't actually abort... but it didn't really make sense to me.

Now it just clicked, unless I'm wrong: Abort is only for while the children of that branch are running. It will still fail to enter that branch if abort self is none. That is basically the "check once when entering this branch" logic that I was looking for. Hopefully I have that right? :S

wild mortar
#

@snow harbor you can use a doOnce gate

snow harbor
#

@wild mortar The problem with that is that the Condition Check still gets called repeatedly, and you have to return from it. I think if you don't return then it always assumes false. I wanted to only have the Decorator get called on attempting to enter that sub-tree, but not continuously, for example, as a child MoveTo task is running. This is actually the default behavior of Decorators, i.e. when Aborts is set to none.

It was just my false understanding of the Aborts option that got me confused.

After more testing and finding a forum post that seems to confirm it, I'm pretty confident about that now. Here's a UE developer (Daniel Broder) explaining it more: https://forums.unrealengine.com/showthread.php?130-Behavior-Tree-Tutorial&p=5946&viewfull=1#post5946

wild mortar
#

Awesome, thanks for the resource!

scenic ledge
#

has anyone worked with perception and hearing?

#

it may seem like a silly question but I was wondering how exactly loudness vs maxrange translates in AActor::MakeNoise

#

loudness is between 0-1 that means a close up explosion is 1 while a footstep is 0.1? or 0.005?

wary ivy
#

up to you I suppose

#

you're the one who's programming the response behaviour anyway

cyan kernel
#

Anybody up this early? I'm possessing my pawn with its default controller and telling it to AIMoveTo on mouse click, with a shut-off on movement keys. However, when I click the mouse before completion, even tho I have a "destroy actor" on "get ai controller" before running new MoveTo code, when I hit movement keys to cancel, the new AIMoveTo won't get shut off. Is it possible to be possessed by multiple AI Controllers at a time, somehow do a "for each" on them?

#

Ok so my second mouse-click starts walking to second location, and if I destroy controller it keeps walking towards point 2, but if I click a THIRD time, it cancels everything

#

:smh:

cyan kernel
#

hey nevermind I was able to figure it out ๐Ÿ˜„

#

a long time ago :x

flint trail
#

when my AI moves to a random target (final target, so to speak) and encounters smart nav link proxy on its way, AI jumps while facing final target the AI was walking toward to. Looks weird. How can I make AI face nav link's end points while it's traveling to the final target ? (I am using Move To task in the BT)

#

how would I rotate character movement component to an intermediate target while it's doing Move To the main/final target ?

raven leaf
#

Hey guys! I'm not really asking for help - I'm asking for an explanation as to why this bug happened....

When I used 'EventReceiveExecute', the AIs couldn't function and stood still, the BT would freeze up.
When I used 'ExecentReceiveExecuteAI', everything works fine.
Thoughts?

primal galleon
#

anyone here work with these new fancy deep learning algorithms? i see there's a plugin for tensorflow, wondering if that will meet my needs for my game.

flint trail
#

anyone ? ๐Ÿ˜ฆ

patent hornet
#

setfocus and using controller's yaw should work

waxen junco
#

@heady arrow but I want it actually running away consistently not just to a place

flint trail
#

@patent hornet what I have is a selector, which leads into one brach that has sequence of Move To and Wait (moving to target) and another branch is a custom Task for jumping. Do I just drag off a new task off the Move To task and have focus/yaw set in that task ? (at work right now, can't mess with UE4)

lyric flint
#

@raven leaf The more suitable method is called if both are overridden. So I guess you had ExecentReceiveExecuteAI without a body. (I think)

raven leaf
#

@lyric flint Should all my tasks be running on execute AI rather than execute?

lyric flint
#

@raven leaf Just started learning AI myself so I have no idea ^^. But I want to say yes if the task is intended for AI since it makes it clear.

raven leaf
#

Guess its better to be safe than sorry. Thanks ๐Ÿ˜ƒ

lyric flint
#

anyone know why my AI moves in a standalone game, but wont move in a packaged game? i'm using the FlyTo node in the don3d plugin. i did some research and found that "get blackboard value as vector" may not be working in my Behavior Tree

flint trail
#

hmm... So I tried making AI face nav link proxy so when it jumps, it faces the direction of the jump (tired using focus node in BP and RInterpTo) - sometimes it seems to work, but sometimes AI completely ignores the task (I run custom FaceDirection task before Jumping task).

long verge
#

Guys can anyone tell me how to properly implement aging of perception stimuli?

#

I just can't get it to work

#

The age always returns 0 no matter what I do

ocean crystal
#

Is this for currently perceived actors?

long verge
#

Yeah it might be my poor understanding of the perception updating mechanism

ocean crystal
#

Well, take sight for instance

long verge
#

But I just use ontargetperceptionupdated

ocean crystal
#

every tick, if you're visible

#

It'll generate a new stimulus for that actor and sense

long verge
#

That makes sense, can you tell me the difference between onperceptionupdated and ontargetupdated?

ocean crystal
#

So if you're getting an age of 0 even if you go undetected, that'd be odd for me.

#

Maybe I have a misunderstanding - I'm sure I'll be corrected.

#

Offhand, no - sorry.

#

I can look at it and tell ya, but I wont be doing that tonight.

long verge
#

Well I presume that target only registers one actor that has been perceived and perceptionupdated returns all the perceived actors

#

But basically my problem is that I can only register perception once, meaning that when I move into the visible half angle of the actor that should see me it senses successfully

#

and when I move behind an object it does the same

#

but in between

#

It does not seem to update

#

I would assume that somehow as long as age != max age, you should be able to update whatever you want to update every tick

#

But I can't get this to work

#

drives me nuts

lyric flint
#

Are cameras any expensive when not being used? My bots will have more or less the same functionality as the player but I'm wondering whether I should get rid of the camera on the base character class I'm using and have it strictly on the player character

flint trail
#

@timid island @supple tree do you folks happened to have that internal conversation about AI training stream by chance ? ๐Ÿ˜Š (wondering if we get lucky to have AI stream tomorrow)

flint trail
#

Is there a way to make AI slow down before it stops? Right now it seems to simply stop abruptly when it reaches the target

flint trail
#

Googling reveals that deceleration when using Move To task isn't even working for AI?! What kind of BS is that?! True or false ?

flint trail
#

anyone ?

#

๐Ÿ˜ฆ

timid island
#

@flint trail We don't currently have one scheduled, but we'll see what we can do!

cyan kernel
#

G'day folks.... anybody know why in multiplayer, on client-side, when I unpossess a player character before spawning default controller to perform an AI-Move-To, after a few seconds the character freezes on client-side and goes stuttering around on server side? It happens a good 4 or 5 seconds after I perform the unpossess/spawn controller, and otherwise all the move-to etc works fine, I can even re-possess it by the previous controller and can "get controlled pawn" successfully to do custom events even tho I'm unable to move

#

the default controller I'm spawning is a child of the ai controller and I'm using get ai controller for it

flint trail
#

How do I make my AI Characters to steer around each other? Currently they just bump into each other and rub until they manage to go free from each other

lyric flint
#

hey guys fixed my ai problem from earlier - i had to use floating pawn component in the actor to move him around. the problem was i had two movement components, one from a plugin i downloaded and FloatingPawnMovement. when i deleted the additional one my ai moved in a packaged game.

vale snow
#

can I get help with ai not moving? I put down a navmesh

patent hornet
#

try debugging it with VisualLogger @vale snow

#

Windows>Developer>VisualLogger, record the incident and you will have a timeline with blocks that have all AI/Pathfinding requests as well as BB information in them

foggy moth
#

also @vale snow - make sure your AI are SPAWNED or PLACED setting for their AI Controller Assignment.... that way theyre assigned a controller when theyre alive in the world.

vale snow
#

oh thats IT

#

nope, still not working

#

I'm gonna come back to it in the morning

boreal moss
#

Hi. Anyone can suggest me good MP based AI behavior tree tutorial?

grand atlas
#

What methods can be used to have the pathfinding consider world states? As an example, in an RTS with gates, the team owning the gate, its units will navigate through it, where as an enemy unit will try to navigate around it?

patent hornet
#

try NavFilterClass @grand atlas

flint trail
#

Do I need to use EQS with AI Perception ? In what cases one would use EQS ?

flint trail
#

anyone ?

patent hornet
#

watch that

#

its a good example of AI Perception and EQS

flint trail
#

right, but that's not what I am asking

#

from what I already gathered online, EQS is there to find actor / location and determine whether it's visible (or complies, so to speak, with a certain rule)

#

why would I use EQS vs doing it in BP ? Faster? More convenient (and is basically eventually will be a standard way to find things / run rules tests) than BP ?

ocean crystal
#

Latter, potentially former as well.

#

Perception should be processing stuff also, EQS isn't required for it

flint trail
#

I see, thanks

random ridge
#

anyone know why when I click to move onto the raised area it paths to the side of it?

grand atlas
#

The navlink is causing it.

#

The navlink is an indication that a character can path there, but it gets stuck on the side because it can't get up.

random ridge
#

I have set the navlink direction to right to left