#gameplay-ai

1 messages · Page 173 of 1

celest python
#

I was also participated in that conversation right? I remember something like this. But my idea was to not letting state machines affect the flow of the BT, and from what I can see your previous method was exactly obeying that rule 🤔 Main problem of BTs, you can not jump from a node to another node like state machines, and default flow logic of BT not helping radically switching behaviors. That's where you integrate different tools into BT's flow, but without breaking the BT's "prioritization" logic.

#

I haven't tried yet but assuming from the docs I read, your previous setup is very similar to StateTree (i.e. selectors on top of the state machines, no sequences or other composites etc.)

visual silo
#

Hmm

#

Yeah it's definitely feeling more difficult to abandon state-like thinking for this. The HFSM on top of the BT definitely was making it easier

#

Without it, I'm trying to implicitely create those same sorts of transitions through the decision logic

#

which I think can have its strengths but it's harder to design

opal crest
#

I can't say if you are "thinking about BT's right", since I'm still not sure if I do 🙂 But, the way I would probably start thinking about this is:

a) When will the agent "care" about sound stimuli?
b) Would the sound stimulus cause the agent to cancel any behaviour?

Then I'd put a 'HeardSoundLocation' into the BB, and add a decorator to a node in the part of the tree where I care, and make sure that the decorator can cancel any behaviour that it should override when it changes. And yes, clear it once it is no longer relevant. (it might help to have an age for the stimulus so that we can ignore sounds that are too old)

celest python
#

I have too many ideas but I'm quite lost between them

#

I wrote and remove multiple times 😂

misty wharf
#

Is there any reason to avoid using BT as a state machine of sorts if it works for you? 🤔

#

I mean it might not have all the fancy features as a more FSM-specific system but if it works it works lol

visual silo
#

Trying to make it respond to hearing something while chasing is mind bending a little right now

visual silo
#

and then I can go back to the state machine approach but also have a better idea of how to do more complex things

#

fuzzy states

misty wharf
#

Ah right, sure if it's for sake of learning why not :)

visual silo
#

The way I'm reasoning about it, it's turning into the same thinking of these nodes as lots of mini-states.

#

that don't really have well defined transition

opal crest
celest python
#

I'd not explicitly define "sound" or "sight", I'd have them as "interesting thing" or you name it. Both visuals, sounds, or other senses should feed a single abstract variable in BT and AI should be alerted in same way. If you abstract it, you can make your AI act more fluid and solve the behavior switching issues a little bit more. And I'd go more task oriented rather than having multiple BT nodes*. That's how Alien Isolation does. I wouldnt have "Attack" node either. It should be a part of your BT directly so you can prioritize it to cancel less important behaviors like investigating etc.

#

BTs can not jump from nodes to nodes so having abstract prioritizations help a lot to manage enter-exit thing between behaviors

visual silo
#
  • So if I have a target, go to it.
  • If i hear something, go investigate... and then start searching?
  • If I don't have a target, and didn't hear something, go to the last spot I saw the player and then start searching....
#

hmm

#

I guess I just need to copy those nodes

#

There isn't a way to have two things go to the same node

opal crest
#

I think Eren is suggesting that "hearing" and last sighted could be the same behaviour. It's just a PoI that the AI should check to see if there's a delicious player hiding over there.

visual silo
#

Yeah, I could see doing it that way. There is a moment upon hearing where the agent should look and go "huh?" which is different than just continuing to chase the player

celest python
#

this could be a BT directly

visual silo
#

Although I think that's where this is breaking down too. Going to the last seen location is really just a patch for... keep going to where you saw the player until you get a new stimulus

celest python
#

But you shouldnt jump between nodes like that or copy them, i guess. I'd try to have them as more prior behaviors in BT and use a service or a BTTask to enable them by discarding current behavior

#

If thats not possible I'd try to copy

visual silo
#

Yep

#

This has been helpful 🙂

celest python
visual silo
#

I think this points to me that I need to work more on the perception side as well to be giving blackboard better data.

opal crest
#

I have a service in my patroller that just gets the current highest priority point to check out. The service is responsible for "remembering" everything it gets from the AIPerception world and deciding which point is most interesting right now. So it's doing all of the interesting stuff like deciding if sight is more important than sound, and ranking by age, distance, and type of target seen. The BT is therefore pretty simple.

visual silo
opal crest
#

Not really. It's just a delegation to make the AIController a bit more general and useful with different units. I don't know if that's the right decision, but it's working for me so far.

misty wharf
#

The main benefit of having those kinds of things in services is that you can use the BT to control when it's doing its thing and such

celest python
# visual silo I think this points to me that I need to work more on the perception side as wel...

I'd think blackboard as memory and support/manage that memory with services, and think your BT flow as "roundtripping" logic, not states. You will switch to attack from search behavior if your AI see any player. And one way or another if your AI wont die, you'll end up switching to search or another behavior again. Try to design your blackboard with values that can support the behaviors with the info, for example if you visit the search behavior 2nd time in a very close time, and in a very close location to previous one your AI can get more aggressive etc.
That's just a mindset in my imagination of an AI, not trying to alter your AI design. Keywords are "roundtripping" "memory" and "services".

misty wharf
#

But it's mostly just a question of whether that makes sense for you or not

visual silo
#

So this BT isn't actually possible with UE's implementation?

#

Since there's no parallel node (that allows sequence & selectors below)

#

This is from that AI Arborist video

celest python
#

Its Simple Parallel

#

But probably not good enough compared to other engine's parallel nodes

visual silo
#

Right, to use simple parallel you'd need to combine all the logic for fire & reload into a single task

#

rather than have the decision logic in the BT

ocean wren
#

Then think about what variables you need to break those different high level priorities apart.. the investigate thing might be "aware of something weird that needs investigating" right?

#

So your condition on your higher priority investigate BT would just read that value as being set to something not null

#

The difference here, is that if that value then gets reset to null.. you don't have to do anything, because the priority will automatically switch back to patrolling

#

i.e. there's no explicit state to have to transition

#

Same for if you spot an enemy, clearly higher priority than investigating something... etc etc..

opal crest
ocean wren
#

Want to hear something funny? I got locked out of DallE2 because I've been generating too much stuff with it 🙂

#

also ran out of my gdrive space saving the results 🙂

opal crest
#

haha. You did melt their 3090's.

ocean wren
#

They basically said "come back in 24 hours" 🙂

#

This is definitely one of those things where we NEED an open source version

#

but the training of that model was around 300k so unless we get some kind of distributed training going, not going to happen

opal crest
#

It seems like with ML, that models have gotten too big for hobby-ists to generate them. Yeah.

ocean wren
#

I'm waiting for microsoft to give me OpenAI access now.. so we can build some extra stuff using cognitive services.. that'll be fun!

opal crest
#

I'd totally lend my GPUs to a GTP3@home effort though.

ocean wren
#

I suspect that'll happen before too long

#

I mean I've got a relatively beefy GPU, but you need NVIDIA/META/OpenAI/Deepmind/Microsoft kind of grunt for these large models

#

at least for training

#

apparently this DallE-2 is estimated to run on an A100

#

so might just squeek into a 3090 with a bit of noodling

#

easily fit on my A6000, but we need it training first

misty wharf
#

There was an article a while back about these AIs and how the training cost being so prohibitive is one of the big problems

#

In that those who have the resources to train them can potentially gain a quite distinct advantage

ocean wren
#

It really is, and allowing people unrestricted access to them

#

This is perhaps the most transformative example I've seen of ML's potential for the creative sector.. its really shit that its not freely available

#

I've been generating storyboards for a new game as an example.. hence why I ran out of credits 🙂

opal crest
#

If training is 'embarassingly parallel' then it ought to be possible to build a global network of hobbyists to train liberated models through p2p connections. Could re-revolutionize the space if it isn't already happening.

ocean wren
#

I hope microsoft buy the rights to it and incorporate it into powerpoint 🙂

opal crest
#

Haha. That would be the one thing that would get me ever use PPT again.

ocean wren
#

Yeah, there are efforts towards that.. but getting people to coordinate is a huge ask

#

seriously, its the PERFECT tool for powerpoint

#

I suspect Adobe will do something like it.. they're big into ML now

#

But then they're shit at dev, so maybe not 🙂

opal crest
#

Clippy, "insert clipart of a dog dressed like a boss, designing a behaviour tree"

ocean wren
#

I mean adobe has an image hosting thing.. they could scrape the crap out of it too

opal crest
#

I can walk to their office and ask them kindly to start working on it, lol.

ocean wren
#

I was generating "aircraft carrier buried in mountain, in the style of simon stahlenhag" 🙂

opal crest
#

It's going to be wild seeing IP rights intersect with this.

misty wharf
#

and the question of how copyright applies to the training data

#

is the product from the AI technically a derivative work?

ocean wren
#

Yeah, the legal stuff is going to be bonkers

#

OpenAI claim ownership of all generated content, but I'd love to see that tested in court

#

especially when you get multiple models up to the same quality (imagen from google recently for instance)

#

One of mine from yesterday

#

And another.. for this storyboard

misty wharf
#

nice

#

my friend was using dall-e mini to generate some parts for some promo images he's making for some new music he's releasing in a couple weeks

ocean wren
#

Trying some different things

#

I quite liked the sort of steel round thingies..

#

One thing that pisses me off, is that it generates these amazing images, but often crops off the heads, or crops part of the round image 😉

#

Like this one

#

I haven't figure out a way to guide the prompt to zoom out a bit 🙂

#

I guess thats why we still have to research what prompts actually do

#

But the point remains, I couldn't in like a trillion years create these images myself

#

Well, not in like a few seconds 🙂

opal crest
#

That's some game concept art if I've ever seen it.

ocean wren
#

Its really compelling being able to imagine something, describe it and see it

#

I was considering posting on indiedb with a bunch of this stuff just to see the reaction 🙂

opal crest
#

Would be incredible if they could return a parameter space explorer, so you could see what was "nearby" but you didn't quite bullseye with your prompt.

ocean wren
#

There are a few things you can do in the interface

#

like you can mask off parts of the image and give it a prompt to generate the masked off areas

#

So for example:

#

That's Jake Birkett, indie guy, posts images like this every now and then on twitter

#

so I asked his permission to try this...

#

So mask off parts and add "post apocalyptic" to the prompt

opal crest
#

Oh, that's crazy.

ocean wren
#

Or change the prompt

opal crest
#

Would that work with any source image? Kind of a hybrid prompt?

ocean wren
#

Yeah, I found it a bit.. picky.. it didn't do well with like full head shots

#

I think it needs sort of enough space to generate the infil

#

There was a good example on youtube.. where someone cropped out a bunch of plants, then generated some ghibli trees, then masked only the trees and generated the terrain 🙂

opal crest
#

Right. It's a tempermental artist, needs enough canvas to express itself.

ocean wren
#

Exploring the prompts and how to guide them will be a new creative skillset, mark my words

#

you CAN ask it for variations though.. like this:

#

So you can find something you like, ask it to add variations

opal crest
#

The secret language thread was really interesting. (that gibberish had a semi-consistent meaning),

ocean wren
#

Yeah, a big part of this stuff is figuring out how prompt weightings work, some keywords nuke my generations 🙂

#

robot basically kills anything good 🙂 cos they pull in a ton of shit looking stock art robots 🙂

opal crest
#

Can you prompt the variation? "This, but sadder"

misty wharf
#

I'd try some other words for robot-like things, like mech or cyborg

ocean wren
#

No, its not quite that directable, you can redo the same prompt and add sad, but then sad might change the overall look a lot

#

yeah, I did try mecha.. lemmie find it

misty wharf
#

I wonder how does it work with non english languages

opal crest
#

Or "gundam" if you want to force a certain style, I imagine.

misty wharf
#

if you used メカ for example which is mecha in japanese

ocean wren
#

Yeah, that might actually work a lot better

#

I used mecha

#

One problem I've got, is that I broke out each image into a directory with the prompt used to generate it.. but i've done thousands of images 🙂

misty wharf
#

:D

ocean wren
#

stuff like that

#

Those were both mecha prompts

misty wharf
#

ロボット or ロボ might be worth a try as well (robot and robo respectively)

ocean wren
#

I'll give that a go tomorrow night when I'm allowed to generate again 🙂

#

Here's something funny..

#

Lookit the hands 🙂

#

For some reason, it really doesn't like female ninja hands 🙂

#

This one here though...

#

I mean that one is fookin nice

#

It really does generate some nice poses

opal crest
#

I'm happy that algorithms also hate drawing hands. There is balance in the universe.

ocean wren
#

I guess training on hundreds of millions of concept art pieces counts for something 🙂 apparently its dataset was 460million image/text pairs

#

I mean its not generating anything NEW, its all derivative.. but I suspect thats like 80% of commercial art, it not more

opal crest
#

So, there's definitely some lab out there trying to tune parameters for doing this with 3d models, right?

ocean wren
#

And frankly, I've seen people trying to charge money for worse 🙂

#

yeah, I suspect that Epic will do it with Megascans once they reach a bigger database

#

But there's already a dataset called shapenet that we use for generative models on 3D objects

#

Did you guys see InstantNerf btw? 🙂 just a heads up.. thats the future of rendering too 🙂

#

I guess I do like the whole dystopian thing way too much 🙂

opal crest
#

It also pairs well with generative art. Discontinuities or a sense of the broken is thematic.

ocean wren
#

Yeah, exactly

#

some of the more.. atmospheric images have that nice sort of "not photographic" thing

opal crest
#

Instant Nerf is way better than I thought it would be. Image based 2d to 3d has come a long way.

lyric flint
#

Can anyone help me understand player controller and player indexes?

ocean wren
#

so it gets the basics, but representational rather than an absolute rendering

lyric flint
#

I don't see the correlation

ocean wren
#

there isnt any

#

player index is just the index of the player in the connected players list

#

player controller is a class that a player uses to control a controllable class (character usually)

opal crest
lyric flint
#

so do you need a player controller for every player?

ocean wren
#

yeah

#

and an AIController for every AI

lyric flint
#

but how does the player controller know which player it is "connected" to?

#

not the pawn, but the actual player

ocean wren
#

Yeah, if you're interested in sort of 3D graphics ML state of the art, look at Michael Neissner's youtube channel: https://www.youtube.com/c/MatthiasNiessner

#

Michael basically has all the top profs in ML 3D generation on his channel, basically records seminars for his students

#

I quite like some of the work by Andreas Geiger

#

and his students obviously

#

Project: https://philgras.github.io/neural_head_avatars/neural_head_avatars.html

We present Neural Head Avatars, a novel neural representation that explicitly models the surface geometry and appearance of an animatable human avatar that can be used for teleconferencing in AR/VR or other applications in the movie or games industry that rely on a...

▶ Play video
opal crest
#

This is great. I have some fun catch-up to do here.

#

This is getting closer to the sort of things I'm curious about: https://www.youtube.com/watch?v=ZqgiTLcNcks

Project: https://lukashoel.github.io/stylemesh/

We apply style transfer on mesh reconstructions of indoor scenes. This enables VR applications like experiencing 3D environments painted in the style of a favorite artist. Style transfer typically operates on 2D images, making stylization of a mesh challenging. When optimized over a variety of pos...

▶ Play video
ocean wren
#

I've got a soft spot for Michael Black's lab and his work.. very similar to my own interests

opal crest
#

AI mediated kitbashing would be a great gamejam/indie prototyping tool.

ocean wren
#

Paper: https://arxiv.org/pdf/2111.02444.pdf

Understanding 3D scenes from a single image is fundamental to a wide varietyof tasks, such as for robotics, motion planning, or augmented reality. Existingworks in 3D perception from a single RGB image tend to focus on geometricreconstruction only, or geometric reconstruction with semantic segmentati...

▶ Play video
#

There's a load of work thats sort of on the cusp of usability

#

things like depth from rgb images.. instance segmentation and voxel creation

#

Thing is, a lot of this work is good for robotics guys too, so there's a lot of interest in increasing sota

opal crest
#

There seems to be a lot of focus on RGB -> 3d.

ocean wren
#

So I'm just on the lookout for stuff we can use in games 🙂

opal crest
#

Which, yeah, robotics and self-driving.

#

But also Camera -> In game model.

ocean wren
#

I'm toying with a prototype over summer, where we generate an Unreal Engine scene from a camera image (i.e. we layout the scene given an input jpeg)

opal crest
#

Though I pity whoever is trying to convince the AI to generate bones.

ocean wren
#

pose estimation is probably the easiest part now 🙂

opal crest
#

Right, for people that assumes a skeleton, and maps input to bone parameters based on image processing?

ocean wren
#

it basically predicts a probability function for each pixel of a given joint

#

classic lib is CMU's OpenPose, but its a bit crap

opal crest
#

I was thinking more of given enough footage of real thing, determine its points of articulation and construct a skeleton.

ocean wren
#

Oh there are those too, look at Michael Blacks lab for that kind of thing

#

look at the smpl-x work

opal crest
#

Man, I remember when I was excited about just estimating Gaze from a camera when the person was wearing IR markers.

#

That was a fun grad project though.

ocean wren
#

Yeah, this stuff is basically easy now.. Google's MediaPipe does a pretty good version and is fun to play with

#

Its not quite mocap quality, but if you multicam some of it it improves

#

Epic gave a megagrant to a company doing exactly that about a year back

opal crest
#

Yes, I have a fonder on my hard drive when I was taking some notes on whether the free tools were good enough to do some simple home mo-cap.

#

Answer was 'not quite' and I wasn't excited enough to revisit my signal processing notes to clean up the input.

ocean wren
#

You want monocular 3D pose estimation

opal crest
#

There definitely look better than what I was able to dig up last year. Still an essential tremor that is pretty common to camera based methods, but there must be some post processing that I could do.

ocean wren
#

Yeah, for sure, you could also add a stability term into the model itself

#

I've seen RL versions doing that to good effect

#

also adding in physical properties like anti-self-penetration helps etc.

#

The jittering is probably the easiest thing to deal with for slower motions at least

opal crest
#

Yeah, the silver hammer I used to use for things like this was a kalman filter, but that's going to make all motions smoother than they probably should be.

ocean wren
#

yeah, there was a filter method that motionbuilder used to use.. but the name isn't coming to me.. something like tubbman or something

#

I'd have to search the literature

#

I'd go for a kallman initially though

opal crest
#

You've been incredibly good at indulging my curiosity 🙂 Thank you.

ocean wren
#

maybe scale the kallman based on joint velocity or something

#

No problem man, I like this stuff myself 🙂

atomic coral
#

omfg

ocean wren
#

We're installing a mocap studio at work soon.. so will get to play with a bit more expensive kit, but I want a monocular thing at home

opal crest
#

Yeah, the prediction parameter is probably going to be "whatever the current rotational velocity is, continue that" so it'll smooth out changes to that.

atomic coral
#

that whole time i think i was instancing the FMyRecastQueryFilter wrong.

ocean wren
#

Oh, that won't help 🙂

atomic coral
#

managed to get the query filter actually hitting the proper filter functions, by changing InitializeFilter

ocean wren
#

Good work 🙂

opal crest
#

👏 🎉

#

Did it require a source build in the end? I never did finish the thing I had that was supposed to annotate paths with the modifiers it passed through, and if your work works without a source build, I might have to dig it up.

atomic coral
#

i'm still trimming it down to a minimal working case, but it looks like to make a truly working custom nav filter, you just need to:

  • subclass FRecastQueryFilter
  • set bIsVirtual = true in constructor
  • override passVirtualFilter and/or getVirtualCost
  • subclass UNavigationQueryFilter
  • set bIsMetaFilter = false in constructor
  • override InitializeFilter to:
Super::InitializeFilter(NavData, Querier, Filter);
opal crest
#

Awesome! That's in my notes now. Incredible work.

atomic coral
#

now to figure out a way to pass info about the pathing entity

atomic coral
#

then the big question is.. how to actually make use of this data

mint terrace
#

that is awesome that it's working

#

can you get to the querier with what you have or

#

actually looking at the polys and understanding the prev/current/next poly relationships will be the meat of it, but before that you'll need the querier I imagine

atomic coral
#

I think it should be sufficient to just store a TWeakObjectPtr to the given Querier at initialization . . .

mint terrace
#

yeah seems fine?

#

maybe I'll do one of these, I have ideas about some runtime cost stuff I'd like to do

atomic coral
#

i'm hoping it'll be sufficient to compare getVirtualCost's pb parameter to the location/rotation of querier, but i'm just getting to checking out the data in pa/pb right now

atomic coral
#

hmm. how to cast the Filter.GetImplenetation() up to the actual class, so I can call a function on it......

#

Casts is erroring i can't convert INavigationQueryFilterInterface to FMyRecastQueryFilter ..

#

FRecastQueryFilter implements INavigationQueryFilterInterface
FMyRecastQueryFilter extends FRecastQueryFilter
Filter.GetImplementation() returns *INavigationQueryFilterInterface
Cast<FMyRecastQueryFilter>(Filter.GetImplementation()) errors 'TCastImpl<From,To,ECastType::UObjectToUObject>::DoCast': none of the 2 overloads could convert all the argument types 1> with 1> [ 1> From=INavigationQueryFilterInterface, 1> To=FMyRecastQueryFilter 1> ]

mint terrace
#

ahmmm is there special casting for this sort of interface cast

#

yeah I think it's GetObject() and Cast<>() that?

#

no wait that's TScriptInterface

atomic coral
#

i shouldn't have to declare that my subclass also implements that interface.. but i wonder

mint terrace
#

/shrug

atomic coral
#

nope that errors that it's already a base-class

#

derp, static_cast is probably the answer, Cast only works on UObjects

#

Things I've never needed to use before for $100

atomic coral
#

lol in the thumbnail version, i thought the category was "mierdes" .. i may need to see an optometrist. But "mierdes" is definitely a good category.

#
QuerierLocation=(X=10840.777 Y=-10312.226 Z=99.159) 
pa=(X=-10840.777 Y=10312.226 Z=10.000) 
pb=(X=-10845.000 Y=10080.000 Z=10.000)
mint terrace
#

off to the races

#

interesting that X is inverted?

#

maybe that makes sense though in the level i dunno

#

oh wait Y is too

atomic coral
#

thanks to some poor souls previous notes in unworking code that Y and Z are reversed in Detour...

mint terrace
#

lovely

#

oh i guess pa/pb are relative to querier location

#

maybe

atomic coral
#

according to the doc for Detour (holy wow, real documentation!) pa and pb are the start position on the edge of the previous/current poly, and the end position on the edge of the current/next poly

#

so, yeah, it does look like to make sense they'll need to be inverted

mint terrace
#

which docs?

#

need some leisure reading materials

#

i just figured it would be documented on getVirtualCost but

#

since thats just a way to override getCost() anyway, this makes sense

#

oh tbf there is a See Also on getVirtualCost

atomic coral
#

((GetActorLocation() - MoveEnd) | GetActorRotation().Vector()) should give me > 0 if ActorRotation is facing MoveEnd, right

misty wharf
#

Probably

#

You might need to normalize the direction tho, not sure

opal crest
#

Dot product should work properly without normalization.

atomic coral
#

i guess GetForwardVector would be better

atomic coral
#

i suspect i'm doing that wrong. i need to do these calculations more than once every 5-6 years to remember how they go lol

atomic coral
#

hmm. it's not having the overall effect that i was hoping for. setting it to go to a target that is 500 units behind him, with three possible exits, one behind, one in front, and one to the side, i expect him to not pick the one behind every time

opal crest
#

Are you only using the dot product? Or are you combining it with the original cost function?

atomic coral
#

multiplying the original cost times 1000 .. but then it applies some hueristic thing since it's a nice big poly that it's on, and reduces that in half or so. i'd still expect that to cost WAY more than taking the shorter path that i'm looking at, though

opal crest
#

I see, so when a path segment heads behind the agent, you multiply the cost by 1k? And it still takes that path?

atomic coral
#

yes. i wonder if there's some way to visualize pathing costs

opal crest
#

You could use debug draw?

#

It could be a mess, but drawing each path segment considered and the cost associated would be readable. (since it should compute the same cost each time, even if it visits the same segment more than once)

atomic coral
#

i'm going to try returning DT_UNWALKABLE_POLY_COST and see what happens.. that should completely eliminate that path from consideration....

#

lol.. ok.. now he turns, walks to it, but won't take it, and now the other exits are invalid

#

... i should probably check that the other exits even work

mint terrace
#

i feel like gameplay debugger should have this (visualization of costs)

#

but for all its power, it kind of misses the boat on that stuff

#

also the gameplay debugger lies-- if you focus a character, then change its controller (Possess), it will report no controller

#

fun fact

atomic coral
#

gotta be something i'm missing out on here - now he's walking to the forward exit, turning and going to the one he shouldn't use, in the same move

#

it's literally pathing him to the far end of the poly then back to the near end

#

i'm starting to suspect my idea is rife with holes that i didn't understand when i conceptualized it, and still don't

opal crest
#

You might need to store the initial facing direction instead of the actor.

#

The navigation system will recalculate from time to time while you are moving.

#

I'd be curious if it works well at drawing a path when you just call FindPathToLocationSyncronously

mint terrace
#

i assume there's going to be lots of cost calculations, from one poly to the next

opal crest
#

since that'll only fire off once

mint terrace
#

so you cant just affect them all

#

at least, the same way

#

youd need to factor in where in the path it is and how you might "plan" that route from where you start to where you want, and then yeah as epigraph is saying, expect that it will recalculate that as the agent navigates the original path

atomic coral
#

yea i'm checking to see if it's doing any re-querying

mint terrace
#

if you executed a single moveto, and just observed what calls getVirtualCost() is getting, i would assume you get 1 call per nav poly boundary

#

so is current where the agent* currently is right now, and prev/next signify the boundary that is being checked? aka, current has no direct relationship to prev/next-- so for all the calls to getVirtualCost() in the first round of navigation planning, youd get current being the same poly/tile/etc and prev/next would be iterating over the nav poly boundaries being considered?

opal crest
#

I've been thinking. If this is really about exits and you only have a player agent, you could do something like "when player enters the room, mark the exit they entered from with a navmodifer_obstacle. (you could use a box collider the same size of the navmodifier to track the last entry the agent took)

atomic coral
#

ok, conceptually, it works, if the front exit is pretty close, he'll take that instead of the rear exit, which is the much closer route without accounting for turning

mint terrace
#

i think the exits are just a way to constrain it to check behavior (during testing)

atomic coral
#

i could make it so that the smart links for entrances and exits close .. but this seems like a much better way once i figure out the thorns

opal crest
#

It is. It's a very cool approach.

atomic coral
#

if it's recalculating on the fly, it's not going thru my filter

mint terrace
#

i think it will only recalculate if needed

#

which would be if the state of the navmesh changes (like modifiers change etc)

#

would also include smart links changing

#

etc

atomic coral
#

hmm.. i don't see how any of the other data is especially useful.. right now i'm just using pb, which is the "end position on the edge of the current and next polygon"

atomic coral
#

hmm.
ok, so. MoveEnd is 'pb'.
Dot is the Dot Product of Rotation and Location-MoveEnd
If MoveEnd distance from current location < 200, then if Dot > 0.8, return maximum cost. If Dot > 0, return regular cost * 10k, otherwise return regular cost.

ocean wren
#

There is a backtracking thing in the nav system btw.. saw it in the docs yesterday, no idea what its about though.. just thought I'd mention I saw it

bleak valve
#

Hi are there any tutorials for neural networking in unreal engine

short smelt
#

Hello everyone, is there a bug on the Move To node in the Bahavior Tree on UE5? I cannot plug actor keys into, only the SelfActor shows up. (Also transform keys)

misty wharf
#

Make sure your object keys have their class set to actor

#

It will not work with transforms, use vectors instead

short smelt
#

Like this right?

misty wharf
#

Click the arrow next to key type to expand it

#

This will let you specify the type of object

short smelt
misty wharf
#

the other arrow

short smelt
#

Ohh

#

Thanks!!

ember sandal
#

hey I am brand new to the UE AI world, so I hope my ignorance isn't too baffling lol. But I have a (hopefully) simple question. Is there a way to do an AI assisted MoveTo without a NavMesh?

misty wharf
#

no

#

you can certainly implement something else yourself but I'm not entirely sure how you intend it to work without navigation

ember sandal
#

my goal is to have ships fly around in space

#

but flying doesn't seem to be what the NavMesh is built for

#

unless I just don't get it

misty wharf
#

Yeah it isn't really

ember sandal
#

so there is no way to get AI assistance in flying?

misty wharf
#

Basic flight in space is quite simple though, just move the actor towards the point over time

#

There is no flying pathfinding out of the box no

ember sandal
#

I see what you mean

#

so I'm overthinking things with this

#

trying to over engineer

misty wharf
#

Yeah it really depends on the specifics. If you don't have obstacles you need to avoid it's quite straightforward

ember sandal
#

yea I don't really have any obstacles to avoid, its just a matter of going from one place to another

#

@misty wharf thanks a lot for the help

misty wharf
#

👍

fossil wraith
#

should i be doing AI in CPP or Blueprints I'm still procrastinating and I just don't know which one I should use as my AI is planning on being complex. ive asked this before but i also just dont know what to do or how to do stuff. Im making a stealth game AI.

Ai functions i need:

Path system

Ai to follow the path

Each Path point needs to have options such as whether it is just a wait type or it does an action and if i choose action it needs to give a list of what actions i can do. and obviously with the wait function i need to put in the amount of time.

Obviously Basic form of detection which i can use the perception system and see if the AI spots an actor that derives from my player class.

And i also want the AI to stop following the path after 1.5 seconds of seeing the player then the ai will either chase the player or go to the players last known pos.

I also want a way to get the AI to notice different things like dead AI (havent implemented yet as i dont know how to do it yet)

misty wharf
#

If you use BT's it's not hard to replace them with C++ based tasks later if it seems useful

#

even if you aren't it really doesn't make that much of a difference and is possible to change later

fossil wraith
#

i cannot find any good tutorial or resource on what i want my AI to do

fossil wraith
misty wharf
#

There's been some discussions on this channel previously about stealth game mechanics and I think there might be some info on youtube but you'll just have to search for it because I don't really know them off the top of my head

#

Most of what you want doesn't sound too complex

fossil wraith
misty wharf
#

I would suggest trying to break down your problems to small parts and then going step by step

#

For example the AI to follow a path and have actions at waypoints, you can just start by making your AI move to a specific point and then make it follow a series of points, and so on

atomic coral
fossil wraith
#

why would you want to move without navmesh?

atomic coral
#

if you're using character movement, or something derived from that, anyway

#

if a walking character finds itself off navmesh, or suddenly flying or falling

atomic coral
atomic coral
bleak valve
opal crest
# atomic coral hmm. ok, so. MoveEnd is 'pb'. Dot is the Dot Product of Rotation and Location-Mo...

I followed in your footsteps and built a visualiser for this approach. It's interesting how rarely the extra weight for direction seems to matter unless you do what you did and mark it as not traversable. If you are going around obstacles you tend to both go with and against the grain, so it balances out. Haven't figured out how to get the prior path segment so I can try to make it about changes in direction and prefer a straighter, if longer path.

ocean wren
bleak valve
ocean wren
#

It depends 🙂 what is it you're interested in doing?

bleak valve
#

I need a neural network for throttle control for my vehicle

ocean wren
#

Riiiight.. in that case my answer is overkillorama for you 🙂

#

You basically need like a single layer perceptron 🙂

#

But just for the record, my recommendation is to make your NN's external to UE and call them from a HTTP request

bleak valve
#

Oh

ocean wren
#

For your specific use case, I'd just hand code a simple NN in C++ and have done with it

bleak valve
ocean wren
#

There are people who'd done plugins for PyTorch and the like, but honestly its too much pain 🙂

opal crest
#

If you had suggested embedding python. I may have rioted 🙂

ocean wren
#

That's a bit of a difficult question.. again it depends on your game

#

Pytorch is C++ too

#

typically you'd create your model architecture in python, then save it and then load the saved model arch in the C++ version

bleak valve
#

So ur recommending PyTorch for this use case right

ocean wren
#

But again, that's totally overkill for a throttle control

fossil wraith
#

wait you can use python with UE?

ocean wren
#

No, my recommendation would be to quickly do a simple NN in C++ yourself

ocean wren
bleak valve
#

Ok seems complicated lol

ocean wren
#

You can use python in the editor

#

But for some mad reason, they didn't enable it for the runtime

fossil wraith
#

so python for editor stuff but not gameplay

ocean wren
#

Which is strange, because another group made it work at runtime too, but gave it up when Epic released their editor only python

#

its weird

bleak valve
ocean wren
#

Epic added python I suspect because its required in the VFX industry

#

Yeah, look on github

fossil wraith
#

blender uses python i know that and I think Maya and Max can as well

bleak valve
#

But I am not sure how do I start

ocean wren
#

Yeah, python is all over the place, hateful language 🙂

#

Pro: can't help you there.. plenty of tutorials out there on the interwebs about pytorch

opal crest
#

Perceptron's are not complicated. The terminology makes them seem that way, but it's really worth coding one up outside of unreal to see how NN's work.

ocean wren
#

what he said.. agreed.. make your own.. its pretty simple

#

you don't need GPT3 for a throttle 🙂

bleak valve
#

I can use tensorflow also right?

ocean wren
#

Yeah, pretty sure TF has a C++ build, but it uses their crappy bloody build pipeline, so probably not UE friendly unless some pyscho has taken the time to figure it out 🙂

bleak valve
#

Ok I’ll start with a basic neural network outside ue

opal crest
ocean wren
#

Again, you can use HTTP requests to an external model.. I'd write a python thing in PyTorch, host it via fastapi and then hit the fastapi with calls via HTTP requests in UE

bleak valve
#

Last question: do games usually use neural networks

ocean wren
#

The reason I advocate that, is that you can test it more easily and honestly its probably a wiser move to run the NN on an external GPU

#

That's a bit hard to explain, but in general, no.

#

But yes, some do

#

Or rather, they do for certain tasks, not always for gameplay

#

A load of games-as-a-service use ML for things like customer prediction, attrition, advertising, fraud detection and the like

#

Some have used them for training bots

bleak valve
#

Oh

ocean wren
#

I use them for cinematography

#

if you search for "GDC machine learning" on youtube, you'll see a bunch of examples

#

Lots of people doing ML for animation stuff right now

bleak valve
#

Thanks for your suggestion

ocean wren
#

actually. Epic just added some ML based animation deformation stuff to UE 5.0.1

#

I wouldn't recommend it as a beginner thing though 🙂

#

The Embark guys used reinforcement learning for balance controller on Ark Raiders

bleak valve
ocean wren
#

so yeah, its kind of a bit niche still

bleak valve
#

It’s gonna be my first neural network

ocean wren
#

In that case, I'd recommend writing your own

#

in C++

#

learn how simple it really is

bleak valve
#

Apparently

ocean wren
#

pfft, its only simple

#

dot products and the like

#

numbers go up, numbers go down kind of stuff 🙂

atomic coral
#

if i don't come up with an acceptable result here pretty quickly, i'm going to have to shelve this work, admit temporary defeat, and go work on other tasks for a while, and probably tackle the problem from a level design standpoint rather than code

ocean wren
#

Well, you can get neighbours from the dtPolyRef, which might be useful

opal crest
#

It might, though I'd really just like to be able to get the current candidate path (if that's even how the alg works). The filter might not have enough info about the state of the search to do that.

atomic coral
#

@ocean wren i'm not seeing anything that looks useful -- perhaps some of the indices/handles to other data might be able to provide further information, but i don't know where to plug them into?

opal crest
#

The we could add a fixed, but non-linearly increasing cost to turns, and let the g term of the A* search nudge the path toward one that takes gradual turns.

atomic coral
#

@opal crest nope, i think the most state information you're going to get there is "here's the poly i'm looking at, along with the previous and next to be considered for this path" .. at least, i'm assuming it's the previous and next for this calculation

#

but without any position information for the prev/next, i don't see how it's useful.. unless one can dig other structures from that data

ocean wren
#

You really need to do a dyjkstra rather than an A* don't you? so that you can determine the cost of routes

#

Just feels to me that trying to do it from heuristic cost is missing something

atomic coral
#

That may be right -- I've honestly never researched pathfinding, what's been given to me in Unreal has always been sufficient before, with a little nudging here and there. Definitely implementing a whole thing like that would be out of scope. The time I've spent on this already is out of scope, but I thought it would be worth it for future exploration also

ocean wren
#

Well, its good to learn this stuff 🙂

opal crest
#

My intuition is that there isn't any difference between adding g (path cost) to discourage a route because it's difficult terrain, and adding g to discourage a route because it has turns in it.

#

h definitely needs to remain untouched (since it measures how close you are getting to the goal).

ocean wren
#

You might be right.. but my pathfinding spider sense is tingling

opal crest
#

Yeah, and this is definitely weird territory.

atomic coral
#

well if nothing else, i've sent some people down a .. erm... path.. of discovery 🙂

opal crest
#

One thing I observed is that because the total angle to get to a place, if you don't have a maze, is generally the same between two routes. So just adding up the angles and assigning a cost doesn't change the result.

#

Which is why increasing it non-linearly seemed like a solution, since it would penalize sharp turns more than gentle ones.

#

But then the topography of the navmesh would start to matter quite a bit.

#

It might just be that we want to only penalize the angle of the first segment, so that the character doesn't head straight back, and then otherwise score it normally.

#

But yeah, it's been fun revisiting classical pathfinding because of this Q 🙂

atomic coral
#

honestly, since we're traversing a link and transferring control to a different BT Task, immediately after hitting the end, we're doing another pathfind anyway, so I don't expect long paths to matter too much

#

hmm. not sure if this is useful, but once the exit the ai is facing becomes farther away than the one it's not facing, then it will start backtracking to the bad one

#

the mindboggling part is it walks all the way to the good one, then reverses

ember sandal
atomic coral
ember sandal
#

No I am not. and thats why I'm sure I'm doing things wrong. At this point I just have a blueprint class derived from the Pawn class. And there I have a custom Playercontroller attached

atomic coral
#

ok, my experience is using AI controlled pawns that are derived from Character, and use CharacterMovementComponent

ember sandal
#

ahh I see

#

I think thats where my gap in knowledge is. I don't have any "characters" in my current game just ships and vehicles

#

I am now feeling like I have gone about everything wrong

misty wharf
#

MoveDirectlyTowards might work for floating pawn movement or such

#

There's no reason for it to be a character if it isn't a character

#

imo

atomic coral
#

ok i'm not familiar with what is and isn't in the MovementComponent, but I do know that there's a lot of psuedo-physics handling over in CharacterMovementComponent

misty wharf
#

Yeah, if it's for moving spaceships it seems like kinda pointless :)

atomic coral
#

right, but something like the Flying movement mode might be useful to look at. I'd wonder if the AI movement stuff has a soft dependency on CharacterMovement.. like.. not a real dependency, but it doesn't actually work without it

ember sandal
#

hmm I see

misty wharf
#

iirc it doesn't specifically require CMC, it uses PathFollowingComponent

#

But I think it requires some variety of Movement Component

opal crest
#

You can derive from Pawn Movement Component, but you will be doing a lot of the work yourself.

atomic coral
#

that does sound correct, but also the MovementComponent might have no idea how to move the Pawn to comply with the PathFollowing

misty wharf
#

Yeah

#

FloatingPawnMovementComponent might be able to, ProjectileMovementComponent might not :)

atomic coral
#

i'm.. also talking about things i only have a cursory understanding of, as all of my recent work has involved already existing characters, so my knowledge is incidental to my experience

ember sandal
#

this has been an incredibly enlightening discussion for me

#

I wasn't sure which direction to move in, but I think I know what to do now

opal crest
#

FloatingPawnMovementComponent is a good start for spaceships, though you'll need to add logic for turning, etc...

ember sandal
#

sounds good because thats still a better place to start from than where I am now

atomic coral
#

oh, there actually is a FloatingPawnMovementComponent 😮

opal crest
#

I don't remember if it responds to AIMoveTo properly though (even if your pawn has an AIController)

atomic coral
#

I really miss having an editor that can easily do "Show me all child classes of". Boggles my mind that that is lacking from everything

#

hmm. even setting that cost as unwalkable... it still applies the heuristic, which reduces the cost, which makes it not ignored..

opal crest
#

Yeah, ultimately it's going to be balancing 'distance to goal' with path cost, and taking the greediest option. Weird that it overrides unwalkable though.

atomic coral
#

it's in the 'special case' in the function that calls getCost, for the last move in the path.. since it's also the only move in the path

#

i think

#

my getCost is only being called twice in this test level, one for each link out of the poly the AI is in

#

at least until the AI gets to a larger navmesh area

opal crest
#

I see, so there's really only one nav poly.

atomic coral
#

effectively, yes. it's standing on a poly, that has a pair of navlinks out of it

opal crest
#

And it's just trying to find "out", and somehow that ends up just being 'closest' because of the special case for last move.

atomic coral
#

The 'pb' that i'm getting for each call is the exact location of each of the navlinks entry points

opal crest
#

That makes sense. It's normally drawing a path from the entry point of the poly, to the center of the next poly and pb is the point on the edge of the poly that intersects, and with the navlinks case, I guess that's the navlink location.

atomic coral
#

i take that back, it applies the heuristic, but then hits the continue anyway, because it's comparing the unwalkable score to the variable pre heuristic

#

so.. why the hell is it going there?

ocean wren
#

It intersects each neighbour edge and gets the cost from those

#

then once its got the costs for each edge, it does the funnel algorithm based string pulling

atomic coral
#

can you point me in the direction of what code you're referring to?

ocean wren
#

goddam it.. gimme a sec 🙂

shadow furnace
#

Any built in ways to cull unreachable navmesh islands?

ocean wren
#

Not that I know of

#

All of this is within FPImplRecastNavMesh

shadow furnace
#

I guess I get to implement it

#

Weee

atomic coral
#

@shadow furnace are you wanting to remove disconnected mesh bits from the built data?

ocean wren
#

There might be a function on the Recast implementation.. there's a few functions that sound like it

#

Just don't know if any of them are made available to UE

#

This code is kinda crufty 🙂

atomic coral
#

hmm. there are facilities for disabling string pulling, but i don't see any way to Get There From Here

#

oh, there it is in the path following component

#

oh, nice, we already extend from CrowdFollowingComponent, so i can just add a new condition to disable string pull. maybe that'll help

#

nope

ocean wren
#

Hahaha.. classic unreal engine "maybe that'll help"... "nope" 🙂

#

Sweeney giveth and he taketh away

atomic coral
#

i would expect if they aren't connected, they're not going to be considered anyway? at least, usually

ocean wren
#

I guess you can walk the navmesh and just alter the polyref's so they can be filtered

atomic coral
#

ok i am actually going to shelve all of this mess, because all of this work has had zero change whatsoever to the actual behavior in game. only minor changes in a test environment

ocean wren
#

Its a learning experience, get used to it

atomic coral
#

yeaaah i've been doing this for a number of years. i just hate every time i have to put something onto a shelf never to be seen again

shadow furnace
#

I suppose a simple "is reachable" check would suffice

atomic coral
#

ooooh

shadow furnace
#

Yeah, I should be more specific

ocean wren
#

Could you teleport and just look for the closest point on the navmesh next to the teleport target?

#

You can do a navmesh raycast for the direction of the teleport

atomic coral
#

i'm not domain familiar with EQS, but I'd try an EQS check with an is reachable test, rather than going through trying to eliminate disconnected bits before hand. That's probably the more reasonable method.
If you'd like, though, I have just figured out how to implement NavigationQueryFilter and you can use that to filter out

celest python
#

What does "search start/end" means for BT nodes?

#

What is a "search"

misty wharf
#

iirc "search" is when the node is active and the BT is "searching" for the next node to execute below it

#

so basically it should start every time the node becomes relevant and and end as soon as it stops

celest python
#

So like second state after "activation"?

misty wharf
#

Yeah something like that. Best to look at how the code is ran tbh

celest python
#

Gotcha, thanks

celest python
#

Is there any way to make BT wait for a node to abort itself before switching to another node?

#

Recently I started to think Abort function being synchorous is almost root of every problem I'm having in BTs

misty wharf
#

I vaguely recall looking into this as well but unfortunately the answer seems to be no

celest python
#

Damn sad

misty wharf
#

You could potentially have it set up so that you run abort logic in the controller or pawn, and have another node which waits for it to finish

#

or run abort logic separately in another node, or something

#

there's a few options like that I guess, depending on what it is you're aborting and how the rest of it works

celest python
#

I'm trying to make my AI switch to a specific behavior smoothly without cancelling everything instantly, but over the time I end up using FSMs for that rather than BT and I think I'm doing something wrong or BT's really not that efficient.. Probably I'm doing something wrong because whole industry using it

misty wharf
#

BT's aren't the answer to everything

celest python
#

I can also make sense aborts being sync because over the time conditions can change dramatically and you also have to manage the "aborting" state inside the tasks but.. 🤷‍♂️ It's ending up on choosing your poison

celest python
# misty wharf BT's aren't the answer to everything

Over the time I start to approach them to more of a high-level layout of AI rather than a complete solution because 99% of the time I find myself needing to find a workaround for the issue I'm having and any workaround I find break the flow of BT

#

And over the time I start to feel like game AI is a very tacit knowledge

#

Like level/game design

#

Something you cant learn from books/articles/any other resource and only experience

misty wharf
#

Hard to say yeah

#

I think some type of patterns book would be helpful in theory

#

Eg. here's BT's, here's a bunch of things they're good for, here's a bunch of things they might not be good for

#

here's FSM's, etc.

celest python
#

Yeah, I wonder how AI people being recruited these days with this amount of lackiness of resources for those things

misty wharf
#

I never really looked at what kind of books and such are available for this kind of general purpose gamedev stuff... there's a lot for programming in general about just general purpose language/framework agnostic stuff

celest python
#

There is Game AI Pro 360 book, but I can say it's not really providing solution to real issues of the tools from what I read yet

#

But they show some real world examples from AAA games

misty wharf
#

haven't gotten around to reading any of it tho lol

celest python
#

I strongly recommend it though 😄

#

Its very helpful

lyric flint
#

IS there a way to accomplish a "one time event"? So for example, I have a bool called CanSeePlayer and whenever my ai perception senses the player, I want it to do a one time trigger, for example play spotted audio and maybe a dialogue line, then reset and do it again next time the player is seen

misty wharf
#

Sure, just trigger it from when the player is spotted

#

successfully sensed will be false for events where LOS is lost so you can use that to check

#

perhaps also a timer to make sure it doesn't keep happening too often if sight is only lost for a moment

mint terrace
#

can I just say #gameplay-ai has been lit lately, love to see all the activity in here

celest python
severe cypress
#

Is there any system readily available that can do hundreds of AI without completely obliterating performance?

ocean wren
#

Mornin all..

#

There's some new GameAIPro style books being written too.. but won't be done until next year

shadow furnace
#

Or roll your own

viral elm
#

is there any documentation for this?

#

otherwise I suppose I'm gonna have to read through these?

misty wharf
#

Usually the answer to "is there documentation for this" is "no" even for things that have existed in the engine for a long time

#

Sadly :P

ocean wren
#

That'd be a biiiiig NOOOOO 🙂

viral elm
#

😔

#

damn

#

Coming from unity and especially python, where everything has a documentation this is a change

ocean wren
#

You could always learn it all and write documentation for it..

#

python docus are terrible though, unity is better

#

But yeah, Epic have form in regards to poor documentation

viral elm
ocean wren
#

Yeah.. can't argue

misty wharf
#

You can sort of go through the code usually to get the same level of docs as unity has

#

although unity docs do sometimes have at least a few samples

ocean wren
#

Yeah, at least they show you some examples of functions in use

misty wharf
#

for many engine bits you can search for usages to see how things should be used, but it might be harder for something like AI stuff :P

viral elm
ocean wren
#

Yeah, if its blueprint and art related, you're golden

misty wharf
#

I think that plugin is almost brand new which is why

ocean wren
#

Well, its because it was a weekend project for one of the guys at Epic, hence the experimental tag

#

What is it you're after doing?

viral elm
#

still a shame you can't even find a mention of it anywhere 😅.

anyways, I'll try my best to read the code

ocean wren
#

There are plugins on github

#

For random pytorch stuff

#

and TF

viral elm
ocean wren
#

oh 🙂 ahahahaa... yeah no, doubt that you'll find good examples of that

#

Hoping a student of mine tackles that this coming year.. but haven't come across anything

viral elm
ocean wren
#

yeah, you'll always have to compile them yourself..

viral elm
ocean wren
#

MLAgents was pretty crap too though 🙂

viral elm
#

i gues I didn't go enough in depth on it then 😅

ocean wren
#

One of my undergrad students used it for a project.. I mean it "worked" but it wasn't "nice"

#

As with many things in games, ML gets no love.. usability is kind of shocking

#

Plenty of work still to be done. With RL in particular

misty wharf
#

I wonder how hard would it to be to make your own weather AI 🤔

ocean wren
#

The guys at Embark rolled their own tech for it.. which is what I'm doing. Building a kubernetes cluster for training etc.

misty wharf
#

There's a website which shows rain radar stuff and you can usually predict if it's going to rain in the next hour or so by just looking at it

viral elm
misty wharf
#

the weather report usually just says "yeah it's gonna rain today" and not if it's gonna rain in the next 1h or so which would be more useful to know

ocean wren
#

We were doing level generation for this student project.. I mean it worked in a notional sense, but he was comparing different methods and some of them didn't seem to function

#

The aim was to look at learning by demonstration

#

Anyway, if you're just interested in RL then maybe that experimental thing might serve you.. haven't looked at it myself

#

But for production stuff, you'd be better off rolling your own kubernetes based training

#

kserve and all that

#

kserve->kubernetes->k3s->k3d

#

containerised python code, running in kserve on kubernetes cluster running on k3s in a k3d container 🙂

#

etc.

#

Basically, MLOps 🙂

viral elm
ocean wren
#

Let us hear how you get on

viral elm
ocean wren
#

Its "the future" 🙂

ocean wren
#

goddam exploring Dall-E prompts is just too much 🙂

#

Trying to see if "Cyberpunk Zealot" overpowers "Studio Ghibli" 🙂

misty wharf
ocean wren
#

Apparently Studio Ghibli stands no chance against cyberpunk warrior 🙂

#

I am trying princess mononoke, but it might need the big guns.. totoro 🙂

uneven stratus
#

Does anyone know a good tutorial for making your own AI movement system that uses the navmesh? Characters are too expensive for my purposes and Floating pawn Movement don't give me enough control

misty wharf
#

You could just look at how CMC works and pick the bits you like

#

Basic character movement doesn't need much more than just a gravity force

uneven stratus
#

That would probably be a good place to start

#

Although I'm a little intimidated by all the complex code that works with replication (I don't need replication in this case)

misty wharf
#

Yeah I mean if you want to keep it as simple you can basically just have a movement force and a friction value

#

have it tick and it applies the force as movement on tick, and applies friction to slow it down if it's grounded

#

I implemented quake 3's movement code in unity at one point, their code is free and not too hard to follow

uneven stratus
#

Yeah that sounds like a good idea, I'll go take a look at that!

stiff linden
#

Okay, so I need some pointers of what I fucked up. I started of with the TopMap sample project. All was fine, the Navigation worked, Even an AI Move To node worked. But then at some point I changed something and now no ai movement at all works, except MoveToLocation but only when I turn off Use Pathfinding

#

My NavMesh is still there, visible by pressing "P"

#

Oops. I take it back, AI Move To does not work in that sample project

patent hornet
#

players don't have those

stiff linden
#

Right. So I guess to summarize my problem: AI Move To or any of the move to functions don't work. The character does not move at all, no log outut, nothing

#

The class is a child of AIController

ocean wren
#

Did you try delecting the navmesh volume and readding it?

#

deleting even

quick current
#

In EQS, How do I put a custom circle center ? I want to put to the location of a Target Actor.

misty wharf
#

Create your own EQS context which returns the actor you want

quick current
misty wharf
#

With some difficulty

#

EQS is not very easily parametrized

#

Your context can read the value from for example another actor or some other location to return it

quick current
#

Alright, if I understand correctly, it's going to be difficult to do this. My Target Actor is however present in a blackboard

misty wharf
#

One way which might not be too bad would be doing something like have your context get the querier

#

you can store the target you want in the querier, or you could even get the querier's controller and read it from its BB

quick current
#

Ok thanks a lot. I'm going to try this

#

BTW, I found a really good tutorial serie for AI, it's pretty advanced :
https://www.youtube.com/watch?v=6AiCpXOlrdE&list=PLNTm9yU0zou5y0cWEz59BQnHd0c6fC2XZ&index=26

Project Files: https://www.patreon.com/posts/62412743 .
This is the 28th episode of Unreal Advanced Locomotion System based shooter series. In this episode, I am going to start working on team-based AI vs AI combat system. Here, AI characters who belongs to different teams will be able to detect enemies from different teams and engage in gunfig...

▶ Play video
fossil wraith
#

Hey everyone im making a AI path follow system but i am so stuck

#

This is the blueprint i am making its a mess and i think its all wrong but i dont know hwo to fix

#

This is the Function that im calling

void UPathFollowerComponent::GetNextWaypoint()
{
    if (CurrentWaypointIndex == Waypoints.Num() - 1)
        CurrentWaypointIndex = 0;
    else
        ++CurrentWaypointIndex;
}
misty wharf
fossil wraith
misty wharf
#

so execute AI never runs?

fossil wraith
#

it is but i dont think I am getting "target" correctly

misty wharf
#

it's pretty hard to say because it isn't visible where it comes from

fossil wraith
#

Am i even doing the general code correctly?

misty wharf
#

I mean the basic idea looks correct

#

You need to debug it more than just "I think"

#

Use print nodes nodes to see what values are being set into the variables and where the code is actually going

fossil wraith
#

yeah i just tried and the Target is not getting set

#

but i dont know how to make a call to the component

misty wharf
#

Okay, so where does the target come from?

fossil wraith
#

its a reference to my path follower component because thats where the functions are

#

Should the functions really be in the waypoint actor?

#

this is what im trying to do for context

misty wharf
#

The ones that are shown in the screenshot probably not

#

so Target is UPathFollowerComponent?

fossil wraith
#

yes

misty wharf
#

Where does it get that?

fossil wraith
#

I dont think it does and i dont know how to

#

ive tried making a function that returns a pointer to the component but that didnt work

misty wharf
#

Right

#

The component is on your guard npc I take it?

fossil wraith
#

yes

misty wharf
#

In that case what you can do is cast controlled pawn into your guard type, then get it from that

#

or you can do a get component by class from controlled pawn

#

either way should work

fossil wraith
#

and the Behaviour tree this task is on the AI controller which is controlling theNPC

#

english failed me

fossil wraith
misty wharf
#

the basic idea is good you just need to debug it and fix it

fossil wraith
#

i know you cant see but im confusing myself like mad

#

OMG I COULD HAVE A FUNCTION TO DO THE CHECKS

#

isntead of spaget code

misty wharf
#

heh

#

having it as a function isn't going to make it work if it doesn't work at all tho lol

fossil wraith
#

i think because im using so much spagetti code it is breaking my brain therefore breaking the cod

misty wharf
#

:D

#

Did you get the casting working for getting the component?

fossil wraith
#

yes

#

The character moved to the first point

#

i just need to fix the looping

#

then i realized i wasnt incrementing the array

#

of waypoints

#

but my code was so messy i didnt know where to put it

misty wharf
#

Ah

#

It might make sense to set it up so that you have a function to which you pass the current waypoint

#

and it gives the next waypoint it should go to from that one

#

this way you don't need to keep track of the current index, and it will work regardless of what waypoint you start at

fossil wraith
misty wharf
#

Wouldn't it make more sense if it returned the next waypoint directly instead of just the index?

fossil wraith
#

so make it return a waypoint actor instead?

misty wharf
#

so you can do something like move to waypoint -> get next waypoint -> move to waypoint...

fossil wraith
#

@misty wharfis it better that im using components rather than throwing everything in the AI character class and should i keep using it So i can make like chase component and like kill player etc as some enemys cant move and some cant kill

misty wharf
#

If it makes sense to you, sure

fossil wraith
#

well as im going to have multiple types of guards i would have thought it would have been a better workflow

misty wharf
#

It's a bit hard to say whether it's the correct way or not, because there are many ways of doing these things, and whether it's good depends on how you want things to work

fossil wraith
#

im mainly worried about optimization and performance too

#

which i guess i can profile that at a later date

misty wharf
#

Actor Components should be fairly good. Scene Components will affect the performance of moving things as they need their transforms updated when moving

#

But in general unless you have hundreds and hundreds of characters moving about, you're unlikely to see scene components being a problem

fossil wraith
#

I dont plan on having massive levels (I suck at level design and i am still thinking of how i want my levels to be

#

but my plan is for my game is having an angel thats fallen from heaven by accident and has to sneak their way back to heaven and humans hate angels so yeah

fossil wraith
#

Apparently it cannot get to the waypoint

#

Just worke dout why its because every time my task runs its reseting the Array

#

Okay so i need to have the array on the NPC?

#

How should i se the initiall variables should i have like a manager of some sort?

#

because its resetting every time the code executes

#

@misty wharf sorry to be a pain again what should i do here?

misty wharf
#

You probably should store the current waypoint somewhere else than the task

#

that way you can then read the current waypoint in the task to select the next one

fossil wraith
#

or do i just make a function in the component that is like "get current waypoint"

#

thats probably the best bet?

misty wharf
#

Yeah you can just store it where ever it makes sense, could be in BB, could be in ai controller, or in the component

fossil wraith
#

black board would probably help in the future when say i do my chase stuff when it returns to normal?

#

however i think quite a few of the variables only need to be set once at the start then just updated

normal mist
celest python
ocean wren
#

So filtering in this case would just check if true and enable specific behaviours to check if that were the case

#

imagine something like having ammo being a filter for all of your weapon handling logic

#

So its a boolean selector in a behaviour tree.. or a node in a decision tree, or a conditional value in a utility system

#

The "broad phase" thing just means at the topmost logic level.. before you get down into the details

#

You'll often hear of broad phase and narrow phase.. typically in physics, where you do a sort of higher level object sorting as broad phase, then individual overlap tests as narrow phase

normal mist
#

wow, thanks a ton @ocean wren

gritty peak
#

Hey I am having an issue with my ai. When i spawn them in have a them patrol on a lane. For some reason certain enemy types do this fine where others get their navigation aborted. The odd thing is it only happens on one level. any idea why this might be happening?

bronze wagon
#

My behaviour tree is crashing the editor and I cannot figure out why. It’s been happening since last night and I lost several hours of work due to it. I spent today setting up perforce and making commits before each run now. I’ve gone over the blueprints over and over but cannot find the issue.

#

First it was a memory exception and now it is an array out of bounds exception

#

I’m using arrays but only for each loops

#

Not sure why it would crash the editor instead of the PIE and give me a hint on what is happening.

#

Seems random but it doesn’t take long to fail

bronze wagon
#

I just stepped through every line in the code and have a breakpoint at the begin of every task, no issues. yet it crashed after the node was complete for the first time. it is a looping branch

#

looking at the unreal source it looks like it is the debugger itself crashing

ocean wren
#

It could be that you're stomping memory and its just appearing in the BT stuff. Try and isolate just the bit of functionality. So maybe copy your BT into an empty level with just what you need to make the BT function and debug it there.

#

Essentially, you need to make a reproduction case before you can fully debug stuff like this

#

Also, consider what assumptions you've made, check if they are true.

keen crow
#

why does the pathfinding test discard actors that are reachable? is it something about the fact the actors root location is in the navmesh gap?

keen crow
#

it seems it has to do something with these properties of navmesh. I tried lowering them for some other actors and it broke pathfinding for another actor...

mint terrace
#

well if the actor is in a gap between navmesh then it's not reachable via navmesh

#

I'll be here all night

bronze wagon
#

no crashes yet

keen crow
misty wharf
#

I've had this same issue

#

I solved it by just having it check path to front of the object instead of to the object's location

#

Of course for me that works because the objects have a clear "front" which must be reachable for it to work correctly, but for something else it might not I guess - I'd imagine there should be some kind of way to do a custom reachability check where you can test distance to the final location

mint terrace
#

i mean---- if they are not supposed to move, but also do not block navigation, then Can Ever Affect Navigation set to false might be the right call

#

if the actor is supposed to move, and you're doing dynamic navmesh generation, then yeah thats a pickle

misty wharf
#

I don't think not having it affect navigation is the solution though

#

If it doesn't affect navigation, npc's would try navigate through it which would obviously not work

mint terrace
#

I don't know what the target is for, I guess

misty wharf
#

Yeah I mean it would in theory work for that, but for example if an NPC needs to walk past it, it wouldn't be able to avoid it being there if it doesn't affect navigation

mint terrace
#

yeah assuming it's an actual thing to be avoided

#

/shrug

#

looking back at that screenshot I'm not sure it is something to be avoided?

#

more like a destination for ai to take cover or something (red circled part)

misty wharf
#

Well yeah, but even if it's intended as something like that, you'd walk up to it, and then if you'd decide you need to walk to something on the other side of it, you wouldn't be able to because you'd get stuck on it if navigation was disabled on it :)

mint terrace
#

if you disabled affects nav the navmesh could generate beneath

misty wharf
#

yeah but if you tried to move to something which is on the opposite side of it and navmesh was generated under it, the npc would just attempt to walk through it

mint terrace
#

yeah that's true

#

there are reasons, but then I'd wonder if making it higher cost would be better

#

then navs through it could be controlled, but navs to it's point would be valid

misty wharf
#

Good point, I guess as long as its movement cost was sufficiently large that it would never make sense for an npc to attempt to "shortcut" through it it might work

mint terrace
#

yeah tuning would be needed there

#

but if you are naving directly into a high cost area, then no other path would suffice anyway

#

would always be higher cost

#

so whatever cost necessary would work, assuming this didn't kill other pathing flows

#

if it's a cover spot, most times you don't want any AI transiently going in there or else face awkward RVO avoidance

#

or worse, detour crowds 🥁

strange blade
#

Hey anyone played much with generating splines? I'm trying to get my ai to do some 'dinosaur movement' behaviour, and get them to follow a spline! Unfortunately the spline I generate from path points along a navmesh suck and was wondering if anyone had any suggestions to be able to get a more smooth transition?
Repost from #blueprint but was told it might be a good question here? Also worth mentioning I'm trying to achieve this with blueprints hehe

mint terrace
#

ok so

#

you're selecting some points along the spline to generate?

#

what if you produced the point on the spline to generate over time with a timer or a relaxed tick, and then fed that into blackboard with observe blackboard value

#

youd be able to control the resolution of the calculation, and observe blackboard value woudl allow moveto's to the point to update on the fly

#

should allow you to control the tradeoff of cpu vs accuracy of moveto along the spline

#

should be plenty doable in blueprint

strange blade
# mint terrace you're selecting some points along the spline to generate?

Interesting, im looking into a way to produce this now. I'm currently using 'find path to location synchronously' and generating my spline based off those points. Would it also be possible to get the length of that spline and generate say 10 points across that spline with point 0 at the root, 9 at the final length, and then spread the remainder across the rest with equal distance apart?

mint terrace
#

if blackboard doesnt work for you then direct find paths are obviously needed, but telling the AI to just navigate to a position with blackboard/behaviortree might be what you are looking for [using observe blackboard to update pending move-to's on the fly]

#

thats the most obvious path. if you are already invested on direct findpath calls, then maybe use the async version and interrupt it as the up to date point along the spline changes

#

im suggesting ticking at a low rate to select these points along the spline as the current game time increases

strange blade
#

Thanks I'll investigate the behav tree approach! I'm still quite fresh to using them so I have a bit of a learning curve to understanding good practices and such.

mint terrace
#

you can do a lot with it; its easy to think that its janky because moveto has to complete to the original position you requested and that you cant change that, but you can

strange blade
#

will that moveto just be updated when the blackboard position changes?

mint terrace
#

if you have ticked "Observe Blackboard" then yes

strange blade
#

Interesting! I'll check that out-

strange blade
mint terrace
#

generate the spline points you mean?

strange blade
#

yes!

mint terrace
#

that part is the hard part 🙂

#

some code or some such to do it 🙂

strange blade
#

ha, I thought as much :p

mint terrace
#

recently we discussed a way to override how navigation costs worked at a core level to do something similar to this (limiting the required angular change of navigation paths to be minimized)

#

but that is pretty intense, and since you are intending to go for splines to generate the path ahead of time, i feel like it can be done without that level of difficulty

strange blade
#

I see, I was hoping that this way would get what I wanted (or close to it) without going through too many hurdles

mint terrace
#

there's also something to be said for just modifying the maximum rotation on the character movement controller

#

i think in theory its supposed to somewhat respect it

#

ymmv

strange blade
#

I was able to achieve the effect I wanted with 'add movement input' nodes to move if pawn see's player, and if not rotate and move until it directly sees player again, but sadly it had no accountability for path finding so that wasnt too helpful in the end :p

strange blade
#

Trying to move this fella becomes a bit more obvious sadly

#

But thank you for the help and pointers! It's definitely pushed me towards a better direction! I'll report back if I get anywhere with this! 🙂

mint terrace
#

yeah it's not easy getting cmc to mesh with realistic simple rotations

fossil wraith
#

AI is torture ISTG

keen crow
severe tangle
#

Can I somehow inherit from DetourCrowdAIController, because of the avoidance logic already implemented, and use it inside my own AI Controller?

misty wharf
#

It's not exported so no, but if you look at how it's implemented it's extremely simple and you can just do the same thing in your own AI controller subclass

#

<@&213101288538374145>

#

It's been a while since I've seen one of these, used to be a lot more common it feels like or maybe I've just not been looking when they get posted lol

fair zealotBOT
#

:no_entry_sign: tagamedeveloper#8802 was banned.

night hazel
#

yeah

#

slight uptick recently

#

but it has been far fewer than they used to happen

misty wharf
#

It's good to know Discord is finally maybe doing something about it

fossil wraith
#

Zomg

misty wharf
#

Oh boy

fossil wraith
#

<@&213101288538374145>

fair zealotBOT
#

:no_entry_sign: blob#4362 was banned.

fossil wraith
#

My gawd

night hazel
#

i just tabbed away

misty wharf
#

lol

night hazel
#

and it happened again

misty wharf
#

they're back with a vengeance

fossil wraith
#

Zomg do you know why my location isnt updating and is this even correct?

misty wharf
#

Is it supposed to update the BB value or?

fossil wraith
#

yes and i just realized thats the old code

#

<@&213101288538374145>

misty wharf
#

wow

#

so much for discord doing something about it lol

night hazel
#

yeah

#

looks like they figured out how to circumvent the blocking

fossil wraith
#

jesus between the neo nazis raiding servers supporting pride and this discord is a mess

#

IVE FUCKING DONE IT

weary holly
#

Im trying to coordinate my ai and I saw that there is a team sense. Now I've found only some articles about how to use them but not really in blueprint, could somebody explain to me how the sense exactly works and what stimuli information it returns?

misty wharf
#

I don't think anyone has really used the team sense, it's come up a few times but it seems nobody really knows

#

In general the builtin team support with the attitudes hostile/friendly/neutral is something you need to use C++ to configure

opal crest
# strange blade But thank you for the help and pointers! It's definitely pushed me towards a bet...

The heavy duty tool for this is probably to customize the path following component, and control how your agent moves toward the next goal point on each tick. I'd guess that the faster your dino is going the slower it should turn.

https://docs.unrealengine.com/4.27/en-US/API/Runtime/AIModule/Navigation/UPathFollowingComponent/

Rama has some code/videos using this to add jumping to the path following behaviour of his AI.

#

The other thing you could do is manipulate the generated spline control points. But I honestly don't have the a good clue how you would wrangle to the math to get the intended effect (Maybe Freya's Bezier videos on you tube would help there?). I use some very simple splines generated from navpaths to visualize turn based movement, but for those I make the handles really short to make the corners tight but rounded.

strange blade
#

Thanks for getting back! 😄

severe tangle
#

I'm playing around with DetourCrowdAIController and NPCs are avoiding each other as expected, but it seems they ignore player's pawn. Can I change it to avoid player's pawn too? Using Blueprints

misty wharf
#

You need to add the player pawn into the crowd manager

ocean wren
severe tangle
#

Crowd Manager can be only changed via C++? Don't see a way of adding players pawn inside Project Settings => Crowd Manager.

severe tangle
#

Oh if you meant CrowdFollowingComponent in Path Following Component I have already done that, but it still ignores player

misty wharf
#

iirc yeah the crowd manager might be another C++ only thing

#

but it's basically CrowdManager::Get(World)->RegisterPawn(player pawn) so it's not super hard to do

severe tangle
#

oh yea that should be doable! Thank you

severe tangle
# misty wharf but it's basically CrowdManager::Get(World)->RegisterPawn(player pawn) so it's n...

Sorry to bother, but I tried your approach, looked up UE docs as well as forum post

https://docs.unrealengine.com/5.0/en-US/API/Runtime/AIModule/Navigation/FCrowdAvoidanceConfig/
https://forums.unrealengine.com/t/registering-player-character-with-ucrowdmanager/313220/3

My Implementation looks like this:
``
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class MYPROJECT_API UUCharacterCrowdAgentInterface : public UActorComponent, public ICrowdAgentInterface
{
GENERATED_BODY()

public:
void InitializeComponent();
// Sets default values for this component's properties
UUCharacterCrowdAgentInterface();
};

void UUCharacterCrowdAgentInterface::InitializeComponent()
{
Super::InitializeComponent();
UCrowdManager* CrowdManager = UCrowdManager::GetCurrent(this);
if (CrowdManager)
{
ICrowdAgentInterface* IAgent = Cast<ICrowdAgentInterface>(this);
CrowdManager->RegisterAgent(IAgent);
}
}
``
I also added this component to player via constructor, but nothing seems to be happening.. Do you know why? Or how could I make it work, I wasn't able to find some decent tutorial sadly..

Crowd manager is responsible for handling crowds using Detour (Recast library)

misty wharf
#

Ah right it required that interface

#

You need to implement the functions in it - GetCrowdAgentLocation, Velocity, Collisions and MaxSpeed

#

You can just have it return the owning actor's location, velocity, capsule size and radius and max speed respectively

severe tangle
#

I see, I thought I could just add it as a parent from UE editor but this interface wasn't present. Going to give it a try

severe tangle
#

I did implement them:

void UUCharacterCrowdAgentInterface::InitializeComponent()
{
    Super::InitializeComponent();
    UCrowdManager* CrowdManager = UCrowdManager::GetCurrent(this);
    if (CrowdManager)
    {
        ICrowdAgentInterface* IAgent = Cast<ICrowdAgentInterface>(this);
        CrowdManager->RegisterAgent(IAgent);
    }
}
FVector UUCharacterCrowdAgentInterface::GetCrowdAgentLocation() const
{
    return GetOwner() ? GetOwner()->GetActorLocation() : FVector::ZeroVector;
}
FVector UUCharacterCrowdAgentInterface::GetCrowdAgentVelocity() const
{
    return GetOwner() ? GetOwner()->GetVelocity() : FVector::ZeroVector;
}
void UUCharacterCrowdAgentInterface::GetCrowdAgentCollisions(float& CylinderRadius, float& CylinderHalfHeight) const
{
    if (GetOwner()) {
        GetOwner()->GetSimpleCollisionCylinder(CylinderRadius, CylinderHalfHeight);
    }
}
float UUCharacterCrowdAgentInterface::GetCrowdAgentMaxSpeed() const
{
    return 300;
}

But result didn't change

misty wharf
#

Maybe try registering in BeginPlay

#

In my other project where I use this, I have it in my player character and it registers itself in BeginPlay, the implementation of the interface is otherwise pretty much the same as yours

#

Also you shouldn't need that cast to interface there, since the class inherits from it already

sudden citrus
#

Who do I ask if there is dynamic subtree injection planned for the State Tree?

#

cause if there is I can safely throw BTs in the bin

#

alternatively: please make blackboards stackable

#

then I won't have to throw them in the bin

celest python
#

They were talking about Epic was going to listen the community at #mass

#

You can also ~~hijack ~~ sneak StateTree into their scope @sudden citrus

sudden citrus
#

Can you explain what you mean by that?

celest python
#

So you have a chance to provide them these ideas

sudden citrus
#

I mean the hijacking

celest python
#

Ah that was totally an incorrect word usage of mine

sudden citrus
#

oooooooh you mean mentioning state tree in that topic, I thought you were talking about a technical solution 😂

celest python
#

lol yeah

sudden citrus
#

I doubt dynamic injection would be possible in the context of Mass at least - it would change entity memory layout

#

I'm hoping to be able to support it in a Brain Component though - simple FSMs for crowd members and low LOD actors, complex in combat

celest python
#

Since StateTree is used together with mass maybe they can also prefer to get feedback for those seperately

#

That's what I tried to say by hijack sneak into their scope

sudden citrus
#

let's see, I'll have a look through the channel, thanks

celest python
#

For now they'll only listen community for mass specific things but state tree is also pretty much related

misty wharf
#

I wouldn't hold my breath on them listening to anything

#

Nothing I've seen them promise they would do on the forums has ever materialized

sudden citrus
#

I have slightly higher hopes for UE5 features seeing how they've hoovered tech talent throughout 4's life

#

probably backwards compatibility standing in the way of change more than anything

misty wharf
#

If you want a feature in UE you need to convince Fortnite players it's the best thing ever so that they all start begging for it alex

final trail
#

I have a melee enemy and I’m trying to figure out how to make them attack at intervals instead of at the same time, any tips?

misty wharf
#

Easiest solution would be to add random delay between actions

#

this way they will not synchronize with each other even if they begin actions at the same time

final trail
#

I see

#

That’s way easier to set up than a director

misty wharf
#

Yeah, it really depends on how you need it to work but if all you need is for them to not look like they're acting in perfect sync, random delays between actions should do the trick :)

final trail
#

Thanks so much for the input

placid bloom
#

Hey all!

Noob question here but for an AI just chasing a player is it better for optimization to use the blackboard or just a MoveTo off and event tick?

celest python
#

for a single AI it wouldnt matter

#

but to answer the question using MoveTo node in BT is more optimized

#

Only path following component ticks in C++ to move the pawn and MoveTo node only listens for movement end or failure events etc

placid bloom
#

ok fantastic. I was getting to about 15 ai and it was starting to chug a bit so ill look into swapping it over to that.

celest python
#

always profile first

#

bottleneck might be something totally different

#

moving 15 ai should be nothing

#

Like only should cost 0.2ms or even less

placid bloom
#

well they are only are only 2d flipbooks so they shouldnt be the issue

placid bloom
#

ok ill have a look thanks 🙂

#

ok so did some testing and its definitely doing it only when the bot is moving. This is the setup i was using

#

ok i think it might have been the part at the end causing a loop even though it has event tick. Not really sure why i had that in there

celest python
#

thats not correct though

#

AI Move To already ticks behind the scenes, you dont need to update it with your own tick

#

AI Move To is pretty much same with BT's MoveTo task

placid bloom
#

so just have it go off event begin play?

celest python
#

yeah

#

also try to use BT instead

#

unless you really need something basic like this (which is fine)

#

if your game mechanics will extend on the long run its better to setup a BT

placid bloom
#

yea im just looking for something basic. Their aim is to get to the player (Which will deal damage) until there is no health left. Do i have to do the custom event to reset it because they seem to stop as soon as they reach me

celest python
#

probably MovementResults returns "AlreadyAtGoal"

#

cover all the cases and tie them to Chase node

#

from OnSuccess and OnFail outputs

#

by using Movement Result enum

placid bloom
#

Ok sweet that has fixed it. Now i can have over 100 with no change to the fps

celest python
#

Nice

placid bloom
#

Thanks for the help 🙂

celest python
#

Np blobthumbsup

noble silo
#

Hello! Has anyone had much experience with using AI in a top down paper sprite game? My main issue is I am using sight as my main source of perception but my enemy can always see my main character through the walls because they are almost horizontal. Would sound be a better sense or is there a way to make AI not see through collision?

#

perspective on my ground plane

#

game view

misty wharf
#

it uses visibility as the trace channel by default

#

so as long as you block on that channel f.ex. via invisible colliders it should work

noble silo
#

ok cheers!

#

I will look into that!

misty wharf
#

depending on how things work you can also change how the sight check trace is done, but for that you'll need C++ to implement IAISightTargetInterface

#

so you could for example trace closer to the ground to ensure it hits the low walls

ocean wren
#

I'd just build blocking volumes for my tiles

#

I assume you're using tiles

#

Hmm, I might have messed up.. I agreed to do a quick visualization simulation thingy for a navy event... probably going to cause me pain 🙂

#

I guess I could stick in a T72 or two and call it integrated intelligence or somethin

#

They want a visualization of some sattelites.. so might have to draw some satellite orbits

#

Its just a quad strip though thankfully..

#

I guess I'll have to write a scanning shader so we can show some ships being scanned by the sattelites