#gameplay-ai

1 messages ยท Page 150 of 1

celest python
#

Which version of engine you are using?

mossy nexus
#

this is 4.27.1

celest python
#

I'm on 4.26, that explains

#

Why you got the error after 1 year

#

I dont even have a check for !SearchData.DeactivatedBranchStart.IsSet()

mossy nexus
#

I assume they put in the ensures that weren't there before

#

this project started on 4.23

#

where I don't believe there were issues

celest python
#

Yeah this whole code block is new on 4.27

mossy nexus
#

explains

#

perhaps that's why it's buggy?

#

for what it's worth, this BT now works completely as intended:

#

there is no default state though

celest python
mossy nexus
#

because everything is decorated

#

so I feel like this is a bit hacky

celest python
#

Though I'm not even understanding that it tries to explain, maybe because I'm not a native speaker of English

#

"There should not have more than one deactivated branch."

mossy nexus
#

it doesn't make sense to me either

celest python
#

Have more than what? Have more than where?

mossy nexus
#

ah where's that Epic guy, perhaps we could ask him

celest python
#

I doubt he is working with AI framework

#

It's more like Miezsko's area, you can ask him via Twitter tho

#

He literally cares and explains

mossy nexus
#

I don't do twitter lol

#

but that's nice to hear

celest python
#

He is the only Epic staff answers questions on answerhub ๐Ÿ˜‚ ๐Ÿ˜…

#

Anyway, I think until someone points out something, you can go the "if it works, it works" way i guess

#

If it was something ultimately cruicial, it wouldn't be fixed in 4.27

mossy nexus
#

I can only go "if it works it works" if it ships

#

and I think that ensure will break that

celest python
#

Nope

#

Ensure does not prevent shipping

mossy nexus
#

I coulda sworn

#

I'll double check

celest python
#

None of the checks can run compile time

#

Only static_assert

#

And it takes static values only

celest python
#

But ensure() can not crash

mossy nexus
#

well previously that ensure caused a long thinking pause for the engine when it happened

#

but that does not seem to be the case anymore

#

so if it's just the case of the ensure being a d for the sake of being a d

#

it might work

celest python
#

And it will take a lot of time

#

I mean, you are not going to ship soon I guess?

mossy nexus
#

well no I ran it through exe/launcher before without IDE and that's where there were issues

#

just a VS ship, nothing major

#

this is my own project as well

#

but let's say I would want to get a demo out

#

yeah so it is an issue

#

because it freezes for like 10 seconds without an IDE

celest python
#

I just tried to say meanwhile trying to gather info about that ensure() you can keep working on other things, if you are not going to ship a demo in a few weeks or month, since its a fresh update you might not be able to get instant info about how to solve it

mossy nexus
#

oh yeah I'll ask around I guess

#

but if mieszko is only available on twitter that's an issue I guess ๐Ÿ˜…

celest python
#

Also available on answerhub but its very rare

#

I even saw people tweeting him to answer answerhub questions ๐Ÿ˜„

#

Wish he was active around here like MrHibbits

mossy nexus
#

aye it would make things much easier

#

ok so just did a test shipping build

#

and it doesn't seem to have the same issue

#

no 10 sec freeze

#

so I guess that might work

celest python
#

Yeah checks was not running on shipping build

#

But I was not sure about ensure()

mossy nexus
#

still, very strange

#

anyway, appreciate the assistance. knowing that ensures don't block shipping makes this seem much less of an issue than I thought previously

#

I'll see if I can catch Epic staff on the server and ask them about that code block

celest python
#

No problem, wish I could be more helpful ๐Ÿ™‚

#

Good luck on your further development

mossy nexus
#

thanks, appreciate it!

keen crow
#

I'm trying to add a filter for my blackboard key in C++ decorator but for some reason in behavior tree the filter removes every option but I have object BB keys inherited from actor

#

The CharacterKey dropdown is empty here although there are fitting keys in the BB

#

nvm, I changed it to this and it worked

keen crow
#

What is the best way to make my AI look not at character's actor origin when aiming at him but say at his head or chest? I'm thinking about setting focus point as some character's bone world location but I'm struggling to find the best function to override for this

bright rune
#

I use socket at head bone

keen crow
#

and how do you tell the bot to aim at that socket?

#

do you have some service in BT that constantly calls SetFocalPoint?

misty wharf
#

If you have a character, then they should have a head height value defined somewhere

#

you could perhaps make use of that

bright rune
#

First I check if I have target, then I try to get it's skeletal mesh and then find the socket location and then do this https://forums.unrealengine.com/t/how-to-make-character-look-at-you-only-head/144089

#

so anim BP takes care of the "Looking" part

#

and yes, you can apply that while aiming too (not only head)

#

for example make one of the spine bones to look at the target

keen crow
#

hmm ok thanks I'll give it a try

neat wing
#

hey guys. so i have a simple ai thats shooting at enemies when in sight. problem is my main character has weapons attached to the back and side, and they seem to be blocking the sight of the ai. so everytime i turn the main character back or side to the ai, it returns the 'successfully sensed' as false. does anyone know how to make the weapons ignore the ai perception?

misty wharf
#

Easiest fix is to check which trace channel it's using and make the weapon's collision profile ignore that channel

#

The perception trace channel should be in project settings somewhere, probably under AI

neat wing
#

@misty wharf I have actually set both the skeletal mesh and the collision sphere to ignore the visibility channel that the AI uses for its perception. any ideas what else could be causing it?

misty wharf
#

So your weapon is a separate actor with a collision sphere and a skeletal mesh, and you are attaching it to the player character?

neat wing
#

exactly

misty wharf
#

Hmm

#

If it's set to ignore the channel then I don't think it should affect it at that point ๐Ÿค” Maybe just try setting the weapon entirely to NoCollide?

#

And when ingame, verify that it still has those settings when attached by looking at it in the world outliner

tough helm
#

Hey, does Epic have any proper showcases of the BT/BB system like they do for stuff like Fortnite animations and the Action RPG example? Because we keep struggling with not knowing if we are using BTs correctly or not.

misty wharf
#

there might be livestream recordings I vaguely remember seeing on their YT channel

tough helm
#

Only thing I can find heavily documented is EQS and Perception system, but not stuff like creating Tasks and Decorators in C++, how to deal with Decorators aborting subtrees, how to properly utilize dynamic subtrees etc

#

I found this one, but it's overly simplistic, mostly in BP

misty wharf
#

Yeah unfortunately that's pretty much what the docs for AI is

#

As far as I can tell

tough helm
#

That's a damn shame

misty wharf
#

So if what you're doing works, you're probably doing it at least mostly right :P

tough helm
#

Well it works, but it's really clunky and we fight the system most of the time.

misty wharf
#

You can always ask here for feedback on how you're doing things

#

There's a couple folks here who know a thing or two about it :)

tough helm
#

Well for example I would like to send structures into BB and can't find a way to do that

#

Or like I said, a way for decorators to abort dynamic subtrees

#

without needing to tick (like the BP decorators from epic do, even with a comment not to use it like that...)

misty wharf
#

Yeah BB's don't really do that. UObjects are afaik the way to go if you want to carry more complex stuff there, but you need to make custom decorators etc. to do anything useful with those then

#

Personally I don't use the BB for everything, mostly for values which are more relevant to the BT itself, and I have more decorators and tasks that directly just access info on the relevant pawn

neat wing
dull loom
#

Hey guys, when using dynamic navigation is it possible to make the agent ignore it's own collision?

misty wharf
#

Yeah that doesn't really make sense, I'd recheck that the trace channel is indeed the right one, and the actor has the expected settings when it's not working

#

It's bit annoying to debug this stuff unfortunately

mossy nexus
thick dew
#

Sorry for the baby question, but how do tasks like "go to location" keep active until complete? When I make my own task, I only see events and nodes that complete or fail in one tick.

misty wharf
#

don't call finish execute until the task is complete

thick dew
#

Oh shoot is it really that simple?

#

Like, if I want an enemy to attack as soon as it stops being stunned, should I put a loop in the task, with waits?

tough helm
#

personally I would keep the info it wants to attack and just stop the BT for some time, it should pick up where it left off when it restarts

#

but it depends if your BT can handle this type of usage

#

you can also do a task that starts, returns in progress and finishes when some event "stun finished" is called or when gameplay tag "stunned" gets removed etc, without needing to tick, loop or wait

thick dew
#

Yeah, events would be more performant

#

How exactly do you tell it to finish when the event is called? Is it just binding an event inside the task?

misty wharf
#

One way to do it is to use an event dispatcher

#

For example I have a number of dispatches on my AI characters, like "finished throw"

#

so my BTT_Throw calls the Throw function on the character and binds an event to the Finished throw event

thick dew
#

That's dispatchers on the actor class?

misty wharf
#

Yeah

thick dew
#

Ok

#

Ahh, I'd never really wrapped my head around when to bind events

misty wharf
#

it's quite useful for a lot of things like this :)

#

basically when you want others to be able to react to something happening in your actor, without the actor having to know who wants to know

keen crow
#

Is there a decorator to compare a blackboard value to a constant? For example I want to put a decorator on a task where I compare Enum blackboard value to some constant. I wouldn't really like to make my own decorator for comparing every type

misty wharf
#

Doesn't the Blackboard decorator do just that?

#

It allows you to compare some value in the BB to a value you specify in the decorator's parameters

mossy nexus
#

I generally just make my own decorators in these cases

misty wharf
#

Ah yeah you might be right

quasi glade
#

@mossy nexus Hey, I was asking for help earlier with AI not moving as intended. I just fixed it! If you're interested the issue was that RecastNavMesh had Runtime.CanBeMainNavData turned off by default, when I turned it on the AI started to move again. What a damn relieve, this was bugging me for a few days already.

mossy nexus
#

good to know

#

thanks for posting the solution

quasi glade
#

Yeah, I'm about to post it on few other topics in the internet since people still did not find the solution. I hope it saves someones time, eh..

keen crow
misty wharf
#

Yeah it has some special handling for some other types but not all as CE pointed out earlier

keen crow
#

Another question. Why on Earth can Move to task occasionally (1/10) fail? I'm going insane here. Even if I put Force Success decorator on it sequence still fails on Move to even though I can see in the runtime that the blackboard key points to a valid actor in world and is actually reachable via navmesh

misty wharf
#

it can fail sometimes if the actor is blocked and cannot move for some reason even if technically a valid path exists

#

at least I've noticed this behavior in some of my own testing

keen crow
#

And why doesn't Force success decorator doesnt work? And why does FinishWithResult Succeeded task finishes the execution of a sequence immediately instead of completing selector with a successful result?

misty wharf
#

Well force success should always force a success regardless of what happens with the node

#

FinishWithResult should just succeed the selector in this case

keen crow
#

And for some reason it just doesnt work. Or maybe something else doesnt work somewhere but I'm already losing my mind here

misty wharf
#

hard to say without seeing more of the tree

keen crow
#

Well the initial behavior tree select between 3 states: attacking player (the CurrentTarget is set in AIController via damage and sight senses), Investigating some locations and just patrolling - going from 1 set point to another.

#

Then the attack behavior tree focuses on target, moves the bot to an acceptable range and attacks and avoids characters point of view

#

And when I'm debugging I can see that combat BT runs for an instance or for some time and eventually stops at move to and just switches to other select options from calling BT

misty wharf
#

it doesn't really look like that should abort unless the currenttarget value changes..

#

the selector looks like it should always succeed, since it has the FinishWithResult branch

#

and the Move To should also always succeed since it has that decorator on it

keen crow
#

well it doesn't. there are only 2 actors on scene and no breakpoints trigger

misty wharf
#

have you checked this dropdown has an actor selected in the BT editor?

#

sometimes it will automatically select, sometimes it won't... unless it has an actor selected, it won't break on anything

keen crow
#

yeah I have the correct bot selected. There are only 2 characters on my level - player character and bot

misty wharf
#

Hmm, in that case it would seem to me that the entire sequence never even starts if none of your breakpoints that are seen in that picture trigger

keen crow
#

no no i meant breakpoints in code are not triggered. those where the BB CurrentTarget is set or cleared

#

those breakpoints in BT work

#

but eventually it all just stops at MoveTo

#

and switches to another select option in the initial tree

misty wharf
#

Ahh I see

#

I recall the visual logger logs more info on BT state - I would try looking at that

#

I think it might log the state of each node as they exit, so you should see if something is failing

#

It really doesn't seem like the move to should be the problem there because force success should force it to succeed...

#

one thing you could try is wrap the move to in a sequence and put the force success on the sequence, or try using the same selector method as in the earlier node

keen crow
#

How can it be that even though CurrentTarget is set the last option is still chose instead of first here?

misty wharf
#

if the Run Behavior node fails then it will try the Investigate branch, and if that fails, then it will pick the Search branch

keen crow
#

ah right

misty wharf
#

so it seems that's what would be happening there

keen crow
#

then again something fails in the combat BT

misty wharf
#

Yeah it would appear so

#

check the visual logger, I think it should have more details on it

keen crow
#

where exactly is it?

misty wharf
#

Window->Developer Tools->Visual Logger

mossy nexus
#

my own experience is that generally the nodes put forward by default weren't working well, so I have had to create my own nodes in many cases

keen crow
#

hmm ok I was running it to a point when the Combat BT stopped working (which was almost immediately). What exactly should I look for here?

mossy nexus
#

I've personally had not had great success with the visual logger as most of my logic is spread between a component and the BT. I default to looking at the BT while in play to find issues

misty wharf
#

the BP_AIC_NPC_C probably has the BT related logs in it

#

so if you click that and then move the red indicator thing it should show you different data

#

you can turn off the other log categories from the bar above so it might be easier to see where the relevant bits are

#

But yeah also if you do pause in the behavior tree, you should be able to use the debugger buttons there to go backwards and see where it aborts... but I think vislog shows the node info as well in case the BT debugger isn't cooperating

mossy nexus
#

I don't know what the BT debugger is. the BT runs actively while in play. if it doesn't run, it means there are no valid paths

misty wharf
#

I mean these buttons up here

mossy nexus
#

I assume that works with breakpoints only

misty wharf
#

Yeah that and if you manually pause from there

mossy nexus
#

I see

#

I haven't had to use them

#

but to be fair my only issues so far with BTs have been bugs on the side of epic's code

#

the rest has been easily handled through just watching the BT react

misty wharf
#

heh

mossy nexus
#

it's still a problem in editor/dev builds, but it's something that doesn't affect shipping builds

#

which I guess is a silver lining

#

(and has been fixed in UE5 apparently)

keen crow
#

k I reorganized my BT tree like this and it just started working

#

Another question. How do I make my character invisible for AI controllers perception senses without casting an observed actor to the game character everytime and checking some condition? AFAIK you can place a special component on actors to make them perceptible but characters seem to have it somewhere under the hood

#

What I want to do is make the bot ignore my character once it dies

misty wharf
#

you can remove it from the perception sources or whatever it was called

#

stimulus sources?

keen crow
#

remove what exactly? I want my bot to still being able to see things but just ignore dead characters without casting actors every time they are sensed

misty wharf
#

The character when it dies should remove itself from the perception system stimulus sources

keen crow
#

and how do I do that?

misty wharf
#

the perception stimuli source component on the character should have a function for it

#

UnregisterFromPerceptionSystem

keen crow
#

Hmm I don't have it on my character yet. Should I place it? I mean my character has been successfully sensed with all the senses without it so far

misty wharf
#

Hmm maybe there was something that automatically registers characters as stimulus sources... but I think if you add the component it should be fine

#

There is a function on the perception system directly to remove something from it, but it's not BP-exposed... the function on the component basically does the same thing

keen crow
#

ok thanks I'll give it a try

cold trout
#

But you can disable that via a .ini edit

#

[/Script/AIModule.AISense_Sight]
bAutoRegisterNewPawnsAsSources=false
DefaultGame.ini

keen crow
#

but should I? I mean I like that pawns are automatically detected, now I just need a way to tell bots AI controllers to ignore the character. I tried adding the AIPerceptionStimulusComponent and calling AIPerceptionStimuliSourceComponent->UnregisterFromPerceptionSystem(); once the character dies but that didn't help, bots still see dead characters

misty wharf
#

I think you need to add Sight into the list of senses the stimulus component registers for

#

otherwise it won't unregister it

cold trout
#

Yeah that's probably right

#

And you've def got the stimulus source comp on the pawn, not the controller?

#

I recommend not doing auto-register

#

It's confusing that it's default

ruby bluff
#

Can somebody point in the direction one would be advised to start from to implement attack patterns into the game? Like the classic SNES bosses, or SHMUP's.

misty wharf
#

I think those are mostly state machines

#

you could probably make use of behavior trees for it if you wanted, basically create some custom BT tasks for your different kinds of things, like making your boss move or fire in a pattern, and then you can sequence those in the BT

#

or if you don't want to use a BT just make a regular state machine based on some other system like an enum value for each state

ruby bluff
#

Hm, is it possible to use state machines without an AI controller attached?

misty wharf
#

Sure

#

a state machine is not something that's built into UE or require any specific method of use

#

basically it's just a system which goes if(state == x) { do something; } else if(state == y) { do something else }

#

it can be more fancy or less fancy depending on how you want it :)

simple crest
mossy nexus
#

or you could use a behavior tree ๐Ÿ˜

simple crest
#

(yeah, tbh)

ocean wren
# ruby bluff Can somebody point in the direction one would be advised to start from to implem...

I had a friend do this by having a character string for the attack pattern. He parsed out the "what to do next" at a given timestep and each pattern was just a given string parsed from a comma seperated string of movement actions. So for instance dn,dn,dn,fire,left,leftrn,leftrn,left etc. So he basically parses the string out into tokens, then for each timestep, he would do a function pointer lookup for each parsed token (after converting the token substring into a hash value) and then simply do that function. Each function would run for a given amount of time and do something like move the sprite down the screen, or rotate it or move and turn etc. Basically it was just a sequence of actions one after another. But I thought that idea of using a text editor for his attack pattern creator was neat ๐Ÿ™‚

#

The text based approach has the added advantage that you can easily add new attack pattern token types in

#

This was back on the amiga though, so yeah, nobody was doing custom toolsets

#

I had a student do the same thing in Unity and used a bunch of splines and timelines but honestly I think the text based approach was better ๐Ÿ™‚

misty wharf
#

text based pattern is probably easier to modify, but harder to make it behave in an exact specific way

#

if you need a lot of different patterns it's probably a good system, but if you need a smaller amount of really elaborate and specific patterns, then it might not

#

not that I have implemented something like this ever, but at least that's what it seems like to me :)

ocean wren
#

if you make the timestep small enough between tokens, you can pretty much get anything you want

#

just makes the string bigger ๐Ÿ˜‰

misty wharf
#

Yeah might make it harder to visualize what the end result is like lol

#

I don't think the patterns are really that complex in most, it's like move in this cardinal direction and fire, move in that cardinal direction, fire in a spinning pattern

#

so text instructions would work pretty well for something like this

#

could even do it in code pretty easily so you don't actually need any parsing for it

celest python
#

I just have a struct that contains one montage and a montage array used as "possible next attack montage"

#

I also have a boolean "bGeneric" if its set I can choose any other montage without shuffling from possible next attack montage array

#

Works well with a wacky arcade game blobdance

dark dirge
#

(sorry for english). Hey guys, Im new in Unreal so I have a easy problem (maybe xd). I have a parent class of enemy with death event, and it calls when child class dies. In death event capsule changes type to not react to bullets, but because it calls in parent class, it changes type collision in other child actors, so when I killing one of the child actors, all of them change collision and after one kill all actors doesnt react to my bullets. How can I fix it?

misty wharf
#

That isn't really how parent->child inheritance works

#

if a function is called which is in the parent of some class, it only affects that specific instance

#

if all your instances of some actor get affected by the function call, then the problem is somewhere else - it's likely you're calling the function on all of your instances

dark dirge
#

hmm, I thought that it works like that too, but had a doubt. I dont understand whats wrong then xdd

misty wharf
#

Where does this function get called from?

dark dirge
#

from "health" component, which is in parent class

#

and then "on enemy died" calls the event in parent class

misty wharf
#

So you have BP_Parent -> BP_Enemy or how is the inheritance structured?

dark dirge
#

bp_enemy -> child

misty wharf
#

what class is the first one in with the OnEnemyTakeAnyDamage?

dark dirge
#

bp enemy then

misty wharf
#

ah okay, was just wondering why you had a separate Enemy variable

#

which seems unnecessary if it's in the parent class

dark dirge
#

it has component which called "health component"

misty wharf
#

What calls the OnEnemyTakeAnyDamage event?

dark dirge
#

this thing in health component

#

or I said wrong thing?

misty wharf
#

Hmm ๐Ÿค”

#

Does it actually print the Im dead message for all of your enemies when one of them dies instead of just printing it once?

dark dirge
#

sec

#

it prints once

misty wharf
#

try putting a print into the function which enables the ragdoll and see how many time that happens

dark dirge
#

it prints once

#

but I found one thing, that I can kill two enemy before this happens

misty wharf
#

if it only prints the correct number of times, that seems like it's not being called multiple times then and something else is triggering the issue

dark dirge
#

waait

#

I created a function, and calling this function after the branch in health component and it works

#

maybe custom events calls on all childs?

#

or it doesnt work like that

misty wharf
#

nothing ever calls on everything unless you explicitly ask it to

#

(eg. via get all actors of class -> then call on the items in the array)

dark dirge
#

hmm

misty wharf
#

one way to test it further would be to just disable the function call that ragdolls on death

#

if they still ragdoll (and I suspect they might) the problem is elsewhere

dark dirge
#

I found another thing. I have some experience stuff in player controller, and if after calling death function in bp enemy and then it goes to exp event in player controller, collisions breakes

#

in this option it'll break the collisions

#

"enemy died" in bp player controller is an event, it just calculate things, maybe it somehow doesnt return to enemy, idk

misty wharf
#

you can use find in blueprints to search for other places where it might cause the collisions to change

dark dirge
#

nothing strange

misty wharf
#

well in any case you should try disabling the function I guess

#

that way you can eliminate with certainty that it's not causing the issue

dark dirge
#

the same problem, but now its just not a ragdoll

#

I found where the problem is

#

I have stupid "inventory" system, and idk how but there is a problem

#

waait

#

the variable "buff for damage per level" was zero

#

._.

#

and damage was zero on second level, so I could not apply damage and notify ontakedamage event I think

#

god damn

misty wharf
#

heh

#

yeah games are pretty complex so sometimes systems interact in unpredictable ways

dark dirge
#

I spent a week on it

misty wharf
#

well hopefully next time you'll know more about how to debug it so it won't take so long :)

tough helm
#

hey, are there any bots in the old UT source files?

pine steeple
#

yes

swift nova
#

Does anyone have any info or comparisons on performance between instanced nodes and uninstanced nodes? My Utility AI system needs instanced nodes but I'm afraid it will tank performance

mossy nexus
#

are we talking about HFSM?

swift nova
#

UBTTask and UBTDecorator for Behavior Trees specifically, this Utility AI system integrates into UE4's Behavior Trees

celest python
#

How much AI you have?

stark zealot
#

Anyone know if it's possible in blueprint to take an array of actors (in my case beds) and pick a random one, then check if it can be navigated to by the AI and is not blocked by a door or something. I've exhausted every idea I could think of but I couldn't figure out how to do a proper check to see if the AI can navigate to that specific bed. I know EQS can do it but I don't think I setup the Query Context the best way so it only works sometimes. Any Ideas?

celest python
#

In C++ you can check if there is a path to specific location

#

But with BP I dont think so

swift nova
# celest python How much AI you have?

I'm not experiencing any lag or anything, currently running with 25 agents with no performance issues. I'm building this for a plugin so I want to make sure I have the most efficient implementation possible

celest python
#

If you dont have insane amount of nodes for each AI, with 25 agents it should not be a problem afaik. I havent measured the overhead too, but generally you want to care about optimization about those topics when you start to hit 50 agents or something like that

swift nova
#

Good idea, I'll pump that number up and hop back into the profiler. Thanks!

celest python
#

with a very little radius

#

dirty but should work i guess?

#

if it returns a proper location value AI can be able to navigate

stark zealot
#

I tried but when I do that my AI simply moves to the location directly below that bed. For example if the bed is on the 2nd floor and the door is locked, The AI will move right below it on the 1st floor, then finish the "AiMoveTo" node as successful.

celest python
#

Uh, yeah.. I forgot that function raycasts the closest navmesh

#

You must get your hands dirty with C++ then

stark zealot
#

Darn. Well for now I'll just do a more hands on approach and only only include the beds that are reachable in my array. Then manually add the other beds into the array once those other doors are unlocked.

celest python
#

Uhh

#

Actually

#

Dont we have a decorator for that?

#

BTDecorator_DoesPathExist

stark zealot
#

๐Ÿคฆโ€โ™‚๏ธ

#

Oh nooooo...... I've spent all day on this

#

How did I not see it

celest python
#

I was just going to send my code for that, then I realized I took that code from that decorator ๐Ÿ˜‚

stark zealot
#

Hahahahahaha Thanks for the help. I'm going to try it out now. Man I'm happy but disgusted at the same time ๐Ÿคฃ

celest python
#

Haha, no problem ๐Ÿ˜„ Similar things happen to me all the day and I end up asking most stupid questions in #cpp

stark zealot
#

What's funny is I've talked to several people today about it and they didn't know about that decorator either lol.

#

Works Perfect. Wow that was too easy. I'm definitely calling it a night after that. Thanks again @celest python ๐Ÿฅณ ๐Ÿฅณ ๐Ÿฅณ ๐Ÿฅณ

celest python
#

Np ๐Ÿ™‚

silk spear
#

are BTServices bound by tick? If I set the interval to 0.001 will it get called once in a frame or 16 times?

misty wharf
#

Good question. You could probably try it out and see, I don't know if anyone would know the answer

#

I vaguely remember there might be something else in engine where if your framerate is not high enough to match the required interval it would call the function multiple times

#

but some other places where it doesn't do that

#

so it really could work either way :P

silk spear
#

just checked, they only get called once per frame

misty wharf
#

Interesting, good to know

mossy nexus
#

anything in the game is always going to be lower bound by tick

#

timers can accrue calls if they are less than tick, but they will only ever get called (together) at the next tick

celest python
#

Just looking at to ARecastNavMesh::GetRandomPointInNavigableRadius() and its one of the worst implementations in whole AI framework lol

#

I was using this a lot but never thought it was bad like this

misty wharf
#

Really

mossy nexus
#

I don't have the editor open

#

(or vs for that matter)

celest python
#

Depends, it tries to get a point, if it fails, it uses while() to find a point with relatively expensive methods

bright rune
#

those comments are funny too "todo extremely naive implementation, barely random. To be improved"

mossy nexus
#

any big O approximation?

celest python
#

I dont think while() will loop longer than 5 or 6 if you are not somewhere that navmesh is totally acting weird or something is wrong

#

It's fine if you are not using it 50 times in a frame though

#

You said you have 20 AIs usually, it shouldn't even create any visible overhead for you

misty wharf
#

I'm using that to spawn a bunch of junk :P

celest python
#

In my case I have 100 AIs potentially call this in a single frame so I might need to optimize this ๐Ÿ˜ฆ

misty wharf
#

...seems to work okay so far with no hitches tbh

celest python
misty wharf
#

Are they? :P

celest python
#

Yep

misty wharf
#

There's a bunch of stuff like that with weird todos in the engine code

celest python
#

They're making UNavigationSystemV2

misty wharf
#

Ah

celest python
#

And bunch of other stuff, as far as we heard from MrHibbits

mossy nexus
#

did you see that the bug that I had with the ensure was a faulty implementation Intax?

celest python
#

Yep I have, sorry I forgot to reply that

uncut rune
#

For some reason, my navmesh gets slightly distorted while I'm in play mode. The first photo is when I'm looking at it while not in play mode and the second photo is when I am in play mode. Does anyone have any ideas on why this is happening? ๐Ÿค”

misty wharf
#

I noticed the navmesh sometimes looks a bit wonky if you leave it on. If you turn the display of it off and back on does that help? It could just be a debug overlay glitch and not actually affecting the navmesh, which was the case with what I was seeing on my end

celest python
#

Yeah I remember I had similar issue

#

Navmesh was actually correct but when I tried to visualise it, it wasn't that accurate on the floor

ocean wren
#

if I recall, that UNavigationSystemVR has been in the codebase for like 3 years ๐Ÿ™‚

#

I mean an empty version of it

#

So if they're finally going to do something? good on em ๐Ÿ™‚

celest python
#

UNavigationSystemVR?

misty wharf
#
protected:
    /** allows adding random time to wait time */
    UPROPERTY(Category = Result, EditAnywhere)
    TEnumAsByte<EBTNodeResult::Type> Result;

Nice copypaste in BTTask_FinishWithResult lul

shadow python
#

if i have ISM being dynamically spawned in runtime, how to make it affect navigation so units don't try to pass thru it?

ocean wren
#

I meant V2 ๐Ÿ™‚

fickle cedar
#

How do I interrupt this part when PlayerToAttack is set?

misty wharf
#

set the bb decorator on the other branch to abort lower priority, or add a bb decorator to the branch you want to abort which aborts self

fickle cedar
#

will it abort as soon as the variable is set?

#

or will it wait till the sequence is done?

misty wharf
#

immediately

fickle cedar
#

Like this?

#

This seems to wait till the sequence is finished anyway

misty wharf
#

you did not set it to abort

mossy nexus
fickle cedar
real arrow
#

could you explain what you mean by this (the finish execute), i'm having a similar problem

real arrow
#

Very weird how aborting would just stop working

mossy nexus
#

more than likely it's the decorator that is being used not having a proper setup for that particular case

real arrow
#

I'm not using any decorators tho

misty wharf
#

If you don't have any decorators that might be the reason why aborting isn't working :D

real arrow
#

oh sorry brain fart, for some reason I was thinking about services

#

yeah with decorators I don't think there's anything that should be wrong as I'm just using a blackboard based condition decorator

#

in debug I can clearly see it the value of the variable change to a condition where it no longer satisfies the sequence, yet it never aborts

#

it was working before and now it just broke out of nowhere

#

but oh well

misty wharf
#

odd, never had any issues like that... you may want to add some prints to verify the value is what it seems to be, especially if you're inspecting values in the BP debugger it can sometimes show them completely wrong

real arrow
#

yea I'm using print statements and AI debug

#

maybe it could be something like tho, guess I'll have to check again

#

yea nop, was not it

#

rip

misty wharf
#

Maybe just rebuild the affected branch of your BT if it's not huge?

#

If you've verified everything is as it should be it seems like it could be some weird BT corruption issue I guess ๐Ÿค”

#

(although it seems somewhat unlikely it would manifest itself in this specific way only and not cause other issues too)

real arrow
#

yea, guess it's worth a try

#

anyway thanks for your help

real arrow
#

I guess I found the issue... I was running the "run behavior" task node, and did not realize that it treats the tree it goes into as a child tree, not as an independent one

#

for future people running into this issue

mossy nexus
#

sometimes it seems that abort options aren't available fully, and I'm wondering if it's because the tree is too deep to abort something outside the scope of the current top node?

#

seems like that's not the case, which brings me to the next question: what governs abort options?

misty wharf
#

iirc it depends on what the node is inside of, eg. selector or sequence

#

you can abort deep trees just fine, I have a top level BT which in some cases aborts a nested child BT

slate harbor
#

how do I get my character to sit on top of the location while using MoveToLocation? as soon as the edge capsule reach the location the character stops but i'd like the center of the capsule to be used instead

desert moat
#

I'm having an issue with my BT after migrating my AI to a new project. For some reason some of the arrows have reversed and now gone red. Anyone got any ideas?

misty wharf
#

Does it look like that in the BT editor?

#

Usually the arrows look like that if you're paused and using the debugger to go through it

#

If it causes problems I'd just redo the affected arrows and see if that helps

desert moat
#

Having a weird issue now tho, my delay doesn't seem to be working and my AI won't move anymore

misty wharf
#

Make sure you have a valid navmesh

#

Visual Logger usually contains more debug info on movement so you might want to check there as well

desert moat
#

Now I can't get my Can See Player variable to update. When will the bugs stop ๐Ÿ˜‚

opaque swift
#

anyone know if I have to incorporate replication in the AI stuff

bright rune
#

not for movement, but stuff like attack animations, you need to fire them on clients too

#

BT doesn't need to be replicated

mossy nexus
#

highest priority is leftmost, lowest is rightmost

#

you've put low priority actions before high priority actions

#

if it's not already giving you issues, it will in the future

opaque swift
#

I just assumed the ai control was embedded in the server so I wouldnt need to

#

but that clarifies alot

bright rune
#

ai controller only exists on server, but it replicates movement automatically via character movement component

opaque swift
#

bt tasks need to be replicated

#

?

#

also the default play sound node in the bt, does that replicate?

#

or should I make a custom one

bright rune
#

no, i don't think it replicates

#

you propably want to use the pawn for replicated stuff, so your bt tasks can call them and then they replicate via pawn

opaque swift
#

smart๐Ÿ˜ญ ๐Ÿ˜… my thinking was way off, that sounds like the better way though

bright rune
#

client doesn't know anything about behavior tree or bt tasks, so you have to use pawn or something else

celest python
#

Anyone knows how engine tracks AActor's location when we set FAIMoveRequest goal as AActor? (more importantly, does it do pathfinding tests for each request on tick??)

#

I couldn't find the code in the engine, probably looking wrong places

misty wharf
#

I think it might be in path following component

magic jasper
#

It repaths when the actor moves from it's original location by the "repath tolerance" amount

celest python
celest python
#

It seems like it's still doing the usual path finding but its async in the navigation code

#

That's why when you submit a move request on tick it consumes tons of CPU power but does not affect anything with move to actor method

magic jasper
#

Yeah doing it on tick isn't a great idea at all, it'll create a new AI task object IIRC too

mint bolt
#

Hello, I have an issue with Navmesh/AI. I have a huge dragon that has a capsule collision larger than 100cm radius and it gets stuck on some huge pillars that I have in that room.

#

Is there any way to tackle large/huge NPC's in UE?

#

I also have some bears that have the same problem if I use a CapsuleComponent with a radius > than 80cm

mossy nexus
#

they should have a separate navmesh

mint bolt
#

Explain a little bit

#

How can I have a separate navmesh for 2 separate actors? Is that possible?

mossy nexus
#

you can have as many navmeshes as you want. you have to configure your agents

mint bolt
#

Any docs on that?

little swan
#

yes go to project settings-> navigation system and add agent details like height/radius & rebuild navmesh

mint bolt
#

@little swan @ the 'supported agents'?

little swan
#

yeah

mint bolt
#

Leme check. The docs are so unclear :0

little swan
#

i dont think there are docs on ue website though, the agent properties are pretty self explanatory

#

you will notice multiple recastnavmesh in teh world outliner once you rebuild for each supporting agent apart from the default

mint bolt
#

@little swan Ok, i've set up 2 agents, one 'default' and one called 'Large' that has a radius of 100

#

Worked like a charm. By the way, how does the navmesh know to select the proper radius for an agent? Does it do it somehow automatically?

mossy nexus
#

you set the radius yourself for the agent

#

and the navmesh understands how much of a buffer zone you need for that particular navmesh

mint bolt
#

Ok, I see so based on that radius it knows what agent to choose. Thanks!

mossy nexus
#

oh I'm not sure that was the answer you were looking for. I can't remember if there's anything specific you need to do on the actors to pick the correct navmesh

little swan
#

yeah the navmesh selects the navmesh based on the agent radius/height you set

mint bolt
#

@little swan it works for my humongous dragon so I guess that's the answer ๐Ÿ™‚

little swan
#

you can also setup a custom navmesh implementation in the preferred nav data class in the supported agents

mint bolt
#

By the way, RVO seems a little off, any idea on that? But since that is only for the dragon that doesn't need RVO I hope it's fine

mossy nexus
mint bolt
#

@little swanhope I don't need to go that far ๐Ÿ™‚

little swan
#

yeah, if you use detour crowd controller you probably wont have to worry about rvo

mossy nexus
#

I can't imagine RVO would work for a huge agent vs a small agent... why would a dragon move out of the way of a person?

#

unless there's some sort of weighting

little swan
#

yeah probably based on how he wants to dragon to work

mint bolt
#

@little swandetrou crowd works very bad, tried it with a troll and some goblins around it. Was getting stuck in them so I've moved to RVO and it was quite fine.

#

The casts he does with the detour around it don't take into account agents that are in the sides of him (left/right). Of course, I could re-compile the engine to make it cast left/right but I don't have the time to do that so I've ended with RVO that works fine-ish.

#

The dragon will be alone in the room so I don't think avoidance of smaller agents is a problem in that case.

#

But I was afraid that it would not break it for something else ๐Ÿ™‚

little swan
#

yeah so the avoidance probably wont be an issue for the dragon lol

mint bolt
#

Thanks for the help! Didn't knew about those supported agents ๐Ÿ™‚

#

I just hope it doesn't cause other issues but I guess I'll see that in time.

little swan
#

yeah

surreal fable
#

Hey guys! I'm currently learning about all things AI in Unreal. This might be a silly question, but does it matter if the AI perception component is in the AI controller or the pawn? I'm looking to have many types of enemy types in my game and I'm unsure if having a unique AI controller for each enemy is wise or not. I've tried googling this for a few days now, but I can't seem to find any solid answers. All the tutorials and courses i've done say to put the component on the controller, but does that force multiple AI controllers to be created?

ocean wren
#

Think of AI controller like a horserider and the Pawn as the horse, normally the player would be the horserider steering the horse, so instead you need the AIController to be the horserider

#

So yes, one AIController per pawn generally

surreal fable
#

Thank you so much! Will it cause issues if multiple enemies of the same type use the same controller? or does each individual pawn have their own instance of the controller?

ocean wren
#

They each have their own instance

surreal fable
#

okay. Cheers!

ocean wren
#

One thing to note, there's a checkbox on the AIController that attaches it to the controlled pawn, if you miss that checkbox, the perception comes from the controller's position and its not always the same as the pawn.. Can't remember exactly the name of the checkbox, but you should be able to find it

surreal fable
#

gotcha! So gotta remember to use get controlled pawn location ๐Ÿ™‚

ocean wren
#

Yeah, sometime I've forgotten and had weird times understanding why my AI was doing weird things ๐Ÿ™‚

mossy nexus
idle hazel
#

Hey guys I know this is probably a super easy question. But how would I go about spreading my ai out like in lost ark ? https://gfycat.com/VagueTautFrog

I'm looking to try a similar setup, overlapping is fine so RVO and detourcrowd controller are no good.

It must be super simple right ? To apply an offset to the path but still have the actor be the goal ?

ocean wren
ocean wren
celest python
#

If you are with C++ you can also override GetMoveGoalOffset(const AActor* MovingActor) on NavAgentInterface or smh like that

#

In any case it's a pita and I'm also working on this currently, you need to observe the offset goal on your own

celest python
pseudo thicket
mossy nexus
#

once again, I'm getting ensure issues

#

ensure(ObservedKeyNames.Num() > 0); on project startup

#

for a decorator that has no blackboard values

#

not sure if it's another ensure bug or if it's actually valid

#
if (GetFlowAbortMode() != EBTFlowAbortMode::None && bIsObservingBB)
    {
        ObservedKeyNames.Reset();
        UClass* StopAtClass = UBTDecorator_BlueprintBase::StaticClass();
        BlueprintNodeHelpers::CollectBlackboardSelectors(this, StopAtClass, ObservedKeyNames);
        ensure(ObservedKeyNames.Num() > 0);
    }```
#

this is the full statement

#

I have other decorators that do not take blackboard values, and somehow they don't have this issue

#

so I'm not sure what the reason is for this

#

the decorator uses the following observer property: aborts both, and the ensure only triggers when it is set to be aborting

#

seems like it's linked to the bugged issue, so perhaps it's part of the same code block that will eventually get removed

placid comet
#

Doing a RPG Game with more than one party member involved and more than 1 map level and have run into an issue...How do we get the ai to resume back control again after taking possesion of them instead of standing around dead on the screen after controlling them?

dry island
#

Hello all, having an odd issue with a behavior tree. Was wondering if anyone knew enough about them to take a gander?

pine steeple
#

Dont ask to ask, just ask

dry island
#

Fair enough. I just can't figure out why a particular sequence node isn't firing...

#

Might be easier to show so I didn't know if anyone had a few moments

pine steeple
#

Problem is, no one is just going to go "Sure i will help", but if you post something someone might see it and help you ๐Ÿ™‚

dry island
#

Fair enough

#

Essentially, I'm trying to start to work with behavior trees because I want some complex AI systems --- I want enemy cars to follow the player when the player performs certain actions, so I'm trying to learn how to use behavior trees. I currently have a blackboard and a tree set up, and for some reason the sequence I am running never gets to the second node, and I can't figure out why.

#

Here is the tree

#

And here is what the task looks like

#

Just wanted to start with a basic patrol. Following a tutorial and it just doesn't seem to work, though it looks like I'm correct. Been stuck on this for a bit. Any ideas?

pine steeple
#

are you sure it never gets to the second node?

#

or it fails instantly ?

dry island
#

Yeah, I was watching it

#

it just fails and goes back to wait

pine steeple
#

Wait will never return false

#

unless you abort the tree somehow, which is not likely here.

#

so your EnemyPatrol task must enter

#

put a breakpoint on the Finish Execute node

#

and play

dry island
#

Just a break key?

pine steeple
#

F9

#

break point

#

you should see a Red dot on the node

dry island
#

Got it

pine steeple
#

i would suggest a small tutorial on debugging in Blueprint, will help you a lot ๐Ÿ™‚

#

now play

#

and see if that break point hits

dry island
#

I have only used print strings XD

#

Never break points.

#

Soo this is what I got

pine steeple
#

now hover over the success pin

#

what does it say

dry island
#

False

pine steeple
#

exactly what i said right?

#

hover over the yellow node

#

(Value) on the node to the left, what does it say

dry island
#

On the blackboard value node?

pine steeple
#

yes

dry island
#

It's giving me the current value

pine steeple
#

and what is that value

#

screenshot it if you can

#

want to see if its a legit vector or invalid

dry island
pine steeple
#

ok that looks valid, now i will tell you what the issue is

#

that node is not good

#

you want to use this node

#

BlueprintPure is executed everytime it is used

#

the one above that, is a Callable node

#

So your node ran twice, once for the location, and once for the return value.

dry island
#

Right that's why it has the pins

#

hmmm

#

ok

pine steeple
#

it found a valid location, but then it ran again, and did not

#

so location was good, return was bad.

dry island
#

I see

#

Interesting...

#

let's see if this works. Thank you for the help and explanation

pine steeple
#

i actually complained about this node 3 years ago

#

and they still keep it in.

dry island
#

Unfortunately that didn't fix the issue, but I'm glad I know the difference and thank you for telling me about f9 for break points and providing a resource!

pine steeple
#

now you need to ensure your navmesh is good

#

if its failing, then your navmesh is not good

dry island
#

Oooooohhhhh

pine steeple
#

when you start play, press the ` key and type "show navigation"

dry island
#

This tutorial didn't even mention navmesh

#

I'll need to look at this

pine steeple
#

lol

#

in the content browser

#

search for Navigation Bounds

#

this one

#

drag it in to your level, and then scale it to cover your floor

#

then try again

#

you can visualize the navmesh by pressing the "P" button

dry island
#

How will I know if it's working correctly? I have it in there now... still nothing

#

Oh wait

#

It did something

#

It's getting to the Move To node now, but the vehicle isn't actually moving

pine steeple
#

well that is another issue entirely

#

could be anything

#

for debugging move to, i recommed the visual logger

dry island
#

yeah lol

pine steeple
#

then you can see exactly what your AI is doing

#

what class is your car based on

#

Pawn? Character?

dry island
#

It's a pawn

pine steeple
#

if its Pawn, did you give it a movement component?

dry island
#

Yup

#

I had it moving with a spline before

pine steeple
#

did you set the speeds, etc

dry island
#

Yes

#

Although I'm not sure if I need to use speed in the blackboard?

pine steeple
#

i am not 100% sure if the normal movement component handles AI

#

all my AI are characters

#

and our vehicles move on a spline

dry island
#

Yeah, that might be the best way to do it...

#

I just want to make it so that the bplayers care can be chased

#

But I'm not sure how else I can do that unless I figure out how to make it use BehaviorTrees

pine steeple
#

not sure if navmesh would really be good for cars

#

unless they are small micro machines

#

though, even that would be problematic

dry island
#

Hmmm

#

Well you helped me alot so far, I appreciate it.

#

Thank you very much

ocean wren
#

Cars on splines? sounds crazy ๐Ÿ™‚

pine steeple
#

ye

#

works well

#

splines are auto generated

ocean wren
#

This an open world thing?

pine steeple
#

(our map is procedural)

#

we use AStar to create a spline from fixed points on the map

#

to generate the best path from A to B between these fixed points

ocean wren
#

Ah gotcha, so you can keep spline continuity

#

Never really tried vehicles like cars.. only done AI for planes and tanks ๐Ÿ™‚

#

Sounds sensible though, and if it works, it works ๐Ÿ™‚

pine steeple
#

yeah, path finding on a navmesh with other agents, would not work

ocean wren
#

I was just imagining a set of splines in a GTA5 style city and wondering ๐Ÿ™‚

pine steeple
#

so we couldn't really do that

#

already hits the clients hard generating navmesh as it is

#

and navmesh moving is not very smart

#

least with splines we can keep them on the road..

ocean wren
#

Are the roads on a grid, or more open?

pine steeple
#

more open

#

just wondering how games do car ai for a lot of cars

ocean wren
#

I guess you could always do the grid thing, but use linear segments rather than splines

pine steeple
#

never really looked into it, never been a major focus

#

we have a max of 3-4 vehicles moving

ocean wren
#

it depends a lot on the game itself

pine steeple
#

and these are for special missions

ocean wren
#

I mean I've seen presentations for racing games, where they use golden path splines and distance from spline constraints

#

But for sort of GTA5 stuff, its probably just spline following for most of it

#

And making sure you only spawn ones close, so lot of LOD'ing the traffic

pine steeple
#

i mean cars in GTA are pretty dumb

#

same as in Far Cry 6 i have been playing recently

ocean wren
#

Yeah, they're more like trolleys

#

If I were more into driving games, i'd like to do some AI for real cars.. more of a Mad Max style game would be interesting

#

But have waaaay too much to work on anyway ๐Ÿ™‚

celest python
#

Do I misremember or.. there was never an option to set trace start location on EQS traces?

misty wharf
#

Isn't that based on the context?

celest python
#

Yes but it's hitting the floor before it hits the context, I remember I was managed to add some Z to start value but I don't remember how

misty wharf
#

Hmm not sure tbh, I do remember there being an option where you can "reverse" the start so that it traces context to item instead of item to context

ocean wren
#

It was in the EQS query itself I think. There's a query context and an offset value in there isn't there?

#

If you look at the generate node properties

celest python
#

I had to add Z directly to the generator itself, sadly can not increase the test properties' trace values

ocean wren
#

You could just offset it in the context though

celest python
#

Yeah that makes sense too, will keep in mind

ocean wren
#

Yea, there's a few offsets in some of the generators

#

look at the circle for instance, there's a Zoffset in there

celest python
#

Yep

ocean wren
#

But yo ucould make a context blueprint and just add your offset into that before returning the result

misty wharf
#

it's a bit weird how all this is handled in EQS tbh

ocean wren
#

Yeah, the usability is trash ๐Ÿ™‚

misty wharf
#

making generic and parametrized queries is annoying

#

like if I want the context location be based on some parameters? how do I even do that other than sticking the position into some "global" and having a context which reads it from there...

ocean wren
#

The idea is good, but the execution is typically UE and not very user friendly

misty wharf
#

I dunno, a lot of UE is good in comparison to Unity at least lol

#

EQS is just a bit weird but you can work around it :P

ocean wren
#

Hmm, I'm not sure I'd call either of them good ๐Ÿ™‚

misty wharf
#

maybe there's a reason for it, but it would be nice if they told those reasons so I didn't have to wonder :D

ocean wren
#

I mean usability in the "I have this idea in my head of how it works, oh it works that way" kind of thing ๐Ÿ™‚

misty wharf
#

lol yeah

ocean wren
#

EQS is actually based off work that Matthew Jack did for CryEngine

#

So its a well understood approach and works for other engines.. but its 1) not well documented and 2) not usability tested with less experienced users and 3) not really well polished

misty wharf
#

yeah

ocean wren
#

As with most UE stuff, the core concept works, but isn't "nice" to use

misty wharf
#

I do find it quite convenient to use for various things despite its flaws

ocean wren
#

Yeah, its that caveat that is frustrating ๐Ÿ™‚

misty wharf
#

The most elaborate system I have using it in my project is an actor spawning/placing system that measures spacing between the given actors and places them in available space or stacks them on top of each other

#

it would certainly be possible without EQS but it would be more annoying lol

ocean wren
#

I've been toying with the idea of starting a company to actually redo a lot of this tooling and actually try documenting and usability testing stuff, but it feels like empowering an abuser at this point ๐Ÿ™‚

#

I might do it just for myself ๐Ÿ™‚

misty wharf
#

I've been thinking of starting to expand my UE notes into actual articles and posting them into a section under my game's domain for even a tiny bit of marketing lol

ocean wren
#

That's a very sensible idea

misty wharf
#

yeah, I've done tech writing on/off for like 10 years as a hobby so just need to decide when I feel like doing it :D

ocean wren
#

Show a bit of expertise always helps reassure followers I think

#

Takes way too much time though and honestly since youtube crapped on smaller channels, I've shied away from visible content production

misty wharf
#

I was doing a series "programmer reviews programming games" on YT for a bit but got distracted and then never got back to doing it more :D

#

(the story of most of my projects)

ocean wren
#

I've been thinking of making a new channel for the AI/ML "creative technology <createch>" stuff I'm working on. Doing things like research reviews and discussion pieces

#

Mainly for visibility in the createch sector if I'm honest

#

I'm going to become a propagandist for ML in games/creative

#

I've been in enough meetings to know that games people are dismissive of AI and its a real issue

misty wharf
#

sounds interesting

#

I kinda would like to try using AI to generate some of the content in my game but it's not really a topic I'm familiar with to a sufficient degree, so I'm just using a more traditional approach of lot of lists and randoms :P

narrow mason
#

I'm definitely interested

ocean wren
#

Yeah, I'm planning on doing a few videos on recommender systems and how that might apply to games. I've got a paper in the works on using graph neural networks for scene content generation that might well be a good vehicle for that

#

I'd like to do some videos on neural rendering and the most recent papers pointing in that direction for games in the future

misty wharf
#

I'm currently generating this type of nonsense for my game lol

ocean wren
#

There's also some potential for a few demos of using cloud based AI systems integrated into games as a video series

ocean wren
#

So, I am doing a livestream this afternoon for some sentiment analysis on twitch/discord/twitter/irc and it just struck me that I could build some sentiment based PCG into an Unreal Engine game and drive it from twitch/discord/twitter on a future livestream... oooh! and make it adversarial!

misty wharf
#

twitch integrations are always fun lol

fickle cedar
#

Do I have to trigger Noise Event each time a sound is played manually or is there any other way?

hot mortar
#

Hi, quick noob question: is there a way to use behavior subtrees that use different blackboards? When I try to do this the subtree doesn't execute, even if the subtree BB inherits from the main tree's BB.

misty wharf
#

@fickle cedar depends. If you use noise perception, every noise you want the perception to react to separately needs its own trigger noise

#

@hot mortar afaik no

fickle cedar
#

@misty wharf I guess... this all sounds like down to what kind of game am I making but... I thought there could be some sort of automation...

#

like in the sound's settings, to trigger noise for AI as well

#

when played

misty wharf
#

I suppose it could make sense, but you have to keep in mind that AI and sound are entirely separate systems, and in general when building software you don't want to couple separate systems too much in that fashion :)

fickle cedar
#

Yeah ok, I'll make my own automation, I was just curious if there's anything before doing it my way

#

Thanks

hot mortar
#

You would probably need to mark the sound cues you want AI to consider as noise sources. Like footsteps should make noise, some kind of ambient/cosmetic noises should be ignored

#

Might be potential to make this into a plugin or something

misty wharf
#

It would be possible to create a sound node that triggers noise every time it plays

#

which could then be inserted into the sound cues you use

#

but I don't really know if it makes sense architecturally

hot mortar
ocean wren
#

Well, my python fu was poor today, but the stream went well enough

#

Got through twitch, discord and youtube chat and analysing sentiment on it

#

Next time we're going to build out the bots a bit and feed them into a central message queue and from that into UE4

#

Just need to think of some simple gameplay we can use to power overall sentiment per-channel

misty wharf
#

what's your channel, I'mma follow so maybe I can come check it out :D

ocean wren
#

It went out on the University of Lincoln school of computer science channel today

misty wharf
#

oh sounds fancy

misty wharf
#

thanks

ocean wren
#

At some point the video from today will go up there

#

We use streamyard for them, so I think there's an approval step

#

I wonder what sort of gameplay we can drive from sentiment

misty wharf
#

Difficulty level? :D

#

Angry chat = more enemies

ocean wren
#

I want to do an adversarial thing, where different chat streams fight against each other

#

using sentiment in the chat

#

so twitch chat vs youtube chat or something

#

twitch chat vs discord might be easier ๐Ÿ™‚

misty wharf
#

ah

ocean wren
#

although a three way would be fun

misty wharf
#

what kind of sentiment data can it discern from the chat?

ocean wren
#

positive or negative scores

#

but we can also extract entities

#

and do other fun stuff

misty wharf
#

hmm, neutral and positive sentiment would probably be good, negative sentiment feels like it's not gonna be too fun to watch lul

ocean wren
#

I mean we can also have the bots channel commands too.. but I kind of want this vague sentiment fight thing ๐Ÿ™‚

misty wharf
#

if you can extract entities you could perhaps even allow some level of character control via sentiment, eg. a certain character is being cheered on and they become more powerful

ocean wren
#

well, the point is that you post negative sentiment things to drive the agent.. you'll likely be logged into chat just typing stuff to force the UE world to respond

#

the chat itself doesn't matter so much

misty wharf
#

yeah but you probably wouldn't want people posting profanity in chat too much :D

ocean wren
#

The power of web browsing is that you can be logged into the stream for dev, the stream for the engine, multiple chat channels etc ๐Ÿ™‚

#

Yeah, I did disclaimer today at the start of the stream ๐Ÿ™‚

misty wharf
#

:D

ocean wren
#

But in the UE version, we'll aggregate sentiment value, rather than posting the actual messages

#

so it'll be like an accumulated positive/negative weight of recent messages score, for each chat channel type

#

I need some simple gameplay which works effectively off of 3 floats -1..1 ๐Ÿ™‚

celest python
#

That's a nice education i guess

fluid goblet
#

I have a behavior tree that is getting stuck on Rotate to face BB entry. It works fine until I run away from the AI. Then the node reports when I mouse over it that the focal point is an invalid entry. But the key it's using is TargetLocation which I can see has a valid location in the keys. Any idea why it gets stuck? I also have a decorator to check PlayerIsInFiringRange. The decorator is set to notify on value change and aborts both. However it never moves on past the Rotate.

mossy nexus
#

let me guess, this is the leftmost node?

fluid goblet
#

yeah leftmost

mossy nexus
#

it's one of the standard nodes, so I don't know if it actually has a success condition

#

which means it's likely ever to only abort

#

if it's the leftmost node, nothing can abort it other than itself

#

my suggestion is to make your own rotate to face

fluid goblet
#

shouldn't the PlayerInRange decorator above be able to abort it?

#

ok, fair enough.

mossy nexus
#

yeah it will be able to

#

abort both will abort that subtree and restart the tree search

#

a good thing to do to debug these kinds of issues is having the behavior tree in a separate window (or on a separate monitor) to see what happens inside the BT during gameplay

fluid goblet
#

It's still running right now. If I mouse over the PlayerInRange decorator it says it's false(fail) but it's obviously not aborting

#

yeah I've got the BT on side and the game window on another

mossy nexus
#

nice

#

in that case your decorator may be broken

#

how have you set it up?

#

also

fluid goblet
#

ohhh you might be right

#

I have a service above in an earlier selector

#

and I think it's using an old "PlayerLocation" key I was trying.

mossy nexus
#

just because you have a blackboard value saying "PlayerIsInFiringRange = false" does not mean that the decorator isn't working necessarily

#

you don't need a BB key for every decorator

fluid goblet
#

I can watch the PlayerIsInFiring range move from false at start to true when I'm in range, and back to false as I back away.

#

Yeah I made a new PlayerLocation key to see if that woudl fix something and didn't change back.

#

let me try with TargetLocation again.

mossy nexus
#

but you can see that happen as well just by noting that the execution goes through the PlayerIsInRange decorator

fluid goblet
#

Dang, once I get far enough away it says the location to face is invalid.

#

but only on the node. They key it's using still shows a valid vector

#

ok I think something is not updating my target location properly.

#

that should also update when it checks to make sure I'm still alive, so I'm going to investigate this more.

mossy nexus
#

I make a point of not trusting most of the basic decorators and have for the most part made my own

#

same for tasks

fluid goblet
#

fun

mossy nexus
#

having seen the code behind them they are arbitrary in their handling of blackboard keys

fluid goblet
#

I'll start swapping out.

mossy nexus
#

yeah the general rule of thumb is that everything you can make yourself you at least have oversight over

fluid goblet
#

So everything stays valid until I back into a door and it closes. Something about the door does not jive with how it works.

#

I'm going to roll my own face player

#

Hey so, you should not have your perception range for sight be less than your firing range.

#

not sure what was happening under the good, but it was NOT liked by the BT.

mossy nexus
#

probably another built in oddity

#

I've made my own perception system as well

#

again, 0 trust

pine steeple
#

Perception system works fine for me

#

and 0 issues with it

misty wharf
#

yeah I don't think perception system cares about anything else except itself

#

if the range of the perception was causing issues with another distance check it just sounds like a conflict with how those two systems were being combined in custom logic :)

mossy nexus
#

possibly

#

anyway I'm sure the perception system works, but I just don't like having to deal with half finished implementations, or hard to customize implementations. at least with my own perception system I know what I'm getting, and I can fix it

#

hell even the interior logic of BTs has had a bug (that is fixed in UE5) that causes an ensure message to freeze non shipping builds for up to 10 seconds

ocean wren
celest python
#

Nice, I already knew you are very experienced but teach graphics + AI together is kind of an another level lol

ocean wren
#

And engine development and machine learning and big data analytics

#

And in the past game design ๐Ÿ™‚

#

We used to write our own engine in my class, these days we make a 2D engine and then move to UE4-5 the year later

celest python
#

We used to write our own engine in my class
That's adorable, some universities in my country still stuck with FORTRAN..

#

I know some people graduated don't know what ternary operator is

ocean wren
#

Kind of a bit of a tossup, making your own engine does teach you a lot, but its never going to be the sort of scale of 1.5 million lines of code like UE ๐Ÿ™‚

celest python
#

Ofc, but that 1.5 million lines comes with an irony ๐Ÿ˜„

ocean wren
#

I'm sure most UK universities still teach stuff like fortran and cobol and the like ๐Ÿ™‚

#

In fact, I've probably got colleagues in my school that do something similar ๐Ÿ™‚

celest python
#

I'm planning to study at UK too hopefully, after I finished my project

ocean wren
#

BUT NOT ON MY WATCH

celest python
#

haha ๐Ÿ˜„

ocean wren
#

Where are you from?

celest python
#

Turkey

ocean wren
#

Pretty sure I gave a talk to some Turkish indies a few months ago

celest python
#

There are only a few 'real' indies here

#

And I know all of them

ocean wren
#

Was organized by the turkish government

#

I think it was turkey, it was a bit of a last minute thing with a colleague doing the translation

#

I mean it was fun and all, but I was mainly just enjoying the vibe of being translated and projected on a big screen ๐Ÿ™‚

celest python
ocean wren
#

No, sadly.. just trying to think. It was a big open air event, the indies had been there for a few days

#

I think it was at a University over there, but this was the Turkish government, I guess some kind of creative sector body or something

celest python
#

I understand, I'm happy finally our government taking actions towards this industry

ocean wren
#

Yeah, I kind of wish we had more in the UK ๐Ÿ™‚

#

I've done similar events in Switzerland for instance.. the UK? not so much

celest python
#

I guess in UK private industry is more common, I have some friends working in UK game studios but most of the events are organized by private corporations and studios i guess

ocean wren
#

Yeah, mostly. There are some creative industries support organizations funded by the government, but most of those are run by film industry people, so they tend to ignore games

#

You can usually get money out of them, but they're massively biased towards film funding

#

Hell, even the forms have a film centric wording.. asking who the director of the game will be etc.. ๐Ÿ˜‰

celest python
#

Haha, I totally understand that ๐Ÿ˜„

mossy nexus
#

how old are you if I may ask?

#

if you're not yet in university

ocean wren
#

?

celest python
#

You're asking me I suppose? @mossy nexus ๐Ÿ˜…

mossy nexus
#

yes

celest python
#

I'm 21 years old

mossy nexus
#

ah okay

#

I did get the vibe that you weren't completely green

#

which is why it's strange to hear that you'd not done uni

celest python
#

I did not even wake up at the morning during exam day, I was studying game dev during high school

#

I'm planning to create enough fund to study at a proper university

ocean wren
#

"proper" ๐Ÿ™‚

misty wharf
#

if it's a thing you wanna do cos you wanna study at a uni go for it, but I never did, and I basically just learned everything myself and I don't know if I'd have benefitted from a degree at all lol

ocean wren
#

It does tend to make a difference if you're interested in working abroad

#

especially with points based immigration systems

#

But yeah, you can learn everything you need alone. Uni just offers more people to share that ride with and some experienced devs to talk things over with

mossy nexus
#

yep it's worth it for visas alone

ocean wren
#

And of course, its an opportunity to focus on a great portfolio

#

and meet a team if you're lucky

mossy nexus
#

haaaa... well

#

game dev schools have gotten better over time

celest python
#

Actually I dislike schools and education programs personally but I don't want to study anything related with software. I want to get a degree on aerospace and sadly thats one of the science related areas you can not proceed alone

ocean wren
#

ours is a traditional CS department that somehow ended up doing games ๐Ÿ™‚ so pretty weird

mossy nexus
#

there's some new schools who have pretty good programmes

#

but still

ocean wren
#

aerospace? yeah, I can't see doing that but CS would get you there

mossy nexus
#

I generally trust a portfolio more than I do a programme

ocean wren
#

Yeah, me too

#

The reality is that we get good people starting our programme, so they're always going to be good at the end.. just with a nicer looking portfolio

#

We also get some.. less good people ๐Ÿ™‚

mossy nexus
#

I can imagine

celest python
#

It's time to get back to work for me, thanks for the conversation

#

Good night/evening

ocean wren
#

gnight

#

I wonder if Unity buying Weta will make Epic buy a VFX company

mossy nexus
#

I don't think the competition is level

#

but I don't know epic's next steps once the fortnite money starts to dry up

ocean wren
#

Well, the two companies have similar valuations and both have spent a ton of money on acquisitions

pine steeple
#

Nice AI chat guys ๐Ÿ˜‰

ocean wren
#

hahaha.. yeah, fair enough... but you're lucky to get ANY chat in here ๐Ÿ™‚

#

other than "how do I do..." questions that is

mossy nexus
#

I do love solving BT problems

ocean wren
#

I want to redo the BT implementation ๐Ÿ™‚

tight lark
#

anyone know why I can't see my volume's navigation area when pressing P ?

#

and also why my AI can't move

#

although I don't need a volume since it's set to Dynamic but nav invokers don't seem to work

fringe rain
#

i'm using a similar approach but i do have a navmeshvolume and it seems to work

#

i was having issues with level streaming, which is why i used navigation invokers. my nav mesh bounds is in the same level as my world elements (which is persistant in my case)

#

also, did you check this box? in project settings

mossy nexus
tight lark
#

I'm not sure

#

wow it works now

mossy nexus
#

navmesh equivalent of turning it off and on again

#

well, almost

raw tangle
#

Hello, I have a problem with my FPS (AI)...

My FPS are slowly going down, for example: 90 - 65 FPS...

After I set all my actors to combat than this happens. Even at one AI at the time the FPS are dropping...

Please, i need help... ๐Ÿ™

mossy nexus
#

this is not something we can conceivably solve for you

#

you'll have to look at a profiler and see where the biggest issue is

#

if you already know it's when it is in combat

#

then maybe you need to have less AI

#

or optimize your combat AI branches

pine steeple
#

you have exlcusions

#

inside the filter

#

this will stop EnemyA from entering NoEnemyA nav area

#

as long as they are using this filter on there move commands

fluid goblet
#

Hours and hours later. I was looping through my perceptions abd setting the TargetLocation on see player but also receive damage. So it immediately invalidated the location and then a bool check I had would never return false so things stayed always true even when not.

ocean wren
#

That sounds like a good learning experience ๐Ÿ™‚

tough helm
#

Hey
When using Run Behaviour, it seems that decorators on leftmost branches in the parent tree are ceasing relevancy and can no longer abort the running subtree.
Is that a bug? Or is there a reason why this behaves this way?

I would expect the Run Behaviour to add a new running subtree, without changing anything in the parent tree, meaning that the parent tree can abort the subtree, but obviously the subtree cannot abort something in parent tree

misty wharf
#

Not sure. I have a parent tree aborting a child tree which works just fine

#

Seems like it could be some other issues

tough helm
#

if the decorator is not on the executing branch?

#

this is the setup I have

#

the decorator on left is not relevant anymore

misty wharf
#

Mine is set up like this so yeah that is different I guess... I assume your decorator is set to abort lower priority if it's on a different branch?

tough helm
#

yes

#

the decorators in the executing branch works

#

the problem is the higher priority ones on leftmost branches

misty wharf
#

if you set it up just for sake of testing to say just have a Wait node instead of the run behavior node, does the wait get aborted correctly?

tough helm
#

i'll try making minimal example

misty wharf
#

yeah just thought it's worth trying to see if it aborts other nodes correctly to see if the issue is with the abort or with the node being aborted :)

tough helm
#

hmm seems like with blackboard base decorator it works

#

i'm gonna experiment more with C++ decorators

#

thanks

#

basically this was my test setup

#

missing bottom row with the run behaviour, but since it was acting same as above I didnt screen it

mossy nexus
#

thanks for bringing this up, it's likely I would have hit the same issue and not figure out that it would be a limitation for a while

#

so many kinks with BTs

glass falcon
#

check if the instigator is itself and ignore it

#

as we humans do

#

could work if you use the team flags

#

actually you would have to overidde the some controller stuff that I cannot fully explain

#

it essentially has to do with overidding the function that the team flags interface uses in the Ai controller or character and if its youself return neutral

#

but havent tested that

#

yeah

mossy nexus
#

feel free to make your own perception system

#

I did

#

I made a component and did my own logic for sight, hearing and touch

#

nah

#

I wanted to see if I could use it but found out it would be more work extending the system to make it work than to make my own

#

so I now have a fluid state perception that works with a behavior tree

#

the bonus is that all of this hooks into an AI director subsystem

#

that manages all AI

#

very very very very lightweight AI

#

I'd speak to GlassBeaver, but this is something that for a single person would be many years of work

#

he's doing exactly that and he's been working on it for as long as I know

#

so at least 2 years if not more

#

good instancing skills

#

godlike math and optimization skills

#

you'll be counting cpu cycles

#

realistically

#

I'd say forget about it

#

see if you can get 100 AI to work simultaneously

#

if that works, 250

#

if that works, 1k

#

but that's probably at the limit

#

you can speak to him about it

#

some very interesting things for sure

#

pathfinding alone would be a nightmare

#

RVO avoidance

#

so many things to consider

#

I personally prefer few AIs that work well though, as I think that's more conducive towards a good player experience

#

I think that's true only if it's something that ever comes up

#

100k vs 100k AI is so far out there it's not likely to ever come up again

#

well "anything" is heavily constricted by budget and production constrains

#

sure, but look at any war simulation game and look at how many AI they have

#

100k AI would require a lot of research during preprod, the entire game would have to be built around it

#

there is no other way