Pathfinding confusion

not sure if this is the right place to post this but i couldn’t think of anywhere else.

i have been learning how to use roblox studio for a small while and i have gotten to the point where i want to learn how to use pathfinding.

the only issue is the default pathfinding service server/client latency! so im wondering how do devs make their pathfinding look good in games? is it custom api?
im really curious and i have searched around and not found a good explanation.
how the ai is still keeping up with the player even on the client side?
its been really frustrating and confusing trying to figure this all out.

any help would be great.

2 Likes

Not sure any explanation could beat the documentation <-click
Other than that possibly download a few from the toolbox or check out some tutorials to learn more.

Question is… How do you run yours? You might be having memory leaks or even unnecessary things running every frame

It shouldn’t happen from default (atleast wasn’t for me)

But some people use client rendering (they’re rendering npc on client) (Not really much do I think)
But it’s kinda advanced thing

I’m actually trying to tackle this issue right now.

My approach is to do all pathfinding on the client. This could be simply done by setting the network owner of the humanoid you are moving to the client, but this could cause issues with exploiters gaining full access of your humanoids, and other clients will still observe latency.

If your humanoids need exact server positions that need to be verified, what I am doing is sending position data of the humanoids over to the client. Then, the humanoids will each pathfind themselves and their paths will match exactly to what that client sees at that moment, so it seems less laggy. The path would not match from client to client, but the end goal will. (This may not suit your needs.)

Here is a good resource that initially inspired me to write my system this way. It shows the benefits of such a system, but of course, it may not match your exact desires.

Use tweens then (real), I dont know tbh