#gameplay-ai

1 messages · Page 170 of 1

ocean wren
#

I'm creating the UI right now, using PyQT which is just that nice mix of hateful python and hateful gui coding 🙂

main heart
#

well if you halfta label code hateful, then those are not code lines in the first place

#

could be some scratch pad fart

ocean wren
#

its python, its ui, of course its hateful

main heart
#

goccha

ocean wren
main heart
#

yeah

main heart
#

Shouldnt Elon buy Linkedln now

wheat arch
#

so here's a new question.

#

my coder is concerned about the number of AI running around in a multiplayer open world game and suggests multiple cutbacks to make it feasible

main heart
#

ok

wheat arch
#

exactly how many AI does it take in a players vicinity to start clogging a server

main heart
#

aha

#

what are your projected logistics?

wheat arch
#

could you elaborate or define your question a bit more?

main heart
#

precisely

wheat arch
#

?_?

main heart
#

could you stop being dumb

wheat arch
#

there's no need for that man.

main heart
#

lul

wheat arch
#

gunna answer my question or be smug 'cowboy'

main heart
#

dm

#

your question is incomplete

#

so much that it hurts to know it even exists

wheat arch
#

it's a perfectly simple and straightforward question.

main heart
#

have you copied it ?

#

from your it team

#

I mean "coder team"

wheat arch
#

you get stuck up on an online date or something? that why you're acting like an asshat

main heart
#

lul

wheat arch
#

I simply asked how many AI in the scene would start to show signs of things breaking down.

#

if you can't be assed to answer, then don't.

#

take your shitty attitude somewhere else.

main heart
#

if you cant read answer then dont post query here

#

@peak creek

wheat arch
#

yes, please, bring them here.

main heart
#

who?

wheat arch
#

Aha, wow. all you did was ping some random guy with the user 'admin' and you call me dumb. <@&213101288538374145>

pine steeple
#

@main heart If you can't answer the question in a productive way, you don't need to reply. Read #rules 1

#

@wheat arch normal traditional AI, does cost quite a bit. I had to do serious optimization to get 200 AI to be working, etc. If you want a lot of AI, then i would look into MassAI (new in UE5). But without optimization you are looking at a pretty low number.

main heart
#

Scooby I dont know if you are following the chat history

#

@wheat arch has failed to answer the logistics

#

and it be better if you check that

knotty dawn
#

and you failed to answer/reply in a professional manner.

main heart
#

who are you

knotty dawn
#

an admin.

main heart
#

well learn to read history first

#

and stop crowding

#

One admin at a time

#

dont gangup on me

#

lul

#

too long

#

cut them

fair zealotBOT
#

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

wheat arch
#

I don't mean to be inappropriate about this but, me and my coworker are thoroughly enjoying this

wheat arch
knotty dawn
#

If you have a bad day, go outside, enjoy the weather, listen to some birds, and come back reenergized and with a positive attitude.

wheat arch
#

massAI is purely for UE5 as well, isn't it

#

somewhat raises the question of how ark managed to get such droves of AI in the world map. was that simplified AI or some smoke and mirrors?

tribal drift
#

Odds are only ai by a player is running, and in that case there isn't a tremendous amount in most cases.

wheat arch
#

if I'm to assume that alone was a huge feat and if I wanted to replicate anything even remotely close to that (and I don't, but it gives me an idea of what I can and can't ask of my programmer) what kind of things are there to consider, what hurdles are there

#

honestly the whole purpose of my asking all of this is to get a correct scope and understanding in which I can plan ahead with

tribal drift
#

I'm saying there aren't as many ai running as you'd think. Most are turned off or simulated if a player isn't by them. And the tamed ones have very limited and controlled ai, most likely still subject to player view. The biggest trick is only touching what immediately impacts a player. I'm not an expert in Ark's implementation, but I feel like you might be giving them more credit than is actually applicable. Also the way they lag out massively is probably deeply tied in.

misty wharf
#

most likely in something like ark you cheat

#

nobody sees the AI? it doesn't exist

#

the AI is far? it doesn't actually do anything complicated because you can't see it with that much detail

tribal drift
#

Honestly even up close Ark has some of the most basic ai I've ever seen.

#

But it's dinos chase you, doesn't need much.

misty wharf
#

Yeah

tribal drift
#

And they do lag out massively... so I'm not sure they'd be my go to example even with that. At least on consoles.

granite vault
#

I just went to take a look at Ark. Very less AI dinosaur. Like only 1 or 2 in an area. No issues. Unless you want more than what Ark has? Even double is still fine.

tribal drift
#

Yeah maybe 4 tops until player bases get big. But then you see massive lag and companion ai has very little going at any time. Hence dead when attacked.

#

Sit boy takes up 0 brain.

timid condor
#

Since I've been meaning to optimise AI in my project recently, are there any specific ways to do that? Where the AI kind of disables itself based on distance?

wheat arch
#

what about keeping track of where they are

#

for example, a skeleton with a bunch of gear that you've already damaged and you want to come back to finish him and get what he has

tribal drift
#

I honestly feel like animal behavior kit from Coqui games is pretty good about walking through optimizing ai how and why. But he runs a sphere with an actor catch, then looks for player tag, disable if not there. Check every so often otherwise.

#

There may be better ways, seems like there are almost infinite tricks in this game.

wheat arch
#

so let's refine my question a bit and close the gap

granite vault
#

But remember. The more you add, the more your server cost increases

wheat arch
#

how many active AI can you get before it just goes splat

tribal drift
#

Depends on the cost of each ai

#

And the system

#

And the position of the moon ;)

#

Sorry that's a joke.

wheat arch
#

could you give me a rundown of how you calculate an AI's cost? is it based on how much logic they have, what tasks they do, the patrol route

#

what consists of an AI's cost

#

I also really really appreciate all the help here guys educating me

#

thank you ❤️

tribal drift
#

Exactly the heart of the problem. Everything you do and show has a cost.

celest python
#

If you dont render and move them all at once you can manage it by behavior LODding etc

tribal drift
#

And the cost is based on the cost of what you're working with, bad logic, bog it down in no time with BP loops

#

One bad ai could lag a system solo tbh.

celest python
#

Just remember, any type of high count of anything and optimization work for that requires dedicated engineer(s) because you have to end up optimizing low level code if you want to go further

#

What Kaos did is crazy stuff to run 200 AI at once

#

It also took a lot of time and tons of R&D

tribal drift
#

I don't even want to imagine, but any links to anything on that?

#

Yeah you'd have to be so optimal at such a level, we get lucky as hardware keeps growing though :).

granite vault
#

But since he does multiplayer, i think he should consider how much he can pay first.
If you are rich and can run a heavy beefy server then only thought of making large amount. No point trying to make a lot when you cannot pay.. if this make sense

tribal drift
#

I think with this it's practice at small scale unless you're getting paid to play with the big boys.

celest python
tribal drift
#

Yeah, always love finding out tricks especially towards those kind of levels.

celest python
#

Hmm, I have some archived messages but I just woke up

#

Give me ten minutes

tribal drift
#

Lol totally understand

#

I wanna go back to sleep myself. Anytime is fine.

timid condor
celest python
#

He only explains visible stuff there though 😄

#

Real stuff is on CMC optimizations he made

tribal drift
#

He has a pack on the marketplace, but yes his tutorials cover it.

#

Yeah that too, he's got quite a bit back end.

#

But if you're looking to start, that's a good place to start imo. Don't need everything in a day.

#

One question leads to another.

celest python
harsh storm
#

My guess would be as such:

  1. Do logic LODs - use simpler logic the further out the player is
  2. Different tick rates - reduce tick rates the further out they are
  3. Animation sharing plugin - help reduce some animation cost (which frees up time on the gamethread)
  4. Have less scene components on the AI - the more there are, the more costly it is to move something
#

Then, if you're using navmesh, there is a lighter mode of walking around that you can use that might help as well; navmesh walking.

celest python
#

MassAI seems to be able to make 1k of pawns move without any visible frame rate drop but it also relies on what Durxxigar summarized -- besides being DOD/ECS

#

Also it's pretty experimental

harsh storm
#

At least, these would be the things that I do to get 200+ AI running around on a server.

tribal drift
#

Haven't played with it, but Unreal keeps pushing the edge, pretty impressive no lies.

wheat arch
#

I'm definitely going to have to try and figure out how to truly fit everything together..

celest python
#

You said you have a programmer and you are collecting info for them right?

wheat arch
#

nahhh I'm doing my own checks

celest python
#

Oh sorry then, not sure where that came from 😅

harsh storm
#

I mean, I just gave you a solid check list to investigate to push things.

wheat arch
#

I have a coder but as a good habit to have I double check for what they say can and cannot be done

celest python
#

Well, then first of all do your design plan properly, know the limits of the engine and your budget, then keep profiling of target hardware

wheat arch
#

too many times I've dealt with people lying about what's possible because it's hard and they don't want to do it, or they don't know how to, or they just don't think it's worth pushing the boundries if there is too much likelihood that it will fall down later on

#

not that he's anything like that though!

#

I just like to do my own checks.

celest python
#

I wouldnt aim for 200 AI for my first game

wheat arch
#

I'm just the environmental artist guy and storyboarder.

#

oh no way in hell am I gunna get 200 AI

granite vault
#

Singleplayer is fine with any amount he wants to aim.
Multiplayer is different beast

celest python
#

Singleplayer is not fine with any amount though, both is limited to how much pawn you want to render at once

wheat arch
#

but I was hoping for something along the lines of like 1 player gets a max of 5 follower AI, 2 pets, 1 mount, and 1 mount per follower

#

but here's the hard part

#

open world. so.

granite vault
#

I agree there are limits. It is just that multiplayer has so much more limits

wheat arch
#

30-50 players

#

if we can

celest python
#

One way or another everything is up to engineering team

#

I wouldnt even try to accomplish high count AIs or open world with non professional programmers

wheat arch
#

mmmmm...

#

how far can I stretch the limits with a good server setup

#

let's say it's a medium to top end machine for a rack slot

celest python
#

Dunno 🤷‍♂️ Up to how much budget and skilled team you have?

wheat arch
#

I haaaave

#

one of each department

#

that's it haha

#

we're a micro team.

celest python
#

Do they have previous experience with shipped games, or any type of familiary to back end architecture of open world games?

wheat arch
#

it's only one guy for all blueprints

#

and he has an impressive background in AI and made all the pawn logic for a moba with all the bells and whistles

#

but not a lot in the ways of open world I don't think

#

brb, at work currently and I've got time for a smoke break. gotta love graveyard. keep typing though this is good to know

celest python
#

Well you can't stretch the limits with blueprint only, why do you want/expect something big from a micro team

#

It's not like I'm saying you can't accomplish anything or so, but you gotta understand both high count of AI and open world systems require high skilled engineers

#

Not coders, programmers, "engineer" is something different

misty wharf
#

Ehhh, coder/programmer/engineer is pretty interchangeable terms :P

celest python
#

Eh, you're right 😄

#

What I'm trying to say is industry experience

misty wharf
#

But there is that nuance there which I assume is what you're suggesting, you need more rigorous systems design for something big and complex which means you need a decent bit of experience

wheat arch
#

I understand what you guys are saying, I do

#

I just need the basics though. it's a post apocalyptic medieval world so I can certainly make the AI count low but I need combat to be fun and engaging, I was just really hopeful I could get maybe 5 ai followers per player (at least in singleplayer or something) and then go from there. which I probably can to be honest

#

BUUUUT it will take time.

#

hey. do you guys think they really spent 1.5mil on ark back in the days of release? that's what they claimed I'm pretty sure.

harsh storm
#

Perhaps. Games are expensive to make. Shovel knight was $1 million-ish.

wheat arch
#

shovel knight?

#

bullshit

#

S H O V E L K N I G H T ?

harsh storm
#

Yes.

wheat arch
#

1 million

simple crest
#

Why are you surprised?

wheat arch
#

because it's so low budget, the mechanics aren't that special looking

#

from an art perspective which I come from, it doesn't make sense

#

coding wise it doesn't seem all that impressive

#

so I'm just like

#

whaaaaaaaaa?

harsh storm
#

This is just what the devs said.

wheat arch
#

"Shovel Knight's budget was $3 million, although its actual cost is a little hazy as Yacht Club Games members ended up giving up their own salaries to fund the project."

#

that's just

misty wharf
#

How many people were involved in that project?

wheat arch
#

dumbfounding

#

I really don't understand

misty wharf
#

With 10 people you could pretty easily hit 1 mil in a year already

misty wharf
#
  • office costs etc.
#

employees aren't free you know, that's how :P

wheat arch
#

I've spent about 15-17k as it stands now on my project and we're probably a quarter of the way through, at least for the demo stages and getting things properly fleshed out

harsh storm
#

Yeah, games are expensive as hell to make. Which is why it's such a longshot for small hobbyist teams banking on revshare to actually succeed.

simple crest
#

How much are you each being paid per hour?

wheat arch
#

and we're full 3d open world with retro styled graphics similar to what valheim is doing but not as cartoony and a bit more detail

#

everyone is getting 15 an hour, I don't give myself any of the money because I'm the primary funder

#

but we don't even work that much, everyone is part time

#

we do 8 hours each

granite vault
#

5 days a week?

wheat arch
#

just 8 hours a week however you wanna accumulate it

misty wharf
#

15 an hour is not a developer's salary in most western countries

wheat arch
#

sometimes 16 if I don't have a lot of bills and costs from real life expenses

granite vault
#

8-16hours a week

wheat arch
misty wharf
#

Looks like Yacht Club Games is based in Los Angeles

#

so for a living wage for a developer you're rapidly closing in to 10k a month

celest python
#

I sometimes agree on 15 per hour but if it is only a BP only project and if I'm not totally responsible of what I'm working on

wheat arch
#

I believe in more of a pay by effort standpoint. if you're going to spend all week making sprites and simple things the pay should reflect. that's why it's just a part time casual gig

#

and everyone in the team agrees and is pretty content

#

but when things hit off and big money is made (not if, but when)

#

then bonuses come into play

celest python
#

Lowest senior rate in NA is 35$ hourly

#

Lowest 😄

smoky summit
#

This is pretty offtopic for the channel

wheat arch
#

sorry erebel.

#

it did come from an on topic item

#

we just kinda.. derailed

misty wharf
#

the mods are watching this channel now after that earlier show I guess alex

smoky summit
celest python
#

First time a mod visited #gameplay-ai since months though 😂

wheat arch
#

might be my fault, there was this guy who was acting like a prick for no real reason and they shewed him off

#

anyways back to AI I suppose

#

who's got the time on their hands to run me through the basic understandings of an AI LOD

#

actually better yet

harsh storm
#

It's the same as graphical LOD

#

The further away the AI, switch it out for more simple AI

wheat arch
#

let's get a rough cost calculator going so I can wrap my head around things

#

here's what I want follower AI to do!
commands:
-harvest; go chop some trees or mine some rocks, gather some herbs or food, hunt things down. how is not important just the command itself, then once said resource is in inventory they return to base and drop it in the correct storage.
-guard; self explanitory, throw in some patrol nodes if it's over a decent sized area
-follow + follow types and logic tweaking (don't chase enemies and stay by me, chase on sight, chase distance ect ect ect)
-formations! this is, as I've been told, going to be hard but still doable.

#

to name a few off the top of my head.

#

oh, automated crafting/refining at stations and workbenches. that too.

#

how expensive would 5 of these little bastards running around in your base be, just on their own

#

and then how expensive/doable would it be to have about 25 of them (5 human players in area) fighting in a battle

#

or rather, 5 human players in an alliance.

harsh storm
#

It's all completely relative. Which is why it's hard to give such a straight answer.

wheat arch
#

if it's a battle they're just going to be doing one thing; attacking

#

if it's an alliance base they'll be doing the full extent

#

okay. how about some probing.

#

let's say

misty wharf
#

The cost comes mostly from how much processing something takes

harsh storm
#

Do it the most simple way you can - then measure. Rinse & repeat.

misty wharf
#

For example chopping trees can be very cheap if it just stands there and a number goes up

wheat arch
#

they can only do one task at a time, and the tasks are hard set with 4 basic steps. get tool, locate resource, gather resource, return resource, repeat (skip step 1 if tool is fine)

misty wharf
#

but it can be more expensive if he walks around and chops with an axe and does a bunch of animations and stuff

#

Nothing you're saying sounds awfully complicated in general though

wheat arch
simple crest
#

Seriously this question is going to go around in circles for hours. Glass beaver is building an RTS with 1,000,000 units. He's spent literal thousands of personal hours developing highly specialized code to enable this. On the other end, the basic CMC with a little extra functionality will grind your game to a halt in 50-100 instances. It's always about how much work you're willing to do and what compromises you're willing to make along the way

misty wharf
#

Indeed

#

My general suggestion is to try to keep things simple and not build overly complicated systems

#

You can build a simple system that does the job, and if you find out it doesn't quite work, it's easier to modify if needed

#

Of course this doesn't mean you shouldn't make accomodations for future features where you know they're likely

wheat arch
#

I shall think hard

#

and have a long sit down with coffee and potentially booze with my coder

harsh storm
#

More acting upon, less thinking

wheat arch
#

and we'll try to hash out a method

wheat arch
#

this project is quite literally what I want to be remembered for. huge stress placed on myself by myself

misty wharf
#

analysis paralysis is the term you're looking for lol

opal crest
#

You don't really need a rough cost calculator. The programmer you are working with can show you the profile info he's getting from the engine. The average ms cost per frame for various AI systems can be broken down there. If your design/vision requires a certain number of AI, then that's the pin you put in and start finding optimizations (or, more likely, compromises) to hit your budget on target hardware.

#

Or conversely, if there's behaviours that are are the real key to your design/vision, then you pin that, and find optiimzations/compromises elsewhere (like reducing the number of AI, or finding ways to cheat and do simplified things for AI that aren't visible).

rugged talon
#

can someone help me with this. i feel like im doing it wrong. im trying to store an actor in this variable which can be seen and is in a certain range

misty wharf
#

what's the problem?

rugged talon
# misty wharf what's the problem?

so i want my frindly ai to shoot enemy ai but with this its only 80% accurate . some times the AI sets the focus/shoots enemies through walls and sometimes doesnt shoot enemy ai when its right next to it

misty wharf
#

Hard to say based on that, you'd need to debug it to find out what's going wrong

#

for example try printing which values it's using

rugged talon
#

yea thats what ive been trying to do for a couple of days but thought i could ask here too

#

wat ive noticed is taht sometimes it wont set the blackboard key to true for seeing enemy

#

even if its right next to it

misty wharf
#

try using on update target perception or whatever it was called and not the one you're using

rugged talon
#

is there a way i can constantly check if there is an enemy in sight or wil the ai execute only work once it updates

misty wharf
#

the one you're using gives you a list of all updated things, the other one just gives you individual stimulus data per actor which you can then look at

rugged talon
#

the one above i just used to get all actors and store the focused one in a variable that is the closest

#

cuz sometimes the ai focuses through walls and sometimes it doesnt so idk wat its doing

misty wharf
#

You should be able to do it all in the other one

#

Basically save the current target to a variable, then when you get new perception updates, compare the distance then to determine whether that one should be used instead

rugged talon
#

so like everytime the ai sees a new target it udpates ?

#

wat if it sees 2 targets at the same time

misty wharf
#

Then it gets two updates

rugged talon
#

ahh

#

ok so i remove the perception node whichgives array right

#

i do all of it in this one

#

target updated

misty wharf
#

yep, that would probably be simpler

rugged talon
#

@misty wharf i tried doing it off just that one node but now the ai just stands still sometimes becuase it doesnt go into the CanSeeEnemy blackboard value

#

ive noticed if there multiple enemies the ai doesnt start shooting until there is an update

#

in seenenemies

wintry flint
#

Drafting a Behavior Tree with an AI Controller, pretending Event Tick is Root

The idea is that my NPCs should...

  • Flee if critically wounded and NOT in a party (So enemies will flee for their lives but the player's allies will fight to the bitter end.)
  • Follow the commands of the player if they are in a party. A "Command" is essentially a target actor & location, that is attacked if it is an enemy, followed & guarded if it is an ally, and used if it is an interactive object (like a teleporter.)
  • Run Idle Behavior if the NPC does not have a party and has no higher priority tasks, Follow Leader if the NPC does have a party.

Is this conceptually sound?

I'm drafting this way because I still don't grasp how to use Decorator & Service nodes beyond updating Blackboard values. (But Composite Nodes and Tasks are understood at least.)

vivid drift
#

@wintry flint Yeah more or less. The decorators are the part that does the boolean checks. The services set values on the blackboard as needed. At a glance it doesn't look like you would need any services.

wintry flint
#

Kewl

vivid drift
#

I am trying to get my ai controlled units to use GAS abilities now. I need a way to flag to the BT Task that a given ability has ended. I'm planning to create a generic "Use Ability" Task that implements an interface that receives a callback on End Ability.

Curious if there's any thoughts on best practices here

misty wharf
#

Seems reasonable. You could probably hook into the OnABilityEnded delegate on the ability system for it

wintry flint
#

OOooh, Decorator, Service, and Task Nodes can get Input Actions

#

I don't think I'd do anything with this but it's real interesting to know about

misty wharf
#

That seems like a terrible idea lol

vivid drift
#

@misty wharf Only thing I can't figure out is how to pass a reference to the Task to the Ability... Seems like you don't get a chance to pass data calling ActivateAbility?

wintry flint
misty wharf
wintry flint
#

I have no idea if I would ever do anything with it, but that sounds like a great time for cursed blueprint experiments :D

misty wharf
#

Exactly lol

wintry flint
#

Maybe for some messed up 2nd person game.

Press W to set the AI's attacking state to True.

vivid drift
#

@misty wharf I don't follow? I'm saying how can I tell the ability which task to call back to when it's done

misty wharf
#

Ahh

#

I wouldn't do it that way

#

I would do it from the task side, so that your task does TryActivateAbility, and then listens to the ability component's OnAbilityEnded if it seems the ability did activate

vivid drift
#

@wintry flint nah you would still want to use inputs on the player controller to set vars on the blackboard of the ai controller of the unit. Imagine an RTS

misty wharf
#

the ability itself doesn't need to know that it's being activated from a BT in that case

vivid drift
#

Ah ok that makes sense.

wintry flint
vivid drift
#

@misty wharf should a c++ implemented task inherit from UBTTask_BlueprintBase

misty wharf
#

If you have no reason to do so I wouldn't

vivid drift
#

@misty wharf UBTTaskNode then? Will that be useable in the BT editor? I presume it will not be extensible in BP?

misty wharf
#

just UBTTask if you're not using the blackboard, if you use the blackboard using UBTTask_BlackboardBase would probably make sense

vivid drift
#

I see. I believe this task will not need anything but the actor and the ability, so I'll try the former

#

@misty wharf Are you sure that's a real thing? Looks like TaskNode might be the root of it all.
class UBTTask_BlackboardBase : public UBTTaskNode

misty wharf
#

Oh yeah you're right

celest python
#

Anyone recognized an issue related with BTNodes properties get corrupted?

#

For example bool, enum and float values I exposed to editor has values in BT graph but debugger displays a different value

#

And this does not get fixed until I remove and add another new node

#

It's not even get fixed mildpanic

misty wharf
#

🤔

#

C++ or BP based nodes?

#

If it's C++ tbh it sounds like a bug in how you've implemented them because I've not seen this

#

or some other very strange issue I guess

wintry flint
#

BT'izing that graph from earlier

#

For that IsParty member variable that keeps coming up, I'm not exactly sure where to set that.

#

My first impulse is to place it on a Root Level Decorator but I'm not sure what to make of the warning it gives

celest python
ocean wren
# wintry flint 🤔

You have a lot of conditions there.. what behaviour is expected for the case where the conditions are not set? make sure you define exactly what you want to happen in both cases somewhere and make sure that your expected path for both condition true and condition false make sense

#

Because its always the edge cases where SOME conditions are true, but ONE isn't that kicks you in the ass 🙂

wintry flint
#

Ohhhhh

wintry flint
#

"All conditions must be true" might be worth making a custom decorator.

#

Actually, I should probably think about condensing all of these into a single condition when possible

#

"bFleeThresholdReached = True", "bHasParty = False", and "CurrentOpponent Is Set" could probably be condensed to a "Can Flee" condition.

misty wharf
#

It depends on how you want to handle it, it can certainly be simpler to have a smaller amount of conditions in the BT if you don't need the specific details there

#

There is also a composite decorator which allows you to use a simplified node editor to create conditions like X or Y or Z or other variations of such

wild gyro
#

Is there a way that navigation also consider other ai pawns in its findPath ?

vivid drift
#

How can I make this property appear in a task?

#

Left is my c++ task with a single attribute I want visible on the bottom; as is done with the example on the right with it's behavior tree arg.

opal crest
#

Sorry, "GetStaticDescription" I think is the right one. It's one of them, anyway 🙂

vivid drift
#

@opal crest It was the latter edit. Thanks

celest python
#

Is there any way to jump out of the selector execution flow?

#

Something like with finish with succeed but it needs to end parent's parent too

#

Without decorators 🥲

misty wharf
#

sounds like a goto

#

I don't think you can just exit with result which would immediately exit parent too, unless the parent is also a selector and you succeeded or something like that

rugged talon
#

is it possible if my ai follows me and attacks me at the same time? i set up a layered blend by bone thing and BT to attack and its attacking but i noticed when it gets close enough to attack it stops and then slaps and then starts walking again

wintry flint
cedar dust
celest python
#

🫂

ocean wren
# wintry flint When I built this I assumed that all of the conditions must be true or else it w...

Its not always bad to have multiple conditions, but what you should be thinking about is how the conditions themselves split the behaviour, if you have a condition "isInCombat" for instance, then you need to figure out what dictates "incombat" being true vs false. Usually for each side of that boolean, you might have a number of subquestions, like "incombat and has ammo" and "incombat but out of ammo".. then those branch around the ammo condition

#

The point is to recognize that having boolean conditions is essentially a tree splitting

#

and you should try and figure out both sides of the tree, or some catch all fallback

#

Otherwise, what you'll get is unexpected behaviour because the specific conditions are almost true but not fully there

#

its also kind of why I've gone off boolean logic based approaches, because they feel far too brittle to edge cases

#

and my brain doesn't have the logic to handle all of the possibilities

#

I kind of prefer "in the ballpark" logic 🙂

ocean wren
#

I find it important to mentally figure out what the priority order is.. like if I'm in combat and I'm running low on ammo, what really is my priority? if I've only got one enemy and I'm likely to kill em before running out, then does the low ammo really get priority?

#

boolean doesn't really express that well

wintry flint
#

So it's not really a fail condition like I was assuming it to be

ocean wren
#

Well, remember that BT's are essentially conditional priority selectors

#

i.e. its important to plan your priorities and your conditions that split your choices (at least the important ones)

#

It can be a lot easier to architect if you figure the high level priority order at least

#

stuff like having different priority set while in combat is decent.. so a split for incombat or not is a clear one

#

The question then becomes one of rearming.. does that have higher priority than firing

#

and is it still "incombat" to be rearming

wintry flint
#

For my NPCs, Flee is the highest priority behavior if allowed. Self preservation takes precedent.

But in most situations it is expected to be suppressed by the following conditions:

  • Its HP is above the flee threshold (an enemy should flee at 50% or less HP)
  • It is not part of a party (I don't want the player's NPC teammates punking out on them)
  • The NPC actually has a target (There's no point in fleeing if its target up and dies, changes teams, etc)
ocean wren
#

That 50% flee point will get predictable fast btw

wintry flint
#

Yeah, it will, though this is just for prototyping purposes

#

In the "real" product I would have more going on to determine when to flee. An NPC should be able to look a character up and down and correctly assess the target's power level relative to its own.

ocean wren
#

sounds like utility 🙂

wintry flint
#

Yeah 😄

I've got a self imposed deadline of June 7th so for now I'm taking the most simplistic, straightforward representation possible.

ocean wren
#

Sensible, having something working is more important 🙂

#

cant iterate on nothing

wintry flint
#

I started the whole project March 7th, I've worked sequentially through the main menu, character creation, party recruitment, and damage application.

AI is the last big part of this equation, the deepest requirement is to have NPC teammates that can move to the target in the player's crosshairs upon right-clicking, and either attack (if an enemy is the targeted actor), defend (if an ally is the targeted actor), and use (if an interactive object is the targeted actor)

ocean wren
#

Nice 🙂 I did that for a personal project once.. felt very natural to me

#

ended up adding a marker on the ground if you aimed at that too

#

kind of tempted to start it back up to copy the Full Spectrum Warrior thing

wintry flint
#

The attitude I was coming from was that RPGs are good at being Digital Barbie right?

So according to my incredibly self-serving logic, the Digital Barbie will be 400% better with 4 avatars to customize! 😂

ocean wren
#

Hmm, not sure its multiplicative 🙂 but can't hurt to try

#

We did a study once using Neverwinter Nights 2, turns out players of RPG's choose characters based on percieved utility.. so chose armoured whatever for tankiness, or leather looking things for backstabby etc.

wintry flint
#

Naw but seriously, it's taking the idea of a hero-builder RPG and having it operate around the player customizing 4 blank slate avatars, instead of just 1. And the player can swap control of each avatar at will (via D-Pad or RTFG)

It was a beast of a task to get the hero swapping done lol.

#

Especially cuz I had an issue where my AI controllers would just freeze after swapping in certain ways

ocean wren
#

So like Rainbow Six swapping?

#

Actually, I think FSW had swapping.. but you have two squads of four to swap between too, so 8 in total

wintry flint
#

How does Rainbow 6 do it?

It was pointed out to me that what I'm doing closely resembled Evolva or Marvel Ultimate Alliance

ocean wren
#

R6 has four squad mates and you can swap them, can't remember if thats only on death, but I dont think so.. might be thinking of Swat 4 though 🙂

#

tab swapping

#

We did it in worms too 🙂 arf!

wintry flint
#

For me it's RTFG/D-pad to swap between heroes 0 - 3

The AI teammates will follow the player controller, so you can essentially pick who is the leader at present

ocean wren
#

thinking about it, loads of games have done swapping.. I think its a really cool mechanic

wintry flint
#

My heritage is RPGs and MMORPGs - my goal is to make the altoholics promised land.

ocean wren
#

does diminish each individual, but emphasises the squad

wintry flint
#

The allied AI is gonna be the heart of that lol

ocean wren
#

whats that bioware rpg called?

#

the one with the stop time control thingy? I didn't know it even had it until watching a youtube stream.. I'd literally played the game for weeks 🙂

wintry flint
#

Uhhhhhhhh

Beats me lol.

I explicitly went for real time action where you have over the shoulders camera and only 1 avatar in your possession at any moment (but the other 3 can be directed.)

The AI controlled teammates are expected to be good-but-not-perfect at "playing the game" so to speak, so that the player doesn't have to micro them too much but can be directed like that if so needed or desired.

#

With the fleeing stuff, that's the heart of a self preservation system

#

Where enemies will try and retreat if they sense their power level is beneath their opponent(s)

ocean wren
#

Be careful, retreating looks bad in combat 🙂

wintry flint
#

Part of this is coming from my ARK modding adventures, I had wild dinos flee at 25% HP - the effect was convincing because dinos had a damage material that would gradually become more visible overtime

ocean wren
#

Might feel wrong for teammates to run and leave you 🙂

wintry flint
#

You could see why the dino was fleeing, you just scuffed it up in a fight

#

Teammates are expected to never flee

ocean wren
#

oh right

wintry flint
#

Fleeing is meant to be suppressed if they're part of a party

#

The expection is to make "winning" (or at least surviving) easier than "killing"

ocean wren
#

turn off rigid collisions and use a seperating force.. thats my advice.. moving a squad around is hard enough as it is

#

oh and steal some stuff from ellie of Last of Us, some good teammate stuff in there

wintry flint
#

I know Ellie was setup to never break the player's stealth.

FFXV also had pretty robust teammates, they were pretty competent on their own and would reliably pick you up if you were downed.

When I modded Oblivion making custom pet creatures I made a point to give them a cloaking spell if the player was crouching and neither it nor the player were in combat. So that way the player would know the pet would never break their cover.

For this prototype all the NPC teammates do is move to the player's position with an acceptable offset (value set to around 300 or so.)

But it definitely looks ugly, in a more finalized setup they should prefer to keep a bit of distance between each other and move towards a specific offset from the player. I expect EQS to be mandatory here.

ocean wren
#

Yeah, EQS would be a good idea.. keep the friendlies in eyeline and slightly in front of the player, preferably towards the enemy so you can see them at the side of your view

wintry flint
#

After June 7th I'll be wrapping up my investment into script/code though. Drawing and modeling are my trained skills, anything to do with BP script and AI is entirely self-taught.

I'm doing what I need to get a working prototype and demonstrate I'm a cut above "Ideas Guy" but that's not expected to be a forever role.

ocean wren
#

ah, the fabled "ideas guy" 🙂

wintry flint
#

Nobody likes em, and being able to draw/model doesn't necessarily put me above that 😄

I don't expect to have a software engineer's range of knowledge but I should at least be able to have the bones of something so I can point at the screen and say "Look! He shoots gun and makes fireballs! Controls nice too!"

(And looks great doing it)

ocean wren
#

hahaha.. that's probably above 80% of indie projects 🙂

wintry flint
#

I should probably share what I've been doing in #lounge or somethin'

#

Wait

#

#work-in-progress

#

Ya

ocean wren
#

Yarp

wintry flint
#

Swooping back to AI (still uploading the progress video!)

The big thing I need allied AI to do is be able to process what kind of actor they're dealing with

#

And also interrupt their following behavior to immediately follow a command

#

I did successfully send a signal from the player controller to the AI Controller but I noticed that AI would only try and process the command after finishing their follow task

ocean wren
#

Yeah, unless you set it as higher priority and set it to abort lower

wintry flint
#

That said the way I did it back then was to run a new behavior tree entirely, rather than using the same BT like I'm trying now

celest python
#

@ocean wren I really think you should write a book

ocean wren
#

I'm already writing two! 🙂

celest python
#

YESS

wintry flint
#

Wait

#

Book???

misty wharf
#

@visual swift lol you think big servers have here enabled?

wintry flint
#

Tell me more lol

ocean wren
#

well, writing IN two, but yeah, likely to be writing a book properly soon

misty wharf
#

If you say so :D

celest python
#

Information about BTs are very rare and many people end up learning best practice by experience or mentorship rather than researching

#

A book dedicated for BTs would be blessing

misty wharf
#

🤔

#

I never found BT's that difficult to comprehend tbh :D

ocean wren
#

Pretty sure there's been a few books on BT's in general. I've read a few at least

#

But not UE specific

celest python
#

Then at some point you're having that "WTF" moment

#

And another experience

misty wharf
#

I guess

ocean wren
#

I'm not sure people would get much out of a book on it.. because the kind of people who have trouble with it haven't got time to read a book 🙂

#

My book will be about the ML/RL stuff really.. because that's a bit more unclear/unknown

misty wharf
#

there is a youtube video about behavior trees

#

which had some kind of gardening related title

ocean wren
#

yeah, I've made a few 🙂

misty wharf
#

that one had some good ideas on more complex BT management

ocean wren
#

gardening related?

wintry flint
#

For me, the biggest hurdle was grasping that the code that actually does stuff lives in tasks, decorators, and services.

misty wharf
wintry flint
#

I saw that one recently 😄

celest python
#

For me it's ambigious rules of BTTasks in general and controlling the execution flow

ocean wren
#

Ah right 🙂

wintry flint
#

The pinned video was also watched

misty wharf
#

Ambiguous?

#

Execution flow is controlled via decorators more or less, they can do all kinds of arbitrary things

ocean wren
#

There's been some good ones from GDC, wonder how many have watched them before coming in here and asking for everyone to debug their blueprints 🙂

celest python
#

Like it doesnt tell you C++ BTTasks are not instanced by default etc.

misty wharf
#

Well it does if you look at the code

#

:P

celest python
#

Hmm, in UBTTaskNode?

misty wharf
#

Probably yeah

celest python
#

Don't remember, maybe I missed

misty wharf
#

when you know the variable you set to make them instanced just find where it's created and you can usually find the default value

celest python
#

It's not confusing anymore since I went all over them a year ago but when I was a starter it was a tiring experience for a while

misty wharf
#

lol yeah

#

also instancing is a lie

#

they get instanced a bit even when it's not on

#

:P

#

if you look at some of the builtins they treat them as instanced sometimes with stuff like binding delegates

#

but they aren't instanced so it's a bit weird

celest python
opal crest
#

I definitely discovered that backwards. Like "this function is not const, but pretty please pretend it is" made me go on a whole code safari.

celest python
#

Sometimes it forces you to use FSM instead at some specific parts

celest python
#

Why I can't just cache values hellmo

wintry flint
#

How cursed would it be to have all the allied AI logic inside one godforsaken task? 👀

misty wharf
#

they're not const on C++ side if they're not on BP

#

also: const_cast and mutable alex

opal crest
#

The number of things telling me to make my variables private, but expose them with UPROPERTY(Meta...) tags is ahhhhhghg.

celest python
#

Summoning Lorash.. 3.. 2.. 1..

misty wharf
#

she doesn't frequent this channel lol

celest python
#

Yeah 😄

wintry flint
#

In all seriousness, while I'm being resolute for now and seeking to do things properly, with my personal deadline coming in about a month I am definitely keeping in mind what my ugly options are.

#

Missing my deadline = I am now Zuko and must regain my honor.

opal crest
#

You can get away with doing a alot in a task, it just makes it things more rigid.

ocean wren
opal crest
#

Only If they deserve to be private 🙂 I default to protected, unless there's a good argument otherwise, particularly if they are UPROPERTY's. And especially if they are going to get BlueprintReadWrite, I start considering putting them in the public section, since that's effectively what they become.

granite vault
#

Does making your variables private or public have any special effect? I have never bothered with this but now i am curious. I think in BP has private option if not mistaken.

ocean wren
#

Its a bit of a holdover from OOP stuff, where you aren't supposed to make your variables public unless you specifically want them to be accessible (so that you can only provide the minimum interface)

misty wharf
#

which is a very good idea

ocean wren
#

kind of

#

OOP has kind of lost some of its shine really.. because people become overly fixated on some of the principles and don't think if they're actually a good fit for the problem

misty wharf
#

perhaps, but encapsulation is something that applies outside of OOP as well :)

#

For example in Haskell you can declare a data type within a module and only expose certain parts of it to the users of the module

granite vault
#

So it is best that only all none accessible (by players) variables all go private?

ocean wren
#

Yeah, I don't have a problem with having private/public values etc.. I just worry that people are still teaching OOP like its a goddam cult 🙂

#

When in fact, for some things, it is positively detrimental

misty wharf
celest python
#

@ocean wren What do you think of an utility editor like this?

main talon
#

Anyone know of a reason that ai perception would simply lose track of the player?
I have a student who followed the behavior tree quick-start guide. All works as expected except while "chasing" the ai will all the sudden switch to patrol state.
Code looks identical, and during debug I discovered the event to make them stop following the player in never fired either. So it's almost like the black board key pointing to the player is invalidating on it's own

celest python
misty wharf
#

So you need to look at how that gets handled and what is updating the blackboard with the invalid values

#

Assuming the sight sense is the only one affecting it, then most likely it either senses something else which causes it to lose track of the player, or something ends up blocking on the line of sight trace channel

main talon
#

No, it's identical to the set up in the "bt quick start guide".
The ai controller is the only thing handling sight perception. And the timer for losing line of sight is pushed way up to 16 seconds.
I can be surrounded by ai characters and they will (in unison) stop running at me and resume patrol for a second before the ones who can still see me chase again

#

The event to clear the player as the chase target is never fired, so idk how they are leaving the chase task and going to patrol

misty wharf
#

If it's identical to the guide then the guide is wrong

#

I haven't looked at it so I can't say, but there is no automatic lose sight mechanism that would do something like this except in the scenarios I mentioned

main talon
#

I've used the guide dozens of times for various students. Never had this issue before.
I'm just gonna have him reinstall the engine, cuz by all accounts it shouldn't be doing that

misty wharf
#

I suspect it's the case of it's not quite exactly the same

#

It would be a valuable lesson in debugging most likely lol

kindred ruin
#

question: I have a AI that follows multiple vectors close together but the problem is that the AI stops for a brief second at each vector, how can I fix this to where he runs smooth with out stooping

main talon
#

Well if it's still broken next time I see him we'll have to try debugging further

rugged talon
#

what is the difference between aborts self and aborts both

#

in decorator

misty gale
# kindred ruin

Custom movement code. Its stopping due to reaching point. You could try and check the distanve manually and update target location before the aiMoveTo acceptance radius is reached

soft mantle
#

Hi! i have this grid made of tiles on a 2D matrix (X,Y)
Do you know of an efficient way to know if Any of the tiles is connected to the rest?
I'm trying to define spawn spots randomly, but i don't want them to spawn if there are in a location like the one pointed in the screenshot

#

I tought about using the NavMesh to check if the place is "reachable" but i'm not sure how to do that

soft mantle
#

Solution: "Find path to solution sync" --> Is partial .

misty gale
#

Sounds like an expensive check 😅

#

You can use a better algorithm for creating the random map

#

One that doesnt allow islands to exist

soft mantle
#

I'm doing celular automata to just let them die / appear with a certain criteria

#

the "is partial" doesn't ended up working as intended, so i may need to do what you said and just don't allow islands : (

ocean wren
#

You could flood fill from one of the tiles and then find tiles not visited by the flood fill and then fill them too. Then you will know which islands are reachable (contiguous tilesets)

misty gale
#

I think islands were undesireable in the first place

autumn hollow
#

Anyone had success with using StateTrees instead of BTs? The official examples are AI and... a weather system, not sure if it's focused on being competent at AI, or rather a general purpose pre/post effect-driven state machine, sorta thing

mint sundial
#

hi, about my nav mesh config....what I'm missing? I want my pawns be able to cross the dark wall. I have create two Object Channels: Zombie and Breakable (block everything by default). The pawns' object channel is Zombie, and they are ignoring breakable objects. The dark wall's object channel is Breakable and is ignoring Zombie objects. Nontheless, something is missing about the nav mesh: for the nav mesh pawns can't cross Breakable actors. Thanks for any help! (L)

mint sundial
#

brekable wall:

mint sundial
#

a workaround:

night panther
#

Who knows how to get the hostile perception system working and would like to make some money

#

Just need Custom AI Controller with the proper C++ code I can just parent to

#

ue5

#

settings of the team id to bp

uncut wolf
#

you can change that in project settings tho

night panther
#

under navigation mesh tab

unborn mauve
#

Hi , does anyone know how to do a spherical navmesh? I cant find info anywhere

#

Or a different system to replace the nav mesh

misty wharf
#

If you want to use a different system to replace it, just don't use the navigation movement functionality and do something else

vivid drift
#

Hmm trying to write a custom task in c++ to handle using GAS abilities. Trying to use the built in move to task as a reference but I don't follow it entirely.

It seems that ExecuteTask of a BTNode needs to return a EBTNodeResult to indicate the state of the task for the BT. But for anything that isn't instantaneous this should return EBTNodeResult::InProgress.

It looks like BTTask_MoveTo kicks off a AITask_MoveTo which is an async thing. But I don't understand how it ultimately tells the BT that the movement was a success or a failure.

vivid drift
#

For example. BTTask_RunBehavior has the following code

EBTNodeResult::Type UBTTask_RunBehavior::ExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory)
{
    UE_CVLOG(BehaviorAsset == nullptr, OwnerComp.GetAIOwner(), LogBehaviorTree, Error, TEXT("\'%s\' is missing BehaviorAsset!"), *GetNodeName());

    const bool bPushed = BehaviorAsset != nullptr && OwnerComp.PushInstance(*BehaviorAsset);
    if (bPushed && OwnerComp.InstanceStack.Num() > 0)
    {
        FBehaviorTreeInstance& MyInstance = OwnerComp.InstanceStack[OwnerComp.InstanceStack.Num() - 1];
        MyInstance.DeactivationNotify.BindUObject(this, &UBTTask_RunBehavior::OnSubtreeDeactivated);
        // unbinding is not required, MyInstance will be destroyed after firing that delegate (usually by UBehaviorTreeComponent::ProcessPendingExecution) 

        return EBTNodeResult::InProgress;
    }

    return EBTNodeResult::Failed;
}

void UBTTask_RunBehavior::OnSubtreeDeactivated(UBehaviorTreeComponent& OwnerComp, EBTNodeResult::Type NodeResult)
{
    const int32 MyInstanceIdx = OwnerComp.FindInstanceContainingNode(this);
    uint8* NodeMemory = OwnerComp.GetNodeMemory(this, MyInstanceIdx);

    UE_VLOG(OwnerComp.GetOwner(), LogBehaviorTree, Verbose, TEXT("OnSubtreeDeactivated: %s (result: %s)"),
        *UBehaviorTreeTypes::DescribeNodeHelper(this), *UBehaviorTreeTypes::DescribeNodeResult(NodeResult));

    OnTaskFinished(OwnerComp, NodeMemory, NodeResult);
}

It looks like ExecuteTask is binding the end of its subtree to trigger OnSubtreeDeactivated, which in turn runs OnTaskFinished. But OnTaskFinished doesn't have any implementation here or in the base class, so I don't see where it would be passing the node result?

ripe geode
#

Can i rebuild navmesh after placing wall? on them map because im trying to make prototype survival game

#

What i should to do?

misty wharf
#

You can enable runtime navmesh generation in project settings

#

This will allow it to rebuild every time you move/place something which can affect navigation

ripe geode
#

can i rebuild navmesh from c++ because i dont want to make them dynamic because is consuming so much fps in that case

#

ans walls will be do not moveable

misty wharf
#

Probably

#

I'd imagine it's in the navigation system code somewhere

#

It has a delegate which triggers when the navmesh is rebuilt, you could see where that gets broadcast from, it would probably help you find what you can call to trigger the rebuild manually

harsh storm
#

@misty wharf That thing you found with executing a specific part of BT, was that C++ only?

misty wharf
#

Huh?

harsh storm
#

I believe it was last week where you were looking on how to jump to a specific execution of the BT, and you found something

#

RequestExecution - that's it.

misty wharf
#

Ah, yep that's the one

#

That would appear to be how the execution for specific nodes is done, I didn't really spend much time looking at it any more than that though

vernal pivot
#

is there any design document for how the radiant ai works in gamebryo? i was gonna have that sort of system for the npcs in my colony builder.

vivid drift
#

ugh, I feel like I'm spamming the channels at this point with increasingly shallower questions.

How can I make a c++ bt task return success in a behavior tree. I suppose is all I really need to comprehend.

ocean wren
vivid drift
#

@ocean wren I've been trying and I cannot follow the logic. It's obvious when the result is instantaneous in Execute_Task. It seems obvious if you're checking for some end condition in tick and can call FinishLatentTask. But I want to end the task in response to an event, and I'm lost.

ocean wren
#

So you know how to end the tick version right? so all you'd need to do, is hook a delegate and change a value and then check that value in the tick?

vivid drift
#

@ocean wren I'm hoping to do this on a non instanced task. Checking a condition in tick also feels... ugly?

#

I have a delegate capturing the event. I just can't figure out how to call FinishLatentTask and supply it with the behaviortree component that it requires.

ocean wren
#

Its gonna tick anyway 🙂

vivid drift
#

It's going to tick but it won't have member variables to check

ocean wren
#

Well, ok, if you want to do it otherwise, then have the value on the owner and simply have the task check the owner?

#

or have the event change the BB and have the BT task check the BB value, as is right and proper 🙂

vivid drift
#

That definitely feels wrong though. No other tasks work like that. There has to be a way to trigger the end of the task in response to some event.

ocean wren
#

Well, the BB value change will cause the task to change anyway

#

guess it depends what you're task is doing

vivid drift
#

I just want to run a gameplay ability and return success when it completes or failure if it cancels

#

Like... the Move To node does not depend on altering your blackboard to confirm the move is over

#

I just don't understand how this isn't a basic concept

ocean wren
#

Because GAS came after BT

#

And only Mieszko uses the BT 🙂

vivid drift
#

But it's not a GAS problem. The GAS is tangential. I have a task. I have a delegate I'm responding to.

#
//FOnGameplayAbilityEnded delegate
void UBTTask_Use_GAS_Ability::OnAbilityEnded(UGameplayAbility* Ability) {
    // tell task to return Succeeded
    this->FinishLatentTask(OwnerComp, EBTNodeResult::Succeeded); // This won't work because OwnerComp isn't defined
}
#

Maybe I could bind the delegate to the Behavior Tree as a way to force succeed the node but that also feels very bad

ocean wren
#

Yeah, that looks like a bad idea.. unless you have one of those tasks per agent

vivid drift
#

Is it a bad idea to make my AI Tasks instanced? Could I just cache a reference to the behavior tree?

ocean wren
#

Well, the design of the BT system was intended to have a single BT being applied for multiple agents, with the per-agent stuff in the BB

#

Why don't you bind the ability on your AIController and simply set a BB value when the event fires?

vivid drift
#

I could. It still feels dumb to do that. No other tasks do that... and my mental model from blueprints is that you should be able to call Finish Execute

#

meh. fuck it all. doing it in blueprints.

main talon
#

Anyone know how to assign "friendly, neutral, hostile" using the ai perception component in BP?

misty wharf
#

You cannot

#

That part is controlled using IGenericTeamAgentInterface

#

which is not blueprint implementable

wintry flint
#

I'm starting to grasp why I was advised to avoid using booleans if possible. Or at least be cautious about it.

#

Setting it to false is still setting it.

misty wharf
#

Oh?

#

You mean on blackboards or what?

wintry flint
#

Yeah, on blackboards/Behavior Tree's

misty wharf
#

Right

wintry flint
#

Graph work incoming

misty wharf
#

If you're using the blackboard decorator it actually has something that will help with this

#

It has an option to trigger when the value is set, or when the value changes

wintry flint
misty wharf
#

the set one will trigger it every time the value is set regardless of whether it's the same value as before

wintry flint
#

Also I feel like I'm committing a sin by casting directly to my character class

misty wharf
#

lol

#

I mean the other option is using an interface, but it probably doesn't make much of a difference

wintry flint
#

But anyway, the idea is to have an NPC flee it if's below the flee threshold.

And is not part of the player's party, so that way teammates don't punk out on you. But I have a separate decorator covering that.

#

It occurred to me that in the Behavior Tree the "Is Set" value would be satisfied for both true or false

#

But it sounds like "On Value Changed" is what I want

misty wharf
#

Yep

#

"Is Set" is basically "Is true"

#

and not set is value == false

#

they just decided calling it set and not set or unset is more designer friendly lingo I guess

#

but I've seen plenty of beginners get confused about what "is set" actually means, so I don't know if it's actually any better lingo :P

wintry flint
#

Behavior Trees feels like a parallel planet for better or worse.

Now that I'm starting to get into the gory details, it would be nice to have a built in Blueprint equivalent of Selectors & Sequences, right now there's no obvious equivalent.

The flow of data from Blackboards --> Decorator/Service Nodes --> Behavior Trees --> Tasks is a lot to take in when you consider the 7 or 8 classes actually involved with the operation.

misty wharf
#

I just use a lot of decorators which read values directly off my pawns lol

#

Don't like dealing with the blackboard when there's so many random values involved with it sometimes, and the bb is so hard to organize and you'd end up with a whole bunch of random bb variables which basically exist for one branch of the BT and for no other purpose

wintry flint
#

Approaching it in the way guys like Matthew Wadstein suggeset, I'm noticing that I'm basically having to duplicate blackboard values in my decorators

misty wharf
#

Oh?

wintry flint
#

There's the Blackboard Value, and then the Key Name in the Decorators I have

#

Well, that's not a literal duplication

#

But it does come off redundant

misty wharf
#

I'm not sure if I'm following :)

harsh storm
misty wharf
#

inheriting BB's seems pretty iffy too tho

#

if you ever want to run Sub-BT's

#

and it still makes organization hard :P

wintry flint
#

If I want to access the Flee Health Percentage float that's in my Blackboard, it seems to be that I need to make a Name variable in a Decorator or Service that matches the Blackboard variable's name.

#

Is this actually necessary?

misty wharf
#

don't get me wrong I like BT's they work well but they have their small issues here and there lol

harsh storm
#

I haven't tested it with sub-bt's; but I don't think it'd make organization difficult personally. To me, I think the way things are set up is really nice personally.

misty wharf
#

@wintry flint use Blackboard Key Selector

#

make it instance editable

#

this will allow you to just plop the node into your BT, and it'll show a selector you can use to choose the BB value you want to use for it

harsh storm
misty wharf
harsh storm
#

If you're talking about that, then sure. But meh. I don't have much of an issue with it.

misty wharf
#

hehe

wintry flint
#

Oooh, Break BlackboardKeySelector

misty wharf
#

in my current project I have a BB value called RandomInt which is only used by some of my BT's lol

#

@wintry flint you can also directly get a value from the blackboard using the key without having to break it

wintry flint
#

Wat

misty wharf
#

for example

#

Attack Target Actor here is a blackboard key selector

misty wharf
#

in my shooter project it's less of a problem because most things the AI is concerned with is: do I see the player and can I shoot at the player

#

and a few other small things :P

harsh storm
#

I could see how it could balloon up like that, sure. But I'd probably end up looking for a way to reduce it; at least with the way I approach writing my AI.

misty wharf
#

Yeah.. I just have a lot of decorators which can access the data directly off the pawn which makes it much easier to work with

harsh storm
#

Yup - that works too. Bend it to your will!

#

Released ugly code is always better than beautiful non-released code

wintry flint
#

Hmmmm'

#

Is the selector being named after the blackboard or the value you're looking for?

harsh storm
#

The name of the blackboard key you set up

#

I still haven't really used Gameplay Tags all that much either 😅

misty wharf
#

Gameplay tags are nice

#

I kinda prefer enums because they have that type safety, but there are various situations where enums are annoying to work with because of lack of polymorphism and what have you... so instead you just use gameplay tags :P

harsh storm
#

Yeah, I get it.

misty wharf
#

I have a bunch of tags for all my animation states like walking, running, shooting, etc. which is used by my animation state machine related logic, then I have tags for attack types which is used both to decide which attack an npc is going to use and also choosing the appropriate animation from its animation list... etc.

harsh storm
#

So - you're using it as a statemachine for your pawn?

misty wharf
#

Yeah it's just used to represent the animation that needs to be selected similar to how you might use an enum

#

I do have some states like OnFire and Dead as tags as well which works nicely with GAS

harsh storm
#

I typically have a few bools that I change via events and the ABP is listening for those. Simple and works. Thus far, most of my pawns don't have all that many actual states. Montages work well enough.

misty wharf
#

Yeah ABP would probably reduce the need for animation related logic like that but since I'm using sprites it needs a custom system :)

harsh storm
#

Ah - poor 2D; womp womp

#

If only 2D got like 0.5% of the funds from Fortnite.

#

All of a sudden, UE would become a much stronger competitor to the other 2D engines 🤣

misty wharf
#

lol

harsh storm
#

It'd be like a rounding error to them.

misty wharf
#

yeah paper2d is nice even for a doom-style thing I'm doing, but it has a few things in there which are a bit meh

#

I noticed it ends up rebuilding render geometry a lot when sprites update, because it has things like support for different collision boxes and stuff based on sprite, but as a result those can become a bit of a performance bottleneck if you have sufficiently many sprites animating at the same time

wintry flint
#

How do I create a StateTree class?

I feel like I'm missing something very obvious.

ocean wren
#

one doesn't simply "create" a StateTree class, instead one has to will it to exist, offer the gods of AI a living sacrifice and chant the litany of the navmesh in order to invoke its presence.

shadow furnace
#

not a blueprint

#

it's a unique type of asset

celest python
#

a fancy data asset probably

wintry flint
# shadow furnace

Wat

I don't even see the State Tree when I hover over Artifical Intelligence

#

All I see under AI is BT's, Blackboards, and EQS

ocean wren
#

Did you enable the plugin?

#

ALWAYS enable the plugin

wintry flint
#

Ok there's my problem, I wasn't looking for a plugin

ocean wren
#

noob 🙂

#

there's literally always a plugin

wintry flint
#

[Incoherent cretin noises]

#

The last time I ever did anything with plugins was like, 2 years ago lol

ocean wren
#

pfft, you're not unreal-ing hard enough then

#

I plug things in ever other day

#

ever-y

#

New fluid sim for instance.. well worth a plugin

#

Had a meeting with a company yesterday, led me to some pretty wild ideas. For instance this weekend going to have to check out the Caesium plugin.

waxen bay
#

Hi there, can you help me? In Which component should I change collision (mesh or capsule)? and what set presets collision to shoot this AI?

hazy tide
#

scuze me chaps - setting a blackboard Object var as an actor, google turns up many questions but few answers, which makes me suspect i Shouldn't be doing it, but then how can i reference an actor?

#

i've got a key of type object with base class actor, but setting it from my gamemode with either an actor or a subclass just sets it to None

#

never mind, named the key wrong, it works.

#

horay

opal crest
#

Hooray! And yep, somewhere in the top 10 rules for working with blackboards is "check that you're using the key you think you are using".

ocean wren
#

isn't that ALL of the top 10 rules?

opal crest
#

Haha. True though.

nimble smelt
#

I've got an AI-controlled NPC and somehow something is overriding its movement settings. I've tried to make it fly instead of walk, and actually set the walking speed to 0, but when I play the level it's walking around like normal. So I think the movement settings I'm editing are somehow being replaced at runtime?

#

Any theories on how this could be happening?

#

Like, this is not a character who should be able to walk.

#

Also edited this. Still it walks.

vast sluice
#

If I had an Elevator or ladder or something like that how would I make my AI account for that? So instead of him getting stuck he just goes to the elevator or ladder or something and goes up/down that

tardy wolf
#

I believe Navigation has a NavLinkProxy thing for that kind of stuff?

tardy wolf
#

Those two cylinders are the start/end points of a proxy link that lets you jump off the platform and not just navigate down the ramp.

#

Could be janked into a ladder connection, not sure about elevators though.

#

And on an unrelated note: what's a reasonable maximum to have on AI controllers?
I'm wanting to make a game, closest existing example is probably Total War or something... I'm not sure what options I have for having squads of units move around dynamically other than attaching an AI to it.

#

But doing that for every squad and then every soldier in said squads so they can properly fight could quickly become, well way too much.

opal crest
#

It's hard to set a hard limit, it's going to depend on a lot of things, but If you are smart about it, AI controllers are less likely to be your limitation, then, say, CharacterMovementComponent.

#

The MassAI plugin for UE5 shows off simple AI running efficiently at a huge scale, for example.

wintry flint
#

[Cries tears of moron]

Doing the Behavior Tree Quick start guide. My NPC successfully follows me when I enter its perception range but doesn't play any animations while sliding at me.

Patrol also fails to find a valid location.

opal crest
#

For TotalWar, it sounds like they have a battle AI that controls Units (which likely do have some simple AI associated to carry out commands), and soldiers are out of its scope. https://www.totalwar.com/blog/total-war-ai/

#

@wintry flint That sounds like a a lot of movement commands being cancelled quickly. Is your BT flickering like crazy? It could be a decorator that's aborting on every update.

wintry flint
#

The "Find Random Patrol" task immediately fails

#

Graph work incoming

tardy wolf
tardy wolf
#

Obviously the latter player-AI is going to be far more advanced, but have a helluva lot less of them in play at once.

#

So I guess its more a question, how much overhead does simply having an AI bring?

opal crest
#

Not much. It's a component that gets ticked. Just being there is cheap.

tardy wolf
#

Right. And from what I can tell the AI is necessary for even the simple MoveTo nodes to work. So I guess it shouldn't be too much of a concern to add it to each squad? Maybe even each soldier?

opal crest
#

@wintry flint Your only finish execute "false" is after your cast. My best guess is that your cast is failing?

wintry flint
#

Gonna test that with a print string

opal crest
#

Yes, each soldier. You may start reaching a limit at some point, where things slow down, but at that point using stat commands to show you what's taking up all the time will point out what is (unexpectedly) expensive.

tardy wolf
#

Right, I'll go ahead with it and just keep an eye on performance. Looking at videos on the MassAI stuff too.

wintry flint
opal crest
#

Yeah, I haven't made the time to learn that yet, but it's hard to argue with the performance it's getting.

#

@wintry flint Ahh. Then do you have errors in the message log?

#

That's the only other thing that should fail a task.

wintry flint
#

The thing I've noticed with debugging is that an invalid location is always returned for Get Random Point In Navigable Radius

#

This is despite having a nav mesh created and with paths built

opal crest
#

How invalid?

#

Is it returning false from random point in radius?

wintry flint
opal crest
#

Can you check if "Patrol location" has been set on on your BTT_FindRandomPatrol task?

wintry flint
#

That's what it reads like is happening

opal crest
#

Make sure it's exposed (the eye icon) and that you've set it on the task in the BT.

#

I would expect this to mention "Patrol Location" if it's setting the output there.

wintry flint
#

It was set to self actor.

[Cries tears of stupid.]

#

Ok there we go!

opal crest
#

Every last person in this channel has done it 🙂

wintry flint
#

She moves.

#

Now I just gotta figure out why she's not animating

#

She just sliiiiiiiiiides from place to place lol

#

But I think that's an Anim BP issue rather than an AI issue

opal crest
#

Yeah, I'd try to see if the character 'works' with a basic 3rd person character setup before debugging the AI side.

wintry flint
#

This is from the default 3rd person template

#

The demo video for the Behavior Tree Quick Start guide is from UE4 using the Mannequin asset.

opal crest
#

Very strange, generally that works (just grabbing a third person setup and attaching an AI controller).

wintry flint
#

Oh, found it

#

AI Character needs to have Use Acceleration For Paths set to true in Character Movement Component

harsh storm
#

Does anyone else run into issues with Stop Logic not actually stopping the BT from processing?

celest python
#

I lock resources of brain component instead

arctic hinge
rancid wing
#

heyo

#

can someone show me how to move to a player in ue4/5?

#

this is what ive got so far?

#

pls @ me

solemn jasper
#

Anyone know how the perception system (sight) actually works?

#

It seems like once you enter the cone, the perception doesnt update often

#

Until you leave the cone again

celest python
rancid wing
#

mine doesnt even percept XD

celest python
#

Screenshots look correct

rancid wing
#

so, the ai doesnt do anything, when i debug, its not percepting at all

celest python
#

Ah 3rd Screenshot is about perception

#

A thing I never worked in UE

#

Sorry

#

Rest of the active people knows better than me, try keep updating your post if you cant get any answers soon

rancid wing
#

ok, thank you!

harsh storm
#

Does your actor have a stimuli source? Did you check the flags in the sight sense to detect friendlies, neutral, and enemies?

toxic fern
#

Hey guys

#

I need an advice,

#

I am working o a project, I add the AI BP TO FOLLOW an object, but is not working anyone knows why..??

#

When I cast it to the main character it works and follow that character, but it does not follow an object

uncut wolf
#

You might wanna show some code

nimble smelt
#

Is there any way to interact with a Blackboard without using literal names? Surely there must be some struct somewhere that knows the names of its fields

misty wharf
#

You could probably pull the values off the blackboard asset in C++

#

but I don't really know what goal that would achieve since you wouldn't know what they are called

nimble smelt
#

I mean, using literal names and generic functions is objectively worse than using defined functions, so the goal is to avoid that?

misty wharf
#

I don't think the blackboard keys are available as named values

#

I think it's literally a TArray<FBlackboardEntry> where each entry contains a FName field

#

A method I've seen used is to create your own FName fields where you can input the key name and refer to the names using the fields which is I guess a bit better than duplicating the string

nimble smelt
#

Hmm. Next question, what's the right way to get a reference to the Blackboard in a BTTask? This is coming back with None

misty wharf
#

Get Owners Blackboard

nimble smelt
#

Is there a consequence for a Behavior Tree component failing? I'm basically using "fail" as a break statement in a sequence (on like a boolean task which checks whether it should proceed). But then i remembered if you do that with throw statements in like JVM languages it's actually secretly ruining your performance. Is this like that?

misty wharf
#

a behavior tree component failing would most likely crash your entire AI - however it sounds like you are talking about a behavior tree node failing, which is entirely expected and handled

#

it's an expected behavior to the point that you have sequence and selector which have different handling of failing nodes

#

so that you can set your tree to work as you want

#

(assuming you fail in expected ways, being returning failed from the node in some fashion)

neat heron
#

Howdy, i've a quick programming querstion that relates to ai decision making. In fire emblem, a turn based topdown tactics game, to prevent savescumming they make it so that enemy movements and if attacks land are prederermined, so you can't just load the game and do the same thing and have something dif happen. (if Jack swings an Iron Sword on turn 15 with a 45% chance to hit and misses, it will ALWAYS miss no matter how many times you play it). Xcom does the same thing, will rng locked at the start and hits predermined.

I get that this is tied to keeping a stable seed and if nothing changes about how the seed is refernced between two requests, it won't change, but i don't think i really fully understand HOW that, in practice, means that these shots/movements are predermined. Would anyone be able to broadly explain that?
it feels like i kinda understand what to do, but not quite why it works.

mint terrace
#

this is how you would accomplish that specific goal, but note that this differs depending on your use case. For instance in Minecraft, the seed to determine the contents of a specific chunk is based on the world seed and the coordinates of the chunk

neat heron
#

Okay, and so if you were to have a system where the player can rewind their turns to play old turns over again to try dif stuff, you'd just make sure that the various RNG rolls have the seeds they had when it was that turn the last time? So you just store the old seeds and slot them back in if you need them, and once the player moves forward you start using new seeds and storing those?

#

I can def see howthis is highly based on implimentation, but knowing abuot seeding new RNG with old ones is good, i know how to use RNGs but haven't really mucked with seed-based decision making much before. so that's very appreciated.

mint terrace
#

Okay, and so if you were to have a system where the player can rewind their turns to play old turns over again to try dif stuff, you'd just make sure that the various RNG rolls have the seeds they had when it was that turn the last time? So you just store the old seeds and slot them back in if you need them, and once the player moves forward you start using new seeds and storing those?
yeah, you could save the seeds that determined those turns, maybe in an array/list that you could traverse

#

the main principle is: seed X in, random numbers Y1, Y2, Y3, etc out every time

#

the fun part is determining how to pick the seed based on your use case

#

worth noting though, that if you can save the seeds that determine the result of a move, you could save the result of the move, but that might not be as doable if you want to let people branch their decisions-- ie say you have a routine A for move A, that generates 2 random numbers which mean different things for routine B for move B, which generate 3 other random numbers that mean different things

#

saving the seed lets you branch from it, as if the player had hit X instead of Y at that moment

neat heron
#

Okay, excellent. I'll have to test some of that out, can't say i 100% get it but i'm def got some direction now. Much appreciated!

wary ivy
#

are you setting the objective?

#

is the BT running?

ocean wren
#

Maybe we should pin an "how to debug moveto" document in this channel?

#

stuff like "did you check the output logs for any failure messages"

#

and "do you have the name right in the blackboard key"

#

and "are you too far off the ground" and "have you seen if there is any information presented in the visual debugger"

#

and "are you in fact using Unity and not Unreal and are in the wrong discord server"

next swallow
#

hi, I have 1 ai. I spawn the Ai behind my character. The Game is in multiplayer. I want the Ki of the first character team to fight the second character team. I am using a get closest actor function. The problem now is that all the Characters are from the same Blueprint. How can I make that the get closest actor function only see the Ais of the Enemy team?

opal crest
#

You appear to be setting your objective location to "Where the actor is right now". Try using the "
GetRandomLocationInNavigableRadius" node to choose a different location, and see if your BT works then.

opal crest
#

Okay. There's nothing particularly about the MoveTo node that should fail if a simple AIMoveTo node works in the same situation. If you add a breakpoint in your BT, you can see what the value of Objective is in the blackboard. That might give some clues.

sudden citrus
#

Today's fun experiment: Figure out which config bool on the Navigation System and Recast Navmesh does the exact opposite to what it says

#

For example: "Initial Building Locked" comment says it does not influence editor-time generation. It does, and it prevents Force Rebuild On Load from working

vernal pivot
#

how do you cast to a behavior tree task?

sudden citrus
#

cast what?

#

and why? I've never needed to talk to a behavior tree task, they should run on their own and be cancelled by the owning BT observer set

nimble smelt
#

Okay asking here. I've got a pawn that's mostly moving via physics, if given a destination it flies there in a straight line. Inputting a debug destination works fine. HOWEVER, when I run a behavior tree on this pawn, the physics motion slows to a crawl and starts stuttering, even though the pawn's tick rate is still good.
The thing is, the AI step that seems to cause this issue is literally just this. It's nothing, just calling "Set" on a variable. But without this, physics on the pawn runs smoothly.

nimble smelt
#

If I simply edit the above to remove the Set call, suddenly the pawn moves smoothly. Why does this set call interrupt physics motion?

#

Wait it's not even that call! I added a LONG wait call on this AI function so this only gets called ever 15 seconds but STILL the physics doesn't work smoothly. Why?! It isn't even getting called more than once!! This makes no sense!

#

The PRESENCE of that Set breaks physics movement.

nimble smelt
#

Ok RAD I've proved that this isn't an AI issue, now I can just go to #blueprint with this 😄

stuck slate
#

General Question about the best approach to a problem of mine.
im doing TF game that have horde and waves of AI that going to the base, they can break walls and other obj that they have in their way.
But I want them to break it Only if their path is blocked by them(those obj) and they cant reach the player/base. if they have a clear path so they will ignore those obj and move along
any tips?

misty wharf
#

Maybe try making it so that obstacles have a nav area with a higher movement cost

#

This should make them prefer to go around them, but if no other path is available then they would take the more expensive path

stuck slate
#

ill look into it, Thank you very much

dapper onyx
#

Good day, I'm looking to get into StateTrees but I can't seem to find any resources about it. (The official "documentation" is sparse, at best). Does anyone have a sample-project one could look into or does one of the unreal-demo include good examples about it? They haven't used it in Lyra :/

ocean wren
#

CitySamples has statetrees I believe

dapper onyx
#

Thank you so much! I'll look into that!

harsh storm
#

The official documentation actually covers pretty much everything you need to be honest. The only issue that I was having back when I was fiddling with it was data communication didn't seem to be working as advertised. So, getting data from one task to another task just flat out didn't work the way the docs said it was supposed to.

nimble smelt
#

So I've got an AI pawn that isn't moving, and this is for sure why. But I don't understand what it means by goal projection, where do I disable that?

#

Oh weird, it's a hidden variable on MoveDirectlyToward. You'd think the "you're not using navigation" system wouldn't let you even turn that on

tardy wolf
#

For pathfinding, is it possible to get all points in a path? Also is it possible to make a path using this sort of data?
I have a squad and I want each character to replicate the origin's pathfinding but with an offset for formations.

ocean wren
#

You can in C++, not sure about BP

tardy wolf
#

Right. I don't mind diving into C++ since I'll be doing that after prototyping.

ocean wren
#

Think the call is FindPathAsync? something like that.. returns a vector of path points if I recall.. been a while

tardy wolf
#

Its a good starting point at least, thanks. I'll look into it.

lyric flint
#

Is it possible to implement machine learning through BP?

#

Or would you need plugins?

ocean wren
#

Well, its turing complete so you COULD, but.. no 🙂

lyric flint
#

its not possible?

ocean wren
#

Well, I mean its possible that Bigfoot exists.. but highly unlikely

#

I'd suggest that if you want to do ML, then you think about running the ML remotely and using BP to pass data to it

#

There are plugins of course.. but ML on one machine is a bit of a bad idea for any non-trivial models

lyric flint
#

ill need the ML to pass data to BP as well in order for the AI to make tangible decisions ingame, is this possible? BP gathering data from files in a folder/outside the engine?

lyric flint
ocean wren
#

I believe so, but again its usually a bad idea because you might not have access to the files

#

well, trivial would be something like a model that classifies letters

lyric flint
#

shouldnt be a problem if the ML program is inside the game folder id think

ocean wren
#

the typical "hello world" ml model you know

lyric flint
#

oh like a chatbot?

ocean wren
#

no, chatbots are going to be a lot bigger (assuming it isn't crap)

lyric flint
#

im guessing youd need to be running the ML program while the game is running at the same time

#

the seperate program i mean

ocean wren
#

yeah, so what I usually do, is I use a REST api running my model, call it via an UE call and then just use JSON to pass the data between them

#

That way, I can run the ML model on another machine or in the cloud

#

or on my cluster

#

Something like FastAPI can get you started quickly if you're used to Python ML models

lyric flint
#

oh okay so just gathering data from a site/server then?

#

thats on the web

ocean wren
#

its basically a HTTP request/response

#

yeah, in ML terms, they're usually called "endpoints"

#

but they're just ML models hosted via a REST web api

lyric flint
#

yeah i dont really know anything about ML im just getting started

#

I was thinking of a typeable chatbot but that might be too complicated. I was thinking instead that the AI can choose from a large range of pre defined behaviours/choices based on data from its enviroment, itself, and the player. but maybe that doesnt require ML

ocean wren
#

no, it doesn't

#

its basically what the behaviour tree is meant for

#

or statetree

lyric flint
#

im guessing ML is for more dynamic things like a typeable chatbot, image processing or physical movement/navigation stuff

ocean wren
#

ML is quite a broad topic 🙂

#

and then there's RL too

lyric flint
#

oh reinforcement learning

runic flare
#

hi I'm just starting with EQS -- can someone explain what happens if if add more than one generator to the Root of the EQS Query Graph?

#

does the system run the nodes L->R and choose the output with the highest score?

#

or something else...

ocean wren
#

show us an image of your setup

#

But yes, there's a left to right evaluation.. if you have two EQS query stacks and it doesn't return anything in the leftmost, then it'll fall back to the right

#

So the root basically calls whatever is under it left to right until it sees a return

runic flare
#

ahhh of course

ocean wren
#

What you'd typically do is have a set of complex EQS settings on the left.. and a more lax one on the right

runic flare
#

gotcha, makes sense thanks

ocean wren
#

Quite a few people didn't know it did that fallback.. I don't think its documented anywhere, or at least isn't clearly

runic flare
#

yeah I searched for quite awhile but couldn't find an explanation -- all the tutorials only show one branch off the root

#

but I need this fallback behaviour so Im glad it exists 😄

nimble smelt
#

QQ, is it intended that Rotate To Face BB entry only affects yaw and not pitch? (second image is me liveprinting the control rotation)

#

(I do know for a fact that the destination target is not on the same plane as the actor)

stuck slate
#

Can I give the BT action cost ? I want the AI only to do the action he needs to only if its his only way. (I tried to give that object navmodifer its not work well they are still trying to destroy it even tho thier path is open )

nimble smelt
#

How do you do interrupts in a behavior tree? Say if my AI is moving to a certain location but halfway along the route it detects a player

ocean wren
#

Higher priority (left most) can interrupt lower priority

covert scaffold
uncut pasture
#

hi guys i m facing a problem with the ai move to (not workinng) , i ve found multiple solution online and it didnt help the ai move to doesnt work

covert scaffold
uncut pasture
#

Nav mesh placed

covert scaffold
uncut pasture
#

I'll check first in the project setting

uncut pasture
uncut pasture
#

I set it dyn and it still doesn't work

#

I tried to call it on event tick and the editor crush everytime

ocean wren
real haven
#

I want a mob that patrols along a set of locations (array), but BB doesn't support arrays. I was thinking of implementing this https://forums.unrealengine.com/t/can-blackboards-have-an-array/306261 and I made a new UObject that holds TArray<FVector> Array inside. The problem is, how can I use the BT to iterate over this array?

#

MoveTo task only supports Actor and Vector BB values

real haven
#

Seems like a basic AI feature. Patrolling between points. I think I’m missing how to do it more easily since I’m new to using UE

stable falcon
#

its in a Behavior tree task named BTT_Attack Right now i am casting to a Blueprint to get the mesh and play the animation montage is there any way to play montage without casting, please help

#

i dont want to cast to a blueprint each time a enemy attacks

stable falcon
ocean wren
real haven
#

thanks!

ocean wren
stable falcon
#

So i don't want to call that every time enemy attacks

ocean wren
#

Have you profiled it?

stable falcon
#

Not yet

ocean wren
#

so how do you know its costly?

stable falcon
#

I read somewhere in doc

#

Is it costly?

ocean wren
#

Well, its not free, but the real answer is "it depends"

#

if you only have a few enemies, then no

#

if you have a million, then yes

stable falcon
#

Ohh nice thanks for ur help

ocean wren
#

I'd not worry about it until it becomes a problem

stable falcon
#

Ok I will remember that

ocean wren
#

if you're using blueprints, you are already accepting the performance hit

stable falcon
#

Honestly i like to code but BP takes less time to prototype and get results

ocean wren
#

Yeah, fair enough doing things with BP, but don't expect maximum performance is all. Its really not a problem until its running too slowly

#

Then its usually something other than what you expect anyway

rugged talon
#

what is the main difference between a serive and a decorator

#

and what is the difference between aborting when result change or aboriting when value change

misty wharf
#

Decorators can alter the flow of the tree, services can't... I think otherwise they are functionally similar

#

The intention is that services would update values and do other other simultaneous tasks while the tree runs but you can use them for whatever you find useful

#

Abort when result changes: Only aborts if the result changes, eg. true becomes false, abort when value changes: aborts every time the value changes, even if it changes to the same value, eg. true to true

lone stump
#

@stable falcon you can make it less costly by casting to character instead of AI_Zombie, but it shouldn't make much difference. You would be able to use that same task for other characters then

misty wharf
#

If AI_Zombie is a Character then it makes no difference which one you cast to in terms of performance, just the total number of casts (and it's unlikely to have a big impact on it anyway)

harsh storm
#

Also - there is a fairly high likelihood that your AI_Zombie is already loaded in memory anyway. So, w/e.

trail pelican
#

Hey are they any good tutorial about complex boss ai?

#

I want to try to make something like Death Door bosses, but can't find any good tutorials or courses

wintry flint
#

Community tutorials for AI is generally much scarcer than tutorials for Blueprints, I think for what you're doing the simplest, most easily tested version of Death Door-esque bossfights would be to make 2 attacks, and get the boss to conditionally switch between them

#

Like, say, have 1 attack for when the target is at distance or up close. Or if you want to super saiyan at low HP lol

trail pelican
#

I mean yeah, I also though about it, but wanted to find what other people did, and some experts you know

#

since I have no much experience working on ai, this would be helpful

#

(so I don't have to reinvent the wheel, just smart-copy)

misty wharf
#

Usually people just do the most straightforward thing

#

There's no secrets to it lol

uncut pasture
#

Hello guys
i have a simple Question

#

can i use ai move to on a pawn ?

#

cuz it didnt work but when i tried it in a new project with a character it did work

celest python
#

if you have a movement component yes

uncut pasture
#

i guess it doesnt

uncut pasture
#

i tried to move it without mov compo

unique fern
#

Is there a way to pass a variable AcceptableRadius value when using the MoveTo task node inside of a behavior tree? In this case, if I had several unit types with their own attack range properties and I wanted to use the move to node such that they approach another actor just until they are within range

dapper spear
#

I have an ai zombie with physical animations and ragdoll blend with animations that can killed, fall down and has the option to get up from death/ragdoll from a certain time. My character roams in a relative large indoor level, how do i optimize my ai when the character is far and it will getup again when the character is near? Thanks

alpine pecan
#

Also good afternoon. I'm trying to get my AI to path further from walls when they're just patrolling (rather than in combat). I've got an idea two potential approaches but no idea which one is sensible (or if they will work).

  1. Change the character's Nav Agent Radius to be much larger than normal when the AI is in the patrolling state - I cannot see any blueprint access to the nav agent radius value though so I'm wondering if this is not meant to be done. Maybe this only works before runtime due to the issues it could cause?

  2. Two nav meshes. The normal one for combat (so the AI can navigate very closely to walls) and the other using a much larger minimum agent radius. I can imagine there are potential issues where the AI is off the second navmesh but on the first that sound quite clunky to work around though.

misty wharf
#

iirc it uses the nav agent radius to choose which navmesh to use

#

but I'd just give them a try and see which works, they don't seem too complicated to try out

#

lack of BP access to something means nothing about its intended usage, it just means they didn't add BP access to it lol

alpine pecan
#

Going to try option two first methinks

dapper spear
#

I hope UE5 exposes this functionality on blueprints
https://www.youtube.com/watch?v=czuhb6lSEn4&t=529s

Project Files: https://www.patreon.com/posts/62180923 .
This is the 23rd episode of the unreal engine advanced locomotion series. But still, you can apply this method to change the point of the character seen by AI sight perception system. By default, AI sight of enemies can see the middle of the character. Because of that, when the player is b...

▶ Play video
misty wharf
#

I don't think it does... there might be some kind of performance reason for it since it needs to do those checks pretty often

#

It's not hard to do in C++ though

night relic
#

navmesh around navigation invokers is not generating anymore since I migrated the project to UE5

#

Anyone else having issues like this?