#gameplay-ai

1 messages · Page 152 of 1

mossy nexus
#

last I heard consciousness was a result of vibrations in neuron cells

ocean wren
#

I disagree, I don't think they're "logic" because that suggests high/low circuits 🙂 these are more like flows and flow rates

bright osprey
ocean wren
#

Yeah, brains are complex mysterious and fun 🙂

mossy nexus
bright osprey
#

Nobody has won a Nobel prize for proving what consciousness is, and getting a theory promoted to law for it

mossy nexus
#

doesn't mean it can't happen

bright osprey
#

I didn’t say it can’t happen, I said it hasn’t

mossy nexus
#

I think the trace down to the vibrations (I saw a talk on this) was quite interesting

bright osprey
#

Honestly most philosophers understand what consciousness is better than scientists

mossy nexus
#

I disagree with that as well

#

just because a painter can paint a beautiful composition doesn't mean they understand why that composition is beautiful

ocean wren
#

Oooh, philosophy AND aesthetics?

#

I'm in, sign me up 🙂

#

No wait, I worked with a philosopher, he was a pain in the rear 🙂 sign me sideways instead

bright osprey
#

A philosopher is not the artist in that analogy, he is the one understanding the art, where the scientist would be comparable to the artist

ocean wren
#

neuroaesthetics I can get on board with though

mossy nexus
bright osprey
#

The scientist is the one who observes reality to create methods and tools to utilize it to create things

#

And doing so does not inherently imply knowing what one is doing

ocean wren
#

I'm not sure you're getting philosophy there 🙂 I have some problems with it, but real philosophers aren't just giving biased opinions 🙂

mossy nexus
#

well the philosopher is unconcerned with reality in this case, so that point is moot

mossy nexus
ocean wren
#

I'd say most philosophy is concerned with reality

bright osprey
#

Honestly science is a very basic and generalized version of philosophy, metaphysics is much more empirical data driven than most modern science. Science exists because philosophy designed the framework for it

ocean wren
#

Yeah, I hear you, I worked with a philosophy jerk 🙂 so I know, I know.

bright osprey
#

lol yea philosophers tend to be nit picky so I can see how the term jerk applies

mossy nexus
#

rationality created the basis for science, which if you really want to, you could call a philosophy. but most philosophic scholars are idealists less concerned with dealing with the realities of the world and more how the world should be idealized in one way or the other

ocean wren
#

But don't throw the baby out with the bathwater, I've read some really insightful philosophy books about aesthetics and creativity and learnt a good deal about the nature of reality in those domains from them

bright osprey
bright osprey
mossy nexus
#

and even so, regardless of where modern scientific method sprung from, it does not excuse the fact that philosophers as whole aren't really contributors to discovering the actual realities of life anymore

ocean wren
#

There's a good reason a PhD is a doctor of philosphy 🙂 even for a ML guy

mossy nexus
#

because just like philosophy, it's a doctor degree made up of thin air? 😁

ocean wren
#

paper usually 🙂

bright osprey
#

I could argue you are also applying that fallacy by ignoring string theory, Boltzmann brain, aether, God, and all other scientific pursuits considered impossible

ocean wren
#

actually these days electrons

mossy nexus
#

string theory et al didn't arise from not watching the underlying science develop. but regardless, none of this places philosophers in a better light than scientists. philosophy is a young person's game of ideals. jaded rationality is for old people 😁

mossy nexus
#

well disagree all you want. people didn't come up with string theory on a whim

bright osprey
#

Philosophy is a robust and never ending application of skepticism to discover and understand the real truth and meaning of something

mossy nexus
#

all very human constructs

bright osprey
#

You do realize science itself is a human construct as well

mossy nexus
#

yes but it is concerned with observation of the real world

#

whereas philosophy isn't

bright osprey
#

What are you talking about? Philosophy is definitely about observing reality

mossy nexus
#

doubt

bright osprey
#

I get the feeling you have never genuinely read any philosophy at all

mossy nexus
#

nah I don't read anything. I didn't study anything whatsoever. I'm actually illiterate

bright osprey
#

I can tell

mossy nexus
#

I don't even read what I type

#

this is all happenstance

bright osprey
#

What is a square then.

mossy nexus
#

anyway, character assassination aside, philosophy is all about ideals

bright osprey
#

You say science is superior to understanding something compared to philosophy and say science is about observing reality correct?
Tell me what a square is then, science created it, it’s perfectly understood according to science, so what is a square

mossy nexus
#

categorical imperative, utilitarianism, ethics

#

the cave allegory

#

etc.

bright osprey
#

Stop dodging the question just because you know I’m about to prove you wrong

mossy nexus
#

science created squares?

#

do you have a citation for that

bright osprey
#

The methods of science created the concept of square, long before that practice was called science

mossy nexus
#

I disagree

bright osprey
#

So you are saying science can’t explain what a square is?

mossy nexus
#

what, like, semantically?

bright osprey
#

And played no part in its conception

bright osprey
mossy nexus
#

I don't think so no. squares existed before science did. look at bismuth

misty wharf
#

has this guy joined this discord just to argue about philosophy and the nature of humanity? alex

mossy nexus
#

or even iron, which has grid bound atoms in square like configurations

bright osprey
bright osprey
mossy nexus
#

lol okay

#

I don't know how you can tell it's false since according to you, nobody knows what consciousness is

bright osprey
#

Because everything is false until proven true

mossy nexus
#

so by your own definition it cannot be false

#

if we're talking about jurisprudence, then yeah

bright osprey
#

That is philosophy, If you cannot prove it, it should be considered false and tested until it can be proven

mossy nexus
#

if we're talking about nature, then no

bright osprey
#

And if it cannot be proven false it cannot be science

mossy nexus
#

just because you can't prove it doesn't mean it doesn't exist

#

can you imagine lol

#

numbers didn't exist before people did maths

#

what a world that would be

bright osprey
#

I’m starting to actually believe you really are illiterate like you claim

mossy nexus
#

right so nobody could ever count before maths. amounts didn't exist before maths

#

this is next level lmao

bright osprey
#

People counted before math, but they did not engage in math before math

mossy nexus
#

if they counted, numbers must have existed surely

#

for as much as you're being defensive here, your arguments aren't really making sense

bright osprey
#

The concept of mathematical practice exists, the semantic definition of numbers was created with language

mossy nexus
#

maybe you should sit down and rethink your approach

bright osprey
#

The numbers were created through the need to communicate the observed mathematical qualities to others, language is only a communication method

mossy nexus
#

even maths have axioms at their core lmao

bright osprey
# mossy nexus maybe you should sit down and rethink your approach

No you need to go through and read what exactly has been said and look up each word in a dictionary, piece them together in the order they’ve been said, and derive the meaning from what has been said because you are not comprehending anything that has been said and are twisting my words and assuming things I have not said

mossy nexus
#

thanks but no thanks. if I wanted to listen to nonsense I'd go hire a philosopher

bright osprey
#

I’m not a philosopher

mossy nexus
#

you're spouting nonsense all the same

misty wharf
#

He's not entirely wrong but the mildly condescending tone probably didn't help start the discussion on the right foot :P

bright osprey
simple crest
#

having read about 15% of the above all i'm doing to do is say: what the actual fuck was this conversation anyway and why is it here

mossy nexus
#

I agree

misty wharf
#

lol

#

Yeah it's a weird place for it for sure

bright osprey
simple crest
bright osprey
#

Neuron structure is a valid conversation in the discussion of ai, the design of ai is based around the structure and understanding of neurons, why should that be in the lounge?

misty wharf
#

nothing you discussed about the nature squares and what came after it had much to do with AI though lol

bright osprey
#

Go back and read what started this

bright osprey
mossy nexus
#

so neurons are valid conversational topics, but consciousness isn't in terms of AI. got it.

bright osprey
#

I may be at fault for replying to his off topic remarks, but I am not at fault for bringing them up

mossy nexus
#

lmao

bright osprey
mossy nexus
#

I mean I was the one mentioning consciousness here, not you. surely you're not trying to tell me what I meant when I said consciousness

bright osprey
#

You were bringing up the meaning of consciousness and what you think it is, that has no real application to the development of AI

mossy nexus
#

(according to you)

bright osprey
#

Designing AI does not require an understanding of consciousness

crimson galleon
#

so I have an Ai question: is the MoveTo task using one of the move to functions that's accessible in bp? I've tried each of them but it doesn't seem to operate the same way

misty wharf
#

the BT one you mean?

mossy nexus
#

I don't think anyone has stated that. in fact I'd say I've argued the opposite with the artist analogy I made in the beginning

crimson galleon
#

yes the BT MoveTo Task vs the move to location, move actor, etc. found in bp

#

even if it's an actor?

mossy nexus
#

the default MoveTo tasks didn't work for me and would on occasion crash

#

never happened with a custom implementation

misty wharf
#

It looks like it uses UAITask_MoveTo

crimson galleon
#

im with with the standard BT MoveTo task, but would like to parametrize certain bool flags and the acceptance radius

misty wharf
#

which I'm pretty sure is available via one of the BP nodes

mossy nexus
#

yeah AIMoveTo exists

bright osprey
crimson galleon
#

ill try it again, thanks

mossy nexus
#

in either case it's correct that this conversation isn't for here

#

and tbh I cba having it as we're going in circles

bright osprey
#

I have little desire to have it with you, I was attempting to correct your false logic and help you out, there are much better places to have much more meaningful conversations that I can benefit from more, than trying to go in circles with you when you cannot understand even half what you are saying yourself. On this we are agreed

simple crest
#

so @bright osprey how's your UE project going

misty wharf
#

The fact that you keep talking down to him isn't really helping your side of this look any better :P

bright osprey
bright osprey
#

Although that’s not an issue regarding ai, and not one I need assistance with, just another GPU

#

Right, that reminds me of why I even joined and the question I intended to ask to begin with.

Regarding AI in combination of VR, is it better practice with unreal engine 5 to use Cpp hard coding for the entire ai system, or are there situations where the blueprints achieve better performance?
Currently running a pseudo NN in the background to observe all the actors actions in play and adjust the scenario to increase immersion, while the ai. Actors are typical drone hierarchy. With mental tasks handled by independent drones and higher tasks delegated to management drones that over see them.
It is currently all hard coded, but I was curious because the blueprint classes are faster to put together

#

For further context this is currently being hosted on an NVIDIA gpu server by lambda scalar and running on a 64 core ryzen thread ripper, the server operates on Linux specifically a kernel of Anaconda, but everything is operated in a set of virtual machines that operate on windows

#

And is currently configured for the haptic suit by Tesla suit

misty wharf
#

it kinda depends on what you'd do in BP's

#

you could easily do heavier lifting in C++, while using BP's to hook logic together and do some smaller bits, and you'd probably not lose a lot of performance doing so

bright osprey
#

Alright

#

Not particularly concerned with time scale, just more concerned with raw performance

#

Didn’t know if there were situations where blueprints outperformed cpp

#

Due to some shortcut in logic or something

misty wharf
#

afaik there are none lol

bright osprey
#

Hard coding it is then 👍🏻

#

Those tiny performance increases add up when the actor counts get into the thousands 😅

#

The main issue is upgrading hardware though, the hardware it’s operating on is a bit outdated

misty wharf
#

Sounds like a kind of unusual setup to begin at least when you consider the average ue project

simple crest
#

blueprint just runs c++ eventually. it's always an extra layer. you're doing some seriously weird custom/non-game stuff here so you might find some of your questions going unanswered

bright osprey
#

The goal is for the end product to be hosted on the server and people accessing the content to get it streamed to them

#

Mostly since the average person couldn’t afford a gpu server to run the application

simple crest
#

where the content is thousands of moving AI actors?

bright osprey
#

I simply stated the small changes add up with thousands of actors

ocean wren
#

If you're running inference in python, I'd say why not BP it too 🙂

bright osprey
#

We’ve got the animations streamlined as best we can, we even substitute the actors with Niagara particles and basic animation after they’re a certain distance away

#

Similar to how the beetles and bats were done in the showcase, but not quite the same, and probably not as efficient

#

I guess it’s also worth noting that the purpose isn’t for a video game, but for an interactive virtual experience tailored to assist education and learning, particularly in recreating historical scenes and battles while utilizing the full body haptic suit to simulate partial stimuli involved

ocean wren
#

I need to play with compute shaders in UE, seems like its been a while

bright osprey
#

I don’t know much about those, so I can’t help there, I’m just in charge of the ai 😅

#

My knowledge outside ai is rather limited

ocean wren
#

compute shaders are going to be all there is soon enough, mark my words 🙂

#

well, a renamed version of them, according to nvidia at least

bright osprey
#

lol alright, I’ll ask the lead of the graphics team if she’s aware of what they are and see if I can learn anything, although I probably won’t put in much effort other than to understand how it may apply to my work, since it’s not part of my specialization

ocean wren
#

I suspect most AI will go that way

#

the gpu hardware is just built for it and becoming more programmable

#

IF you can buy any <grumble> 🙂

#

There was an interesting AI demo by Nvidia I think it was? called March of the Frogs, back when programmable shaders were first introduced

bright osprey
#

Isn’t that just GLSL?

misty gale
#

How slim are my chances of reaching 300ai with cmc and basic character? Should i start over with a fresh actor?

#

Currently the performance hit with static paths are pretty costly

mossy nexus
#

slim at best

#

but it depends on how complex your general AI is

#

though generally 200+ AI requires a lot of optimization

winged grail
#

So... I'm trying to teach my A.I. how to become a philosopher of science using my behaviour tree.... is there a node for that?

celest python
mossy nexus
#

lmao

winged grail
#

😆 sorry just kidding, I was just catching myself up on the local AI chat lol

celest python
#

Yeah I did not want to mention about it but that conversation is hilarious LMAO

#

Made my day

misty gale
celest python
#

You can't

#

I tried 🥲

#

UE4's max limit with last gen is around ~200 meshes

#

And you barely get a stable framerate

mossy nexus
#

GB has some notions on this with instanced skelly meshes

#

but lord knows how he manages to get 100k AI to work at any conceivable frame rate

celest python
#

Many people want to have gigantic amount of pawns after seeing GB or other examples of released games but they don't realize that requires a lot of changes on the engine that requires you to be a qualified graphics programmer

mossy nexus
#

yeah what GB is doing is next to magic

ocean wren
celest python
#

My first recommendation would be watching what zoombapup posted and use that technique to 'fake' distant meshes

#

Only run logic on near pawns

mossy nexus
#

but GB has actual AI

#

and he's aiming for 1 mill

ocean wren
#

Yeah, that's just silly 🙂

mossy nexus
#

I would imagine he'll do it, but to what extent a framerate would work is beyond me

celest python
#

We still have some light though

#

Since AI team made MassGameplay thing, we are able to simulate mass characters with AIs

#

But without a mass renderer, that wouldn't be useful

misty gale
#

GB?

mossy nexus
#

GB

celest python
celest python
misty gale
#

Ahh

celest python
mossy nexus
#

@ocean wren

misty gale
#

I was planning on leaving most of the ai logic in a manager class

mossy nexus
#

let me know your thoughts on that vid

misty gale
#

So the npcs can be as simple as possible

ocean wren
#

You mean the niagara one?

mossy nexus
#

the twitter one

celest python
mossy nexus
#

a true madlad

celest python
#

Thats not even madness

#

"Unoptimized and unpolished"

ocean wren
#

hmm, I'm curious to see if it was realtime or not

celest python
#

It is realtime

mossy nexus
#

GB conveys an air of a mad scientist in all honesty

winged grail
#

So, I'm always a bit confused when this question comes up (I've been looking through old discord messages and forum posts for a while as I'm trying to have a maximum of between 200-500 characters [higher end would be awesome, lower would be acceptable]). What do people mean by having X number of AI. won't work. For instance, I've got about 500 characters, running a simple movement behavior tree in editor at about 80 fps right now?

ocean wren
#

neat

#

and kinda... silly 😉

celest python
ocean wren
#

I'm trying to find this frogs demo from back in the day.. I thought it was an nvidia demo, but seems not

mossy nexus
celest python
ocean wren
#

FROBLINS!

#

it was an AMD thing

#

god that video is terrible, lemme find a better one 🙂

winged grail
#

Currently, I've got a really basic setup where my CMC and Animation tick are reduced the further away from the camera a unit is. I could definitely see it becoming difficult with super complex logic, but I always wondered if that could be reduced by having smaller discrete behaviour trees rather than large branching ones?

mossy nexus
#

possibly

#

AI LOD'ing does make sense

celest python
mossy nexus
ocean wren
#

yeah 🙂

celest python
# ocean wren https://www.youtube.com/watch?v=FUtzOqgsLyE

There is also this: https://youtu.be/VC8RWntPRvI

Check out the engine demo for Star Swarm.

Follow Star Swarm at GameSpot.com!
http://www.gamespot.com/star-swarm/

Visit all of our channels:
Features & Reviews - http://www.youtube.com/user/gamespot
Gameplay & Guides - http://www.youtube.com/user/gamespotgameplay
Trailers - http://www.youtube.com/user/gamespottrailers
MLG, NASL & eSports - http...

▶ Play video
celest python
ocean wren
#

But anyway, my point is.. this was 12 years ago, doing essentially GPU based AI

#

and I am saying, this is the future of how we'll do AI 🙂 so... yeah. Not GLSL shader stuff, just general purpose compute shaders

mossy nexus
#

I think compatibility is a big issue in this

ocean wren
#

I think they had like 100k froglins in this

#

froblins even

mossy nexus
#

100k and no instanced skelly meshes 😔 GB get on their level

ocean wren
#

Well, it is an instanced skelly mesh, thats how they work

#

basically batch the animations up in textures and use texture offsets to animate, stuff like that

mossy nexus
#

smart

ocean wren
#

GPU's are just amazingly fast

mossy nexus
#

would ISKMs work for everyday AI?

ocean wren
#

well, shaders in general, these days you've got compute shaders, mesh shaders, tesselation shaders, geometry shaders, pixel shaders and vertex shaders. And of course they're moving towards a fully programmable model

mossy nexus
#

tech art is gonna be huge if they fix they compatibility issues

#

dammit now I have optimizations on my mind instead of focusing on bug fixing

misty gale
#

Ty for the answers. Ill play around with it and see if i can get the amount im after, even oversimplified

mossy nexus
#

@celest python I think I found an elegant solution to the issue. the cooldown ending would trigger a fluid state to decrease. but I realized I store a LastKnown value for the fluid state that I could use for conditional logic

mossy nexus
#

do decorators inside subtree automatically have local scope, or?

surreal fable
#

Hello everyone! I'm currently working on a school project using UE4.26 and I'm contemplating making an AI system based on "Utility theory/Infinite axis utility system". The theory itself seems very intuitive for me, but I'm unsure how to begin to put it into practice in Unreal. Information and documentation seems incredibly scarce on the web, so I was wondering if anyone here has any ideas/examples on good practices and methods? I have watched and read a lot of what Dave Mark has put out about it already. Cheers!

mossy nexus
#

the basic idea is based on fluid states

misty wharf
#

I feel like I'm starting to push limits of the behavior trees here... maybe I shouldn't be driving all this logic from it

#

Basically I have a system where an NPC waits for the player to interact, which puts it into a conversation... the BT then branches off based on the selected option. So this is all great and it works and it's easy to sort out AI logic that happens as result of specific choices

#

But... it gets complicated when the AI logic for a given conversation option now should do something (such as wait for another action from player), but also allow the player to go back into the conversation to instead choose some other choice

#

:P

ocean wren
#

zomg: I'd stick the interaction into another object, have the other object set specific conditions on the pair that are interacting. I've used the term "social objects" before, because its a bit like a smart object, but for social interactions

tranquil marsh
#

what does bAllowStrafe do exactly?

celest python
#

Move right and left while moving instead of rotating towards to followed path

#

For example AI is aiming to player and moving to right while keep aiming to it

tranquil marsh
#

gotcha thanks

misty wharf
# ocean wren zomg: I'd stick the interaction into another object, have the other object set s...

Yeah, I have it set up a bit like that.. I think the problem is mostly that the way I've set up the BT tasks that allow controlling which interactions are valid don't play so nice with each other, and selecting a conversation option moves into a different branch in the BT which means selecting a differenet option afterwards wouldn't actually change to a different BT branch because it's already in a branch for the option you selected first :)

#

the conversation option selection is the main problem with the way I set it up, so I probably need to change how the options get handled in the BT so that selecting a new option would abort the branch it's currently in

ocean wren
#

My usual way of handling this, is to have a low-ish priority branch where it monitors for completion of whatever activity and then a slightly higher priority branch which checks if new activities are available and more appropriate (enough to exit the current one etc)

#

so the higher priority would effectively exit out of the current branch and clean up that particular interaction

#

so all interactions would be handled in those two branches

misty wharf
#

Yeah, I have something like that in the part of the tree which handles the general npc tasks as they can have multiple

#

I was thinking of trying to make a custom loop decorator for the conversation options though which might be an interesting and slightly less messy solution for it :) Basically it would behave similarly as the conditional loop but it would just use the npc's conversation state as the condition, since I don't really like pushing random variables into the BB because it's already getting messy as it is :P

#

I already redid the entire AI task logic once from the previous system and honestly all these interactions feel like it's going to need redoing at some point as well but kinda difficult to predict how it should work up front lol

ocean wren
#

Well, my thinking is that interactions with other entities are generally best left out in the world and not encoded specifically in the BT

#

so the external interaction encodes how the entities that are performing the interaction perform the interaction, bit like a smart object does

#

That way, you don't have a really big BT, you have lots of smart objects that encode interactions

#

the BT itself, just deals with being in an interaction and evaluating if a more preferable interaction is to be chosen

misty wharf
#

Yeah that's roughly how it works, but the BT decides when the NPC goes into a state where it can accept that interaction, since it depends on what they are currently doing

ocean wren
#

right, I'd do that with some kind of resource locking

misty wharf
#

Hmm, interesting idea

#

There is already that resource locking system in place too

ocean wren
#

think of it this way, you must be able to walk to a thing to interact with it for instance, so if you're already walking somewhere else, then you can consider the "being able to walk somewhere" resource to be locked

#

similarly for holding things

#

can't hold a new thing if the holding things resource is locked

#

So you'd query the smart object for the resources it needs, then test the resources available in your "can I use a new smart object branch"

misty wharf
#

Yeah, I don't have it set up with separate objects in that way but it sorta works like that by looking at the state of the NPC, and the NPC has an interface for querying it and info like which interaction hint message is shown

ocean wren
#

I think the smart object approach works if you've got a lot of interactive items in your world

#

Its what they used in the sims

#

and really made sense to me

misty wharf
#

Ah

ocean wren
#

and I used it the same way, for social interactions (social objects)

misty wharf
#

Yeah, I have quite a few already with doors, boxes you can open and close, shelves you can put things into, npc's you can talk to, foods you can eat... :D

#

it's currently implemented so that each item defines what happens when you interact with it which so far has worked alright

ocean wren
#

So for instance, if you want two agents to start a conversation, then spawn a conversation smart object and pass it the two agents.. it controls how the two agents do the interaction (turn taking and the like) and then deletes itself when done

misty wharf
#

That's an interesting approach

ocean wren
#

The reason I was convinced it was a good idea, was that they did all of the smart object definitions in script files. So they could release packs of new items without changing the basic game

#

The sims item packs sold really well too

misty wharf
#

Yeah

ocean wren
#

basically, its art and animation stuff, plus some scripts that define how the agents interact with the thing. You could literally produce those massively quickly

misty wharf
#

I try to design my systems in that way as well, especially if it's something where we will probably need to make it kind of extensible as we add more content into the game

#

since if it's really annoying to set up new objects I don't feel like doing it lol

ocean wren
#

The only other bit that needs, is the publication of what the smart object does (i.e. in the sims what needs it satisfies)

#

I'd tie all of it together with a MessageRouter 🙂

#

MessageEndpoint in UE I think its called?

misty wharf
#

this is one of the things I really like about using BT's for NPC task logic in this way, because it's really easy to just change how it works by shuffling the tree a little bit, but just need to build the library of nodes that enable working with all the necessary logic in a nice way

ocean wren
#

Yeah, I just dislike the fact that its too boolean. I like the authoring of stuff, but it feels wrong to apply boolean logic to what are often emotive decisions

misty wharf
#

Yeah I have some more fuzzy selection logic like that which is just handled in the actors themselves via a bunch of rules that are stored for each NPC, the results of it just get accessed through a decorator or such to run an appropriate behavior tree branch

#

For example I have a really elaborate system for the customer npc to choose which video they want to rent based on what genres and actors they like lol

ocean wren
#

I use a knowledge graph ML architecture and a spatio temporal graph ML model trained on films and videos. On the grounds that I want cinematic like behaviours anyway, best learn from films.

misty wharf
#

but at the end of the day it just triggers the customer to walk up to a shelf and pick up an object and walk to the cashier

ocean wren
#

Sounds like good ground for a utility architecture for the "what should I watch" question

#

not a fan of fuzzy logic 🙂

misty wharf
#

maybe fuzzy is not a good term to describe it

#

it is actually a bit like utility AI in that it has a list of weights based on the customer's attributes like the liked genres, and each video gets scored based on the weights

ocean wren
#

right, sounds more like utility 😉

misty wharf
#

yeah, I was using "fuzzy" more to indicate it's not a strict "if x then y" type decision lol

dark briar
#

trying to run EQS but the location update is very slow. how to make it run faster?

misty wharf
#

What do you mean by "location update"?

dark briar
#

my eqs result is a location but it takes time to return the best location when my player character is moving

misty wharf
#

Ah

#

EQS queries are always asynchronous

#

the speed of the query itself depends on how the query and its generator and tests are configured

#

if you have a generator which generates a lot of points and a large amount of expensive tests, it will perform worse

dark briar
#

ok thanks, i understood that. also when i call the task MoveTo, the enemy is just going to the location is was given initially by EQS. so, when i move the player, the location is not getting updated. is there a way to update the location ?

misty wharf
#

If you want it to follow the player or some other actor, you should probably try using MoveTo with an actor target instead of a location target

#

iirc if using with actor it should automatically keep updating the target position if the actor is moved

dark briar
#

yes but i want the enemy to stay in the location that the EQS has returned

misty wharf
#

I'm not sure if I understand... you want the enemy to stay at a location, but also follow the player?

#

or you want to update the location it stays at when the player moves?

dark briar
#

yes the latter one

misty wharf
#

you'd have to use some logic to detect when the player has moved enough and rerun the EQS to choose a new location I guess

#

you could for example save the location of the player that was used for the currently selected location, and check how far the player is from that point to decide if you want a new EQS query to run

dark briar
#

ah okay... you're right. sorry for the silly questions. it's my first time working with EQS

misty wharf
#

No worries :)

misty gale
#

Eqs, is that some sort of sphere trace or something ?

misty wharf
#

It can probably do those too

misty gale
#

Guess I should give it a look, I like the sound of asynchronous

misty wharf
#

It's quite handy for some things

#

It's also timesliced so even heavier queries shouldn't chug your fps, just makes the EQS query take longer to run

misty gale
#

Sounds very convenient. I know theres asynchronous pathfinding aswell, but not exposed to bp's i think..

#

So currently all i 'can' do is serialize the synchronous one

#

It works fine, but the output isnt perfect so it needs extra checks

#

If i had a query result instead tho... that probably gives me all the data i need

misty wharf
#

EQS isn't really for pathfinding, it can give you points in the world but you'd generally do the pathfinding to them separately

#

though it can do a pathfinding test on the points, eg. to check if they're reachable

#

one use for it is to find appropriate locations for npc's to move to based on some criteria, and then you choose one of them as the target and have the npc pathfind to it

misty gale
#

i cant really let the npc do the pathfinding themself, it's to expensive and i cant control the flow properly

#

there's to many requests at the same time

#

so by serializing them through a manager, i circumvent that issue

#

The biggest issue with the path result tho is that im not given any information about the nav area class

#

i can probably fix that if i dive into c++ (which im always procastinating for another decade)

misty wharf
#

ah

misty gale
#

but my current 'fix' (which is terribly costly) is to trace each path point before subsdividing it

misty wharf
#

yeah something I'm doing in C++ is reachability testing for objects for npc's :)

#

whenever the navmesh is regenerated I run navigation tests from the "store entrance" point to all the placed objects in the store that npc's might want to walk up to

#

it puts the reachable ones into a separate array so the npc's won't attempt to pathfind to anything that's not reachable for them

misty gale
#

Sounds clever. So you already tag them by reachability

#

I think i could get around my own issue if i just saved all the path locations in a massive array in the npc manager

#

since i already know every single path point ...

#

instead of tracing them

misty gale
#

Dang. that worked tremendously !

misty wharf
#

Heh, I made a decorator which aborts its subtree automatically when the conversation option is changed, and begins from the first node again, which makes it quite easy to just create a set of nodes below it to manage the conversation actions

#

...but it does feel like I might be slightly abusing how the BT works because I've never tinkered with the flow control stuff to this degree lol

#

although this is basically how the blackboard value monitoring decorators work, my node just aborts based on a different rule :P

mossy nexus
#

@ocean wren how would you recommend structuring something like a generic AI action that is based on the status of the AI? e.g. in high stress situations, the AI may run away, it may fight, or it may do something else

ocean wren
#

How many actions are there?

mossy nexus
#

variable, but generally based on the AIs characteristics there might be a couple

ocean wren
#

I mean, that kind of thing is just what the BT is designed for.. just work out the relative priority of each action and encode that left to right in your BT

mossy nexus
#

for instance the AI might consider it has a chance to fight if at full health, but may reconsider halfway through and run away

ocean wren
#

then enable/disable via conditions

mossy nexus
#

sure that's fine

#

I can do that

#

but

ocean wren
#

so leftmost would normally be the most "action" action.. fighting etc

#

rightmost would be idle

mossy nexus
#

in terms of putting these in as generic actions that I can extend easily, what would you recommend?

ocean wren
#

and then in between is various phases of agression etc.

mossy nexus
#

yeah I kind of have that setup already between alert <> non alert states

ocean wren
#

Typically, I'd encode stuff like agression values as floats in my BB, then use conditions with thresholds to enable or disable various agression actions

#

so for instance, as you take damage, you increase the aggression value, or add the attacker to a list of recently attacking enemies

#

whats the MMO term for it.. trying to remember the name they give the list of threats 🙂

#

so anyway, you have a float or an int that gets added to or subtracted from over different events.. and then you enable/disable the subtree's based on conditions of those floats

#

so I've got floats for alertness, basically if the AI should start becoming more aware of things (say it found an open door that was supposed to be closed)

mossy nexus
#

In terms of architecture, how would you handle the actions themselves? Would each action be a task in its own right? Would it be some sort of data object with a generic action?

ocean wren
#

That depends. I do usually have an action queue, a bit like the PawnActions because I like running my longer running tasks that way

mossy nexus
ocean wren
#

Tends to make management of animation easier if you can just have an action class that has enter/update/exit loops

#

Yeah, usually your sense events will feed in values to the awareness/alertness systems

#

so I've got ones for sensing bodies, or doors in the wrong state, or if they hear a noise, or if they see the player, or if a car is missing etc.

mossy nexus
mossy nexus
ocean wren
#

Have a look at the pawn action code. Its pretty similar to what I do for actions, although I used a set of layered queues generally

#

You'd encode that in the actor that has the code for triggering the sense usually. My smart objects can use a message to transmit their presense and those smart objects can also offer the "this is the usual state I'm in" kind of info

mossy nexus
ocean wren
#

So you'd have like an empty actor with a smartobject component, that component sends a message at some given frequency that its there for inspection or interaction

#

My layered queues are usually so I can have different actions on different parts of the AI, I'm thinking of things like aiming and moving might be seperate

#

I got into that pattern back when I was doing tanks 🙂

#

but I think having channels of actions is not a bad general pattern of use for even single characters, its the "walk and chew gum" problem 🙂

mossy nexus
ocean wren
#

think of it this way, you can have a "where to look" channel of actions, which have simply a queue of interesting stuff to look at

#

you can have a "where are you going" channel, which is the current path

#

you can have a "what am I aiming at" channel with targets and IK chains etc.

mossy nexus
#

Ah that's cool

#

I somehow inadvertently made that happen by creating a component that gives my characters systemic peripheral vision

ocean wren
#

So the smartobject component can use a message endpoint to send messages about its presence at a selectable frequency. So say you had a car and its location has a smart object that says if a car is there or not and if its there sents a message "car here for use" and it not "car is missing"

mossy nexus
#

so I do have look and movement separate, but mostly by the accidental interaction between two systems

ocean wren
#

the smartobjects are there to basically offer data to the query system, the query system can interrogate the objects that it knows about. The two work using a message system

#

Yeah, I learnt a long time ago to have basically what is an array of queues of actions

#

the reason is that I like to be able to do things like clear a particular channel of actions

#

so I might add a few path movements to a queue of moves? but then want to repath entirely, so I just clear the movement channel in the action system

#

I can't remember if I wrote this up for one of the AI books or not. I kind of vaguely remember doing so 🙂

#

If you search for AI Wisdom or AI Pro, you might find it.. they're all freely available online these days

mossy nexus
#

I'll take a look thanks

#

I think the action queue thing is something I've been looking to understand for a while. it feels like actions themselves should be data objects but somehow I feel like I need logic to make them work

ocean wren
#

I do really recommend using messages for some things in AI though, especially inter-object communications

#

yeah, the action queue ends up as basically a set of classes that have start/update/stop functions and can be put into a queue of same

#

its a lot like the old state machine setups where each state had enter/update/exit functions

mossy nexus
#

so they're almost like BT tasks outside of the scope of BT

ocean wren
#

yeah, the BT is there for control logic and not for long term action monitoring in my setup

#

so the BT essentially feeds the action queues and the action queues are what does most of the continual functionality

#

I do tend to mix and match during design phases though

#

But I dislike having lots of monitoring code in my BT

#

especially for longer term activities

mossy nexus
#

by monitoring code you mean service like structures?

ocean wren
#

yeah, I guess so

mossy nexus
#

noted

ocean wren
#

My services usually just take care of threat scoring and the like, mostly sort of utility stuff

mossy nexus
#

yeah I have a single service in mine that is used to feed values into the BB from my custom perception component

ocean wren
#

yeah, me too.. my perception scoring stuff is pretty well customised

#

to allow for stealth gameplay etc

mossy nexus
#

yeah I get that

#

I'm using an alertness fluid state for now

#

which is balanced through a bunch of curves

#

based on sight, sound etc.

cinder spruce
#

what's the best way to get an ai to look at a location? instead of ai move to location, i just want them facing that direction

mossy nexus
#

there's a BT task for this

ocean wren
#

I broke that up into two.. because we had a use case for having completely unaware, to sort of actively aware, to fully alarmed and the two have slightly different requirements

cinder spruce
#

rotate to face?

ocean wren
#

You could rotate to face, but I'd recommend only doing that past a certain angle and just setting a head look controller for smaller angles

mossy nexus
ocean wren
#

I mean if you want slightly more human looking stuff at least, probably not for creatures

mossy nexus
#

and even within my alerted states I separate between neutral alerted and aggressive alerted

ocean wren
#

Yeah, I ended up with two values because I had to propate one of them to the nearby squad and then up the chain of command

#

propagate even

mossy nexus
#

neutral will just tell the player (or other AI) to go away

#

aggressive will actively fight them

#

ah I see

ocean wren
#

I had some stuff like different stances of alarm and alertness, which gets complicated because some of the more military guys were saying they wanted doctrine controlled alarm responses 🙂

mossy nexus
#

jesus

#

well I don't have to contend with such notions thankfully

#

I do have alarms and alert state propagation, but that happens dynamically through the BT

ocean wren
#

according to them, they always have prepared plans for what to do in each type of response, so when we were discussing it in the forums there was quite some dissent between the gamers and the military dudes 🙂

mossy nexus
#

sounds familiar

ocean wren
#

gamers basically make shit up out of their imagination 😉

mossy nexus
#

what players think is "realism" not actually being realism and all 😅

ocean wren
#

usually based on what they see in other games and in films 🙂

mossy nexus
#

yep

ocean wren
#

And we had a good sized cohort of experienced military guys playing, so that was an interesting discussion

mossy nexus
#

anyway. thanks for the conversation. I think I have some ideas for the structure now... but perhaps I should figure out a very finite list of actions that I would the AI to undertake first 😅

ocean wren
#

Yeah, sensible

#

also figure out how independant the actions can be.. looking at stuff is good, but sometimes you need to roll out of the way and that should ditch the head look etc

#

again, you can use resource locking as an idea here.. the channels of action are resources

mossy nexus
#

good point. I think the only point of dependence I see so far is object interaction

ocean wren
#

Its usually limbs and stuff. Arms especially, can't aim a gun and open a door with the same arm at once 🙂

mossy nexus
#

ah right. that makes sense. in my case my AIs don't carry conventional weapons so I think I've somehow avoided that issue 😅

#

but perhaps I still need to consider it for if they hold an item. but I guess I could say that they will always hold items in their left hand and open doors with the right

ocean wren
#

Well, you still need resource locking type stuff in case you find another item to hold 🙂

mossy nexus
#

that's fair, but I think I'll make a tradeoff where the AI will start behaving differently if there's two of anything

ocean wren
#

But yeah, there's a few parts to consider if you're doing any sort of complex AI setup, I guess I've just adopted a few patterns I knew worked from previous games

mossy nexus
#

I wouldn't want them picking up stuff willy nilly.

#

makes sense

ocean wren
#

I'm going to be making a survival game at some point, so I'm going to have my character constantly looting 😉

mossy nexus
#

haha yeah that's an entirely different ballgame to what I am doing

#

I don't even have a proper inventory in my project

ocean wren
#

Hehe.. inventories are another pattern 🙂

#

I use inventories a lot 🙂

mossy nexus
#

I'll probably need to do a little bit of an inventory system, but nothing major. the general idea is that AI and player are based on the same concepts

ocean wren
#

Yeah, makes sense

mossy nexus
#

player inventory will at most be two items that can be used in world, and then something like a currency

ocean wren
#

AIController and PlayerController are about that really

mossy nexus
#

for AI I could make one of those items held in hand, and one like an item on their body

ocean wren
#

Ah, I'm having crafting and trading and the like, so inventories are used all over the place

#

And an inventory for wearing stuff and inventories for lootable objects and crafting recipes and trading vessels 🙂 man I love inventories!

#

admittedly, I am quite weird when it comes to inventories

mossy nexus
#

lol

#

each to their own I guess

#

I prefer players to focus on the action of the gameplay rather than being bogged down in spreadsheets

#

but equally I understand the need for inventories when you got looter shooters or the like

ocean wren
#

pffft, spreadsheets are where its at baby!

mossy nexus
#

and diablo 2 is one of my favorite games in large part because of looting and inventory

ocean wren
#

I like base building games and fps's for the most part, so I tend to want both that and some light RPG so inventories, crafting and building stuff is my jam

mossy nexus
#

makes sense

ocean wren
#

so a mix of fps and base building rpg trading game, but set as a survival thing

#

I just realized that sounds kind of strange 🙂

#

fps base building rpg trading survival game 🙂 hahahaha

mossy nexus
#

I'm fond of immersive sims so most of my systems work towards creating similar systems and dynamics

mossy nexus
ocean wren
#

honestly though, it DOES make sense, its inspired by a bunch of old games I used to play

mossy nexus
#

well, same 🙂

#

standing on the shoulders of giants

ocean wren
#

yeah, fallout 3 is kind of similar in mechanics I guess, but my inspiration is a game called Midwinter and another game called Twilight 2000

mossy nexus
#

or in my case, sleeping on the shoulders of giants 😅

#

fair enough. have you played the long dark? AI is limited in that game, but it's quite interesting in terms of systems and their interaction

#

also fairly addictive

ocean wren
#

I've watched a few lets plays of it yeah

mossy nexus
#

my own inspirations for my current project is basically the world of thief and stalker mixed together

ocean wren
#

nice!

#

I thought thief was excellent, but stalker's head bob made my really ill 😉

mossy nexus
#

there will be no head bobbing

ocean wren
#

thank god 🙂

mossy nexus
#

also it's third person because too many people get sick from first person

#

so I'm trying to widen my audience a bit

ocean wren
#

buuut first person!

#

first person is just more immersive to me

#

I'm having switchable though, because I do like that ability

mossy nexus
#

very valid and true

#

I was considering having it switchable, but there's severe issues with metrics when doing that

#

places either feel too big in first person, or too small in third person

#

but I have some secret design techniques to make it feel more intimate 😉

#

not so secret really, just bringing the camera closer under certain circumstances

ocean wren
#

I'm going to focus the fps version and just make it possible to third person too

mossy nexus
#

that's fair

#

I'd recommend testing indoor spaces generally in third person and see if they are feasible, because that's easily the greatest challenge for third person games

#

in terms of metrics/camera

ocean wren
#

Yeah, most of my environment is outdoors, so likely not a huge issue either way

mossy nexus
#

yeah in that case you'll be home free

ocean wren
#

its set in the falkland islands (nominally so I can use satellite data for the terrain)

cinder spruce
#

the actor never faced the clicked location, is this the right function to use on ai?

mossy nexus
#

the BT task wasn't good enough or?

cinder spruce
#

not sure what you're reffering to

mossy nexus
mossy nexus
#

I forget

#

I made my own because the proprietary nodes kept crashing my game

ocean wren
#

Spartan: he's talking about the BT node "rotate to" that you can use

#

But you're using a blueprint, so not a lot of use to you

mossy nexus
#

yeah unless that AI controller also activates a BT

cinder spruce
#

awkward.. it worked :'
)

mossy nexus
#

well then!

cinder spruce
#

im not a fan of how it keeps following the cursor though, i only wanted it to happen on a click

mossy nexus
#

hmm

#

I don't know what the condition for it to succeed is

#

again, I made my own

#

which succeeds after turning

ocean wren
#

add a blackboard item that has a "time since clicked" and tick it up and then rotate towards only if that blackboard item is less than some value?

#

and reset the value on click

mossy nexus
#

I guess that could work

#

or a decorator that checks for HasClicked that can be tied to the input actions from the PC

ocean wren
#

same same 🙂

cerulean girder
#

what if i want my ai to generate the query around the player character, i made a custom context that returns the player pawn 0 but the eqs is still gernerated around the ai pawn even though i have it set to generate around the player....is there something im missing?

#

the new context bp never triggers debug breakpoints either, like its never run...anyone else ever run into that

misty wharf
#

🤔

#

How's your generator set up?

#

It should work

mossy nexus
#

do you have navmesh enabled?

cerulean girder
#

its literally as basic as i can make it

#

and it still casting around the robot and not the player pawn

#

i want to generate the points around my player pawn so the enemy stays at furtherest distance based on the players location

mossy nexus
# cerulean girder

the first shot does not look right. I'd breakpoint to see if that actually runs

cerulean girder
#

i tried print string prints nothing and breakpoints dont trigger...closed and reopened the editor double checked everything and its still queries around the robot

#

even deleted nodes and remade in the BT

#

no results

misty wharf
#

I assume EQSEnemyActorContext is the one that provides the player pawn?

cerulean girder
#

yeah

misty wharf
#

I would recheck all the settings on the generator, sometimes it doesn't update the name it displays :P

#

it definitely should work the way you have it set up

ocean wren
#

try using the EQSTesting pawn with the same querycontext and see what you get

misty wharf
#

It might not really do anything useful because there's no player if you're not in play mode 🤔

cerulean girder
#

i mean this is like the most basic of basic set up....4.26

ocean wren
#

show us the query context

#

oh, you have

cerulean girder
#

yeah

ocean wren
#

have you tried printing out what that returns?

cerulean girder
#

yeah it never prints anything like its never called

ocean wren
#

maybe its never called?

cerulean girder
#

the 3rd picture, he successfully picks points around himself

#

should be around the player pawn

#

same result with EQStestingpawn

ocean wren
#

time to break out the debugger then

mossy nexus
#

ngl seeing this makes me more confident that the approach of building my own perception system was the correct one

ocean wren
#

What's this got to do with perception?

mossy nexus
#

not so much perception, more so trying to figure out why a built in system doesn't work 🙂

cerulean girder
#

correct....

mossy nexus
#

I just said perception because EQS is perception based too

cerulean girder
#

i already had a robust ai set up, i just thought ild try to use eqs but this is more of a headache than its worth

#

not to mention its adding .1ms per ai for something i handled manually with .0002ms

mossy nexus
#

I had one look at EQS early on, realized that I would have to extend it with custom work to make it function, said f it, and made my own system instead

cerulean girder
#

maybe worth a visit when they take it to beta

#

but im going to hook up my old method i was already happy with...not sure why i wanted to give myself a headache for 3 days

mossy nexus
#

my general view on the AI module has been that it is quite lacking

#

so as much as possible I've been trying to avoid using proprietary stuff and writing my own

#

I even had issues working with built in BT task nodes crashing the game

misty wharf
#

EQS is perception based? Huh? 🤔

cerulean girder
#

i will say this, if someone codes a plug in that simplifies this and expands it, ild be willing to pay 60$ without blinking an eye

mossy nexus
#

and built in BT decorators not really being clear in their purpose (supporting arithmetic, not supporting arithmetic)

mossy nexus
misty wharf
#

Ah that's what you meant

#

I mean you can just query it without perceiving anything too but... lol

cerulean girder
#

my current set up uses the senses to determine what i was just trying to do with eqs...so i can see the correlation

tranquil marsh
#

whats the difference between activation and searchstart in BT service?

cerulean girder
#

i use sight, sound, smell, and damage

mossy nexus
#

smell? that's interesting

cerulean girder
#

some of my ai can detect "chemicals"

misty wharf
#

How does that work?

cerulean girder
#

custom sense class

misty wharf
#

Yeah just wondering how you implement it

mossy nexus
misty wharf
#

I might want to add stinky garbage into my game at some point

#

:D

celest python
#

Making them runaway from bad smells would be a good mechanic lol

mossy nexus
#

sounds like it'd be similar to sound

cerulean girder
#

gameplay tag

misty wharf
#

ah

cerulean girder
#

with sphere radius

#

the perception smell picks it up

misty wharf
#

yeah I need to find some decent way of doing it so that the more garbage you have the bigger the radius gets and any additional objects near each other boosts the radius further

celest python
#

Can perception framework handle the sigths behind the walls out of the box? For example a smell created behind the door but it can't arrive to your room until you the open the door etc

tranquil marsh
cerulean girder
#

i use it for things like gasoline which ai robots can turn to and set on fire, or "spray markers" they paint on the player to follow them

mossy nexus
tranquil marsh
#

ahh gotcha

cerulean girder
#

anyways thanks for trying to help guys...ill revisit EQS when its beta

tranquil marsh
mossy nexus
#

generally there is no interplay between different nodes

#

all interplay is handled by the blackboard

#

but if you are talking about the fact that a decorator check can prevent a node from being active, then no

chilly willow
#

I'm running a behaviortree like this : "BehaviorTreeComponent->StartTree(*BehaviorTree, EBTExecutionMode::SingleRun);" in an AIController. Is there any callback or function where i can check the result (EBTNodeResult::Type) of a behavior tree?

mossy nexus
#

I don't think that's implemented in the BT by default

chilly willow
#

any idea what would be the best place to hook that function up?

mossy nexus
#

not really

#

I would have said subclass the BT but I think that's opening a can of worms

#

but perhaps look at functions like GetLocalBlackboard and see if you can do it in the same way

tranquil marsh
#

why does AIMoveTo not work when I use a subclass of AIController?

crimson galleon
tranquil marsh
#

I fixed it, I overrided begin play on the controller and never called the parent

#

probably should have used onpossess

misty wharf
#

Heh :)

#

Forgetting to call the parent is kinda annoying, I wish there was a better indicator of when you forget to do it in cases where it's required

misty gale
#

If you're always calling parent, maybe it makes sense to isolate it when required , so you only override a part that is not required 😛

loud cedar
#

Hi, why is my navmash shrinks during playing?

ocean wren
#

Because you left it in the wash?

loud cedar
#

👍

misty wharf
#

I seem to have made a custom loop decorator which... freezes the game lol

#

And as far as I can tell it should be working the same way as the conditional loop node, and I can see it does call some other decorators... but it still just freezes so the game stops moving 🤦

mossy nexus
#

sounds like you got an infinite loop perhaps

#

show code?

misty wharf
#

Yeah I mean it is supposed to loop until the decorator's condition is met, hence why I copied the implementation from conditional loop

#

but apparently I dun goofed somewhere

mossy nexus
#

did you copy it verbatim?

misty wharf
#

well it's not 100% identical but the way it handles the looping in OnNodeDeactivation is largely the same, it just uses a different method to determine whether it should keep looping

mossy nexus
#

so, show code

misty wharf
#
void UBTDecorator_LoopConversation::OnNodeDeactivation(FBehaviorTreeSearchData& SearchData, EBTNodeResult::Type NodeResult)
{
    bool bLooping = false;
    if (NodeResult != EBTNodeResult::Aborted && ConversationComponent)
    {
        const bool bEvalResult = ConversationComponent->IsConversationStarted();
        UE_VLOG(SearchData.OwnerComp.GetOwner(), LogBehaviorTree, Verbose, TEXT("Conversation status: %s -> %s"),
            bEvalResult ? TEXT("true") : TEXT("false"), (bEvalResult != IsInversed()) ? TEXT("run again!") : TEXT("break"));

        if(bEvalResult)
        {
            GetParentNode()->SetChildOverride(SearchData, GetChildIndex());
            bLooping = true;
        }
    }

    if(!bLooping)
    {
        ConversationComponent->OnConversationOptionSelected.RemoveDynamic(this, &ThisClass::ConversationOptionSelected);
    }
}
#

ConversationComponent is assigned to it in OnNodeActivation

mossy nexus
#
void UBTDecorator_ConditionalLoop::OnNodeDeactivation(FBehaviorTreeSearchData& SearchData, EBTNodeResult::Type NodeResult)
{
    if (NodeResult != EBTNodeResult::Aborted)
    {
        const UBlackboardComponent* BlackboardComp = SearchData.OwnerComp.GetBlackboardComponent();
        const bool bEvalResult = BlackboardComp && EvaluateOnBlackboard(*BlackboardComp);
        UE_VLOG(SearchData.OwnerComp.GetOwner(), LogBehaviorTree, Verbose, TEXT("Loop condition: %s -> %s"),
            bEvalResult ? TEXT("true") : TEXT("false"), (bEvalResult != IsInversed()) ? TEXT("run again!") : TEXT("break"));

        if (bEvalResult != IsInversed())
        {
            GetParentNode()->SetChildOverride(SearchData, GetChildIndex());
        }
    }
}```
#

just for ease of comparison

misty wharf
#

Heh you know what

#

Even the standard ConditionalLoop decorator freezes if you don't have anything like a Wait node or such under it

#

So that might be the problem that I copied an implementation that does this :P

mossy nexus
#

it's probably an infinite loop

#

then

#

the way I have this kind of setup happening is a bit more complex, but it is robust

#

I create "screenplays" and "roles" for AI actors. each screenplay has a set of roles, each role has a set of points. each point has data about what happens at said point. screenplays have priority, and AI will switch to higher priority screenplays as soon as those are activated. for conversations, roles are set for two (or more) AI to get together at nearby points. conversation takes place based on the point that they are on, and some AI director delegating.

#

points are essentially wrappers for "actions" in world

#

I don't want to use the term ActionPoint because it gives the wrong connotation

#

in case of the behavior tree, the behavior tree just loops over the role indefinitely, with information being updated as necessary

#

any kind of alert state is also being handled as a priority, but the AIs will return to their role once they've calmed down

mossy nexus
#

FWIW I got this and it's working

#

(and I got no waiting time in that behavior)

dark briar
#

Is there a way to score/filter out my EQS item with Camera Angle or viewport?

misty wharf
dark briar
pine steeple
#

@dark briar use the dot test and make a context for the camera actor

#

oops delayed :/

marsh aspen
#

hey guys, do you know a very good and not only "surface" tutorial/s about navigation for AI? Like how to make several nav mesh like "main street nav", "little street nav", and talks about the agents etc etc ?

marsh aspen
mossy nexus
#

I'm attempting to consolidate some of my behaviors into subtrees. is there any good rule of thumb to keep in mind for subtress other than reusability?

#

equally can you edit some values to make subtrees more reusable?

misty wharf
#

I wonder how terrible of an idea would it to be to make a custom BT composite node which does a whole bunch of random things like waiting until X happens before running its child nodes (if this is even possible unless it's a task node?), and looping until Y is true...

#

I have my BT conversation branching working ok but I don't like using several separate nodes for it when it basically always needs to be in that specific configuration for it to work at all :P

#

It actually kinda looks like it's not possible with a composite node, they don't appear to have any functionality to actually wait... so it would require something even more custom than that...

#

Actually on second thought, there is something in SearchData.bPostponeSearch which allows it to repeat the search on next tick which might be the trick here 🤔

misty wharf
#

Kinda but not really lol

mossy nexus
#

... what's the difference? or rather, why is it you could not use a simple parallel for this?

misty wharf
#

well it's not really executing anything in parallel

#

there's a task which starts the conversation (assigning the npc into the appropriate state), and it waits for the player to choose a conversation option... and then a selector with a number of nodes for each option. But as previously mentioned, it needs to abort the option node if the player chooses a different one, and restart the options branch (which is easily done via a decorator which loops it)

#

for current testing purposes it looks like this

#

so I just wanted to consolidate all of the nodes into one because it won't work correctly unless it's set up in this specific way lol

#

...anyway it seems it might be possible but it also seems that it's going to require all sorts of annoying BT magic which I don't know if I care to dive into right now

mossy nexus
#

I think the idea of composite nodes is that they are supposed to stay simple

#

generally this level of consolidation smells bad

#

I think perhaps it's something you might want to handle through tasks/externally from the BT

mossy nexus
#

you can just use FinishExecute as conversation ender

misty wharf
#

Hmm

mossy nexus
#

plus if you do it this way, you can get an outcome when the conversation finishes, and the outcome then decides what the AI does

misty wharf
#

In theory it could be something like that but the problem is that the conversation choices will trigger different actions from the npc, and some of them will immediately end the conversation and you can't do anything, while others will allow you to do some action, or re-enter the conversation

mossy nexus
#

re entering the conversation should mean you restart the conversation loop

#

unless

#

it's something that can be kept within the same task

#

can you give me a use case?

misty wharf
#

Well for example if you choose "find item", it puts the customer into a state where it waits for you to give them an item

#

However it also needs to allow you to decide that you actually don't have the item, so you can interact with the customer without any item in hand and choose some other option

mossy nexus
#

what do you mean "give" an item? if they are supposed to find it, what do you give them?

misty wharf
#

Another option might be "we don't have this item", in which case the customer just leaves in a huff

#

ah it's not that they are supposed to find it, it's that you are supposed to find it for them

mossy nexus
#

that's fine? if it's not an AI action then the conversation is technically still being held

misty wharf
#

well yes, but it needs to put the customer into a state that enables the give item interaction option, and once the item has been given, it needs to have the customer perform some actions

mossy nexus
#

that sounds like it could be handled through conversation as well

misty wharf
#

for example this is what it does currently when you choose the find item option

misty wharf
#

I'm not entirely sure what you mean by that, as in not having it in the BT?

mossy nexus
#

basically if you consider the real life equivalent

#

a customer explains their request

#

store clerk goes to look for an item. what does the customer do? they wait

#

the clerk comes back, resumes conversation, and then accommodates the request, one way or the other

misty wharf
#

I suppose that's an option, it just feels a bit awkward in terms of how the interaction would work

mossy nexus
#

isn't it more awkward if they are standing there with their hand out waiting for an item until the clerk finds the item?

misty wharf
#

find item -> exits conversation -> go look for it -> go back -> choose conversation option "here's your item" -> give item to npc

#

vs find item -> exits conversation -> go look for it -> go back -> give item

mossy nexus
#

IMO the former seems way more natural

misty wharf
#

hmm

mossy nexus
#

the latter seems like a transaction between robots

misty wharf
#

well if we really think how it would work is that the clerk would hand the item to them while being like "here you go" or whatever

mossy nexus
#

depends

#

I would say the conversation would come first in all cases

misty wharf
#

so just giving the item to them directly without having to click through a conversation list feels a bit smoother

mossy nexus
#

yeah but your BT shouldn't be dependent on how many clicks the player has to go through

misty wharf
#

and these interactions are something you do a lot in the game, so having them work smoothly for the player is kinda important lol

mossy nexus
#

user experience != AI behavior

misty wharf
#

Well it isn't really dependent on that the way it's implemented now where it just aborts the branch and loops

mossy nexus
#

you're basically shaping your BT to work in a way that is as user friendly to the player as possible

#

and I don't think that's right

misty wharf
#

Well not really, I'm shaping it to be as user friendly to me as possible because I'm going to have to tweak these interactions and add more lol

mossy nexus
#

you can handle these things in a myriad of ways, and making this more efficient for the player is something that can easily be handled outside the scope of the BT

misty wharf
#

which is why I was looking into the whole idea of consolidating it into a singular node to begin with

mossy nexus
#

yeah again it smells really bad

#

and I think the root cause is now pretty clear for why

#

in the end it's your project, but I would not recommend doing it this way

misty wharf
#

I'm open to doing it in other ways but frankly I'm not entirely sure how the method you propose would fit the particular behaviors I need from the npc's

mossy nexus
#

what kind of particular behaviors do you need?

misty wharf
#

well basically what I just described, where I need to be able to put the npc into certain states based on the choices from the player when the player interacts with the npc

#

I don't think setting up the loop for it is really such a bad pattern, a simple parallel wouldn't really work any differently from it

mossy nexus
#

I suggested the simple parallel before I understood the scope of what you're doing

#

I think this should be a single task, and that task is the conversation

#

right now it seems you want to use the BT as a way to handle conversation branching, AI behavior and player experience all in one

misty wharf
#

Ah

#

I mean... it seems it would still work the same way :D

mossy nexus
#

if the conversation is a task

misty wharf
#

because the tree would then look like this

mossy nexus
#

it would not

#

the recommendation and finding of items would be handled in conversation

misty wharf
#

well that would mean I have to deal with building the AI logic out of BT which is a pain in the ass :D

mossy nexus
#

not really

#

the AI logic would be in the task

misty wharf
#

well if I wanted to do this sequence of actions inside the task

#

this already requires several events which while not impossibly hard are more annoying than in BT

mossy nexus
#

yeah but equally these actions seem more like they should be handled by animation, and not by BT

#

having a conversation in one node would also mean that the AI is in a state where they are responsive. you can have some of these be decorators

misty wharf
#

well the wait just puts the npc into a state where it can accept an item the player gives to them, but it would require an event to trigger the subsequent action, the start look at hand triggers a montage, and the stop ends the montage, so this would also need eventing, the rest not so much

mossy nexus
#

for instead the conversation could be over if the player takes too long (the customer leaves), if the item could not be found (the customer leaves) etc.

misty wharf
#

Yeah there's already a patience mechanic for that where it just aborts the BT when patience runs out

mossy nexus
#

so you're already accounting for these

#

I don't think that last screenshot makes sense in how many different tasks you have

#

to me that could just as well be one task called Inspect Item

misty wharf
#

It could, but the customers have various other behaviors which make use of all of these tasks, which is why they are individual tasks

mossy nexus
#

and I think if you want to do behaviors like this, you'll end up in a situation where your AI is going to be very costly for very little return

misty wharf
#

it makes it quite easy to tweak what they do in each given situation because it's just a matter of rearranging the BT

#

Costly how?

mossy nexus
#

the more nodes, the greater the cost

misty wharf
#

It's not really doing anything more than one thing at any given point, most of the time it's just idle, walking, or playing a montage

mossy nexus
#

you're saying this isn't the only type of behavior AIs will have

#

but again, I think the main issue is that you're trying to do too much with the behavior tree. branching options in conversation sound like they should be in a dialogue tree, not in a behavior tree

misty wharf
#

They are a separate system, the BT doesn't control that

#

the BT just responds to the choices that are being made

mossy nexus
#

recommendation of items, or finding of items could very easily be part of conversation, and it would make it much easier for you to compartmentalize what happens in conversation

#

as for small actions like you have, I think considering them as part of an action point system would make much more sense than having them in a behavior tree

#

so as they are browsing, different point locations could give access to different animations

#

which would correspond with just one state in the BT

misty wharf
#

I suppose. It doesn't have a lot of those animation tasks in there, it's pretty much just the look at hand thing

#

as I added it recently just to see how it would look if they actually looked at the items they're holding when browsing instead of just staring at the shelves lol

mossy nexus
#

I think it's worth considering the high level ideas of how human behavior works and make AI behavior correspond to that

misty wharf
#

the other animations that get triggered are done as result of actions like BTT_PickUp which picks up an item based on a BB key but also plays the appropriate animation

#

(which is part of the character's pickup function so the bt task doesn't really know how it works, it just says pick this up)

mossy nexus
misty wharf
#

mostly it works like so :P

mossy nexus
#

I would probably have done it in a way where the composite would be called Back of Store Work and just have them move around certain points and perform actions. the points would carry the action data

#

have like 3 subnodes

#

QueryNextPoint or QueryNextAction then MoveTo then PerformAction

#

the AI director would accommodate any querying or AI requests at this point

misty wharf
#

Hmm

#

Yeah some method like that could make sense

#

The challenge is that the current task changes the behavior somewhat, for example the customer might be looking for a specific video, or they might be looking for any video which matches the interests, so depending on those types of things they behave slightly differently

mossy nexus
#

the AI director could have a queue of actions or tasks lined up that need to be done

mossy nexus
#

that is internal to the AI itself

#

you could at most have it be unlockable behavior if it's really relevant

misty wharf
#

well it affects what actions they take, for example if they want a specific tape they go straight to the shelves where it should be (based on category) and then go to the counter to ask about it if they can't find it.... but if it's video based on preferences, then they walk around the store and look at items on shelves, and then walk back to the one they wanted to pick it up

mossy nexus
#

so have it based on their priorities

#

if they have a specific thing in mind that's highest priority

misty wharf
#

Yeah but I'm not entirely sure why this should not be in the BT

mossy nexus
#

if they can't find it, decide either to find anything they like, or leave

#

I think reactions like happy or sad is something that can be handled on the back of the success of certain tasks or subtrees

#

but ultimately those are cosmetic

misty wharf
#

Yeah the tree doesn't really concern itself with that, it just either fails or succeeds and if it fails the npc might play some animation about it, or in certain failure conditions the BT might trigger a specific voice line but that's about it

mossy nexus
#

I mean I think the base of the tree for a customer would be then

#

high to low priority: Find favorite thing <-> Find thing that they like <-> Browse Arbitrarily <-> Leave

misty wharf
#

yeah, those are controlled by the tasks that are given to the customer when they get spawned

#

the base tree for it is more like enter store --> process tasks --> handle checkout/cashier stuff if any tasks need it --> leave

mossy nexus
#

those seem like petty tasks that should be found underneath any of those categories

#

you could have Checkout as the highest priority

misty wharf
#

I guess if it spawned the customers without any specific given tasks

#

but since it works based on the tasks the customer has I don't know if setting it up like that would work any better

mossy nexus
#

I mean this addresses the needs of the customer rather than forcing them towards a specific task

#

so customers behave differently based on needs

#

just like in real life

#

I would say it's worth redoing. based on what you're doing it seems to be a big part of the game

#

so having it function in an authentic way I think is going to make or break the player experience

#

so I don't think robotic behaviors are going to be in your favor

#

it will also act as a rule of thumb guide for future behaviors, as they either have to constitute a new category, or expand an existing one

#

and it will prevent you from accumulating tech debt at an alarming rate

misty wharf
#

Perhaps

#

One reason it's done in a task based manner atm is because it makes scoring the customer visit a lot easier

#

Since we know what they set out to do when visiting the store in fairly specific terms it's easy to score it to choose whether the visit should be considered successful or not

mossy nexus
#

I think it doesn't matter. you can score it the same way

misty wharf
#

if it's more needs-based then you don't really know what specific things the customer wanted to achieve, so it would need some other method of scoring it

mossy nexus
#

time to task completion, whether they found what they were looking for

#

whether the clerk was nice

mossy nexus
misty wharf
#

basically the needs aspect is currently just done prior to spawning by deciding what tasks to give to the customer

#

plus the task system supports task interruptions, so for example in the future if we add some features to it where the customer sees a yummy candybar, they can gain an additional task to buy a yummy candybar

mossy nexus
#

you make it sound like this isn't possible with a needs based approach

#

task interrupts can happen regardless, it's just aborting processes

#

candy bar can be be purchased based on whether the customer feels like it at the time

#

etc.

misty wharf
#

Well yeah but let's say if half of the tasks succeed the visit is considered successful

#

so if you have three tasks, return video, buy candybar, rent video, it's easy to do the score

#

but how would you do that using a needs system?

#

and also I'm not quite sure how that would make the behavior any more realistic because even with a needs based system it would still go and return the video, pick up a candybar, pick up a video, and go to checkout

mossy nexus
#

did they get what they wanted?

misty wharf
#

...and also I really need to go to bed now but I'll read your response when I get up :D

mossy nexus
#

like again, the scoring feels robotic as well

misty wharf
#

I appreciate the ideas, you have given me some good stuff to think about so far :)

mossy nexus
#

50% of the tasks were completed therefore successful, beep boop

#

sure

#

goodnight

cobalt palm
#

Hello, I have a behavior tree sequence that I would like to loop until 2 entries are equal. It seems simple but I dont really know where to start after creating a new decorator.

pine steeple
#

make a composite

#

right click -> Composite decorator

#

@cobalt palm ^

cobalt palm
#

There is nothing inside of it. Do I just put the comparing of the 2 keys into the bool? @pine steeple

cobalt palm
#

What Im trying to do is I found out that off my root, there is a task that is executed to set the values of some keys, then a sequence that is when my ai finds a place to go, goes to it, and then I would like to keep going to difference places until 2 keys are the same. However there is no decorator that is a loop that executes until 2 keys are the same.

tranquil marsh
#

how do I feed values into an eqs query? like the min and max range for query

crimson galleon
rain tendon
#

Hi all , i am trying to implement Detection ai , like npcs patrolling . But what i want is only one of them to check around that detection pt . So how should i set only one npcs to work ? Any advices are welcome

crimson galleon
quick sluice
#

Hello! I've got a navmesh set to dynamic. I also added a collision box for other actors to ignore. But the problem is that they are also ignoreing their own collision box. I'm very new to this and I must be doing something wrong. I recalculate the paths every 0,25s. A second problem is that they are not good at ignoring other actors but I think that's because they are ignoring their own collision box. Can anybody help me?

quick sluice
#

Ok I found out that the dynamic nav mesh is not updating. If I don't move a ship they are pathing around it just fine (used the drawdebugline for this)

vocal lichen
#

guys what tut series do you prefer to behavior trees

quick sluice
#

I'm still strugling to get the dynamic nav mesh to work. As you can see in the video the navmesh is generating around the islands. It's the ships who don't generate.

#

This are the settings of the colider.

cobalt palm
quick sluice
#

Oke, I've got something now. I removed the collider and now the navmesh is updating itself from the static mesh collider. It's not what I want but at least it's updating. I still need help though, I have no clue how I setup the collider to be a dynamic obstacle if it breaks the navmesh generation.

misty wharf
# mossy nexus 50% of the tasks were completed therefore successful, *beep boop*

I don't know if robotic is the word - I think videogamey is more like it :) While I agree that it's quite a "sharp" line to draw if it's 50% success/fail, this is important in the sense that the player needs to be able to have a clear idea on how well they are doing, and what factors into it. The result affects customer "level" which affects how much they spend and how demanding they are, and they may stop coming altogether if they fail too much.

marsh aspen
#

strange how it all comes to the nav mesh lol. I have also an issue.
(btw sorry for the bright colors)

So, in yellow we have the main street, the one that the NPC should always get, in blue we have a district where the NPC shouldn't go if it doesn't have something to do overhere. My prob is, the usuals "get random point" et the AI move to nodes always send them in a area they shouldn't go. I've made a querry filter but even with it, they go. So, how should i define a proper destination always on the main street? (i could just put target actor ->road but they just always stop in the middle)

misty gale
#

I think you need to setup a filter with exlusion ?

marsh aspen
#

i should exclude the default nav area you think ?

misty gale
#

yeah

#

i tried it

#

it seem to work

#

exclude whatever area you dont want them to go to

#

In my test scenario i excluded default, so any point they find will be on any of the roads i have

mossy nexus
# misty wharf I don't know if *robotic* is the word - I think *videogamey* is more like it :) ...

there are many ways to make this more tangible for players. I don't think making the player experience based on the BT is a good idea, since it means that players will be privy to what is going on in the behavior tree and can use this to exploit the system. it's better to make the scoring imperfect information, where the players have an idea of what the score will be based on actions AI take, but won't know for certain.

#

again, the BT is not a general purpose fit all game loop

marsh aspen
misty wharf
#

It doesn't really tell the player that level of specifics about it anyway, but having it consistently behave in a certain way allows the player to make a more educated guess on why something happened

marsh aspen
#

Am i the only one who has very strange behaviors from NPCs when nav mesh is building in runtime? Like they turn in circle for no reason

misty wharf
#

I haven't noticed, but if the npc is the one causing the navmesh rebuild then I guess it might

marsh aspen
misty wharf
#

Deactivate what exactly?

marsh aspen
#

nav mesh in runtime

misty wharf
#

Oh, it never even occurred to me to disable it :P In my game the player can place down stuff and that just regenerates the navmesh, I never turn it off

#

Could that be the problem? Can you just leave it on?

marsh aspen
#

well if i leave it on, the NPCs just turn around, like they were blocked by something but there is nothing around

misty wharf
#

Have you looked at what the generated navmesh looks like?

marsh aspen
#

yeah, a big red zone around each NPCs...

dark briar
#

I'm trying to write a custom EQS Test in C++ but the problem is that the ItemIterator is not passing through all the items.
for (FEnvQueryInstance::ItemIterator It(this, QueryInstance); It; ++It)
It just sets the item score for the first item and break the loop.
I've been trying to find any doc regarding this but i can't find it.

misty wharf
#

@marsh aspen that sounds like you have can affect navigation enabled on your npc

#

@dark briar are you sure it's not just getting timesliced?

dark briar
#

i tried using It.IgnoreTimeLimit() as well just before setting up the score

#

but it's still the same.

#

i even tried iterating without any call but just a UE_LOG with index no. and still the same

misty wharf
#

That's odd 🤔

dark briar
#

I think setting score is the culprit here. when i call setscore then it just iterate for the first index and the loop just breaks

misty wharf
#

did you try logging something after setting score just to see how many time it hits that?

dark briar
#

yes it hits everytime the EQS is called

#

but just sets the score for the first item and then it's done

#

i'm using bool filter

misty wharf
#

How many items does it have?

dark briar
#

48 items

misty wharf
#

you probably need to show the code, it should work

dark briar
#

it's quite simple code. I'm just checking if the item is visible to the camera or not.

void UEnvQueryTest_CameraVisibility::RunTest(FEnvQueryInstance& QueryInstance) const
{
UObject* QueryOwner = QueryInstance.Owner.Get();
if (QueryOwner == nullptr)
{
return;
}
BoolValue.BindData(QueryOwner, QueryInstance.QueryID);
bool bWantsHit = BoolValue.GetValue();

TArray<bool> visibleArray;
for (int32 ItemIdx = 0; ItemIdx < QueryInstance.Items.Num(); ItemIdx++)
{
    bool isVisible = false;
    ACustomCharacter* playerCharacter = Cast<ACustomCharacter>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0));
    if (playerCharacter)
    {
        FVector ItemLocation = GetItemLocation(QueryInstance, ItemIdx);
        isVisible = playerCharacter->IsVisibleOnCamera(ItemLocation);
    }
    visibleArray.Add(isVisible);
}

for (FEnvQueryInstance::ItemIterator It(this, QueryInstance); It; ++It)
{
    //It.IgnoreTimeLimit();
    UE_LOG(LogTemp, Warning, TEXT("ItemLocation %i"), It.GetIndex());
    It.SetScore(TestPurpose, FilterType, visibleArray[It.GetIndex()], bWantsHit);
}
UE_LOG(LogTemp, Warning, TEXT("DONE"));

}

misty wharf
#

Hmm I don't see anything wrong in that, but you should probably be doing the visible check in your ItemIterator loop

#

also I don't think any of the builtin tests check for QueryOwner == nullptr, so not sure if that could affect it as well

dark briar
#

umm ok

mossy nexus
#

everything is much more readable that way

uncut python
#

Is it possible to put navmeshes in a blueprint so I can control it more

#

I want to be able to drop in a nav mesh and have it auto fill a room rather than manually dragging it

uncut python
#

Something like that. I can figure out the logic behind it, I just can’t find a way to put navmesh bounds into a blue print or someway I can make my own smarter version of navmesh bounds volume

mossy nexus
#

but I don't think you can expose navmesh more to BP than it is

#

as in, it doesn't make sense to do so

mossy nexus
uncut python
misty wharf
#

Well it's not really an exploit when it's designed to give the player information so that they know what they should be doing :)

mossy nexus
#

so you can use those

uncut python
#

I didnt know that that’s very good to know

#

Would you happen to know what it’s called?

mossy nexus
#

find path or something

#

search without context you'll find them

mossy nexus
#

which I assume isn't desirable

misty wharf
#

I'm not quite sure how they would force a task to complete unless the AI did the desired set of steps to complete it

mossy nexus
misty wharf
#

You'll never really avoid minmaxing if players really want to do that

mossy nexus
#

it's your project but I feel like you're basically painting yourself into a corner because of how much you are relying on your BT to be at the base for the majority of your gameplay

misty wharf
#

especially in building/sim/management type games

mossy nexus
#

well it's your project

#

do what you want

misty wharf
#

I honestly don't know what the problem is supposed to be with BT

#

It runs actions in a sequence

#

If I wrote the logic in BP's, I would run the actions in sequence

#

What's the difference :P

mossy nexus
#

the problem isn't with the BT per se, it's what you want the BT to do

misty wharf
#

Control what the NPC does?

misty wharf
#

It isn't controlling anything like that

#

It just controls what the NPC does after you choose a certain option

mossy nexus
#

you have a high coupling to the conversation system in your BT currently because the BT needs know where in conversation a given AI is

#

so the BT is effectively controlling conversation action

#

you use the BT to score players for a successful visit, which highly couples it with player scoring

#

I mean

#

you can argue about it all you want, but these are things that are happening

misty wharf
#

It doesn't need to know it, all it needs to know is what option was selected in order to choose what the NPC should do next, regardless of how the logic is handled the NPC needs to choose what to do next somehow

#

the BT is not doing any kind of scoring for anything :P

uncut python
misty wharf
#

Just because we discussed behavior trees doesn't mean that everything else that I describe about my NPC behavior to give context on it is also happening in the behavior tree :D Sorry if it was unclear

mossy nexus
#

because that's what you said earlier

misty wharf
#

I have a set of tasks which are managed by a task manager component, the behavior tree is used to run the task specific logic

mossy nexus
#

so the behavior tree decides whether or not a task is completed succesfully?

misty wharf
#

Yeah

mossy nexus
#

so it is highly coupled to player scoring then

misty wharf
#

So if you were to move the logic into not-behavior-tree, then not-behavior-tree would be highly coupled to player scoring

#

what's the difference

mossy nexus
#

the difference is that you can remove the underlying BT while still retaining player scoring, or you can remove the task manger and still retain scoring. having high coupling is the antithesis of good programming, and it's the cause of 95% of issues people have

misty wharf
#

Right, the BT is not required by the system, the BT just triggers a call to the task to mark it complete

#

the task itself has logic pertaining to what happens when it completes, the BT is there to just run it