#gameplay-ai
1 messages · Page 152 of 1
I disagree, I don't think they're "logic" because that suggests high/low circuits 🙂 these are more like flows and flow rates
Nobody knows what consciousness is, anyone claiming to know is just full of crock
Yeah, brains are complex mysterious and fun 🙂
I disagree, science is getting closer. this answer sounds like very luddite
Nobody has won a Nobel prize for proving what consciousness is, and getting a theory promoted to law for it
doesn't mean it can't happen
I didn’t say it can’t happen, I said it hasn’t
I think the trace down to the vibrations (I saw a talk on this) was quite interesting
Honestly most philosophers understand what consciousness is better than scientists
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
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
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
neuroaesthetics I can get on board with though
nope, he's definitely the artist because he's defining things out of thin air according to what his own biases are
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
I'm not sure you're getting philosophy there 🙂 I have some problems with it, but real philosophers aren't just giving biased opinions 🙂
well the philosopher is unconcerned with reality in this case, so that point is moot
to be honest I'm not sure what modern philosophers are doing, but if it's anything like academic circle jerks you'll excuse me for not having a terrible amount of respect for them
I'd say most philosophy is concerned with reality
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
Yeah, I hear you, I worked with a philosophy jerk 🙂 so I know, I know.
lol yea philosophers tend to be nit picky so I can see how the term jerk applies
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
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
I think me and you are arguing the same thing
I think that’s false, I have not met any true philosophers who fit that description
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
no true scotsman fallacy
There's a good reason a PhD is a doctor of philosphy 🙂 even for a ML guy
because just like philosophy, it's a doctor degree made up of thin air? 😁
paper usually 🙂
I could argue you are also applying that fallacy by ignoring string theory, Boltzmann brain, aether, God, and all other scientific pursuits considered impossible
actually these days electrons
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 😁
I disagree fully
well disagree all you want. people didn't come up with string theory on a whim
Philosophy is a robust and never ending application of skepticism to discover and understand the real truth and meaning of something
all very human constructs
You do realize science itself is a human construct as well
What are you talking about? Philosophy is definitely about observing reality
doubt
I get the feeling you have never genuinely read any philosophy at all
nah I don't read anything. I didn't study anything whatsoever. I'm actually illiterate
I can tell
What is a square then.
anyway, character assassination aside, philosophy is all about ideals
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
Stop dodging the question just because you know I’m about to prove you wrong
The methods of science created the concept of square, long before that practice was called science
I disagree
So you are saying science can’t explain what a square is?
what, like, semantically?
And played no part in its conception
Any, give me a scientific breakdown of a square according to the observations of reality from science
I don't think so no. squares existed before science did. look at bismuth
has this guy joined this discord just to argue about philosophy and the nature of humanity? 
or even iron, which has grid bound atoms in square like configurations
So you literally state squares did not exist before science, but you claim they are not a result of it?
No I came to discuss AI, he brought philosophy of consciousness and made false claims of what consciousness is
lol okay
I don't know how you can tell it's false since according to you, nobody knows what consciousness is
Because everything is false until proven true
so by your own definition it cannot be false
if we're talking about jurisprudence, then yeah
That is philosophy, If you cannot prove it, it should be considered false and tested until it can be proven
if we're talking about nature, then no
And if it cannot be proven false it cannot be science
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
What are you talking about? Of course they didn’t, who the hell is arguing they did?
I’m starting to actually believe you really are illiterate like you claim
right so nobody could ever count before maths. amounts didn't exist before maths
this is next level lmao
People counted before math, but they did not engage in math before math
if they counted, numbers must have existed surely
for as much as you're being defensive here, your arguments aren't really making sense
The concept of mathematical practice exists, the semantic definition of numbers was created with language
maybe you should sit down and rethink your approach
The numbers were created through the need to communicate the observed mathematical qualities to others, language is only a communication method
even maths have axioms at their core lmao
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
thanks but no thanks. if I wanted to listen to nonsense I'd go hire a philosopher
I’m not a philosopher
you're spouting nonsense all the same
He's not entirely wrong but the mildly condescending tone probably didn't help start the discussion on the right foot :P
He’s literally claiming a person cannot look at 2 rocks and come to the conclusion there’s 2 rocks without knowing about the number 2
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
I agree
EFool is trying to disrupt a conversation about neuron structure and behavior by dragging consciousness into it and arguing semantics
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?
nothing you discussed about the nature squares and what came after it had much to do with AI though lol
Go back and read what started this
This is what started it. Until that point is was a discussion of neurons
so neurons are valid conversational topics, but consciousness isn't in terms of AI. got it.
I may be at fault for replying to his off topic remarks, but I am not at fault for bringing them up
lmao
Again, you show you are focusing in on semantics and pulling one narrow aspect out of context without understanding the full meaning and comprehension of the discussion
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
You were bringing up the meaning of consciousness and what you think it is, that has no real application to the development of AI
(according to you)
Designing AI does not require an understanding of consciousness
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
the BT one you mean?
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
yes the BT MoveTo Task vs the move to location, move actor, etc. found in bp
even if it's an actor?
you'll get more mileage by creating your own. most of the AI module is half assed
the default MoveTo tasks didn't work for me and would on occasion crash
never happened with a custom implementation
It looks like it uses UAITask_MoveTo
im with with the standard BT MoveTo task, but would like to parametrize certain bool flags and the acceptance radius
which I'm pretty sure is available via one of the BP nodes
yeah AIMoveTo exists
And I very clearly pointed out the fallacy in your analogy as you had it applied backwards, you have your understanding of what philosophy and what science are, backwards
ill try it again, thanks
you pointed out your own fallacy by doing so yes lmao
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
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
so @bright osprey how's your UE project going
The fact that you keep talking down to him isn't really helping your side of this look any better :P
That’s a valid point, ad hominem gets nowhere
It’s going ok I think, trying to get VR to work in a stable frame rate
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
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
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
afaik there are none lol
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
Sounds like a kind of unusual setup to begin at least when you consider the average ue project
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
It’s designed mostly for graphics and ai since that’s the focus, it’s ran in VR and it’s very performance heavy on the gpu
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
where the content is thousands of moving AI actors?
Not just thousands of moving ai actors
I simply stated the small changes add up with thousands of actors
If you're running inference in python, I'd say why not BP it too 🙂
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
I need to play with compute shaders in UE, seems like its been a while
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
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
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
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
Isn’t that just GLSL?
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
slim at best
but it depends on how complex your general AI is
though generally 200+ AI requires a lot of optimization
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?
Can you ever render them even if you solve the CPU part though?..
lmao
is this real
😆 sorry just kidding, I was just catching myself up on the local AI chat lol
Yeah I did not want to mention about it but that conversation is hilarious LMAO
Made my day
Hopefully with simpler relatively low poly meshes
You can't
I tried 🥲
UE4's max limit with last gen is around ~200 meshes
And you barely get a stable framerate
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
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
yeah what GB is doing is next to magic
Displaying thousands of characters on-screen in real-time has always been a challenge - until now. Unreal Engine's Niagara visual effects system opens up doors to go far beyond what was previously thought possible and this presentation by Epic's Joseph Azzam showcases how you can utilize the power and versatility of Niagara to create massive cro...
If you are only going to render ~50 of them on the screen you can do some tricks to make it working though
My first recommendation would be watching what zoombapup posted and use that technique to 'fake' distant meshes
Only run logic on near pawns
I mean this is probably as close as you can get if you're a layperson
but GB has actual AI
and he's aiming for 1 mill
Yeah, that's just silly 🙂
I would imagine he'll do it, but to what extent a framerate would work is beyond me
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
GB?
GB
So if it's for really a 'gameplay' feature, I guess Epic also should develop a renderer for that
GlassBeaver, usually hangs out on #cpp
Ahh
@ocean wren
I was planning on leaving most of the ai logic in a manager class
let me know your thoughts on that vid
So the npcs can be as simple as possible
You mean the niagara one?
the twitter one
I'm not going to say it's near impossible or you shouldn't do it but I will say you should consider this idea very carefully. UE does not provide a good framework for mass entities like this currently. You would need to alter the engine and do a lot of optimizations that probably tire you a lot
hmm, I'm curious to see if it was realtime or not
It is realtime
GB conveys an air of a mad scientist in all honesty
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?
Check this out too: https://twitter.com/HoruGame/status/1449403808967237632?cxt=HHwWgIC5mbjFqJ0oAAAA
If you are not tanking your CPU with Character framework and other things that has possibility to create overhead, the real problem comes from rendering actually
I'm trying to find this frogs demo from back in the day.. I thought it was an nvidia demo, but seems not
for more complex AI it starts becoming a problem
With FPS camera you can somehow solve this by using significance manager and some kind of animation sharing setup but with RTS angle and all of them being rendered, it's out of UE's limits
See this: https://youtu.be/Rz2cNWVLncI
FROBLINS!
it was an AMD thing
Froblins is designed to showcase new techniques for character-centric entertainment made possible by the ATI Radeon HD 4800 GPU series.
god that video is terrible, lemme find a better one 🙂
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?
That's great haha 😄
the music is dreadful
yeah 🙂
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...
The company made this bought by or partnered with AMD
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
I think compatibility is a big issue in this
100k and no instanced skelly meshes 😔 GB get on their level
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
smart
GPU's are just amazingly fast
would ISKMs work for everyday AI?
'Vertex shaders'?
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
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
Ty for the answers. Ill play around with it and see if i can get the amount im after, even oversimplified
@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
do decorators inside subtree automatically have local scope, or?
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!
the basic idea is based on fluid states
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
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
what does bAllowStrafe do exactly?
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
gotcha thanks
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
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
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
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
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
right, I'd do that with some kind of resource locking
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"
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
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
Ah
and I used it the same way, for social interactions (social objects)
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
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
That's an interesting approach
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
Yeah
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
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
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?
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
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
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
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.
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
Sounds like good ground for a utility architecture for the "what should I watch" question
not a fan of fuzzy logic 🙂
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
right, sounds more like utility 😉
yeah, I was using "fuzzy" more to indicate it's not a strict "if x then y" type decision lol
trying to run EQS but the location update is very slow. how to make it run faster?
What do you mean by "location update"?
my eqs result is a location but it takes time to return the best location when my player character is moving
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
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 ?
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
yes but i want the enemy to stay in the location that the EQS has returned
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?
yes the latter one
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
ah okay... you're right. sorry for the silly questions. it's my first time working with EQS
No worries :)
Eqs, is that some sort of sphere trace or something ?
It can probably do those too
Guess I should give it a look, I like the sound of asynchronous
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
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
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
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)
ah
but my current 'fix' (which is terribly costly) is to trace each path point before subsdividing it
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
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
Dang. that worked tremendously !
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
@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
How many actions are there?
variable, but generally based on the AIs characteristics there might be a couple
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
for instance the AI might consider it has a chance to fight if at full health, but may reconsider halfway through and run away
then enable/disable via conditions
so leftmost would normally be the most "action" action.. fighting etc
rightmost would be idle
in terms of putting these in as generic actions that I can extend easily, what would you recommend?
and then in between is various phases of agression etc.
yeah I kind of have that setup already between alert <> non alert states
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)
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?
That depends. I do usually have an action queue, a bit like the PawnActions because I like running my longer running tasks that way
That's really cool. I've often wondered about how AI can pick up the statefulness of the world around it
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.
In this case, i assume each action is an object. How would you handle bespoke logic per action for instance?
How would the AI know the difference between right and wrong states?
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
Layered queues... So something like multiple queues offset by some threshold value?
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 🙂
That does make sense, but it seems that each such object in world would need a component with this data that then is encoded at game start? Then just query the component for whether or not things are correct? Does that sound like a valid approach? If so, detection wise, how would that be handled?
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.
Ah that's cool
I somehow inadvertently made that happen by creating a component that gives my characters systemic peripheral vision
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"
so I do have look and movement separate, but mostly by the accidental interaction between two systems
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
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
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
so they're almost like BT tasks outside of the scope of BT
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
by monitoring code you mean service like structures?
yeah, I guess so
noted
My services usually just take care of threat scoring and the like, mostly sort of utility stuff
yeah I have a single service in mine that is used to feed values into the BB from my custom perception component
yeah, me too.. my perception scoring stuff is pretty well customised
to allow for stealth gameplay etc
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.
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
there's a BT task for this
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
rotate to face?
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
from the player's perspective in mine it looks like there are two, but it's all based on values in the range of a single fluid state. so an AI can be attentive without being alerted. attentive just means it'll adapt some curiosity behaviors for investigations
I mean if you want slightly more human looking stuff at least, probably not for creatures
and even within my alerted states I separate between neutral alerted and aggressive alerted
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
neutral will just tell the player (or other AI) to go away
aggressive will actively fight them
ah I see
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 🙂
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
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 🙂
sounds familiar
gamers basically make shit up out of their imagination 😉
what players think is "realism" not actually being realism and all 😅
usually based on what they see in other games and in films 🙂
yep
And we had a good sized cohort of experienced military guys playing, so that was an interesting discussion
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 😅
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
good point. I think the only point of dependence I see so far is object interaction
Its usually limbs and stuff. Arms especially, can't aim a gun and open a door with the same arm at once 🙂
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
Well, you still need resource locking type stuff in case you find another item to hold 🙂
that's fair, but I think I'll make a tradeoff where the AI will start behaving differently if there's two of anything
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
I'm going to be making a survival game at some point, so I'm going to have my character constantly looting 😉
haha yeah that's an entirely different ballgame to what I am doing
I don't even have a proper inventory in my project
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
Yeah, makes sense
player inventory will at most be two items that can be used in world, and then something like a currency
AIController and PlayerController are about that really
for AI I could make one of those items held in hand, and one like an item on their body
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
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
pffft, spreadsheets are where its at baby!
and diablo 2 is one of my favorite games in large part because of looting and inventory
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
makes sense
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
I'm fond of immersive sims so most of my systems work towards creating similar systems and dynamics
I mean it doesn't sound far off. isn't that basically fallout 4
honestly though, it DOES make sense, its inspired by a bunch of old games I used to play
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
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
I've watched a few lets plays of it yeah
my own inspirations for my current project is basically the world of thief and stalker mixed together
there will be no head bobbing
thank god 🙂
also it's third person because too many people get sick from first person
so I'm trying to widen my audience a bit
buuut first person!
first person is just more immersive to me
I'm having switchable though, because I do like that ability
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
I'm going to focus the fps version and just make it possible to third person too
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
Yeah, most of my environment is outdoors, so likely not a huge issue either way
yeah in that case you'll be home free
its set in the falkland islands (nominally so I can use satellite data for the terrain)
the actor never faced the clicked location, is this the right function to use on ai?
the BT task wasn't good enough or?
not sure what you're reffering to
I reckon the terrain from there makes it easier to work with for sure. I've got directed outdoor spaces and somewhat tight indoor spaces, so camera is a big deal for my project
rotate to face or whatever it's called
I forget
I made my own because the proprietary nodes kept crashing my game
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
yeah unless that AI controller also activates a BT
well then!
im not a fan of how it keeps following the cursor though, i only wanted it to happen on a click
hmm
I don't know what the condition for it to succeed is
again, I made my own
which succeeds after turning
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
I guess that could work
or a decorator that checks for HasClicked that can be tied to the input actions from the PC
same same 🙂
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
do you have navmesh enabled?
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
the first shot does not look right. I'd breakpoint to see if that actually runs
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
I assume EQSEnemyActorContext is the one that provides the player pawn?
yeah
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
try using the EQSTesting pawn with the same querycontext and see what you get
It might not really do anything useful because there's no player if you're not in play mode 🤔
yeah
have you tried printing out what that returns?
yeah it never prints anything like its never called
maybe its never called?
the 3rd picture, he successfully picks points around himself
should be around the player pawn
same result with EQStestingpawn
time to break out the debugger then
ngl seeing this makes me more confident that the approach of building my own perception system was the correct one
What's this got to do with perception?
not so much perception, more so trying to figure out why a built in system doesn't work 🙂
correct....
I just said perception because EQS is perception based too
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
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
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
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
EQS is perception based? Huh? 🤔
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
and built in BT decorators not really being clear in their purpose (supporting arithmetic, not supporting arithmetic)
you are querying the environment. what do you think perception is other than querying the environment?
Ah that's what you meant
I mean you can just query it without perceiving anything too but... lol
my current set up uses the senses to determine what i was just trying to do with eqs...so i can see the correlation
whats the difference between activation and searchstart in BT service?
i use sight, sound, smell, and damage
smell? that's interesting
some of my ai can detect "chemicals"
How does that work?
custom sense class
Yeah just wondering how you implement it
are you talking about BT activation as a whole? if so, activation happens once (per tree completion), searchstart happens every time it has to find a new node in a different hierarchy iirc
Making them runaway from bad smells would be a good mechanic lol
sounds like it'd be similar to sound
gameplay tag
ah
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
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
I meant the ReceiveActivation function in BTService node
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
that's when the node that the service is on becomes active
ahh gotcha
anyways thanks for trying to help guys...ill revisit EQS when its beta
would I need to use activation function if I need to use the results from it on a decorator on the same node?
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
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?
I don't think that's implemented in the BT by default
any idea what would be the best place to hook that function up?
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
why does AIMoveTo not work when I use a subclass of AIController?
it does? whats your setup look like?
I fixed it, I overrided begin play on the controller and never called the parent
probably should have used onpossess
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
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 😛
Hi, why is my navmash shrinks during playing?
Because you left it in the wash?
👍
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 🤦
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
did you copy it verbatim?
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
so, show code
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
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
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
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
you can still use it if you consider how your setup for your loop will be
FWIW I got this and it's working
(and I got no waiting time in that behavior)
Is there a way to score/filter out my EQS item with Camera Angle or viewport?
Yeah was thinking of using something like this
Not by default, afaik
i got the answer using DOT
@dark briar use the dot test and make a context for the camera actor
oops delayed :/
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 ?
are you referring to this? https://www.youtube.com/watch?v=dDnHAUgaQQk
Today I show an often unknown but very useful tool for helping differentiate our AI movement.
seems to be a very good one, thx !
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?
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 🤔
sounds like a simple parallel
Kinda but not really lol
... what's the difference? or rather, why is it you could not use a simple parallel for this?
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
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
like this sounds like the conversation options should be had in a single BT task, so that if the player for some reason decides to have a different conversation, it's still kept within the same node
you can just use FinishExecute as conversation ender
Hmm
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
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
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?
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
what do you mean "give" an item? if they are supposed to find it, what do you give them?
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
that's fine? if it's not an AI action then the conversation is technically still being held
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
that sounds like it could be handled through conversation as well
I'm not entirely sure what you mean by that, as in not having it in the BT?
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
I suppose that's an option, it just feels a bit awkward in terms of how the interaction would work
isn't it more awkward if they are standing there with their hand out waiting for an item until the clerk finds the item?
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
IMO the former seems way more natural
hmm
the latter seems like a transaction between robots
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
so just giving the item to them directly without having to click through a conversation list feels a bit smoother
yeah but your BT shouldn't be dependent on how many clicks the player has to go through
and these interactions are something you do a lot in the game, so having them work smoothly for the player is kinda important lol
.
user experience != AI behavior
Well it isn't really dependent on that the way it's implemented now where it just aborts the branch and loops
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
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
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
which is why I was looking into the whole idea of consolidating it into a singular node to begin with
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
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
what kind of particular behaviors do you need?
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
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
if the conversation is a task
because the tree would then look like this
it would not
the recommendation and finding of items would be handled in conversation
well that would mean I have to deal with building the AI logic out of BT which is a pain in the ass :D
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
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
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
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.
Yeah there's already a patience mechanic for that where it just aborts the BT when patience runs out
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
It could, but the customers have various other behaviors which make use of all of these tasks, which is why they are individual tasks
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
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?
the more nodes, the greater the cost
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
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
They are a separate system, the BT doesn't control that
the BT just responds to the choices that are being made
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
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
I think it's worth considering the high level ideas of how human behavior works and make AI behavior correspond to that
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)
then you can also consider how each of the high level ideas (such as browsing) would have small tasks in them that they could facilitate
mostly it works like so :P
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
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
the AI director could have a queue of actions or tasks lined up that need to be done
I don't think that is relevant for the BT
that is internal to the AI itself
you could at most have it be unlockable behavior if it's really relevant
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
so have it based on their priorities
if they have a specific thing in mind that's highest priority
Yeah but I'm not entirely sure why this should not be in the BT
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
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
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
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
those seem like petty tasks that should be found underneath any of those categories
you could have Checkout as the highest priority
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
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
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
I think it doesn't matter. you can score it the same way
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
time to task completion, whether they found what they were looking for
whether the clerk was nice
the customer would still tell you what they are looking for
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
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.
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
were the customer's needs met?
did they get what they wanted?
...and also I really need to go to bed now but I'll read your response when I get up :D
like again, the scoring feels robotic as well
I appreciate the ideas, you have given me some good stuff to think about so far :)
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.
There is nothing inside of it. Do I just put the comparing of the 2 keys into the bool? @pine steeple
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.
how do I feed values into an eqs query? like the min and max range for query
that should be done within the eqs query itself. The eqs will output the thing you want - such as a target location
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
most likely need some kind of ai manager class, this is because you want to determine decisions amongst a group of ai instead of per
Thanks bro i will try that
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?
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)
guys what tut series do you prefer to behavior trees
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.
Oh. I see now. So once either of those keys are unset, it will break out of the sequence?
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.
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.
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)
i should exclude the default nav area you think ?
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
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
i've spent 3h on this, thx a lot
Yeah it's not really related to the BT at all. The BT just runs the tasks, the rest of the logic related to the success% and how that gets stored is elsewhere
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
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
I haven't noticed, but if the npc is the one causing the navmesh rebuild then I guess it might
actually it's not, i just spawn a building in runtime, so obviously i have to upload the nav mesh in runtime. I have no issue when i desactivate it, except that... Well they just walk into the building. Don't know how to make it right
Deactivate what exactly?
nav mesh in runtime
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?
well if i leave it on, the NPCs just turn around, like they were blocked by something but there is nothing around
Have you looked at what the generated navmesh looks like?
yeah, a big red zone around each NPCs...
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.
@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?
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
That's odd 🤔
ok sorry my mistake, when i try to iterating without any call but just a UE_LOG then it works. but it doesn't work with i set a score
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
did you try logging something after setting score just to see how many time it hits that?
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
How many items does it have?
48 items
you probably need to show the code, it should work
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"));
}
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
umm ok
just for posterity, it really help if you use the triple ` brackets and add cpp on the first line
everything is much more readable that way
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
Thanks!
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
IMO you could look at how you can use generated paths on existing navmesh to give you flow
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
you'll have players exploiting this IMO
I see, I haven’t heard of generated paths I’m gonna google it rn, sounds interesting
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 :)
there are nodes in BP that allow you to path between 2 points o navmesh
so you can use those
I didnt know that that’s very good to know
Would you happen to know what it’s called?
what I mean is that they can force tasks to complete by breaking actions because they know how the AI behaves
which I assume isn't desirable
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
they could gauge behaviors and just minmax it. plus BT are very bug prone so unless you've masterfully designed yours, there'll be bugs. players will exploit those as well.
You'll never really avoid minmaxing if players really want to do that
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
especially in building/sim/management type games
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
the problem isn't with the BT per se, it's what you want the BT to do
Control what the NPC does?
.
It isn't controlling anything like that
It just controls what the NPC does after you choose a certain option
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
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
Thank you I’ll check it out
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
are you not scoring based on successful tasks that are happening in your BT?
because that's what you said earlier
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
so the behavior tree decides whether or not a task is completed succesfully?
Yeah
so it is highly coupled to player scoring then
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
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
