#gameplay-ai

1 messages · Page 13 of 1

pallid mica
#

Yeah but that's per instance

#

Would be nice to change the default

#

I will probably also spent some time adding some default tasks to it from C++

#

Like a "Debug Transform" tasks

#

Now with that said, where does one place "global state" though

#

I guess the Context Actor houses that now ?

fickle cedar
#

The Blackboard felt like burden and was a bit confusing indeed

#

I believe they wanted to follow a general AI development practice but it didn't fit well in UE

#

Looks like the output variable category is Out, for Output it doesn't seem to appear in the StateTree under that task

#

Either way I'm happy I now know how to pass data 😄

celest python
#

or additional UObject you add as schema parameters

pallid mica
#

But that's C++ then right, new Context variable or what?

celest python
#

no C++ needed, its only if you need to add something to schema by default or being able to promote its type

#

Schema's UPROPERTY's become schema parameters

pallid mica
#

What is the Schema then

#

Like, how do I work with it. I'm not following

celest python
#

Schema is the "environment"

#

its the asset you are building ST

pallid mica
#

Yeah okay, so the Parent of it?

celest python
#

yep

pallid mica
#

So a custom Parent would allow that?

celest python
#

not the statetreecomponentschema though - its not exported - use the base class

pallid mica
#

How do I access the variables in a Task then?

haughty coral
#

I think I mixed up this. You can do that fpr sub states and multiple tasks within single state (a bit confusing because the order of execution and finishing is not clear)

celest python
pallid mica
#

Makes sense, thanks!

celest python
#

thats why you might need an additional UObject

pallid mica
#

Fair enough

celest python
#

so you copy the uobject ptr instead of the value

pallid mica
#

Does anyone know what the StateTreeSendEvent node is for?

#

Also, how does one handle latent stuff in tasks? :<

celest python
#

Context param in node functions gives you access to events but looks like events are scoped

#

Context.ForEachEvent()

#

extra way of passing data by event/signal system probably - though it doesnt let you pass a payload like gameplay events

pallid mica
#

Oki

celest python
#

by right clicking

pallid mica
#

EnterState has a return value though

celest python
#

ah right sorry

haughty coral
celest python
haughty coral
pallid mica
#

Ah

#

Running as return for Enter will Exit and Reenter?

#

Ah you use tick too

#

I see the setup now

#

Yeah guess that will have to do

#

Is it needed to call Finished/Failed in Enter?

#

I assume Enter only calls once

#

Did this now

haughty coral
#

Looks good just tou don’t call the Custom event anywhere

pallid mica
#

Ah

#

Right

#

Also, if I want to constantly rotate the AI towards a Target, is that fine in a Task that just doesn't End in one of the Parent States or should I continue doing that in the Character itself?
BT Tick was shit for this

haughty coral
#

I ended to have many tasks just running forever

#

Constantly rotating to something would be one of them

#

Usually every task I use on states which have sub states runs forever because I use it for stuff like “keep doing this while the sub states are executing”. And you can not finish that one as you would interrupt your substates.

pallid mica
#
USTRUCT(BlueprintType)
struct STATETREEMODULE_API FStateTreeEvent
{
    GENERATED_BODY()

    FStateTreeEvent() = default;
    FStateTreeEvent(const FGameplayTag& InTag)
        : Tag(InTag)
    {
    }
    
    /** Tag describing the event */
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Default", meta=(Categories="StateTreeEvent"))
    FGameplayTag Tag;

    /** Optional payload for the event. */ 
    UPROPERTY(EditAnywhere, Category = "Default")
    FInstancedStruct Payload;

    /** Optional info to describe who sent the event. */
    UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Default")
    FName Origin;
};
celest python
#

ohh great, it lets you pass FInstancedStruct

#

though since its actually exposed to BP now, i dont know why its limited to C++

pallid mica
#

I guess something like this

#

Yeah nvm, that's James struct or?

#

That he PR'd?

#

Jambax on Discord

haughty coral
#

He did the BP API for 5.1 and replication in 5.2

#

With events you can make your state transitions event based instead of ticking

pallid mica
#

Ahhh, that's for future me

#

Optimization is always future me

#

Tick all day

haughty coral
pallid mica
#

Do you have an older version?

#

Just asking, cause your Next Arrow is not pointing downwards

haughty coral
#

5.1

pallid mica
#

Hm okay

haughty coral
#

Probably because of ( ? ) in front of it

pallid mica
#

Yeah I guess

#

Execution flow or so can't be visually shown when playing or?

haughty coral
#

Check this, this is my recent summary of ST experience so far

haughty coral
pallid mica
#

Oki

pallid mica
#

I guess one option is to not use AIPerception

pallid mica
#

I wonder if there is anything debugging wise on 5.2already

pallid mica
#

Does someone have an example for an Evaluator? Sounds like I should place my Perception Code into that

#

Created one and added it to the Tree. Now I wonder what I'm supposed to modify from here. Bindings again?

haughty coral
#

I run EQS in an interval as evaluator. The EQS iterates results from perception component and filters only relevant things. When the result changes, it fires State Tree Event and See/No See is switching based on this event.

pallid mica
#

Something something custom StateTree Asset with VariableA and then binding VariableA in the Evaluator and in whatever Task I need?

haughty coral
#

But it is only hobby project/prototype, not a serious project, so take it with caution

pallid mica
#

It#s a prototype here anyway

#

@celest python I don't think I can create BP Version of Schemas, or?

haughty coral
#

There is a screenshot I posted some time ago which shows also evaluators and my early experiments. #gameplay-ai message

pallid mica
#

as in, a new parent for a State Tree?

#

Doesn't seem to show up in the Blueprint Class Dialog

celest python
#

you must inherit from c++

pallid mica
haughty coral
#

I dont think so

#

Tasks can use outputs of Eval directly

#

bind to it

pallid mica
#

Ah, so just put them into an Output Category ?

haughty coral
#

yes

pallid mica
#

Man, too much auto generated crap for beginners I swear

#

Would be nice if at least the Categories would be autopopulated

haughty coral
#

yeah, I also found out about categories randomly

#

Think of Schemes as of use cases / contexts in which you use your ST. You can now use ST for AI logic, elevator, weapon states, RTS order and so on. Iirc you can limit tasks, evaluators and everything only to certain scheme, so RTS order tasks will show only if you work in RTS order state tree. Same for other. You can also define custom context vars. In the case of AI logic it could be your character/AIControoler, in the case of RTS order it could be your selected ARTSUnit, in the case of elevator it could be maybe your AElevatorButton and AElevator.

This is a really cool improvement over BT. If you used BT in different contexts, designers always saw all nodes in the right click menu.. even ones which don't make sense for the given usage.

From what I saw, Mikko follows the concept also for the new World Conditions plugin which has some scheme stuff too.

https://twitter.com/Skylonxe/status/1592821930088108037

https://github.com/EpicGames/UnrealEngine/blob/948f8bdfb0cc55ee163d86aa13c567f04c294eea/Engine/Plugins/Runtime/WorldConditions/Source/WorldConditions/Public/WorldConditionSchema.h

New World Conditions plugin was added to ue5-main today. It looks like a system to check the state of world from other systems in a modular way. Could be potentially used by AI or systems like objectives. https://t.co/wGMaBt2Y0u

pallid mica
#

Thanks for sharing

#

I assume this won't work, or?

#

Or does it reevaluate the Condition if the Boolean changes?

celest python
haughty coral
#

I am afraid not. That is exactly why I mentioned in my feedback the exponential growth and Abort functionality of BT. You need to add transition from See Enemy to No see Enemy and from No See Enemy to See Enemy. I would be interested to know if there is a better way because otherwise it is just the common SM growing complexity problem again.

haughty coral
celest python
#

I see, at first glance reminded me of CryEngine's "game tokens" thing - but seems entirely different

haughty coral
#

Imo it sounds like something usable by objectives system

#

This could be related research

#

But they have my full trust :D the stuff they are doing for UE5 is wonderful

pallid mica
#

Isn't the Transition wrong here?

#

Shouldn't Move To Cover go to Next?

#

Yeah I'm a bit lost. Not sure how I get the tree to re-evaluate when a condition changes.

haughty coral
haughty coral
pallid mica
#

Hm

#

That sounds strange yeah

#

The Decorators are missing I guess

#

Something that looks at a variable and notifies the tree or part of it that itneeds to change

#

Abort Self basically

haughty coral
#

Yeah, this is what I do now

#

my original plan was that every sensed actor change fires ST event StateTree.Event.Sense.SenseCategory

#

and that all main states like Hear Noise, See Corpse, Receive Damage will do (?) -> Root when the event StateTree.Event.Sense happens.

#

But in 5.1 there is an issue that ST Event tags are not using tag hierarchy, so you need to check for exact tags in event transitions

#

This is already fixed in 5.2

pallid mica
#

I added a Transition OnTick to the other option for now

#

Both way

#

That's at least how the Docs do it

#

.>

haughty coral
#

yeah, I guess it is fine too

#

but as you said, Abort stuff would be really handy but I am afraid ST intends to be general purpose state machine and abort probably has no place in the basic state machine concept. Unless Epic decided to alter it and diverge more from state machines. But It can totally be that I am just missing something. I guess we need to wait for more official examples.

pallid mica
#

Yeah it#s a bit strange. Like it doesn't help to bind to Evaluators if the values changing doesn't cause the tree to retrigger

#

Now it's basically trying 24/7 to transition to the other State which fails cause of the condition

#

It does cancel though I guess

#

Like, if the "Random Wait" is still active, it finishes it

haughty coral
pallid mica
#

Which means I need to be careful to handle tasks that are meant to end later and remove all still running logic

#

Yeah I'm being very careful right now not to overcommit

#

The missing debug visuals are quite the killer

#

It looks really nice ,but seems to be one or two iteration to early

#

For AI at least

haughty coral
#

at this point I plan to do core AI in BT and individual encapsulated AI behaviors as ST. That way I can reuse behavior ST for multiple enemies, assign them in details panel and pass different params for every enemy instance. But the main branch decisioning will be in BT, so I don't need to handle the aborting/root transitions in ST that much.

pallid mica
#

Yeah I might fall back to using the STs for non AI for now

#

E.g. Music State Management

#

Although our own StateMachine is in that regard more powerful

#

As there is some transition time to crossfade etc.

#

sad beep

#

maybe that's GateDelay

#

Who kows

haughty coral
#

yeah, we will see. It was mentioned before be Mieszko that the production ready state of ST means it is stable and not that it is feature complete. Might need a few more changes to make it easier to go full ST everything easily.

pallid mica
#

Makes sense

#

I wonder if it might be a future idea to allow defining Abort options in Bindings.

#

E.g. here

#

Some additional setting for "Abort Self on Change", which would be closer to Decorators

#

Just thinking out loud

#

Although pretty sure the Input Params are just handed in and there is no intend to keep track of where that came from and if it changes.

#

Which is fair, would allow to remove BT more though

haughty coral
#

Thinking loud I would expect no change there and the current structure to be more or less final as it is a complete state machine. Maybe the evaluation of transitions will be event based in future but having Abort would be a drastic change to how people use it. (For me it would change it to better but more experienced people can have different opinion).

pallid mica
#

I don't see that much of a problem to Abort a State and have that as an additional Trigger

#

No one needs to use it then

haughty coral
#

I personally don't but maybe Epic wants ST to be close to clean state machine implementation than a completely new paradigm. It was mentioned that BT v2 could happen but it is years away. As I mentioned before, ST could be a backend for it as BT is more or less a state machine just with some implicit transitions. #gameplay-ai message

pallid mica
#

Yeah I mean, if they just improve the looks and stuff of BTs, then I would also be happy

#

I just hate BTs

haughty coral
#

Yeah, me too. But going deeper I think I hate blackboard and not BT.

pallid mica
#

Hm, I think UX wise it could be a lot better

#

BTs that is

#

And that I don't have a proper Parallel and Tick in it

#

Is annoying me

haughty coral
#

yup. The concept is not bad but UX is dated.

fickle cedar
#

Might be worth pinning this one until the documentation mentions so 🙂

pallid mica
#

I don't know if it's correct haha

lethal verge
#

Heyy, kinda landed on some struggles with my behaviour tree for a bossfight. I want to add the condition Dead-Boolean. But cant seem to wrap around how. What I've done is made a blackboard value by pool, and entered the isdead condition from my bosscharacterbp. However, it doesn't really update, or getting applied. Any good guides on how to add the event of death to a behaviourtree? Aswell as unpossessing/deleting it.
Best regards

harsh storm
#

Awww - ya'll were talkin' ST while I was sleeping 😭.

I plan on releasing a blog/written tutorial soon about these things with ST. For an abort condition, I would do a Exit Condition on Tick pretty much. You can think of Evaluators as services from BT @pallid mica. Currently, that is how I'm passing in Perception data. Through the ST event. My Root node has a transition for these kinds of things. (This is also part of what drove me to look into how to alter ST params at runtime, because I didn't want an evaluator specifically for that)

uneven cloud
#

No. Navigation does nothing to collision. Setting the step height lower will limit terrain they can walk over. Increasing the step height will mean they can walk over taller rocks. You might also have a level design problem where even the player will have trouble moving through that.

harsh storm
#

For the move stuff, I am setting up the movement in the enter state function. Then in tick, I am checking if we have gotten there.

uneven cloud
dawn schooner
#

yeah I considered coding one in C++ for animation states

#

thanks for the answer

lethal verge
floral wigeon
#

Hey guys, Perhaps anyone here can help me figure this out

#

I have a map where the ai can take a shortcut around a cave behind a waterfall, Now i wanted to make it so the AI gets telported to the other side of the waterfall and i have an overlapping trigger connecting both "cave" exits. Now the Nav mesh between those two is obviously disconnected and i though i would be able to connect them using a nav proxy link but the ai doesn't seem to take the path even though it's clearly cheaper than it's alternative

#

Is there any way for me to tell the AI hey if you take this path is shorter than the alternative because you will teleport? due to other tasks i can't tell the ai to use the shortcut by command, it has to be it's own decision.

lethal verge
#

Maybe through a task or a conditioncheck, with the distance from actor to the cave?

uneven cloud
uneven cloud
uneven cloud
young lintel
#

Is there an efficient way for AI to look for actors of class within a range around it? (More efficient than using Get All Actors of Class)

harsh storm
#

Perception system is a good start

young lintel
#

Hmm, I'll try that, thanks

#

Also, is there some way to have a BT task that will run indefinitely until a specific event is called on the AI pawn?

#

A task the AI can't know the duration of until it's complete, basically

wind surge
#

how can I make my ai give up after cant see a certain amount of time?

dawn schooner
lethal verge
#

Cant get this Death event to work at all. Tried it through macro, function, bt, animation, montage etc etc xD

uneven cloud
young lintel
#

I mean... I have situations such as when my AI is mining, it reaches a point where the mining completes and a piece of ore drops to the ground, I want them to be able to find that to pick it up. It just feels wrong to query all actors of type 'ore' in order to find the closest one

harsh storm
#

Uhhh - not cheaper than doing Get All Actors of Class? That's an interesting assertion

uneven cloud
young lintel
#

So, what's the right way to handle that, am I just running a loop in that task to check for completion?

uneven cloud
empty coyote
#

Hello, find path to actor synchronously is giving me a path that goes too close to walls. How do I increase the distance away from walls?

uneven cloud
young lintel
#

So you'd recommend just querying all actors of class every half second until I find one that's within the range I'm looking for?

harsh storm
#

You can get the class of the actor that triggers it.

#

Get All Actors of class iterates through all actors in the world

dawn schooner
harsh storm
#

Having a box collider around and tracking what enters and exits would probably still be better, depending on how many agents you plan to have.

dawn schooner
#

How many actors can it be max?

young lintel
#

There is no max

young lintel
#

It could be a lot

dawn schooner
#

You should have a max

young lintel
#

Probably not thousands, but it's possible

uneven cloud
dawn schooner
#

Else how do you know what you can sanely support

young lintel
#

I'm not too worried about defining maximums at this point, until I encounter issues

uneven cloud
young lintel
#

This is very early prototyping, I'm mainly just trying to determine the right approach to doing this

#

There's a lot of ways it can be done, but I'd like to at least start with a way that isn't terrible

harsh storm
#

Get All actors of class every half second is hardly the solution I'd go for. But w/e. I'm checking out.

uneven cloud
dawn schooner
young lintel
#

Sphere cast might be a good approach for this

dawn schooner
young lintel
#

The sphere won't be large

#

two meters, maybe

dawn schooner
#

also if you need something really performant, TOctree2 is the fastest spatial data structure that I have found for now

#

for multiple queries

#

and TQuadtree for 2D, but queries are slower

young lintel
#

Yeah I think sphere trace is going to work the best, there could be dozens of miners around the world doing their thing, but they never need to know about ore that's more than a couple of meters away from them

harsh storm
#

Not really something you want to do every half a second

young lintel
#

No, it isn't

dawn schooner
young lintel
#

Hence my search for a "better" way

harsh storm
dawn schooner
harsh storm
#

It definitely can't be on the agent itself

#

Too many agents would be calling it

dawn schooner
harsh storm
#

It'd have to be in a subsystem.

harsh storm
young lintel
#

Yeah it also doesn't need to be a half second, really, I'm still trying to determine how to make this task figure out when it's finished, heh

harsh storm
#

Perception, box collision, get all actors, etc...

young lintel
#

It could, ideally, just fire when the task finishes to look for the piece of ore that should have fallen

dawn schooner
#

Also BTW, if the gold is dropped by the direct action of a miner maybe that miner can pick the gold and you avoid all this hassle

harsh storm
#

👆

young lintel
#

Well, it's dropped by the harvestable node when a certain progress point has been reached, the miner is simply applying progress to that node every few seconds

harsh storm
#

Like - I know having a bunch of moving trigger boxes is shit for performance at scale

#

But it is a solution depending on the context

#

Are you trying to make it where when an ore drop it shows the distance on the hud or something?

dawn schooner
young lintel
#

Very likely

dawn schooner
#

I would not bother with distance checks or queries

#

just have that miner pick it, 0 performance cost

#

and probs same results 90% of the time

#

I mean, unless there is something important about having a different miner pick it, players won't notice/won't care

young lintel
#

Actually I guess I could just make the node send the ref to the ore it spawned in the completion event

dawn schooner
#

faster to code, faster to run

young lintel
#

Hey, I'm slow, give me time, lol

#

So this leaves me with the question of the task itself, can I use delays or timers in a task?

harsh storm
#

Yeah

young lintel
#

Okay that should work then

harsh storm
#

There is a built in delay task already.

#

Depending on how you are structuring your BT, that may be a better thing to use

#

Just not enough information to accurately say

#

(Which is also why you were given so many different solutions to your question)

young lintel
#

Sure, I understand

#

I appreciate your patience

lethal verge
#

Since you guys are ballers on the AI, is anyone help me to kill off my AI? xd - nothing but bugs

#

couldve been that easy, huh

#

But nah, behaviourtree will go nuts in error log

#

i figured it out however

#

But now I just need to make my death animation stop loopin

#

and fixed that. lol

uneven cloud
keen onyx
#

how do i stop enemies from blocking other enemies' vision?

viscid oasis
#

Is running an EQS alongside a simple parallel bad?

#

I'm trying to split movement of my character from it's aiming / firing.

sullen escarp
# viscid oasis I'm trying to split movement of my character from it's aiming / firing.

Why not have a task at the top of the tree calling a custom BT Task like ShootAtEnemy that hooks into AI Controller to see if it has target, can see them, and has ammo (along with other rules you want) then fire weapon. Can have it loop the task every 5 seconds with a ±1 second deviation.

That way you can have the AI try to aim / fire at the player whenever possible across multiple child branches such as if they're running towards enemy, going to find more ammo, or wandering.

harsh storm
#

You're honestly the first person I've ever heard defending using it every half a second for potentially thousands of actors

viscid oasis
uneven cloud
# harsh storm No. Mainly because I haven't ever reached for it as a solution. Lessons from all...

This is why blindly following advice that includes absolutes, especially when it comes to performance, is bad and perpetuates naive information. Yes in some circumstances it's too slow and it's better to reach for a different data structure, but in many cases (especially for hobbyists) it's a perfectly fine tool. I've used it in several shipped games just fine.

In programming there aren't a lot of absolutes. Every decision that you make has pros and cons and it's more important to understand those instead of using absolutes. Sure the documentation says it's slow, but it doesn't give the context of why. If you actually dig into it, what it's doing in a non editor game is perfectly reasonable. Sure you shouldn't use it every tick, but you should be avoiding tick anyways.

I never said that it's fine for potentially thousands of actors. It is however better than the other solutions given depending on the context.

harsh storm
#

No, it won't matter much in small games.

#

And yes, a lot of things are context dependent. There is no denying that.

#

And I don't think anyone was ever talking in absolutes.

harsh storm
#

So - I'm pretty sure I traced it down to the hashtable you mentioned before. Inside FActorIteratorState, it calls GetObjectsOfClass() which inside of that calls ForEachObjectOfClass() which then gets the FUObjectHashTables singleton and calls ForEachObjectOfClasses_Implementation() And in there is where the actual finding of classes happens. So it seems like this table gets updated when a new object is created, and everything is derives from UObject.

viscid oasis
#
class RAPTOR_API UREnvQueryFindEnemy : public UEnvQueryTest
{
    GENERATED_BODY()

public:

    virtual void RunTest(FEnvQueryInstance& QueryInstance) const override;
    virtual FText GetDescriptionTitle() const override;
    virtual FText GetDescriptionDetails() const override;
    
};
#

Sanity test - having an issue with getting this to compile at all.

#

It's a custom Environment Query Test. Really basic. But for some reason it's throwing that the RunTest has no overloaded member FEnvQueryInstance.

#

I thought maybe my header is cooked, but it's not.

viscid oasis
#

fuck it. didn't include const in my .cpp

celest python
#

If anyone adds BP-created enum to their ST as parameter, be careful

#

I did it two times and cant open the ST graph anymore

terse panther
#

hey there, what avoidance will be better for the enemy AI Detour Crowd or RVO, and will there be any performance hit by using any of these two? As right now my enemy AI are bumping into each other way too much

viscid oasis
#

I'll throw this one to ChatGPT

#

BAH

pallid mica
#

So, friends of Behavior Trees. You could maybe win me back if one could explain me how I get a ticking Service that ticks every frame.

#

It doesn't matter why, I just want it ;_;

celest python
#

they dont tick everytime

pallid mica
#

I knoow

#

I want them to

#

At least the option

#

After all this thing whole setup is actually using tick

celest python
#

create a base service class and inherit from FTickFunction, use it's tick -- you wont be able to access default parameters though since it only gives you DeltaTime

pallid mica
#

It's just that Services have extra code to only do it every x seconds

#

The problem is WrappedTickNode

#

ACTUALLY

#
if (NodeOb->bTickIntervals)
{
  // Some annoying code
}
else
{
    UE_VLOG(OwnerComp.GetOwner(), LogBehaviorTree, Verbose, TEXT("Ticking aux node: %s"), *UBehaviorTreeTypes::DescribeNodeHelper(this));

    const_cast<UBTAuxiliaryNode*>(NodeOb)->TickNode(OwnerComp, NodeMemory, UseDeltaTime);
    NextNeededDeltaTime = 0.0f;
    return true;
}
#

This looks quite nice

#

So I just need a childclass, like the DefaultFocus one

#

And set the boolean to false

dense condor
#

I have 2 decorators on my behavior tree for 2 of my character states, attacking and holding. I know that when sequences fail they start from scratch, i have another state called knocked down that i think breaks the loop. after it goes into knocked down state the behavior tree gets stuck in the holding branch. Im not sure why its getting stuck.

pallid mica
#

Wait you can just set the Interval to 0 and that ticks every frame?
Hm, I'm sure that didn't work before

pallid mica
#

And arrow wise it seems to have returned to its parent

#

What's at the top of that tree?

dense condor
pallid mica
#

The interval stuff is not about your stuff

dense condor
#

oop

pallid mica
#

Oh

#

Eh

#

I think you are using the wrong Composite node

#

Sequence stops if a Child fails

#

You want a Selector

#

Selector stops when a Child succeeds

#

The Sequence won't progress to the next node on the right cause the first one fails due to the AIState

dense condor
#

i think thats right but it didnt fix my issue. I think it might be because i am reseting the state on a set timer by event thats throwing off the behavior tree or smthn.

dense condor
# pallid mica Oh

ye thank you i think ur thing fixed it and switched up the timer ty

#

i think... prolly

lucid plover
#

Hi folks, I see you've been talking about StateTree, maybe you have the answer I'm looking for.

Do you know if there is a way to use statetree's Parameter like a blackboard ? It seems to be read only. There is a way to pass variable between tasks without using Parameters (by categorizing them as Input or Output), but its working only for tasks that share the same state, not between different states.
I've tried to set a float to Parameter category, bind it to a Parameter and increment it, but the end value is still 1 (coming from 0, the Parameter isn't set).

If the answer is no, how do you keep a short / medium term memory ? With a custom solution by settings variable directly in the Context class used by the StateTree (your derived class actor ?) ? Thanks !

pallid mica
#

Not related to Alex's question, just saying.

fickle cedar
#

@pallid mica So you eventually gave up on ST? 🙂

haughty coral
celest python
lofty sail
#

Hello, I'm trying to put a "AI MoveTo" node in a ST task but because "ReceiveEnterState" can only be a function I can't, is there a way to make it work?

lucid plover
# lofty sail Hello, I'm trying to put a "AI MoveTo" node in a ST task but because "ReceiveEnt...

As a workaround, you can add a custom event in the event graph of the ST Task and call this event in ReceiveEnterState. Then you will need a way to tell your ReceiveTick if the task is running or succeeded (a boolean or enum perhaps ?). That doesn't seems the way to go, as it seems to there is no way to call a specific function to end a ST Task.

If anyone has a better idea, I'll be glad to know it.

fickle cedar
#

Perhaps the StateTree Send Event function could be called after the AI Move To

#

While in the State Tree, there would be state transition upon this event

lucid plover
#

Maybe I'm wrong, but I think the question was about AIMoveTo that is a latent function, and can't be call in another function, but only in an event graph. But your solution seems pretty elegant and could be used with another not latent Move function I suppose.

haughty coral
#

It should be possible by creating custom blueprint base which returns running by default and true/dalse depending on if finish func was called. Just like BT bp base classes do. But it might be tricky to get them to display it in class picker. But it can be hacked with copy paste. #gameplay-ai message

lucid plover
#

A bit hacky but should do the trick, thanks for the tip !

pallid mica
harsh storm
#

Side note - why are your AI questions that I can answer quickly always asked when I am sleeping 😭

harsh storm
harsh storm
#

Getting the path follow result isn't exposed to BP I believe.

uneven cloud
terse panther
harsh storm
#

Keep in mind that there is a cap on how many agents you can have active at one time. Default is like 50 or something like that

#

Changeable in the project settings

lucid plover
# harsh storm 1) Yes, it is by design that different states don't share data really. You can b...

Thanks for your answer !

1 / 2) I get it. Too bad we can't set back by an Output variable.

  1. I see that FStateTreeExecutionContext isn't a BlueprintType, do you know if there a reason to hide it in blueprint ? Is it by design a wrong way of keeping medium term memory ?

By looking at UStateTree class, I see there is a method named GetDefaultParameters() const that return FInstancedPropertyBag, but the Parameter being private, I don't see a way to set it back, is this even possible ?

While waiting for an answer, I ended up making a very naive Blackboard-like component attached to the actor, it does the trick but I'm not sure if I want to know how unoptimized it is.

harsh storm
# lucid plover Thanks for your answer ! 1 / 2) I get it. Too bad we can't set back by an Outpu...

Don't know why it would be hidden in BP, maybe it was just forgotten to be exposed or maybe it just can't be exposed. It might be an instanced struct thing, in which case, BP support was only added for those at the very last minute for 5.1 release. In which case it may have just been forgotten.

When you have the FInstancedPropertyBag, you should have access to functions like SetValueFloat(PropertyNameAsFName, Value);

lucid plover
#

Oh, I was thinking the struct was passed by copy, thanks I'll give it a try !

uneven cloud
pallid mica
#

Rotating your AI towards a Target sounds pretty important to me tbh

#

And I disliked that I had to do this outside the BT, cause doing it every 0.2 seconds looks really shitty

#

But I already got that working now. Services are just not nicely exposed in that regard to BPs

#

In C++ Epic even sets Interval to 0.f on some of their Services

#

Which causes them to tick every frame

#

You just can't in BPs cause the UI clamps it to 0.001 or so

uneven cloud
wind surge
#

how can I make a camera shake that only plays when being chased by an enemy and disappears when enemy stop chasing?

uneven cloud
pallid mica
#

The FocusActor stuff didn't look like it was made for rotation towards target the way I needed it

#

Also not enough control for me

#

If BPs of BTs are exposed with restrictions, then it's kinda both

#

But I get what you mean, don't worry

celest python
uneven cloud
celest python
#

Service -> AIController Focus -> Pawn FaceRotation

pallid mica
#

Yeah but that's the thing. I don't want to have some of the stuff in Controller, some in Pawn, some in the BT

#

At least for this specific topic

celest python
#

yeah thats the issue with BTs

#

legacy from UT times

celest python
uneven cloud
celest python
#

You can 1:1 replicate MoveTo BTTask to a StateTree task

#

and code would be the same

#

Problem is, ST's BlueprintBase classes dont cover required BP helper stuff like BT's BlueprintBase classes

harsh storm
#

To be fair - Eren does have a bias against AIController 😅

pallid mica
#

That's the overall annoyance for me

uneven cloud
celest python
harsh storm
#

You only use tick to check if they've arrived at the goal or not

celest python
#

especially when you want to go data oriented

celest python
harsh storm
#

Yes - it does.

celest python
#

BTTask_MoveTo just calls RequestMove on PathFollowing with some additional wrapper stuff

harsh storm
#

But you need some way to exit the state

#

There is no "Force Exit State" function to call when you get to the destination

uneven cloud
pallid mica
celest python
pallid mica
#

Not saying it should be a replacement, but it could have been

#

Hope they update BT's visuals at some point. ST looks so pretty :D

harsh storm
#

I still like the BT visuals 😢

celest python
#

fixes some of the UX issues

#

specifically the parameter groups thing

harsh storm
#

What I like about it is it is super simple and straightforward 😅

uneven cloud
harsh storm
#

It isn't trying to do anything crazy, lol

celest python
#

but then I realized at least %75 of UE game AI dont require much modularization in the tree

pallid mica
harsh storm
#

Make reusable behavior trees more or less

celest python
pallid mica
#

Ah

#

That is indeed nice

#

So I can make an Attack Tree, expose variables and control them from the RunBT Node?

harsh storm
#

Yeah

#

Pretty much - it is what the RunBT node should've been honestly.

pallid mica
#

Yeah

#

The only other thing I wonder if I just never understood it correctly (or I'm the only one needing it) is proper Parallel Trees.

harsh storm
#

I don't know if it helps reduce the creation of BB keys, unless you can't link to a BB key

#

Simple Parallel as generally worked fine for me personally.

#

But I also only use it for move & attack stuff

celest python
pallid mica
#

Yeah there was something with SimpleParallel and RunBT iirc

pallid mica
#

Can't recall but I think there was even a "bug" in the form of the SimpleParallel not supporting using a RunBT for the MainTask or so

#

it's been too long that I tried that

celest python
#

There is a bug abouts its serialization to the graph

#

sometimes it doesnt get deleted 😄

pallid mica
#

Na it was more about not really finishing

#

Cause the RunBT Task being slightly different in that regard than a normal Task

harsh storm
#

That plugin also provides a simple utility ai thing and a random selector, which is honestly....also kind of nice.

pallid mica
#

Yeah but that's stuff I wouldn't purchase for. I can create these things if needed

#

Like, me personally

#

Still nice if you aren't able to do that

harsh storm
#

Definitely. But it's a nice little bonus. The main selling point is the better RunBT nodes

#

A lot of reflection in that node 😅

pallid mica
#

utility score rings a bell

#

That one might even be a bit more interesting than the random one

harsh storm
#

Yeah. It's nice & simple & straight forward.

pallid mica
#

Ah yeah stuff like this was in some GDD of some client a while ago

#

Hugely complex scoring system for AIs to select an Ability

#

Based on what the Player has done so far

celest python
#

A non programmer client knows what utility score is PepeHands

pallid mica
#

Could be useful in the BT to just plug into tasks

harsh storm
#

Fear popularized utility AI if I recall correctly

celest python
#

wasnt it GOAP?

harsh storm
#

Create a Behavior Tree Instance object for modifying parameters similar to Material Instances.
This is an interesting bullet point

pallid mica
#

Yeah it was some round based, sort of JRPG for that Client

harsh storm
celest python
#

same picture anyway

pallid mica
#

Wasn't the Run Instanced thing what we just discussed about having parameters exposed?

harsh storm
#

Expose Behavior Tree parameters by using Run Behavior with Parameters task.
Well this is also a bullet point

#

So they're saying the same thing twice? 🤔

celest python
celest python
#

this one means custom BTTask

harsh storm
#

Yeah - I was replying to Cedric

celest python
#

oh sorry - i cant read

harsh storm
#

But what do they mean about doing an instance object?

celest python
#

@verbal shore ChillBar_wave
can you explain? 😄

uneven cloud
harsh storm
#

The BT already has params exposed, no?

pallid mica
#

There is

harsh storm
#

@uneven cloud btw - thanks for challenging me (I mean that in a friendly way btw) last night. Caused me to learn more about how objects are actually created in UE.

pallid mica
#

RunBT (With Parameters)

#

And RunBTInstanced

#

Not sure with RunBTInstanced gives

harsh storm
#

Yeah - that's what I'm trying to ask really. What the actual difference is. Because I could just throw in the RunBT param node.

pallid mica
#

Unless there is a BTInstanced Asset you can create

harsh storm
#

They likened it to material instances - which is a whole new asset

pallid mica
#

Which only works with that node

#

Yeah

celest python
#

or maybe just details customization

#

more likely imo

pallid mica
#

Actually

celest python
#

because many AI singletons rely on that specific asset

pallid mica
#

The Screenshot of the Node gives away that it's another asset

#

BTI

#

So I assume the idea is to have a "child" of the BT with fixed new values

#

Where RunBTWithParams needs you to type the params multiple times

#

E.g. if you have a BT that you use in 2 different ways, but in 10 places

#

You don't wan to fix that one variable in those x places

#

But just on the BTI

#

It's like having a Enemy with a Health Variable. You don't want to type that in manually whenever you spawn the Enemy, but rather have Enemy_SomeCoolDude with Health already set that you can reuse, as well as Enemy_SomeFunkyGirl.

uneven cloud
harsh storm
#

That's what I thought as well to be honest. Specifically because they mentioned Material Instances.

pallid mica
#

Yeah it's probably that then

harsh storm
#

I'm just not sure I'm sold on the use case to be honest.

pallid mica
#

Sadly, that stuff should really be default in the Engine ;_;

#

Yeah me neither yet

#

Most of the values that are different are usually originating from the AI itself

#

They have some examples. But I feel like a lot of those are just AI params

harsh storm
#

Yeah - those are the values from the RunBT param

pallid mica
#

Like, if these values are in the TIGER BT

#

Then why does the TIGER not provide them

#

That's basically where it would fall apart for me

harsh storm
#

That's how I parameterize my BT stuff as well

pallid mica
#

This also causes issues if you need that value outside the BT

#

What if I want to show that Sneak Distance to the Player somehow

harsh storm
#

And it doesn't look like you can just select a BB key

pallid mica
#

I mean, maybe for stuff like a reusable tree that has some non-AI Specific settings

harsh storm
#

Wait - I'm silly. You have to have that as a type anyway

#

Ignore my statement 😅

pallid mica
#

Maybe you want a tree somewhere to have a higher WaitDelay that doesn't matter to the AI itself

#

Then I can kinda understand it, but that seems like an edge case

#

I like by Data in my DataAssets

harsh storm
#

I mostly just like the RunBT being a proper RunBT 😅

pallid mica
#

But that's kinda good, makes me more or less realize that I only need to code their Utility and Random Selector stuff for our Internal Plugin lol

celest python
pallid mica
#

Yeah exactly, don't need to buy for that

celest python
#

I'd like BT to allow data binding similar to ST

#

could solve everything for me

pallid mica
#

Automatically binding to a Key based on name would be cool

celest python
#

yeah

pallid mica
#

Just to skip some bugs

harsh storm
#

It might be planned for the BT 2.0 that Mieszko is thinking about.

#

But who knows if he'll ever get to work on it

celest python
#

Mieszko said anything about 2.0?

harsh storm
#

Not much.

#

But I recall him talking about it around the time he was talkin' about EQS 2

pallid mica
#

The problem with these things are that if they ever release, it will still be a year or so before they will be usable to the full extend

#

So it's really unlikely that we touch BT2 any time soon I guess

harsh storm
#

Fornite just needs to be more AI driven. It'll be finalized real quick 👌

pallid mica
#

I'm kinda hurt by the PredictionPlugin, if one can tell ;_;

celest python
#

dont remind

#

but hey - they said they will continue on it

#

just.. probably years later

harsh storm
#

You? Nahhhh

pallid mica
#

The Salty part does indeed come from my side

uneven cloud
#

As someone who is not a fan of the new AI systems, I hope they don't modify EQS an BT too much.

celest python
harsh storm
#

I'm kind of meh about ST after playing with it for a week or so. But I do like creating a new task/condition/evaluator more in ST than the BT counterparts

celest python
#

😄

terse panther
verbal shore
harsh storm
#

What is the Instanced BT you talk about in the BTE plugin?

#

How does it differ from just doing the RunBT with params?

verbal shore
#

There are two ways to expose behavior tree parameters, one this directly happening through the node, another one is like creating a data asset and modifying them from there

#

It's especially useful when you want to use same configuration in multiple AIs. In "Run Behavior Instanced" you pick the Behavior Tree Instance object

#

The naming might be confusing but I couldn't come up with something better. It's inspired from material instances

harsh storm
#

@pallid mica 👆

verbal shore
#

@pallid mica

harsh storm
#

I win

verbal shore
#

No I win 😄

harsh storm
#

Refresh

#

Server said I win

#

😈

verbal shore
#

Haha congrats 😄

celest python
#

respect the server authority 😄

verbal shore
#

That's one thing I know

harsh storm
#

So it's pretty much making a DA for a behavior tree more or less

verbal shore
#

Yep, exactly

harsh storm
#

Is the Instance a "child" of the original BT?

uneven cloud
verbal shore
harsh storm
#

I can see why you'd describe it like a MI, but it isn't 😅. Because MI's are reflective of their parent assets

#

Tough call.

#

But alrighty. I get it now.

#

How does interacting with the BB work when dealing with the sub trees?

verbal shore
#

Subtrees can have their own unique blackboards, this is also not provided by the engine. So it enables using different blackboards as well

#

You can't bind BB keys to exposed parameters, my goal was just exposing them. I didn't want to use blackboards much so I didn't need it back then.

#

If parent tree has a service that ticking and modifying a variable called "TargetActor" and the subtree also has the same variable, it will modify the value in subtree

#

But when you go back to the main tree, those changes will not be carried back

celest python
#

one crazy idea I have right now buying the plugin and going through some existential crises with slate and creating a fake data binding system based on Blackboard and FProperty's exposed to parameter groups but I dont have enough time 😔

verbal shore
#

Haha, you're spending huge time with different AI solutions. Might not be the best idea to add another one. 😄 Though I would lose a sale haha

harsh storm
#

You can't bind BB keys to exposed parameters
😭

verbal shore
#

new ST thing also really cached my interest but I wouldn't even be able to get started implementing it from at this point (to my own game project)

celest python
#

ST just keeps my attention because of state machines and data binding

#

and of course.. replacing AIControllers i.e. data bindings

harsh storm
#

Or because "oh shiny"

celest python
#

nope

#

spending some time with erlang

#

i think verse could achieve what ST is doing in code 😂

harsh storm
#

Eh - verse ain't going to be a thing for us for a lonnnnnng while

verbal shore
celest python
#

tl;dr its bottom-up version of BTs - current node determines which state to transit instead of a top level node

#

rest of the stuff is pretty much solving the data binding system and its rules

pallid mica
#

@harsh storm @verbal shore Thanks.
Do you have an example for the usage of both RunBT Versions, especially when there is the option to store those different params in the AI itself?

#

E.g. an Attack Range would live in an AI DataAsset for me

#

From what I've seen in the Marketplace Screenshot, almost all (I don't know what all of them do) of those variables seem like things that could just be stored in a Tiger DA for the AI itself

harsh storm
#

I think the idea is that your AI DA would now be in the BT DA more or less.

#

So no more AI DA per se

pallid mica
#

Ehhhh

#

Me no likey

#

I spawn AIs via that DA

harsh storm
#

Same

pallid mica
#

So that should be the initial point for everything creation of AI for me

harsh storm
#

DA for data
Actor for functionality

pallid mica
#

Our game is even setup to not have preplaced AIs

#

Only AI spawners

#

Makes load time really quick :D

harsh storm
#

Saaammmmeee

verbal shore
#

That's fair haha. I have data assets that define my AI characters as well, but they mostly define the very basic things. For example, Tiger hunts deers, silkworm hunts butterflies etc. So core stuff is handled in data assets. (I could do that within BT but I also need to let other AIs know about each other so it's unavoidable). How I use Run Behaviors with Parameters is that I use them for things like combat, neutral behaviors etc. I like using behavior trees, and if I start handling everything through data assets it would greatly limit my capabilities, especially when I have this many AIs

#

I created different behavior trees for different combats, so they are like templates and I just modify their value

harsh storm
#

I typically have something like Attack range in my DA as well. Then I have a BB key for attack range. My controller sets that attack range BB value from the controlled pawn's DA

pallid mica
#

Ah, so this is the equivalent of me trying to rotate my character via a Service

pallid mica
#

Wherever I can link to a BBKey, I probably have access to the ControlledPawn.

harsh storm
#

I guess it just kind of depends honestly. Because you can set the value in the task or w/e upon entering the task.

#

I see what you're saying.

verbal shore
#

In my solution if I need to get something directly through AI data asset I can design my task & service & decorator around that idea, but I very rarely need that

celest python
#

out of the context but, last two day's conversation quite proves devs mostly spend time to design how their data will be used on AI

#

rather than adding functionalities

uneven cloud
#

Data is the most important thing if you are working with designers.

verbal shore
#

Yeah, it can be really dangerous as well. 😄 If you design something bad (did this countless of times) it takes more time to create stuff. If you put too much time on designing your systems then you forget developing the game (also did this countless of times)

harsh storm
#

I do like BT's and BB's - but I do understand that it can be a bit cumbersome getting external data to the BB correctly

#

Relying on strings (I know they're FNames) is also a 😭 moment

verbal shore
#

Yeah I love BTs as well, would love to see they get more love from Epic. They recently added gameplay tag support for BBs I guess, but it would be super cool to see more BT features. I think they are really powerful and super fun to design AIs with them

pallid mica
#

Because if so, you are god damn right

#

Mostly just reading up on stuff cause AI is def not my thing usually.

ocean wren
#

Bloody typical, I spend weeks making this NLP based voice control system and then find that Meta has released a voice SDK to do the same on the 12th of this month

#

Mind you, theirs doesn't do continual transcription and whatnot

#

Guess its nice to see other people's version of stuff at least

uneven cloud
#

If it makes you feel better, Epic keeps releasing new systems I've already written.

ocean wren
#

Hahaha.. guess its an occupational hazard 🙂

#

I enabled a bunch of random plugins today.. man there are a lot in 5.1

#

Of course the build then failed, so I disabled them all again

#

Think tomorrow I'm going to add Amazon Polly based text to speech.. the Meta version isn't great, the Epic version is worse (but quite like Steven Hawking voice, so kind of fun)

#

Polly can drive face blendshapes at least..

pallid mica
#

When creating BehaviorTrees, are there downsides to cutting them into multiple subtrees, even if there are no plans to reuse the subtrees elsewhere?

#

E.g. a Main Tree and then 2 SubTrees for "Sees Enemy" and "Doesn't See Enemy"?

#

Mainly for the sake of keeping logic in BTs smaller and easier to read, but losing the overall "everything visible in one picture (BT)"

fickle cedar
#

If I add a Delay Task with "run forever" checked into a StateTree state, the execution should never leave that state, correct? (no transitions present)

fickle cedar
#

Gosh this is frustrating

fickle cedar
#

Seems like the execution jumps between states no matter transition conditions

fickle cedar
#

Anyone willing to share their whole StateTree MoveTo task? Pretty please

harsh storm
harsh storm
fickle cedar
#

BP preferred but I'm happy for anything I guess

harsh storm
#

In Enter State, get your binded actor, get the AI controller, then call the Move To node (actor or location, up to you, or support both). Then make a switch from the Return Value and if they are already at goal, return that the state succeeded

fickle cedar
#

EnterState is a function and the AI MoveTo node is latent, it won't let me

harsh storm
#

Don't use that node.

#

Use Move to *

#

Not AI MoveTo

#

That's how I did my BP version if I recall correctly, before switching to native

celest python
#

have a boolean bIsFinished

#

create a custom event that calls AI Move To

#

and set bIsFinished to true when its done

#

and if bIsFinished is true return from tick

#

one of other 1324242352 options

fickle cedar
#

@celest python I tried that originally, thank you

#

And what @harsh storm suggested doesn't work either but says that there's no instance of AiController

#

I guess I need to instantiate it manually 😅

harsh storm
#

No. Just bind to the actor context variable

#

Then get that actor in your task

#

Pull off that and get the AI controller

#

If your AI is not pawn based, then yes, you won't have an AI controller

#

Instead, you would just end up moving them in tick or something like that

fickle cedar
#

Like this?

#

My Unit is Character-based, but still I get "Accessed None trying to read property CallFunc_GetAIController_ReturnValue"

harsh storm
#

I'd investigate around why that is happening then.

fickle cedar
#

ok, here was the catch

#

@harsh storm @celest python Thanks for your help, appreciated 🙂

harsh storm
#

I always select the bottom one. I feel like that should be the default

timber flax
#

Hiya all, i'm trying to figure out how to get enemy AI to aim accurately at the player

#

Basically, how do you get a humanoid mesh to accurately point their weapon at a player

#

I've tried using some spine deformation stuff, as well as Aim Offsets, and both seem to have accuracy issues

#

but that might be more down to my calculation logic too

#

has anyone had success with this sort of thing in the past?

ocean wren
#

What we did was solve for the weapon line.. so basically move the arms to match where the weapon should be if it were pointing at something. IK the hands to the weapon rather than attach the weapon to the hands. Weapon was procedurally animated and could do things like block against geometry and the like. Probably overkill for most games that aren't FPS focus

timber flax
#

Gotcha

#

My game is FPS so i'm trying to get it right haha

#

Thanks for the input :)

ocean wren
#

Have a look at the FK/IK switching, basically you can use the aim offset to get in the ballpark and then IK for the final angles to ensure its correct

#

Just remember to make sure you handle the physics of the weapon hitting walls and stuff

bleak grotto
#

@ocean wren
This is kinda random but I remember like years ago you tweeted/retweeted an AI agent emotion topology/graph that boiled down like 16 or 32 emotional states with like leaf end nodes like “apprechiation for self” vs “Apprechiation for other”. with qualitative labels for it like “proud” etc..
I’ve been trying to find it but google has been completely useless due to all the recent clickbait articles spam. Tried to see if it was a GDC thing but had no luck.

#

Working on a sims/rune factory mashup so was trying to find that article again. If you don’t remember/doesn’t sound familiar disregard but I thought there might be a chance

lethal helm
#

can I switch from nav generation static to nav generation dynamic during runtime 🤔

quaint radish
#

how can I prevent ai from detecting itself? I have AIPerceptionStimuliSource added to player controller, and AIPerception added to EnemyAIController. My understanding is that this arrangement should prevent ai from sensing each other, because ai is never a source/does not have the source component.

#

I have them set to move to me as soon as they see me but they are seeing each other too and Im not doing any check to make sure that they dont move to other ai.

#

Somehow they are just moving to me even though visually we can see that they are register sight sense with other ai.

quaint radish
#

How to allow my character to push ai out of the way?

ocean wren
#

It might well be something from Richard Evan's work on the sims.. have a look at his stuff from GDC

#

Rich mostly used rule based systems though..

#

Oh wait, was it something like Prom Week?

#

Actually, I think I know what you mean.. its the standard model for cognitive modelling of emotions.. or rather an early version of it

#

Was it something like this? or more of a flowchart?

ocean wren
#

I think you probably mean the OCC model of Ortony, Chlore and Collins?

#

ORTONY, A., Clore, G. L. & Collins, A. (1988). The Cognitive Structure of Emotions. New York: Cambridge University Press.

#

Man, feels like a lifetime ago I was looking at this stuff

#

Relevant paper from a while back:

timber plaza
quaint radish
#

I cannot do this from within engine?

#

I pasted your text exactly as is and same results. AI still sensing other ai pawns

quaint radish
#

ok let me try that. I followed this and remember having to put that text into DefaultGame, and did not have to restart then. That was for 4.25 though.

#

amazing

#

youre my hero. pm me a venmo. will pay

timber plaza
quaint radish
#

interesting. did not know that for certain.

ocean wren
# quaint radish How to allow my character to push ai out of the way?

To answer your question.. easy mode is to handle on collision with capsule and just issue a move request in a direction away from the collision point.. slightly better and harder, is to disable the rigid body for the capsule of the actors, add a detourcrowdfollowingcomponent and then find the function where it calculates forces (something with avoidance in the name if I recall) and write your own to add a force away from the nearby entities in the force calculations.

#

The former would technically work, but will look weird.. the latter definitely works and feels smoother, but you'll need to hit the C++ code for it

#

The detour controller already has the force calculations in there, so its just modifying things really.. but it does run a lot nicer and you then don't have to deal with absolutely stuck collision capsules.

quaint radish
#

I do like the force calculation option. What part is limited to c++?

ocean wren
#

The only real downside to the detour version that I saw, was that smoothly shifting the characters needed better animation support

#

Well, adding the detour controller is C++ only if I recall.. and the force calculation is only available to C++ too

#

It just was never exposed as far as I can tell

#

I mean I doubt anyone other than me ever used it 🙂

quaint radish
#

alright so limited to a simple.. on collide, nudge away basically.

ocean wren
#

yeah, you could get a LITTLE bit trickier and do an EQS test to see where to move away to that doesn't have another collision object in it

#

i.e. "nudge towards somewhere without an obstacle and generally in the right direction"

quaint radish
#

ah nice... I do like that thought

#

Would prevent ai from getting shoved through world geometries

ocean wren
#

I generally don't like the idea of rigid bodies for AI entities.. almost more hassle than its worth imho

#

I don't mean for collsion.. I mean for collision response

quaint radish
#

isnt rigid body for physics? like.. specifically for falling/jumping?

ocean wren
#

Yeah, but every character has a capsule as well as the rigid bodies associated with the physics skeleton

#

and it uses the capsule for collision testing for movement and the like

quaint radish
#

makes sense

ocean wren
#

I like to keep the capsule, but disable capsule->capsule collisions for the AI and player, so basically all characters can pass through each other

#

I then use forces to keep them apart (which is what the detourcrowdcontroller is for)

quaint radish
#

that sounds really clean actually.

ocean wren
#

Works pretty much exactly like Team Fortress 2 if you want to see what it feels like

#

It helps when you've got to get a squad of soldiers through a narrow doorway 🙂

quaint radish
#

its undecided atm how Ill handle player moving through ai. I have 3 of various sizes and I want the player to feel that difference

ocean wren
#

And worst case, you can literally swap positions of overlapping capsules to allow them to pass in different directions

quaint radish
#

is that replicated too?

ocean wren
#

It does depend on your circumstances in your game to be fair.. but if you've got a lot of agents going about doing things having this stuff helps a lot

quaint radish
#

Yea I can see that

ocean wren
#

its replicated yeah

quaint radish
#

bravo

ocean wren
#

Well, I mean the AI runs on the server, so the positions are server authoritative anyway

quaint radish
#

Maybe anything multiplayer is just admirable to me for both that I dont understand it well enough and replication in general gets tricky quick compared to single player games.

ocean wren
#

You've got me wondering if the new MassAI has some of this built in now too 🙂

#

Try the matrix awakens example.. might have some of this.. I honestly didn't even look at the character side of that 🙂

quaint radish
#

And with movement responding to collision, and replicating that... Cant imagine how youd make up for packet losses or lag, predictions etc

#

I know those are things you might have to worry about

ocean wren
#

The only loss or lag would come from the player.. from the AI with it running on the server, you can't really get any

#

So if anything, the player would be the only thing that went wonky and in my setup, that wasn't an issue because they weren't doing rigid collisions.. so you'd not see any significant difference in response

#

The forces were all smoothed anyway, so it would resolve any player->AI differences in a smooth way relatively quickly

quaint radish
#

nice

ocean wren
#

I mean sure, you'd still have issues with hitreg and all that for FPS to deal with.. but for general movement amongst multiple agents, it works out fine

#

Dammit, going to have to look at the matrix sample again now 🙂 add it to the todo list

quaint radish
#

sounds logical. if you got a vid of what youre working on would like to see it

ocean wren
#

Will be posting a vid for my current voice control stuff once we agree with company that they're OK with it

#

Hopefully a few weeks.. working on the demo now (part of the funding contract we have to demo it at two events)

quaint radish
#

any vid specific to this movement stuff we are talking about?

#

lots of stuff here lol

ocean wren
#

Going to be a fun one.. trying to think of the most impressive demo..

#

I thought I'd recorded one on the movement, but looking at the list last week apparently not

#

I thought I'd done one on the smart object stuff I did too.. turns out nope 🙂

quaint radish
#

dang. oh well lol. Thanks for all the food for thought.

ocean wren
#

No problem.. at some point I really should do some demo videos of just general AI stuff I guess

#

Its been a while since I just sat and noodled with AI stuff in C++ though, having to do Python has broken me a bit 🙂

#

Would be nice to do a voice control demo with a huge army or something.. but isn't really in keeping with the company I'm working with

quaint radish
#

I have been in ue4-5 since 2016 with a year in there in unity and c#. Dont think ill ever step outside of unreal again. Dont have the guts haha.

#

Well, This AI thing I am working on does happen to be in line with my job, since I am working on ai for them in unreal also.

#

But its drone warfare and collision is disabled. exploring how to have multiple ai, different behaviors/trees.. levels of aggression etc

ocean wren
#

I'm working with a lot of non-game stuff right now.. mostly visualization, language, simulation things.. data visualization and voice control (natural language understanding)

#

And some military ISR stuff

#

Digital Twins and the like

#

But right now, its about sparkly demos for voice control 🙂

quaint radish
#

yea maybe you could do voice controlled ai, 2d ai to create charts lol.. maybe demonstrating some sort of collision stuff as they cross paths through each other lol

#

combines voice controlled data visualization with ai and crowd control maybe lol

#

This video of yours mentions crowd control but does not point to the 2nd in the series like most usually do..

ocean wren
#

Theres a playlist for that.. if you look at my playlists

#

Its quite old that one though.. so likely nodes are out of date etc..

#

Part of the reason I don't do tutorials much anymore except for if someone asks me for a specific thing

quaint radish
#

haha dang. Saw RTS stuff got excited, then says c++ haha

#

not gonna link here since its not ai lol

ocean wren
#

If you're doing an RTS, you're going to have to use C++ really.. highly un-recommended to attempt it in BP

quaint radish
#

haha i am not. Just a fan of the genre. Have tried though. had multplayer set up, joinable lobbies.. race selection.. resource gathering and attacking

#

but.. movement desync.. killed it and ha dno idea where to look to solve that

ocean wren
#

Some examples of different crowd papers from years ago 🙂

quaint radish
#

Im making something heavily inspired by The Siege Breaker. There is lots of crowd stuff involved since it is a tower defense or base defense. Im using this project to make something that is manageable within my skills. small scope. 3 enemies, 3 towers. 1 player, 3 buildings.

#

the only thing not using ai in this are the buildings. walls and harvesters, blocks pathing and generates resources respectively.

#

You really went deep on this ai stuff, and have been for 13 years! good job!

ocean wren
#

I've been doing AI for longer than that 🙂

quaint radish
#

I just have this video as a time stamp from 13 years ago. Cannot imagine how some of these demonstrations improve with tech and your understanding.

ocean wren
#

A lot, and yet.. sometimes not so much

#

Game AI is a weird field to be in

#

On the one hand, we're doing stuff like natural language understanding, voice based image generation, on the other, we can't seem to create a decent movement system API 😉

quaint radish
#

haha Starcraft 2 wasn't decent?

ocean wren
#

It was very specific to SC2 though, and was proprietary

quaint radish
#

yea

coral patio
#

hi guys, im playing around with character movement component and ai move to

Cant understand why this happens:

When i tell char to move on area where it cant step up, char going to wall and not stop right before but just trying go through it

When i tell char go to near the wall all works fine

Anyone knows how to fix it?

ocean wren
#

Its likely you're trying to a navmesh "island" that isn't connected to your current one and doesn't have a navmeshlink to join it

#

trying to move to..

quaint radish
#

makes sense

ocean wren
#

So build a ramp up to that island, or add a navmesh blocker to remove the navmesh in that area

quaint radish
#

press p i htink to render pathing

#

You can also adjust your pawns movement step height i think

ocean wren
#

You can usually see in the logs whats going on too

#

or use the visual logger to see

quaint radish
#

but youll want to confirm your nav mesh is building pathing on those steps

coral patio
ocean wren
coral patio
ocean wren
#

Its probably that the click position is slightly nearer the main navmesh than the island navmesh

#

basically, from what I am seeing, I'd suspect that its actually finding the navmesh poly closest to the click and trying to move to that, so if you click in different positions the nearest poly might be on the island or on the main navmesh

#

Just a guess though, you'll need to debug to check that's the case

coral patio
#

ty, will try to check it out

dusky swan
#

morning all. so i get this is prob a stupid way to learn, but i know nothing of code and im really struggling with learning blender and python. this morning i decided to use that OpenAI site to spit out some basic code and then try and back track any errors blender gives back and learn what those mean (ya, assabouttit way of doing it i know but tutorials dont seem to be sinking in) with this in mind can someone help me understand what this error means please?
Python: Traceback (most recent call last):
File "\Start with a cube as the base for the cabin", line 49, in <module>
KeyError: 'bpy_prop_collection[key]: key "Camera" not found'

ocean wren
#

You might want to ask on the blender forums or some such.. this isn't really the right place for this kind of question

#

And yeah, not a good way to learn 🙂

bleak grotto
# ocean wren

Yes this was it!! Thank you! I’ve been looking all over for this. Very much apprechiated

bleak grotto
ocean wren
#

Crazy how things have changed.. all of the latest ML shenanigans has blown up a bit, but still people struggle with BT's and the like.

#

Its weird, all of the issues you have balancing things like utility scores for utility reasoners and now we've got the same issues for stuff like reinforcement values for RL algorithms (or the NLP stuff I'm doing right now)

#

Why does it just get more powerful and not easier and more natural?

ocean wren
#

using an image to generate a text prompt that then generates the audio

celest python
uneven cloud
ocean wren
#

Yeah, forgot 🙂

normal mist
#

In 5.1 are there any tools to see where in the state tree it is currently executing?

celest python
#

Its logged to vlog

normal mist
quaint radish
quaint radish
#

Anyone know what we have access to in BPs with Detour Crowd AI Controller vs AI Controller? I am aware of settings in the Project Settings, and the rvo in the movement component, thanks to @ocean wren s vids on youtube (https://youtube.com/playlist?list=PLaIL7QdE_Vqi8MIo2vghzW_Jj0Jz_grFH). Concerned about changing the parent for my aicontroller to the DetourCrowdAIController. Anything changes I should be aware of?

quaint radish
#

Can you set the enums default value in a blackboard, without forcing the behavior tree to do it, and without changing the order of the indexes in the enum? I imagine the blackboard enum is simply using the first one, but wondering if im blind or missing something in the blackboard.

void wadi
#

Hello ! I would like to change the AI perception shape of UE. Is it possible ?
Currently, my AI can see with a Cone shaped AI Perception, but I would like it to be more of what TLOU used (which is basically the cone plus a circle around the AI).
Thanks !! 😉

ocean wren
#

You also need a DetourPathFollowingComponent if I recall correctly

ocean wren
quaint radish
#

I did not see detourpathfollowing component in your vids.

#

Maybe I missed it

#

Basically, should I expect anything to break from reparenting the ai controller to detour crowd ai controller?

uneven cloud
uneven cloud
quaint radish
#

any tips for getting ai to see me when I am visible at the top of this platform? Not sure why they cannot see me..

#

seems like theyre all trying to hop up the jump proxy for some reason

uneven cloud
quaint radish
#

I went to the edge and nothing changed. Deleted the proxy and now they go around

#

I either put time into making the proxy work both ways, 1 way, or remove it lol. Maybe I can get the proxy to work later kinda lame that its in the template and breaks things to start with.

ocean wren
quaint radish
#

I did it and it is working 😄

ocean wren
unborn jungle
#

Does the navmesh use the lowest LOD of each mesh by default to generate on?

#

I changed my LOD group reduction settings and have noticed a large speed up in navmesh generation

sullen crater
#

Hello guys. How I can get what location, which be received from hearing sense path exists?

harsh storm
#

sigh - my ST keeps crashing on the client 😭

harsh storm
#

@celest python Has your ST been crashing on client? I'm thinkin' about just putting the ST on the controller 😅

celest python
#

I never tan ST on client before

#

Ran* (on mobile expect emily level typing times)

harsh storm
#

If you're putting the ST Comp on your AI Pawn, how are you making sure it is only ran on server?

#

@celest python Notice me senpai

celest python
#

I have a different way of initting characters in my project

#

Since they are pooled its dynamically created comps

#

On specific net roles

harsh storm
#

Now that you mention it, I guess I could add the component on possession. That only happens on server.

celest python
#

Whats the error btw

#

I wonder if its intended check or not

harsh storm
#

Memory access error in my moving task. Only happens on client. So I'm guessing there is some client specific shenanigans that are happening due to competing stuff.

celest python
#

Hmm, i think... The move to stuff is relevant

#

Rather than ST

#

Otherwise i guess ST memory thingy is cursed

#

Btw Client shouldnt run ST i guess? 😄

#

Especially a moveto

#

Its a pathfolloeing comp thing

harsh storm
#

Nah - it shouldn't. ST uses a brain component. Traditionally, BC is on the controller.

#

Controller doesn't exist on clients

#

I'm thinkin' the memory error is because of that reason btw.

#

Probably something deeper in the framework that has this affect. I didn't dig too much to be honest.

celest python
#

(i might go offline and answer back tomorrow)

harsh storm
#

But I know the MoveTo stuff is reliant on the AI controller.

celest python
#

ST is meant to used on actors and used actors on citysample afaik

harsh storm
#

That's also not networked

#

And uses a different movement thing

#

ZoneGraph

celest python
#

Where st comp lives currently

harsh storm
#

I've been putting it in the Pawn. Seemed to make the most sense because of the data binding

celest python
#

Try checking the role on beginplay and init comp there

harsh storm
#

Yeah - that's what I'm going to end up doing. Except doing it on possession.

celest python
#

Possess also works but i thought pawns could get possessed or multiple times

#

If thats not the case

harsh storm
#

Possession only happens on server.

#

AIController only exists on server.

#

Win-win in my eyes 😅

celest python
#

Still pawns can get unpossessed and possessed by Ai controllers multiple times

#

But probably you dont do that

#

Because... Why would you xD

harsh storm
#

Exactly 😅

celest python
#

So yeah win win

harsh storm
#

Maybe my zombie can get in a car 🤣

celest python
#

Would be a nice game design

ocean wren
#

car driving zombies? whatever next

#

mind you, after four hours in a traffic jam I'm probably not far off 🙂

ocean wren
#

goddam it, just spent a day debugging and it turns out it was a trailing slash in a connection url string.. fml 😦

harsh storm
#

Uggghhh - and now, for w/e reason, I can't bind to previous tasks

north oriole
#

Is it normal that move to does stop as soon as target is unreachable? shouldn't it still get the nearest it can to it?i even have allow partial path checked

void wadi
#

Hello ! I am trying to make my AI hear sounds (in this case, a grenade).

The issue is that my Blackboard key for the location of the impact of the grenade is always set to "Invalid". It never takes the location of my Grenade.
You can see images of what I have done in AI_Controller (Image 1) and in the Grenade BP, after it detonates (Image 2)

Thanks a lot !! 😉

clever mason
#

How do I automatically list enemies in my combat manager when they spawn?

deep grove
clever mason
#

Thanks

viscid oasis
#

er just checking - EQS shouldn't be to find an actor, right?

uneven cloud
uneven cloud
cursive stone
#

How do I solve this error? I tried setting it as a parent

#

But it's not working

#

I need to replace it

ocean wren
#

I don't suppose anyone knows where the interfaces section of the details panel went in 5.1 do they?

#

ahh, class settings

misty gale
ocean wren
#

Hmm, so adding an interface seems to not return a "does implement interface" of true.. curious

celest python
#

BP interface or C++?

misty gale
#

Does it require an actual implementation for it to return true ?

celest python
#

it just checks if reflection data has given interface type in the class info

misty gale
#

That should be a no then

ocean wren
#

Ha, first crash of the day.. seems like interfaces went a bit awry in 5.1 🙂

celest python
#

they didnt change

ocean wren
#

So adding a blueprint interface to one actor shows it in the editor to override, on another, which already had a function called something with a function name of the interface its adding.. doesn't show the interface 🙂

#

and then it crashes 🙂

#

haha.. what a numpty, I was implementing the wrong bloody interface!

cursive stone
#

guys need some help

#

i am trying to integrate chatgpt in unreal 5 can you help all help with a headstart

ocean wren
#

does it have an API?

#

i.e. a rest endpoint?

ocean wren
#

apprarently it does

#

httprequest is the way to go

#

If you can find a schema for the API, UE 5.1 introduced a new plugin where you can convert the schema to code and blueprints by dragging the schema into the content browser (schema comes from openapi api description in the demo I saw)

cursive stone
#

do you know how to integrate it ?

ocean wren
#

Well, yes I do.. I mean its an API right, you implement the API calls like they want and you get some return values in JSON that you parse.. search online for http and json in unreal engine

#

Watch that video.. got most of the methods they have for manipulating data

#

specifically this for BP only stuff.. https://youtu.be/HOpyZ8552oA?t=1024

How can programmers create environments where designers, artists, and game logic work as one? Through intuitive data systems. Learn the art of storing data in Unreal Engine, as we analyze how different methods impact designers and/or help teams scale.

We’re excited to bring you sessions from Unreal Fest 2022, available to watch on demand: https...

▶ Play video
ocean wren
#

goddam data tables are lame 🙂

#

I definitely am not a fan of the usability...

uneven cloud
#

Data tables are very useful, especially if you work with designers.

void wadi
#

Hello !

I followed this tutorial to make only ONE of my enemies move to a sound location : https://www.youtube.com/watch?v=xWBawODyxC8
The issue is that I don't manage to make it work. I've done the same as him, except that I do not have a "Team ID". I am using Lyra Starter Sample so instead I am checking the Team ID of Lyra.

What do you think could be the issue please ?

Or, do you have any other ideas on how can I make it ??

Thanks a lot !! 😉

Project Files: https://www.patreon.com/posts/63395392 .
This is episode 42 of the third-person shooter series based on Unreal Advanced Locomotion System. Today, we are going to get started with how to make AI-controlled NPC characters work as a team. For example, when the player throws a rock near a set of enemies and they hear the noise. Acc...

▶ Play video
deep grove
void wadi
deep grove
void wadi
#

The only thing I have changed from him is that :
On the first image, it's his Blueprint (in his NPC_Character) :

  • Before the "Is Valid" node, he got the NPCManager BP Actor, and after the Branch node, he Set it.
    The Second image is my BP, with the Lyra tweaks.

Do you think it's the reason why it does not work ?

Thanks !! 😉

plucky knot
#

Inside a ai controller

void wadi
uneven cloud
void wadi
# uneven cloud Instead of asking us to watch a tutorial and then try to figure out what you mig...

My AI is able to hear noise, and to go to the noise location. The issue is that every enemies (that heard the sound) are going to the location.
What I want is that only ONE of them move to the noise location, while stop moving.

The code I posted previously is just a part of the tutorial. Basically, he created an actor to "manage" AI characters. And this code apply the AIManager BP to the AI enemies who belong to a specific team.

That's what I want to achieve, but this tutorial is the only one I've found on the Internet to do so. I also did not find any posts about this on the unreal forum.

Thanks ! 😉

lyric flint
#

hello, i have a question regarding stop on overlap option in behavior tree how can i make this checkbox clickable? thank you in advance

uneven cloud
uneven cloud
#

Try the other reach test as well.

lyric flint
uneven cloud
#

You have them both unchecked?

lyric flint
#

yup

uneven cloud
#

I'd have to look at the source again, but I'm not 100% sure that's even used anymore. The reach tests is how you control how it stops on overlap.

void wadi
#

But actually, I remembered that I set my AI to be always in Team 1, so I force Team 1 on the Team ID variables, and it's still the same, my AI go to the same location :/

lyric flint
north solstice
#

Any idea on how to prevent findpathtolocation from being too close to wall?

haughty coral
#

Do we know if movable smart objects are planned for 5.2?

plucky knot
#

I've been watching a few Behavior treee videos, it seems all the logic is used in Tasks, and AI controller. I wonder what AIBlueprint is supposed to do at that point. Mostly Animation?

fickle cedar
plucky knot
fickle cedar
#

If the pawn/character is controlled by a player, you can put the controls logic in there. That way if you have multiple pawns with different controls in a game that the player (controller) can possess, it's easy to switch them including controls.

I also put health points there, death effects and events, etc. Which applies for AI as well.

timid iron
#

Hello, does anyone have an issue with navigation not working in a packaged game?

quick bramble
#

Heya folks - I've traditionally used custom AI systems, even with my unreal work, but I'm looking to learn the stock unreal implementations a bit better. I prefer working in C++. Anyone have any tips on guides or videos about best practices to help me ramp up properly?

As an example, it looks like you would define your blackboard and keys in blueprint and use a blackboard component to manage the values in C++ on your custom controller. For creating behavior nodes it looks like you can do custom C++ implementations, but it almost seems just as easy to expose C++ functions to blueprints and have the behavior tree execute a blueprint call that shells out to your C++ implementation. Overall just trying to get the feel on how someone with more experience would approach building things in these systems vs. the standard intro tutorials I'm finding.

quick bramble
#

Maybe as one other example - I could run a LOS check as part of my actor tick and write the result to the blackboard and check it in a decorator, but maybe it's preferable to just write a custom "HasLOS" decorator so that the actor tick doesn't need to be enabled and the behavior tree can manage how often it needs to run that check?