#gameplay-ai

1 messages ยท Page 164 of 1

sudden citrus
#

Imagine a stress testing AI which is supposed to run multiple branches in a loop, without any regard to how it looks or whether it makes sense. If one fails, you'd still want the loop to proceed because you're just testing stuff. It lets you reuse nodes in different scenarios without having to make wrappers.

The real cursed thing I've seen is a "return false" node used in a selector... used to loop while polling a bool in the blackboard

gray sail
#

How is dynamic AI navigation handled in large open worlds?
Let's say e. g. an NPC should go from Town 1 to Town 4. How would they find the correct path there?
In a small world, a simple pathfinding algorithm would just be ran on the navmesh, but in large open worlds (e. g. Skyrim) with complex road systems, this isn't really performance-efficient if many NPCs would be doing this, right?
And if it is actually an usual navmesh, I assume the resolution is extremely low to decrease the number of nodes?
Bonus question: How are navmeshes set up with paths through landscapes that the AI should not usually enter? Manually thousands of volumes seems extremely tedious to me, so does this work in a different way (or are the volumes included in e. g. a road spline actor)?

sudden citrus
#

To answer your first question: hierarchical pathfinding, or road networks, are usually the solution

misty wharf
sudden citrus
#

Second question: you could automate placement of areas around certain obstacles, change the nav agent size (if you don't want them going in between trees) or mark up with volumes automatically. The solution depends on your exact use case

sudden citrus
misty wharf
#

Yeah I meant the Finish With Result node :)

#

Just can't think a lot of usecases for it where it would make more sense over Force Success

#

so wondering if I'm missing something about it :P

celest python
#

If you encounter one of them in the wilderness they just move to a random location in their way

#

Usually you want to do the same

gray sail
gray sail
celest python
#

If they do, they probably follow some cluster of navigation paths I guess

celest python
#

Not sure if its exposed to BPs

gray sail
#

Are there any documentations or tutorials on it? Didn't see any.

sudden citrus
#

It's not implemented. The function call routes back to basic pathfinding

celest python
#

Oh really? Damn

#

I thought I saw it somewhere

celest python
sudden citrus
#

The interface exists, it's just a ruse lol. You can test reachability using the cluster graph though, by setting the mode on Path Exists decorator to Hierarchical

celest python
#

Ah yes that was what I saw

#

Welp, looks like Fortnite never needed it

sudden citrus
#

Yeah, they seem to just build large paths from known waypoints, because FMetaNavPath received updates from the fortnite branch.

When asked on UDN, Mieszko said they won't implement hierarchical search because the cost of maintaining a hierarchical graph in dynamic generation eats up all the savings from searches - which kind of misses the point because you hit the expansion limit no matter the time

#

you can implement this

#

(but it assumes uniform costs)

celest python
#

Kinda way too low-level things for me, but I like studying these type of papers. Thanks for sharing

sudden citrus
#

Also FMetaNavPath is a great way to actually build hierarchical paths using the above approaches - you just give it the top level path and it will kick off low level searches when reaching points, or you can override that behaviour to do granular searches 2 waypoints ahead to smooth it out (because the hierarchical path will be blocky and wasteful)

#

It's not a terribly difficult thing to make once you know how to talk to the navmesh ๐Ÿ™‚ it maps to recast concepts pretty well.

gray sail
#

On another note:
Let's say I have a path going through my level, with some surrounding area (using dynamic navmesh generation with invokers).
I want AI to only have this path available as navigation area, unless they are explicitly allowed to use another one, e. g. when they are in combat or a different AI category like a wild animal.
My current idea is to use have modifiers added to the path spline apply custom areas and override their cost settings by using Navigation Query Filters on per-AI basis.
Some AIs would use a filter on their operations that overrides wilderness costs to be extremely high, and for others the opposite. When they e. g. enter combat, this filter could also simply not be applied, and they would be able to use all of the area.
I don't know if all important functions support filters, so this could be a flaw.
Is if this is a good concept, or if there is a better way to do this (also regarding performance)?

ocean wren
#

Might be worth watching how they did the navigation for that Hideo Kojima game (I'm blanking on the name, but I recall a GDC video on the navigation)

#

Death Stranding!

#

Oh to be a fly on the wall in Epic code design meetings..

#

So far reading the Mass.... framework, it looks to be an ECS system based on "fragments" which are essentially components in the ECS and there's a command buffer which adds/removes them from "entities", which I assume are actor base classes with some container for holding fragments

#

There's also the concept of tags in there.. so I guess some sort of tag based filter mechanism

#

There's a concept of a "processor", which I assume is the base class for whatever takes a group of entities and does some computation on them

#

There's also a "phase", which seems to determine the ordering of the processing

#

Hmm, so there's a UMassSchematic derived from UDataAsset that defines the processors array. I don't know if those are user editable or not

#

Man this stuff is going to freak people out ๐Ÿ™‚

#

So the basic idea, is that you have a data driven ECS system a bit like Unity's DOTS, based off of stuff that you can read about by Scott Bilas from Gas Powered Games back at GDC 2010-ish

#

The components are called fragments, presumably not to confuse people used to ActorComponent, so of course that becomes more confusing ๐Ÿ™‚

#

There's a notion of an archetype, which is basically a template for fragments + tags to add to an entitiy... so think of it as a system that allows you to clone the fragments and tags of another entity (bit like a Unity prefab)

#

and of course, this will all be completely undocumented ๐Ÿ™‚

#

Toying with the idea of giving this to my students to document ๐Ÿ™‚

ocean wren
#

That would be too cruel though

celest python
celest python
celest python
ocean wren
#

I'm looking for something useful for my advanced graphics MSc students to get their teeth into

#

has to be something graphical but slow, easily understandable but reasonably easy to improve performance of

#

I'm thinking some kind of skeletal animation thing

#

Hmm, so the new smart objects are pretty simple.. a new component type and a few nodes for the BT (findandusesmartobject)

misty wharf
#

smart objects?

ocean wren
#

Yeah, smart objects ๐Ÿ™‚ they're a sort of coordination for multi-agent use

#

generally popularized by the sims

#

I've used a similar approach before to get a squad of soldiers to clear a room of threats by going through a door in squad order etc.

#

You can imagine one being used for moving the bomb in TF2, they had a similar thing in Wolfenstien (RoTCW) for moving the train using the AI

#

basically a "slot" system object that coordinates who goes where

#

They used smart objects to annotate the beach scene in Bioshock Infinite, good GDC talk about that on YT

#

They'd be useful for some of the "queing at a till" situations people have been asking about around here for example

misty wharf
#

Yeah I have a vague idea of how it works but is this now builtin or what were you referring by "the new" lol

#

I think I actually have a smart object of sorts in my queueing system, but never really thought of it being particularly smart lol

ocean wren
#

Yeah, they've added it into UE5

#

along with the Mass Gameplay thing

#

and the StateTree system

misty wharf
#

interesting

#

I heard about some of the AI things in it but didn't know about this one

celest python
#

Its probably only made for StateTree ๐Ÿ˜„

#

AI behaviors encapsulated into structs

ocean wren
#

Yeah, I had a quick look at the StateTree stuff too

sudden citrus
#

Really useful to read about others' discoveries in 5.0, I'm still due a deep dive into Mass

sudden citrus
hallow drift
#

how can I make a pawn follow their path exactly the same as if it were to follow a spline? no more getting stuck into some anything

#

just follow the path as a spline

sudden citrus
#

what are you getting stuck into?

celest python
#

You can place nav modifiers to level to try to keep them in specific places while navigating

#

Like placing modifiers that costs more to move to edges of the roads etc.

static crystal
#

I'm trying to create a grid of points that are near actors with a certain tag

#

will the "GameplayTags" test here check the actors found in "Overlap: Sphere"?

#

and if not is there a way to do this out of the box, or should I just make a custom "overlap and contains tag" test

misty wharf
#

the tests are ran against the results from the generator

#

the overlap test therefore isn't really returning anything, it's just for testing whether an overlap exists

sudden citrus
#

Let's make sure we understand correctly, you want to:

  • find all actors with a tag
  • generate points near them?
static crystal
#

yeah kind of. Basically my actor needs to walk up to a piece of furniture and throw it at the player.

So the actor needs to find positions that are next to furniture and can also see the player from

sudden citrus
#

What you're doing in the screenshot is:

  • generate a grid of points around the actor sending the query
  • overlap with a sphere around each of the points around that actor, looking for furniture
  • check that furniture for gameplay tags
static crystal
#

oh so it doesnt check the furniture that the overlaps find?

#

does*

sudden citrus
#

It does, but you're finding furniture that surrounds the points that surround a single actor

#

read both again carefully

misty wharf
#

I guess you'd want to first generate a set of reachable furniture within desired distance, then generate points around them

static crystal
#

so will the items returned in this case be the positions next to the furniture, or the furniture themselves?

sudden citrus
#

Your current query will return positions of furniture that's near the querier, and it will be searching for them in a really weird way

#

Looks like you've just misunderstood how an EQS query is constructed, so:

#
  1. a generator creates a lot of points using contexts - a context can be one actor or multiple actors
#
  1. you can run tests against those point, filter, score them
#

Generators give you the pool to pick from, Contexts are reference points, Tests are how you pick them.

#

Do you want to find all furniture in the world or nearby furniture?

static crystal
#

just nearby

sudden citrus
#

There is no obvious way to do this so I see how you got confused

#

Basically you want to filter the context, not the points

#

is this a single player game?

static crystal
#

its multiplayer

#

so running the gameplaytags test against a grid generator does nothing right? because its just a set of positions

#

but would work agains the actors of class generator

sudden citrus
#

You can create a new Blueprint Env Query Context that generates furniture around the Querier

hallow drift
sudden citrus
#

Do they get stuck in scenery or other pawns?

hallow drift
#

No, i dont even know what it gets them stuck

sudden citrus
#

@static crystal

hallow drift
#

There is nothing with collision there

sudden citrus
#

So there are no other pawns, they just stop walking?

hallow drift
#

They walk in place

#

And stop, that is a fail

#

But there is nothing to block them there

sudden citrus
#

Have you checked the navmesh in your level?

hallow drift
#

Yes

sudden citrus
#

how are you telling them to move

hallow drift
#

MoveTo(actor) in c++

#

And it works

#

But it has some spots it get stuck

sudden citrus
#

in what class is that MoveTo cause there's a bunch

hallow drift
#

Controller

sudden citrus
#

do you call the MoveTo every frame or just once?

hallow drift
#

Once

#

what is even stranger is that they can get there, but cant leave

#

In my engine pathing generated a spline and then objects followed it with no collision, and it worked fine in the big part, can't I emulate that in ue4?

sudden citrus
#

If you've done that before, you can make your own PathFollowingComponent that does that, sure

#

but I'm not sure if it will solve your problem

dark warren
#

Hi,

I try to get my head around Behaviour Trees but my Decorators just wont work (check the screenshot). Only the left part of the tree is executed even if the decorator returns false. Even inverting the value does not change anything. Why?

misty wharf
#

If TestDecorator returns false it aborts the entire branch it's on

#

Since your root node is a Selector, it will execute branches until one of them succeeds

#

so if your leftmost branch always succeeds, then the rest of the tree will never get executed

#

also note that it says your decorator on the selector is going to get ignored entirely unless you are running this in a sub tree

dark warren
#

Ok so how would I set up something like this?

misty wharf
#

so you first want it to run the patrol part, and once that succeeds, you want it to run whatever is to the right of it?

dark warren
#

got it. Placed the decorator (Has Waypoint) to the patrol sequence

misty wharf
#

Yep that should work :)

dark warren
#

Once I wrote the question I got it almost instantly ๐Ÿ˜„

misty wharf
#

yeah that's how it goes sometimes

dark warren
#

thanks!

sudden citrus
#

rubber duck debugging ftw

dark warren
#

Oh one other question. Is there a way to run a different behaviour tree (different file) within a behaviour tree?

sudden citrus
#

yes, see the Run Behaviour node

dark warren
#

I had this AI for several years running as a state machine and it's quite complex. Want to transistion to BT now for UE5

#

Perfect!

sudden citrus
#

Run Behaviour Dynamic lets you dynamically reassign the subtree but if you just want to statically split a BT, use Run Behavior

#

you can also tell the AI controller to run a different tree during gameplay, that kind of approach works very well with utility AI logic

#

High complexity in BTs should be avoided imo, it's a quick way to create something cursed

#

Or you can run a state machine that has a different BT in each state.

#

the only problem is that if you use different blackboard classes for each, they will be wiped

dark warren
#

Ok I plan would be to have the Patrol and non combat part in one BT and the combat in another BT. I should be able to apply a decorator onto a Run Behaviour node right?

#

On and how important is a Blackboard? I can't imagine that much use cases for my AI at all. I would use it for some condition but mostly the values would be stored in the AI it self and called from the Task and decorator nodes directly.

sudden citrus
#

The blackboard lets you decouple logic between your controller and other stuff, and the BT

#

Avoiding dependencies is a Good Thing

dark warren
#

but how is the blackboard directly avoiding it? If I need the focus target of the AI, I can call it directly from the AI instead of writing it to the blackboard and then getting the value from the Blackboard

misty wharf
#

Sometimes it makes sense to use it but others not... I've found using tasks and decorators to access the pawn directly works pretty well, especially if you have a lot of values to deal with because the blackboard can become very messy

#

Plus you'd need a lot of extra logic to move values between the blackboard and the pawn/controller

sudden citrus
#

That is the problem with huge BTs, the BB becomes messy.

misty wharf
#

Yeah, the BB editor is not great, you can't even reorder values

dark warren
#

I'll brobably mix BT and State Machine and avoid BB for the most part and hope it will work out

sudden citrus
#

If you do that, use interfaces

#

you don't want to discover later that if you open the BT editor it has to load a 9GB character

dark warren
#

I actually also do not use interfaces that much in the past as I always have a base AI class all the others parented from

sudden citrus
#

Let me put it this way: a lot of patterns are available that don't really matter in small projects but introduce good practices.

dark warren
#

I'm actually in bigger projects (consoles)

misty wharf
#

base character can avoid the "load 9GB char" issue as well assuming you don't hook up assets into the base

sudden citrus
#

Like, if you write hello world in C++, you probably don't care about heap allocations. If you write it 10k times you do

sudden citrus
misty wharf
#

hey if you got a PC good enough to work in the editor with that then does it actually make any real difference? lol

dark warren
#

I'm cheching verly basic conditions in Decorators right now. Like this where I check if the AI is able to wark around freely in a radius

sudden citrus
#

Closer to release they asked me to make a light menu-only player controller or something and I just couldn't without ripping out references to the main character for 3 weeks. Avoiding hard references is good practice, really, and repeating that "I probably won't have a problem with it" just means you will have a problem with it a bit later

dark warren
#

I shipped 4 games with hard references and had not a single issue with it

sudden citrus
dark warren
#

๐Ÿ˜„

sudden citrus
#

I guess bad code is everywhere around us

dark warren
sudden citrus
#

belongs on the controller, or instead I'd make different BTs for it

misty wharf
#

The pawn/controller split is a bit of an annoying thing tbh

#

I have a bunch of things which technically should be in controller, but it's much easier to have it on pawn

#

for example you place pawns into level, you can adjust settings

#

but if those settings are in the controller? nope

sudden citrus
#

I only have that issue if I make a test level, otherwise I don't spawn pawns at design time

misty wharf
#

so you use some kind of spawner actor for it which does it at runtime?

sudden citrus
#

yep

#

I believe the Mass system has spawners too

#

I want my levels to be throwaway, the less manual setup in level entities the safer it is to recreate

misty wharf
#

yeah, my other project spawns all of it at runtime since it has a dynamic system for it anyway, but my shooter project has a lot of them placed directly into level at design time

#

although we also have a spawner for spawning enemies from result of events or such

dark warren
#

With the old State Machine I had all those flags at the Pawn and the controller pulled the values from it. As I'm working on Combat Snadbox games, I need to tweek every character with a lot of values and I tried spawners but it did not work out to well for me

sudden citrus
#

it also lets you avoid weird logic in the engine - there are different code paths for level placement and runtime spawning

opaque fractal
#

Hey guys, do you know if it's possible to use the Gameplay Debugger to debug the Perception Component attached to my Player Controller? I can only make it work with AIControllers.

ocean wren
#

Well yeah, why would a player need a perception component, given they've got a brain?

#

ok, given that we ASSUME they've got a brain ๐Ÿ™‚

misty gale
#

A brain needs external stimuli .. duh! ๐Ÿ˜…

#

The more the merrier

sudden citrus
#

There's probably a way to get it working but I think player centric stuff can become so different that you're better off manually running raycasts, sphere traces and whatever

#

Try pressing tab for the free camera in GDT and aiming at the player

#

maybe there are keys to cycle target actors?

normal sentinel
#

Can an AI controller with a pawn that can fly be told to move to a point in the air? It seems to simply sit at ground level and do nothing.

main heart
#

On getting back to basics, have a read at SOLID principles

misty gale
normal sentinel
#

Fair enough. I was hoping not to have to implement my own FlyTo task, but I guess I am.

lone stump
#

@normal sentinel you can make it move from a to b without following path. Make sure pawn has FloatingPawnMovement component and just make it do MoveTo without pathfinding

misty gale
lone stump
#

Probably just basic penetration stuff, but there's no pathfinding, that part you would have to do yourself or get some plugin

sudden citrus
#

Havok has 3d pathfinding, but it costs money. And last I checked (3 years ago) they sold their UE4 integration as a fork. Perhaps now that the Chaos switch prompted an interface change, it's a plugin

misty wharf
#

You could probably do some kind of floating pathfinding via EQS and A*

#

eg. generate a set of valid points to travel to for example on level load with EQS and you can then have your floating pawns navigate using the points with A*

#

so you'd basically end up with a 3D grid pathfinder of sorts

sudden citrus
#

there are whitepapers around for flying pathfinding definitely

celest python
main heart
#

But yeah, may not be simple ๐Ÿ™‚

misty wharf
#

Yeah it depends on how complex your level and such is I guess

misty wharf
#

some kind of grid is generated and A*'d

celest python
#

Yep

misty wharf
#

Not sure how it handles grid sectors that are obstructed in some fashion tho

#

It does some kind of box overlap check but not sure how helpful that is

magic jasper
#

Also useless for non-flying stuff

#

Uses the same implementation as warframe

ocean wren
#

Dammit, my steamdeck won't arrive until Q3 ๐Ÿ˜ญ

mossy nexus
#

I was thinking about doing 3d pathfinding as bands in the air

ocean wren
#

Did you read the wiki? it literally says how it works, with a paper from Daniel Brewer and everything

misty gale
#

One is not used to such luxury, so one rarely bothers checking ๐Ÿ˜›

mossy nexus
#

other than "it's inside volume"

#

a visual representation would have been great

#

it does mention layers, but even so I'm not sure if they would correspond to e.g. air bands

shell gazelle
#

has anyone used the "move directly to" task with a vector destination in ue5.0? I can't get it to work with vectors. Works with actors though, but not their location vectors.

#

The vislog & source code tells me that the "OnPathFinished" got a something as a parameter that it couldn't handle:
LogPathFollowing (Log) OnPathFinished: Invalid[]
which makes me think of a bug

shell gazelle
#

okay.. it's a bug (sort of). Having "Project goal location" checked (it's checked by default) and not having a nav mesh will make the "move directly to" task fail. The vlog's don't catch this.
So basically if you make your prototype floaty characters wonder around to random points, it just fails silently unless you know to uncheck "project goal location".

normal sentinel
#

Can anyone shed light on what actually causes a task to be aborted?

#

In general is looks like basically, tasks are expected to be short lived, and you use decorators to filter tasks.

#

but if you do have a long running task (lets say flying to some random distant point) and you want to abort that if a BB variable changes.

#

What actually triggers AbortTask ?

#

ah, sigh~ nevermind, I see, abort task is protected.

#

It's for tasks to abort themselves, not an external caller to abort them.

#

I was hoping you could somehow write a service that could abort the child subtree

shell gazelle
#

in behavior trees, decorators can abort other nodes

normal sentinel
#

oh... the time limit one aborts the task its on

#

Cheers, let me have a look how it does that.

shell gazelle
normal sentinel
#

ooh, nice.

#

thanks~

foggy pike
#

Why would EQS query go through doors? Is there a way to have it test for navigable-ness?

#

oops I can do a path test lol

crisp bone
#

So I'm getting insanely large NavMeshBoundsVolume in my world. To the point where it's crashing the project. Does anyone have any insight on how to optimize NavMesh?

lyric flint
#

Have you tried navigation invokers.

crisp bone
#

I'll go google "navigation invokers" - thanks.

lyric flint
#

@crisp bone And for your sanity and troubleshooting purposes, after you learn about navigation invokers, and poke around by yourself, if for some whatever reason it doesn't work as expected, you can try and copy and paste the following settings as some sort of workable starting point in your DefaultEngine.ini of your project

[/Script/NavigationSystem.RecastNavMesh]
bFixedTilePoolSize=True
bForceRebuildOnLoad=True
RuntimeGeneration=Dynamic
TileSizeUU=2000.000000

[/Script/NavigationSystem.NavigationSystemV1]
bAutoCreateNavigationData=True
bInitialBuildingLocked=False
bAddPlayersToGenerationSeeds=True
bSkipAgentHeightCheckWhenPickingNavData=False
DirtyAreasUpdateFreq=60.000000
bGenerateNavigationOnlyAroundNavigationInvokers=True

But do this only when you are about to jump out the window, it's good for you to learned the manual stuff by yourself in the project settings GUI ๐Ÿ˜†

crisp bone
#

Thanks. Looks like it may be working, "P" in editor is showing nav mesh rendered strictly around AI Characters....

thin chasm
#

Dunno if this has already been answered before so apologies if it has.

Trying to solve this issue within this game I'm working on.

I have AI enemies that attack the player character and I've set up a move to for the enemies towards the player character when they're sighted, but when the player character jumps (and they jump quite high) the move to for the AI enemies fail due to the AI characters not being able to jump or get a path towards the player when they're airborne. Ideally I would want the AI to continue to follow the player but follow to the location underneath the player at all times.

I came up with the idea of line tracing down from the actor and updating a vector for the AI enemies to move to. Although this approach does work the vector is not constantly updated in the move to even though I'm updating the vector with a service (I realized this is probably due to Track Moving Goal option only works for actors and not vectors).
I've tried to see if I could edit the existing Move To code to do this trace but it doesn't seem like it would be the best way of approaching it.

What would be the way people would go about solving this problem?

somber ore
daring osprey
#

Hey, I have an issue, my second wait node fails instantly, even if I put more tasks to the right of it. Anyone might have any idea why is that?

misty wharf
#

if move to fails it usually means the point is unreachable, either because your navmesh is missing, the actor is not on the navmesh, or the point is not valid for some other reason

#

Visual Logger has more debug info on why movement fails

sudden citrus
#

I think he said the wait node fails. But maybe the actual issue is that the move node fails and the wait never happens

misty wharf
#

Wait should never fail so it's more likely the move to failed

ocean wren
#

Yeah, any failure of a child node would cause the sequence to fail so its probably the moveto node, as someone mentioned you can check the visual logger, but if the moveto fails it generally spits out why into the log file too.

thin chasm
urban rivet
#

do it programmatically ๐Ÿ™‚ how are u calling a move to? if it's to a vector then only do X,Y keep Z same as the ai controlled pawn

night robin
#

Hello hello, what would you guys suggest to accomplish a simple flying AI pathing system?

thin chasm
urban rivet
#

been a while but doesnt BT have a move to vector task?

daring osprey
misty wharf
#

Yes

#

It won't cause the rest to fail, it just causes the sequence to abort

daring osprey
#

Whats the proper way of handling the z of the point it needs to reach? I gave the goal vector a custom position and I think it can t reach the z axis properly

misty wharf
#

You should be able to use project to navigation or whatever it was called

daring osprey
#

Ok cool, thanks!

#

Does that just ignore the z or calculates the goal z properly?

misty wharf
#

It projects the given point to the navmesh

#

so it should have the point on the mesh after using it

thin chasm
#

even if the vector is being updated with a service

misty wharf
#

Yeah you would have to rerun the moveto every time you update the vector

#

The lack of it auto-updating is a side-effect of how vector values are treated, they end up being new copies of the value, so when you update the BB value, it won't update in the moveto task, wherein if you assign an actor, it will keep reading the actor's position data so that can obviously update

urban rivet
#

they end up being new copies of the value
unreal

crystal grotto
#

Is there a way to let a single NavMeshBoundsVolume cover the whole landscape besides the obv scale it up to the moon way ?

misty wharf
#

You can edit it in brush editing mode and make it bigger that way :P

crystal grotto
#

Not quite the answer i was hoping for, but i'll just accept it xD

misty wharf
#

Yeah kinda wondered about it myself as well but haven't found any way of having it generate it in places without extending the bounds

spark jackal
#

anyone have information or documentation about the new AI systems in UE5, specifically the new StateTree system and MassEntity?

celest python
#

Check out DigitalFoundry's Matrix Demo review, its the best some kind of documentation/explanation so far I saw

#

Not a documentation per se, but ๐Ÿคทโ€โ™‚๏ธ

fresh remnant
#

Has anyone had ResumeLogic not work? PauseLogic seems to work(pauses everything), but resume logic seems to keep the behavior paused

fresh remnant
#

nvm my bad ๐Ÿ˜„

uneven stratus
#

In my RTS I'm building, whenever I tell Units to attack something large like a building, they all move to the exact same corner of the building to attack. I think this has something to do with the navigation system finding the "closest" it can get; How can I make the ai take the real shortest path to it?

misty gale
#

Adjust the found location manually

ocean wren
#

find the navmesh edges close to the building position, take the radius of each unit and apportion them each a position on the edges of the building so that they line up along the edges sort of surrounding them

#

Basically, write your own code to handle it

ocean wren
misty gale
#

Could be helpfull if the building could return its constraints

ocean wren
#

Just have to build a list of points along the edge

misty gale
#

Fair enough,

#

Plus ensures valid location

ocean wren
#

I do that for my squads and it looks pretty reasonable

#

I doubt anyone in RTS land does it any more complicated than that ๐Ÿ™‚

misty gale
#

Shhh, im also in rts land ๐Ÿ˜‚

ocean wren
#

The tricky bit is when you want your agents to go through doorways tactically ๐Ÿ™‚

misty gale
#

Yeah that sounds troublesome. ^^

#

Glad im more towards city builder/resource manager than strategy really

#

All i need my ai to do is perform a few animations and move along splines exclusively

ocean wren
#

splines in an RTS?

misty gale
#

Its no traditional rts :p

#

Singleplayer , more towards frostpunk in some ways

ocean wren
#

oh I get you

storm oracle
#

Hello everyone, it's normal that a service calls an event 2 times in the same frame?

ocean wren
#

Is it?

celest python
storm oracle
celest python
#

Any possibility you have multiple instances?

#

Or how do you know it gets called twice in same frame

storm oracle
#

Is more like thee event that the service calls is launched twice

#

The call stack says is the same object on receive tick, the service is made to tick every 2 seconds. The breakpoint tho doesn't go back to the service function, but instantly goes to the event i launched, so it makes me think is being called twice. This in debugging the blueprints

storm oracle
#

At the end found why was called twice, cause i didn't see there was 2 input nodes connected. Didn't know about this.

unborn jungle
#

What is the difference between Nav Mesh Proxy Simple Links and Smart Links?

#

I see only documentation saying you can enable them but what would be the reason to use smart links over simple links?

misty wharf
#

You can subclass smartlink to provide custom behavior

#

For example if you have a door with a smart link, it could trigger the npc to play an animation to open the door, walk through and close it

#

Or it could trigger a jump animation, etc.

unborn jungle
#

Ah got it so for basic move to this launch pad to jump up, I don't need to use smart and can get by with simple?

#

My AI are dropping down fine but it seems they still just group up by the edge of a jump instead of jumping on the launchpad nearby, it feels like their target location is too far away from the navlink or something so they default to their non nav link behavior of just getting as close as possible without falling off the edge

uneven stratus
#

@ocean wren @misty gale sorry for slow reply, thank you for the help! I'll try experimenting with these ideas tomorrow!

echo oracle
#

What structure do you use in behaviour trees to get an enemy to do an attack that takes a certain amount of time and also stops the tree from continuing on?

idle wigeon
#

I'm pretty new to UE.. I need to do a lot of pathfinding, seems like the kind of problem that has already been solved.. is there some performant library everyone uses for that?

idle wigeon
#

Ahh nevermind it's built in.. google failed me.

misty wharf
#

this way the BT will not advance from that task

echo oracle
#

What node do I use to get it to wait and listen?

misty wharf
#

create an event dispatcher for it in your character BP, then bind an event to it

echo oracle
#

ah. Awesome

#

ty

hoary peak
#

When will the tick rate of a task matter? I assume it matters for moving and delay/timers but is there anything else that's obvious that I'm missing? I'm not using sight/perception or anything alike that I assume would also be affected

misty wharf
#

if you mean BT tasks, the tick rate just controls how often the task's Tick is called

#

BT tasks are separate from actors, so it doesn't have any impact on how perception and such behaves

hoary peak
#

Yeah I'm talking about tasks, so if I don't run anything on tick inside a task the tick rate wont matter?

misty wharf
#

yeah

misty gale
#

Isnt tick rate used for bt eval?

misty wharf
#

Huh?

misty gale
#

Nvm, it was a task question ๐Ÿ˜…

#

Mis-read

misty wharf
#

Anyone know if there's a trick to support passing gameplay tags into parameters for EQS queries?

#

It seems extending FAIDataProviderTypedValue would be the way to go, but the other subclasses of that seem to use for example FIntProperty and such, and there isn't one for FGameplayTag as far as I can tell...

misty wharf
#

Okay well this is just confusing... are all parameters for EQS actually just converted into floats? ๐Ÿค”

#

They all just are... floats...

#

No wonder there's literally nothing anywhere on how to do anything useful with parameters

#

It's because you literally cannot because it's hardcoded to only work with things that easily convert into numbers ๐Ÿคฆโ€โ™‚๏ธ

#

All I wanted to do was to create a test that would call a function to do some traces for a LOS check

#

but it needs a tag to be able to determine certain things for the LOS check...

#

Okay, maybe I can just directly poke the test instance like this... will have to test this tomorrow to see

TSharedPtr<FEnvQueryInstance> QueryInst = UEnvQueryManager::GetCurrent(this)->PrepareQueryInstance(Donger, EEnvQueryRunMode::SingleResult);
UEnvQueryTest_WeaponLOS* LOSTest = Cast<UEnvQueryTest_WeaponLOS>(QueryInst->Options[0].Tests[0]);
LOSTest->Foo = 1;

If this doesn't work then it's gonna have to be some really ugly hack I guess...

simple crest
#

that's some serious "that's right, it goes in the square hole" ing

#

where does the bool go? that's right, it goes in the...

keen crow
#

float?

keen crow
#

how do I make AI to perceive character in situations like this when say character's head is visible for AI but it can't trace the actor root? I tried putting another AIPerceptionStimuliSource component on the character but that one is not a scene component ๐Ÿค”

ancient wedge
#

How do you guys handle dynamic AI with Navigation Invoker? If the target is outside of the Invoker?

misty gale
#

According to earlier talks here, having invoker on the target , despite there being "gaps" , allows the AI to find a path to a target

#

I have not tested or confirmed this by any measure, so take it with a grain of salt (or testing)

viral spade
#

hi everyone is there a way to use a classic boolean and not with the (is set) in behaviortree ?

celest python
viral spade
celest python
#

yep

viral spade
# celest python yep

Does conditional loop work like this to : is set = loop ans is not set = not loop ?

celest python
#

I never used conditional loop before

#

I generally avoid BTs

#

Just have an overall knowledge of it

#

But I dont know, try and see yourself?

#

Probably its same as regular for loop in C++

#

It will loop until your condition is false

lyric flint
#

why i cant put nav mesh bounds high in the level?

#

it stops showing that green area on certain height

celest python
#

There might be a setting for that in project settings

lyric flint
#

yeah went and searched did found nothing what i think will set it up

#

48000 units +Z is what im not able to put it in..

viral spade
misty wharf
#

Conditional Loop will loop if the value is set

celest python
misty wharf
#

it's more like do { stuff } while(condition)

#

iirc it runs the nodes once and loops if the condition is true

misty wharf
#

and added code into it like so:

    for(UEnvQueryTest* Test : QueryInstance->Options[0].Tests)
    {
        if(auto* LOSTest = Cast<UEnvQueryTest_WeaponLOS>(Test))
        {
            LOSTest->AttackTag = AttackTag;
        }
    }
#

Then, you can easily run an EQS query using the regular Run EQS node in BP's, choose this class as the Wrapper class, and call this function from blueprints to set the value directly in the test :P

#

It feels a bit roundabout but it works for adding effectively any arbitrary parameters to EQS tests... and you could use it with generators as well

minor kindle
#

using blueprints is there a way to add blackboard inputs to a BT task? im trying to recreate the Move To task but make it a spline, ive got some code that can do the spline it would just be ideal to pass the blackboard variable

misty wharf
#

set the type to Blackboard Key Selector and set it to be Instance Editable

minor kindle
#

thanks, is there a blueprint example of the Move To function? just something i can base the logic of my spline function on

misty wharf
#

Not sure. There are some Move To nodes that you can use with pawns or ai controllers

minor kindle
#

any suggestions for making a more smooth ai patrol? im doing an eqs query and its pretty good but ofc the ai snaps to move to that location. i dont want to use root motion if possible because i may have a lot of ai's running at once

misty wharf
#

You could tweak the EQS query so it produces more varied points, or give the character a higher threshold for reaching the point maybe so it doesn't need to reach that exact position

minor kindle
#

Yeah Iโ€™ve tried the threshold Iโ€™ll also try some more variability and maybe score points close to it higher

#

But doing that would mean more queries which could have performance ramification

#

Itโ€™s AI for a zombie so ideally there would be at least 10 at any given area

misty wharf
#

TIL "only blocking hits" does absolutely nothing in an EQS trace test

#

So that's another nice discovery :P

#

It seems to suggest that it would make it allow overlap and blocking hits if you turn it off... but... it does nothing. The trace is always only on blocking hits

#

So that was a fun 30 minutes wasted trying to figure out why it did not work the way I wanted until I looked at the code for it

#

Tweeted this earlier today and yyyyyeah... https://twitter.com/therealzomg/status/1503376797999771651

Unreal Engine's EQS is really handy, but also feels like its design is kind of half-assed. Parts of it work very well, but other parts of it feel like they were just tacked on in a hurry.

For example, query parameters are just... weird. They all get converted into floats... ????

minor kindle
#

When did EQS and BT release?

#

Is it like a new thing with UE4/5 and thatโ€™s y is not working perfect? It seems like a lot of AI YT tutorials donโ€™t show using it

#

The unreal YT channel has a great vid on it tho

misty wharf
#

Yeah not sure, it's been in ue4 for some time I think

minor kindle
#

it seems like its been around for quite a while but for some reason lots of ppl show tutorials not using it

misty wharf
#

probably because it's kind of complicated to understand :D

minor kindle
#

i think its easier than trying to do it from blueprints

#

at least for the same capabilities

misty wharf
#

Yeah, it's not hard to use on a basic level, but figuring out the parts takes some work since it's not that well documented

minor kindle
#

the unreal official video on it is really good

#

so i did some stuff with the EQS and its better in terms of picking points to go to that make sense but the rotation isnt smooth

#

its pretty good tho

#

by making it prefer points close to the AI it breaks the previous behavior, making it basically hug walls to search an area more than before

#

i still think trying to recreate teh Move_To would be best

#

basically u get start pos, end pos, generate a spline, then move along the spline path until within range of the raidus

#

just not too sure how move to implements this

#

and for some reason my BT task isnt letting me make a timeline

#

i could make the timeline on my character but thats sorta not organized

minor kindle
#

ive got this which seems ok but it doesnt work cause the very first point is ridiculous, but subsequent points make sense

#

it starts at like crazy numbers and if it can try to input the next (before it auto deletes) it is a expected value

#

nevermind a null value can be anything in memory

#

can i make a BT task wait to finish execute till a custom function in a character completes?

misty wharf
#

sure

#

if you don't call finish execute it won't finish the bt task, so set up a dispatcher in your character for the function completion or such and trigger finish execute on that

minor kindle
#

i got it actually

#

i had to make a variable in the custom function for the BT Task

#

now only issue is the spline moves the character referenced from its eyes not feet

#

so it moves into the ground XD

misty wharf
#

you can probably offset it by cylinder height or something

minor kindle
#

get base eye height is close but not quite right

#

maybe cause the target location is based on the EQS?

#

now i gotta also get rotation splining ๐Ÿค”

minor kindle
#

Maybe what I need is root motion

kindred moss
#

Did you get any help? I'm in the same boat as you.

misty wharf
#

his question is very complex and it can be approached in many ways depending on how it's intended to work

minor kindle
#

If the player is not close enough to see the AI it would be most efficient to simulate anything it would do with no actors

dense halo
#

Hey, does each nav mesh volume have it's own RecastNavMeshData, or is shared?

misty wharf
#

afaik it's all generated into a single navdata

dense halo
#

Is it possible to have 2 different nav meshes? I have a very large map and I'm using the nav invoker component so it doesn't build the nav data for the whole thing, but what I want to do is have another nav mesh that covers the whole map but with very large tiles

#

Is there a way to get the ai to use a nav large nav mesh with larger tiles when needed? I.e moving from one end to the other end of the map, since using nav invoker doesn't work

misty wharf
#

I'm not really that intimately familiar with how it works, but I know you can have multiple navmeshes if you have multiple different agents configured for it, as each agent can use its own navmesh

dense halo
#

I was trying to do that, but it seems to select the nav mesh depending on the size of the character? Not sure what function or variable I need to set to change the nav mesh used, other than changing character size

sudden citrus
#

as many other AI systems it was never given the time to fully mature

#

I mean it's stable and all, but many use cases are just prohibitively complex. Like using data bindings.

#

lots of boilerplate

misty wharf
#

Or the fact that the data bindings only support values that can be marshalled as floats lol

kindred moss
# misty wharf his question is very complex and it can be approached in many ways depending on ...

For me, I'm trying to create a system where two AIs (a man and woman) move through a home preforming tasks at specific times of day. The complicated part is that the time of day is exposed to the user, so they can a dynamically switch from morning to night and anything in between. Therefore, I need the AIs to react accordingly, automatically changing what they're doing based on that time variable. They don't need to follow the player. Any thoughts?

misty wharf
#

You could have them look at the game clock and decide the action based on that

#

If the player changes the time, perhaps fire an event and have the AI revalidate their current action and choose a new one if needed

kindred moss
#

Thank you!

misty gale
#

Also some delegate to inform the AI about the sudden shift in time may be helpfull ๐Ÿ™‚

misty wharf
#

Yeah that's what I meant by the event bit :)

misty gale
#

How did I miss that part lol

kindred moss
#

I'm a non-programmer, what's the Blueprint equivalent if you don't mind me asking?

misty wharf
#

event dispatcher

kindred moss
#

Perfect

misty wharf
#

I have something similar in my game to this - I have a game clock which has its time stored in my game state class, which also has an event dispatcher for when time changes by certain amounts

#

game state is easily accessible for actors, so it makes it easy for any AI or such to listen to the events

kindred moss
#

Okay, that's great to know. Sorry I'm very new to AI and have only been working in Unreal for 1-2 years. I will look into Game State. That sounds like it would solve one of the problems I was going to attempt to fix today. That is that the float variable which controls the position of the sun and also the time of day is inside a SunSky class. Therefore, when I try to access it from the UI, Character, BTT or BTS classes, there's no reference. I can't think of anyway to create a reference other then Get All Actors of Class on an initialize event or equivalent.

dense halo
#

does anyone know if it's possible to have 2 different nav meshes with different tile sizes/tile unit sizes etc, does anyone know where I need to look to find out where the nav mesh data actors are actually spawned??

misty wharf
#

Yeah, I'd have a central value in somewhere like game state for the time

#

You can have the sunsky update based on the time from state, and also other actors if they need it

#

btw you may find it convenient to use the DateTime type instead of a float value or such for tracking it, since it has builtin functionality for some date maths and other logic

#

Depends on how realistic your ingame time is I guess :)

kindred moss
#

That makes sense! I'll look into that as well. You're a huge help. I currently have just duplicated UE's SunSky Blueprint, and made a child which is the one we use in game with the location of Lausanne, Switzerland. SolarTime is a variable built into that Blueprint which is a float as you said. You're saying to convert that variable to the DateTime type and store it in the Game State class and go from there? Everything has to be extremely precise. The time of day and the position of the sun in the sky are two of the most important factors of our project. Thanks again.

misty wharf
#

I think DateTime supports time down to like microsecond or something

kindred moss
#

Yep ahah

#

That's good for sure

misty wharf
#

But yeah basically you'd use the DateTime in your GameState as the "source of truth" for what time it is in your game

#

and your other blueprints like the sunsky bp would read it from there, and do any conversions if they need to

kindred moss
#

That makes sense. I'll start doing some research now. Thanks for your help.

#

I only have one map by the way, is GameState still useful? There's only one player.

celest python
#

Anyone knows an example of normalization math for utility?

#

I had a look on EQS but its very specific to their system, I want to normalize the distance to 0-1

misty wharf
#

Oh boy

#

I found another fun EQS feature...

#

ActorsOfClass cannot use a baseclass in its search if it's abstract... so that's also nice

#

:D

celest python
#

Hmm, makes sense

#

Im surprised Epic managed to thought about something like this

minor kindle
#

i also found a bug not with EQS but the AI stimulus system, basically the first time i set everything up it works but if u close and reopen it doesnt until u check a particular box for the player (in terms of sight detection)

misty wharf
celest python
#

Were we able to place abstract classes to level? ๐Ÿค”

#

I might be confusing, but I remember it was implying "notPlaceable"

#

So based on that thought that might be the reason

#

Since you can not construct it anyway

#

It wont be able to provide info about environment

misty wharf
#

well if you want to grab a set of actors having the ability to select abstract is useful

#

for example my npc actors all share a baseclass but the baseclass itself is abstract

#

now I can't select all my npc's with EQS, because it won't let me use the baseclass because they forgot to use AllowAbstract in the UPROPERTY declaration for it :P

flint trail
#

how is it usually handled, when NPC gets out of the nav mesh area somehow (how to bring it back so it looks more or less naturally) ?

ocean wren
#

don't let it get out?

#

project its position to the navmesh and teleport it back on

flint trail
#

well, say there is an explosion and it kicks NPC off the navmesh.

#

is there a way to check if NPC is outside of nav mesh and kill it ?

ocean wren
#

Well what do you think makes most sense for your game?

flint trail
#

teleporting NPC back would look like a hack, but might work if NPC fell of the cliff or something

ocean wren
#

Well, if they fall of a cliff, you can let the killz kill them

flint trail
#

if it's like a magical barrier separated area - killing it off would make more sense

#

I guess there is no out of the box built-in way to check if AI is inside navmesh area ?

ocean wren
#

Well, there are functions to check.. not sure if they're accessible via blueprint though

potent bane
#

ah thank you friend

fickle tide
#

https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/ArtificialIntelligence/BehaviorTrees/BehaviorTreeQuickStart/
So I'm going through this guide, but no matter what I try I keep getting the same error:

Blueprint Runtime Error: "Accessed None trying to read property Blackboard". Blueprint:  Enemy_Controller Function:  Execute Ubergraph Enemy Controller Graph:  EventGraph Node:  Set Value as Object```
I've tried looking online, but so far no dice there

This guide shows how to use Behaviour Trees to set up an AI character that will patrol or chase a player.

#

I set up the Enemy Controller the way the guide did, but either I missed/messed up a step or the guide is outdated

fickle tide
#

This is the Blueprint event graph in my project

#

And this is the Blueprint graph in the guide

fickle tide
#

So.. what am I doing wrong?

fickle tide
#

Looks like both of these are failing, hm..

ocean wren
#

When it says "accessed None" it means whatever it is doesn't exist.. which suggests either its working on the wrong class, or something hasn't been setup properly yet

#

Like for instance you haven't created the behaviour tree/blackboard in your begin play etc.

misty wharf
#

@atomic oak I would suggest reading the server rules unless you want to get into trouble with the moderators

atomic oak
#

oh ok did read them but did not see anything that was violated by this post

misty wharf
#

Yeah I just saw it posted in two places which would probably go against them :)

atomic oak
#

thanks for pointing it out where would you reach out to potentially interested people ๐Ÿ™‚

misty wharf
#

Oh actually my bad, you posted it on the other channel many days ago

#

My excuse is that I just woke up lol

atomic oak
#

lol

misty wharf
#

Honestly it was probably fine here since it was AI related :P

#

forums or the ue reddit could also be worth checking

#

it looks interesting in general, but not really for my projects right now :D

atomic oak
#

Then put it back here haha

#

you got any link on the forums was checking a lot for them

misty wharf
terse star
misty wharf
#

Well we do talk about general UE-related AI topics here

atomic oak
#

it is hard to say it fits multiple categories haha

terse star
#

I guess!

#

It's just an odd one, like you say, Avatar!

misty wharf
#

I know @ocean wren likes all these machine learning things :)

atomic oak
#

yea if you guys got any contacts of individual dudes or studios that could be interested in having a demo session let me know would be really appreciated ๐Ÿ™‚

#

for now its free so a win-win for anyone who wants to generate more 3D architecture content without coding haha

mossy nexus
#

I don't htink it's relevant for #gameplay-ai since it's a product being sold. I don't think advertising has a place on this server. <@&213101288538374145> is this correct?

terse star
mossy nexus
#

I don't know, is it on the marketplace?

#

looks more like advertising than a marketplace asset

fair zealotBOT
#

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

#

:triangular_flag_on_post: Avatar#5475 received strike 2. As a result, they were muted for 1 hour.

knotty dawn
misty wharf
#

Oh well. I told him it was probably ok here :P

#

It didn't look like it was being sold at least right now, he was just looking for feedback on it

misty wharf
#

I dunno, I guess asking feedback for your product is marketing in a sense, but it looked relevant to the channel's topic as we've discussed ML based systems for unreal before

mossy nexus
#

it's also against the rules technically to argue against mod decisions so eh

misty wharf
#

lol

#

yeah I wasn't trying to argue it either way, just wanted to point out that I did tell him it was okay and why I thought so :)

terse star
#

Against the rules to argue against mod decisions? Damn. That seems pretty draconian.

#

You should at least be able to state your case!

#

(Without being a dick about it)

misty wharf
#

Probably just so you don't start a big argument about it in public, I'm sure it's always ok to dm mods directly about it

mossy nexus
mossy nexus
misty wharf
#

I mean I did originally tell him to not post it because I mistakenly thought he was crossposting lol

fickle tide
#

Or is my implementation of it the issue?
(Long story short, I'm wanting to have all of the enemy AI logic in one place, and an enemy's AI depends on which type I give it [type being an enum variable on the enemy base class]. However, one of the types is "None", because one of the "enemies" is a training dummy. If it weren't for the lock-on system, I could just have the training dummy be separate from the base enemy class.
I've created only one blackboard so far, because I'm wanting to make sure the process works before adding the rest)

kindred moss
#

@misty wharf Sorry, this is a little unrelated to the AI part but it's all part of the process. I have been making some progress on my project. For testing purposes, I'm using the Events of Mouse Wheel Up and Mouse Wheel Down to adjust the time. However, I'm not sure how I should properly increase and decrease a DateTime variable. I'm trying to increase/decrease it by 1 second every time the event fires for example. Any thoughts? I'm really wondering how you do it in your project lol...

misty wharf
#

That's pretty much how it works in mine

#

You can create a Timespan value using the FromSeconds node for example, you can then do datetime + timespan to get a new datetime value

kindred moss
#

Weird...That's what I was thinking too but for some reason I can't add Timespan to DateTime...

#

Sounds like it's a UE5 bug

misty wharf
#

If you get your datetime value and drag from the pin, does + not offer a node to add timespans into it?

kindred moss
#

It does but it automatically disconnects and turns the Add node into Timespan + Timespan...It must be a bug. I've found a few people that have had that issue in UE5...

misty wharf
#

ah

kindred moss
#

I think I found a work around! Yay lol ๐Ÿ‘

#

Does your GameState time tick?

misty wharf
#

I have a timer which increments it at certain intervals

#

If I needed it to increment faster than it does then I'd probably use tick

ocean wren
ocean wren
#

Yeah, I looked at it, not sure its really going to be any use

#

You really don't want to run your ML on your own GPU to be honest

#

unless you have an A6000 like mine

#

Really most ML done with UE is done via a Kubernetes cluster

#

the inference via ONNX stuff is ok, don't get me wrong, but people will want to train models etc..

#

I think the use case for that ONNX stuff is really tiny models that run quickly, probably on CPU etc.

#

my use case is huge models run on clusters communicating with UE instances, also running on clusters

#

Kind of more interested in the geometry tools ๐Ÿ™‚

celest python
#

Geometry Scripting thingy?

ocean wren
#

Yeah

#

I teach Procedural Content Generation to my undergrad students, so might get them to write a sort of "mini houdini"

#

To introduce them to writing graph editors if nothing else

celest python
ocean wren
#

Yep

#

I'm teaching them Houdini also, so figure getting them to write a simpler version would be good

#

Might do it in Unity though, we'll see

dense halo
#

is there a function that I can call to rebuild all navigation data on the UNavigationSystemV1? calling UNavigationSystemV1::Build doesn't seem to do it

ocean wren
#

Isn't there a Generate... function?

#

if I remember you can dirty a bunch of tiles and it'll regenerate

mossy nexus
celest python
#

I will probably want my level designers to work with procedural tools more often

#

Actually Ubisoft living that future today

#

Going mad with Houdini and other engine specific tools to create a new Far Cry each year

celest python
#

We really need a GDC about how dying light 2 built their levels

mossy nexus
celest python
#

Same tools used

mossy nexus
#

I dunno

#

last I played was origins, and I was done with the game within 20 mins of playing it

#

if that's what people consider "good level design" then the industry is going down the drain

celest python
#

I havent played Origins

mossy nexus
#

I imagine it's the same as odyssey

celest python
#

But if you didnt like you probably have a point

mossy nexus
#

ubisoft is not known for making great games

#

they are known for making games cheap

#

they cut most of their good franchises and started making cheap open world games

#

that can easily be live opted

#

so yeah I'm not surprised that ubisoft would use procedural generation

#

but let's also not act like they are the industry leader in terms of design

#

because they are definitely not

celest python
#

Of course they are not, it's just many other 3A like Ubi would appreciate further improvements on those tools. Thats why geometry scripting could be a demand

#

Like how Marvel sucks but people watch it

mossy nexus
#

design you need intent, and that intent isn't free necessarily

#

the amount of complexity in designing something worthwhile, and having it tie into narrative etc. would be lost in procgen basically

misty gale
#

Ai driven proc gen?

#

Ship it !

mossy nexus
#

any procgen

#

but for stuff like genetic animations

#

sure

kindred moss
#

Okay, I'm confused about some basic AI stuff probably because I'm about done for the day and am tired. I'll try to explain. So every time the time/sun changes in my level, I use an Event Dispatcher to signal the sun/time has changed. That's the gist. Now for the AI part. In my BT, when the game begins, I first want to play an animation of my two AIs getting out of bed. Then, every time the time changes, I want to sort through a Data Table I created in my BTTask_GetActivityLocation. Based on the game's time stored in the GameState, I want to select a specific row and, more specifically, its "ActivityLocation" vector. How might I do that is my first question? Then finally, still in this task, but after getting the corresponding vector, I will update the Blackboard Key called ActivityLocation. Then the AIs will move to that location, and then they'll play some sort of animation, say stuff, etc. Is the attached picture of my DT and task a good start? That's my second question. Any help is appreciated.

mossy nexus
#

I'm sure you'll enjoy

#

so how this you fix this? really easy, I just didn't

#

this dude is the purest form of a programmer

#

it gets better

celest python
#

Uh @kindred moss sorry mate we were blocking your question

kindred moss
#

It's all good ahaha

celest python
#

I first want to play an animation of my two AIs getting out of bed.
This feels like an event so I would not do that in BT

#

So you just want to make your AI react to your world events basically?

#

And you want to have Data Tables that contains event names and related script data?

#

@kindred moss

#

Your system strictly enforces everything to happen in a specific form by bounding everything to struct's data that you used in DT

#

What I would do is using an abstract UObject and a system to manage/select tasks

#

And avoid BTs

#

something something utility system

mossy nexus
celest python
#

what's already there
But BTs can not cover everything

celest python
#

Especially if you are feeding data by runtime changing values

mossy nexus
#

nah true I mean I do have my AI subsystem giving them tasks

#

in my case

#

but still

#

once a task is acquired

foggy pike
#

Hoy. I have the following issue:

If player fires gun near enemy behind a wall with a closed door, and the enemy runs off to investigate the sound, if the player opens the door the pathfinding will update to go through the newly opened door
Basically, the agent is pathfinding with a long path around to a spot, but I want the player to be able to open a door (which updates the navmesh) and go past. But the problem is opening the door creates a shorter path for the pathing request, and I don't want him to do that. How would one approach solving this? How do I make him "commit" to the longer path?

celest python
#

Usually doors should not affect navmesh

kindred moss
#

I have a scene (it's just one map), where the player can move around and change the time with a dial. This time is stored in the GameState class. Every time this time changes an event fires. When this event fires I want to go through this DataTable and select the row which corresponds to the time. This row will hold a bunch of different data but most importantly it holds the location where I want the AIs to move to or be. When they get there they'll do some AI behaviour, but when the user increases/decreases the time again, a new row in the DataTable and this new location will be selected, and therefore I want the AIs to abort whatever they're doing and start over by moving to the new location. I'll look up what you're saying though but I really would like to use BT. In the long run, I think it will help me make something more complex.

foggy pike
celest python
#

Why not just request another move?

foggy pike
#

Sorry, not sure I follow?

#

Like why would requesting another move solve that? : o

celest python
#

Actually sorry since you are following a pawn it updates the path each ~0.1s

#

So it wont help

foggy pike
#

๐Ÿ˜ญ

celest python
mossy nexus
#

but I reckon you may have to write your own MoveTo

#

zoombapup might know the correct answer tbh

foggy pike
#

ech god yeah maybe

celest python
#

Why its affecting navmesh?

foggy pike
#

Sometimes I want AI to pass through them.

kindred moss
foggy pike
#

for context, this agent is a patrol monster that chases the player if it sees them, and I want him to chase them through doors

celest python
#

Have a service that updates requirements of the AI on top of the main selector node

#

And have a boolean, if that boolean is true, do the action by sequencer, and preferrably by avoiding DT

mossy nexus
#

the cheap option ๐Ÿ˜‚

foggy pike
celest python
#

Am I hitting a language barrier ๐Ÿค”

foggy pike
#

Well THAT behavior works fine haha

#

it's just that if the player fires their weapon behind a closed door, and there's a valid path to that position a long way around like through which the player came, then I still want the monster (at least for now) to be able to move to that location

#

although realistically maybe they shouldn't

#

maybe I should just set the max navigable distance

mossy nexus
#

I get the idea of committing to a path

#

because realistically the AI shouldn't know that a new path has opened

foggy pike
#

pretty sure there's a way to set maximum path length right?

#

yea

celest python
#

Ohh you want AI to not use the door in that case?

foggy pike
#

yea if hte player opens the door AFTER they fire the weapon and the monster moves away

celest python
#

Ok

#

Can you check if nav modifiers can be a sub object (as scene component) in BP?

foggy pike
#

ah-ha they can

#

oh a scene component

#

I'm looking at variables hang on

#

ah yea they still can

celest python
#

yeah, so you also need a data object

#

they are fed with that object

#

and that object determines the 'cost' of the object

#

if cost is higher than other options, AI prefer most cheap one

#

Its up to you to change/modify/trigger/create that modifier

#

all 4 is the option

#

you can create the modifier volume dynamically, change the data object dynamically

#

you need to determine when you need to do that, like how will you understand when player is in that situation etc

#

then signal to nearby doors

#

etc.

#

at least this is a starting point

#

you can extend it to moon

foggy pike
#

cool

#

I'll have a look at that, thanks Barusu ๐Ÿ˜‰

celest python
#

๐Ÿ˜‚ Np

faint basin
#

Barusu

foggy pike
#

held off making the joke for as long as I could prayge

#

LMAOOOO

faint basin
#

Nice name change goaKEKW

celest python
#

@foggy pike those data objects I was speaking of were NavAreas btw

#

Nav Modifiers require them

#

they hold the cost data

#

UE has built-in low-medium-high classes

#

and you can colorize them which is awesome for debugging ๐Ÿ˜„

foggy pike
#

ah cool

#

ahhh looks like they can't be scene components ๐Ÿ˜ญ

celest python
#

but that colorization might not appear before u restart the editor (i had fun times with it)

mossy nexus
#

nerds

celest python
#

my bad

#

they are actors lol

foggy pike
#

tragic

celest python
#

do you do c++?

foggy pike
#

oh lord no

celest python
#

then you are also forbidden from subsytem gang

foggy pike
#

wtf that's so sad

celest python
#

well, you gotta find a way to spawn/trigger them dynamically

mossy nexus
#

@foggy pike I would try and see if there's something like OnNavmeshChange and then do a LOS check or a sound check to understand whether the AI could perceive the path change, and only then allow the path to change

mossy nexus
celest python
#

Miezsko and other gods of AI module dont like BP-only devs

mossy nexus
#

the AI module is half assed anyway

celest python
#

They dont like C++ devs either

mossy nexus
celest python
#

๐Ÿ˜„

foggy pike
#

I've gotten by so far!

mossy nexus
#

then I started with a little cpp

#

now I can't stop

#

please

foggy pike
#

heho

mossy nexus
#

send help

foggy pike
#

yea fr I'll learn it as I need

celest python
#

Pls dont be a better programmer than me, at least I'm better than you at something related with game dev @mossy nexus

mossy nexus
#

to be fair though I have a background in software development

#

so itwasn't my first language to pick up

faint basin
#

You seem to know a lot about AI Barusu, so while this discussion is going, I'd like to hop in and ask a question. Could a combat manager for AI be done in blueprints? (Combat manager as in if X amount of enemies is attacking the player, the remaining will sit back and not attack)

mossy nexus
#

but who knows

#

my AI subsystem is a neat 350 lines long

celest python
#

I would counter attack you with my 350 meters of level design but ...

mossy nexus
#

and I think another 175ish for the AI component

#

but I do mad stuff sometimes

#

like I use behavior trees for camera movement

celest python
mossy nexus
#

I lied, it was 365 lines

#

some unimplemented stuff still that I need to do at some point

#

like global alarms

#

but eh

celest python
#

How is your game going on btw

#

Having improvements?

mossy nexus
#

I've been taking a break tbh. not been feeling super creative

#

I kind of need someone to bounce ideas off

#

like I keep having improvements that I need to make

#

but it's all just rewrites

celest python
mossy nexus
#

you'd have to play the game kappa

#

I dunno, perhaps

celest python
#

Have you gotten that far to create a playable demo?

mossy nexus
#

it's semi technical

#

I got a playable first level

#

or used to, at least. I have been refactoring the meantime and not checked if it still is

#

and I want to refactor some systems to get rid of bugs

celest python
#

Are your refactorings mostly include c++ or are you also do crazy replacements with design too

mossy nexus
#

both

#

I have a system of "schools" that I have to figure out how to implement

#

and progress

celest python
#

Literally "schools"?

mossy nexus
#

no as in

#

"magic schools"

#

like different types

foggy pike
#

wtf ph.d simulator

celest python
#

๐Ÿ˜„

mossy nexus
foggy pike
#

(average playtime 35064 hours)

celest python
mossy nexus
#

procgen could really help as well, making nonsense ph.d. writeups

mossy nexus
#

basically the entire game uses a spell system

#

and you use spells for everything

#

like if you get stuck in a dead end? there's probably a spell for that

#

can't talk to someone? there's probably a spell for that

#

and here's the kicker, spells require analog input

#

so more difficult spells are actually harder to input

celest python
#

Can I determine the end of the game by doing a spell in the beginning of the game?

mossy nexus
#

actually, yes

#

but it's a very difficult spell

#

and you'd have to find it and learn it first

celest python
#

๐Ÿ˜‚ I knew you'd thought about this

mossy nexus
#

and it would probably kill you trying to cast it

#

so can I go with... "technically"?

celest python
#

Would be fair

#

What kind of system you use to manage high level layout of the progress in the game?

#

Old school gameplaytag + quest system combo in a subsystem or...?

mossy nexus
#

I use mana in the world for casting spells, and you basically pick it up as you move around. but it doesn't regenerate. however, you can always cast spells even with no mana, at the cost of your health

#

which means you can also cast spells above your level... at the cost of your health

mossy nexus
celest python
#

Sandbox game?

mossy nexus
#

more or less

#

every level is a domain of a boss

#

the boss isn't always out to kill you, but you're kind of trying to get rid of it

celest python
#

Hades intensifies

mossy nexus
#

killing the boss is the hardest option

#

but maybe you can play nice with the boss

#

and the boss will reward you

celest python
#

Can I drive the game by dialogues

#

Just by speaking

mossy nexus
#

there is almost no dialogue

celest python
#

Is this all because of a master plan or just tight on budget ๐Ÿ˜…

mossy nexus
#

I don't generally like dialogue in games, it often feels obtuse in trying to tell a story

#

so I let the world tell the story for the most part

#

I like how dark souls dialogue is

#

used sparingly, but intensely

celest python
#

You are really a fan of that

#

I love talking my way out though ๐Ÿ˜…

mossy nexus
#

it's all about being in the game and staying in the game

#

well get the talking spells

#

maybe that's a way ๐Ÿ˜‰

celest python
#

Was a weird gif

mossy nexus
#

it's very much an experiment as well on how far I can take the concept of a "boss"

celest python
#

aaah spells are the boss

mossy nexus
#

well

#

I hadn't thought of that

#

or I kind of had

#

some spells have a mind of their own

#

but to have one as a boss ๐Ÿค”

#

why not

#

even better

#

have a good spell that is easy to cast be guarded by a boss summon first

#

you have to defeat the spell to use it

#

I like it

celest python
#

๐Ÿง 

#

Nice one

mossy nexus
#

but yeah in one instance there is no physical manifestation of the boss

#

the boss is the level

celest python
#

I'm hyped already

#

honestly

celest python
#

I probably found only documented thing in AI Module

#

FBBKeyCachedAccessor

#

And no one needs to know about it

dense halo
celest python
#

Does NavData->SupportsRuntimeGeneration() returns true when you try NavigationSystemV1->Build?

#

It might be why if its returning false

dense halo
celest python
#

I see

final trail
#

Hi, im trying to make my ai move to a actor in the level, but instead of going to where the actor is, it goes to the center of the map, any help?

misty gale
#

Center of the map is 0,0,0?

dense halo
#

hey, does anyone have an idea where/how ue4 stores generated nav data for when you have disabled runtime generation?

misty wharf
#

afaik same way as with runtime generation enabled :P

kindred moss
#

Hey all, thank you so much for the help you've been giving the last few days...I've managed to sort out all my initial problems ๐Ÿ˜€

#

Where do I look for understanding better how to give my AI unique animations and dialogue once he's moved to a location? Is this on the AI side of things or the interactive object side?

dense halo
kindred moss
#

Here's my current setup. Based on the time of the clock which the user changes whenever they please, I sort through a DataTable I made which has some basic information about the activity such as where it's located in the scene. My first BTTask gets that info. Now I have an AI that moves locations whenever the time/activity changes. Woo, great! But now I want them to start doing stuff like talking and interacting with stuff in that space. I can't show my project unfortunately but I'll post the back end if anyone wants to take a crack. I'm just kind of lost on where to go from here...

misty wharf
dense halo
misty wharf
#

One of those I'd imagine would be it

#

Or at least contain pointer to the data - if you generate the nav data and then look into your actors list, you get the actor which represents it afterall

#

if you delete that actor, the data is gone

lyric flint
#

@dense halo I don't quite see the problem. Actors have a Serialize method. The same Serialize method works both ways to/fro disk. Look at ARecastNavMesh::Serialize for example. Roll your own inheriting from it, or change the source code as you see fit, if inheriting turns out to be too much drama. The Serialize method can handle any kind of possible data you can think of throwing into it, it's really just operator<<, if you have some basic ideas of how serialization works you should be all set.

dense halo
lyric flint
#

I think the chunks are for world partition. Put some breakpoints inside some of the serialize methods, for example on the immediate Super::, and see where the call is coming from. my personal experience mostly is all in Level::Serialize, but the generic idea should still apply :)

dense halo
#

do world partitions have their own nav data actor? I haven't used it before so I'm not sure how it works

lyric flint
#

the key is that Serialize can handle any kind and type of arbitrary data

#

in world partitions I do not use static only dynamic nav mesh

dense halo
# lyric flint the key is that Serialize can handle any kind and type of arbitrary data

I have an octree that I want to save, still trying to see if it's possible serialize it automatically or if I have to save the items and then add them back in individually when loading, but my octree element has a TWeakPtr, is it possible to serialize this?
they are pointers to objects in the level but do you know if it's loaded, it will still reference the same object?

lyric flint
#

is best to use the scientific method. A small controllable sample/environment. As I already mentioned, everything goes through Level:: Serialize. So put the breakpoint there first. Further down in the same method there should be Ar << Actors I'm quoting from memory, so it may be slightly different. in your world outliner you should see all the actors in the level. One of them is the one you need. That's one the one you need to have a Serialize method, with a super:: in it. It has to, otherwise doesn't work :) put a breakpoint in it as well and see what data is about to serialize when you hit the save button on your dirty level. Later, closed editor, opened the editor, load the map in case, and the same breakpoints should it when loading. Previously the breakpoints hit when saving. Compare the data. Does it look the way it should? Tinker with it until it does :D

#

time to hit the sack though, but let me know how it goes

dense halo
dense halo
#

hey, how does UEnvQueryGenerator run asynchronously? it doesn't inherit from AsyncTaks so how does it do it?

celest python
#

You dont always need asynctask

#

Its probably using task graph

misty wharf
#

It's not async that's how

#

It runs all on gamethread afaik but it uses timeslicing to enforce a time limit per frame

dense halo
# misty wharf It runs all on gamethread afaik but it uses timeslicing to enforce a time limit ...

is this the same for UEnvQueryGenerator or only UEnvQueryTest https://mercuna.com/writing-eqs-test/ (says here UEnvQueryTest uses timeslicing but can't find anything on ENVQueryGenerator)

I'm following the example of UEnvQueryGenerator_ActorsOfClass, and just using GenerateItems to get the items from an octree which contains the cover position, I want to run traces to see if the cover is valid given the player(s) so the ai can run to cover, so it makes sense to use a query test to do this right?

#

or should I do this as a BT Task?

misty wharf
#

Whichever makes sense for your project, there's no singular right way to do many things like this

#

having a test for it in EQS could make sense

#

and you certainly can wrap the query in a BT task to make some further decision based on it for example.

dense halo
#

is <FAIDataProviderBoolValue>.BindData(QueryOwner, QueryInstance.QueryID); used to get the value you set when you call SetNamedParam on the query? tried to put a break point but it seems to not be changing from the base value

misty wharf
#

Yeah

dense halo
# misty wharf Yeah

do you know any tutorials or guides that can help me create my own UEnvQueryContext_Querier that returns a UObject* ?

misty wharf
#

I'm not sure if it can do that

#

I think they always return actors or vectors

dense halo
#

๐Ÿ˜ญ

celest python
#

or anything represents a value in the world i.e. vectors

misty wharf
#

It sounds like an attempt to have the context function as a parametrization system

#

:P

#

I guess you could have a custom function on the context which returns an uobject

#

but not sure if you'd need anything else for it to work

#

of course it wouldn't work with any of the existing generators or tests

lyric flint
#

is there a way in Blueprint to Refresh Nav Mesh ??

dense halo
# lyric flint is there a way in Blueprint to Refresh Nav Mesh ??

you can make a c++ function

    UFUNCTION(BlueprintCallable, Category = "Development|Editor", meta=(DisplayName="RebuildNavigationData"))
    static void K2_RebuildNavigationData();

void UCoverSystemStatics::K2_RebuildNavigationData()
{
    FlushPersistentDebugLines(GWorld);
    for (TActorIterator<ANavigationData> It(GWorld); It; ++It)
    {
        ANavigationData* NavData = (*It);
        if (NavData)
        {
            NavData->RebuildAll();
        }
    }
}

that's the way I did it to run it on editor when I needed, you might want to pass an actor or something to get the world

#

@misty wharf @celest python do you guys know if it's possible to pass a list of actors to a EnvQueryTest from blackboard key? My AI basically has an array of player characters that it's aware of at a given moment (not all the players)

celest python
#

blackboards can not store arrays?

misty wharf
#

If you have a context which can read the appropriate BB key you could have the context provide it

#

otherwise you'd have to write a custom test or generator that can read it in some other fashion

#

and also yeah I don't think a BB can contain an array, you'd have to wrap it in a uobject or something first

celest python
#

if you store it in your ai character or ai controller you can check if they are in desired condition to be stored in that array and add

misty wharf
#

one way I can think of you could do it: Get the owner of the query, get its AI controller, get its BB, then read the value off the BB

celest python
#

by casting from querier

misty wharf
#

(this can all be done in a context)

dense halo
#

ok thank you, and yeah I didn't know you couldn't store it in arrays, I have it in my ai pawn right now so I will move it to the controller since it makes a bit more sense

#

I was hoping I could move it to bb and bind it somehow

misty wharf
#

Yeah if you want to store an array in the BB you would have to create an object to wrap it, and then store a ref to that object in the BB

#

this way you can then query the object and read the array off it

lyric flint
dense halo
#

hey, is the queryowner in FEnvQueryInstance& QueryInstance always the ai pawn?

#

like can I be sure that it's always going to be the pawn if you run the query from a blackboard service->run EQS

misty wharf
#

Usually it would be the pawn I think

#

You can set it manually to whatever if you use the run eqs node though

dense halo
charred lava
#

Are there solutions to use a AI Rootmotion based Locomotion system with the Navigation System? I saw this video https://youtu.be/P1ZfIthFcV4 but I dislike how the AI Character turns to the next point before start moving. I thought about using the Motion Warping system to rotate the AI Rootmotion movement to the next destination point, but then he might overshoot a curve a bit and he might get stuck on the corrected path.

#

With rotating on place

#

with motion warping (rotation only)
Update: I guess with more root motion animations for more angles (8 angles) there isn't much rotation to correct with motion warping and with that it's less error prone. Right?

misty gale
#

How about using a spline for the motion warping?

#

Or in general start warping a tad before reaching the current target location...

#

Getting stuck can be a problem tho i guess

charred lava
#

Splines sounds nice, but then I need a system for dynamic created splines that stays in the navigation path, because I don't want them to be created manually.

misty gale
#

For sure

#

I've seen some examples of spline based movement, with pretty decent results

#

In my faint memory this was somehow related, but i realize now thats its not very ๐Ÿ˜…

misty wharf
#

certain contexts like Querier wouldn't really work so well if it wasn't set to pawn

haughty pelican
#

Is there anyway to get an AI to move to taregt points without using a behaviour tree? As im trying to code a FSM to handle my AI?

misty gale
#

Many ways. Interpolation, simulating axis inputs

#

Pick your poison^^

charred lava
misty wharf
#

Or you know you could just use a regular blueprint with Move To nodes

#

which is probably the simplest way to do it :D

misty gale
#

Why keep it simple ๐Ÿ˜„

ocean wren
#

If you're using UE5 you can use the statetree

dense onyx
#

Hey! I`m trying to make my character fly by following specified path. If I set movement mode to flying, then actor following curve, but on surface only, not going up or down. Any ideas how to fix this?

misty wharf
#

If you are using Move To or such, those use the navmesh for navigation and will not fly

#

you might need a custom pathfollowingcomponent for it if you want it to work with moveto, but not 100% sure.

dense onyx
#

this is how it look like now. Yes, I use AImove to. I was trying to turn off NavMesh at all, since I get position from path. But nothing

misty gale
#

Aimoveto on timeline.. hmm

#

Looping even

#

Timeline is tick driven

#

Executes every frame

celest python
misty gale
#

the system seem more designed towards interpolation really

celest python
#

Just setting location would be better

#

Instead of AI Move to

ocean wren
#

Whats with all the people trying to make flying AI?

#

Is that the newest indie thing or something?

misty wharf
#

Good question

#

I sometimes see patterns in questions on programming subreddits and it always makes me wonder did a popular youtuber post about that or something

ocean wren
#

Well, there was a time a short while ago where everything was "how to make genshin impact"

#

I figured something like that again

misty wharf
#

I'd like to see "how to make all the old games zomg played as a kid"

#

Now that's something I could get behind

kindred moss
#

How do I control the speed at which the AI Controller moves its Characters?

celest python
#

Set max speed on character movement

kindred moss
#

Okay, so I set the Max Walk Speed in the Character Component and then let's say I'm using a Blend Space, do I always have to adjust the max value of the Blend Space speed as well to match?

misty gale
celest python
kindred moss
#

Okay I'll look into that, thank you.

celest python
#
    Speed = FVector::DotProduct(ZGOwner->GetVelocity().GetSafeNormal(),
                                ZGOwner->GetActorForwardVector());

    Direction = FVector::DotProduct(ZGOwner->GetVelocity().GetSafeNormal(),
                                    ZGOwner->GetActorRightVector());
#

This way they always be in range of 0-1

kindred moss
#

Okay, sorry I'm a non-programmer but I can read that. Thank you. Let me get this straight. I create a speed between 0-1 and a vector that's unitized as well. Now those values plug into my Blend Space. Does it not matter that the range of my Blend Space is not between 0 and 1/-1 on both axis? Also, does it not matter that the speed axis is the same as my Max Character Speed Range laid out in the Movement Component? Mine for example is currently between 0 and 140cm/s. I'm just confused about how these values all work together. I'm sorry for being a nuisance but I really appreciate your help.

celest python
#

Btw sorry