When using PathfindingService, it seems as if the agent is ignoring all of the parameters given, here are a few screenshots to prove my point:
Photo of ignoring cost (set to math.huge)
Make points around every corner, else you could set up custom hitboxes allowing the NPCs not to walk off the path, you’d have to give them a custom CollisionGroup like “NPCs” and then around every stall & decoration place huge walls which they cannot even jump over. Furthermore make sure to also do this with around the paths.
I slammed a red transparent cylinder into the NPCs and now they kept on getting stuck, but this time it happened more because the cylinder was preventing them from moving, and no, I cannot put walls around the grassy areas because this is a freebuild game.
I often get the same thing a do wonder if the WaypointSpacing in AgentParameters might be reduced ti help.
You could temporarily create a part at each waypoint to confirm this.
Roblox pathfinding is just broken.
I have been working a lot with it lately.
The worst offender is terrain. have been trying to create a vehicle experience where you are followed by several pursuit cars over muddy/rocky roads and I have found that:
Pathfinding is slow.
Pathfinding is unreliable.
Best way to alleviate this is to create your own A* or Dijkstra implementation.
I have done A* but in my case the implementation is difficult as you have to come up with a way to set the weights of the cells in A* or links in Dijkstra.
If you don’t have the time Open up the
File>Studio Settings>Studio>Visualisation>Show Navigation Mesh
Restart the studio and then build your map around the 64x64 cells.
AgentParameters has always been very buggy so when you run your program and create paths you should be able to see what they are set to. Then just move the objects slightly to allign with the grid(The less triangles there are the more accurate it tends to be)
tl;dr roblox pathfinding bad, make your own
WHICH I DO NOT THINK IS EASY IN ANY WAY SHAPE OR FORM
Is there a place where I should start first to do this or do I have to endure the pain of having to find a mildly reliable website that probably doesn’t have a single smidge of JavaScript or CSS on it and is probably made in 2001 and outdated.
Either way, I think I should try studying the Theme Park Tycoon 2 pathfinding (which is very difficult) or just keep on pressing buttons until something happens and then a mild amount of dopamine gets released in my brain, OR contact Roblox support and ask them to do something about it (which everybody knows is not going to happen).
Well. IMHO pathfinding compared to other algorithms is actually a simple algorithm once you get to know it (compare BInary sort). It is really up to you how much you are willing to learn.
Again I recommend that you go to File>Studio Settings>Studio>Visualisation>Show Navigation Mesh
Restart the studio and then build your map around the 64x64 cells, ensuring that you create the least amount of “triangles.”
That is the easiest fix I have for you.
It is a bit of an extreme example. But, it’s really the only way I have found helps.
I also would suggest try decreasing the agent radius to about 4 or widening the paths a tad. I don’t know what your parameters are. But, All i can suggest is try lessening them a bit or even removing it all together.
Never mind, it still bumps on walls and I tried optimizing it with WaypointModifiers, yet it still did not work, well it half worked, half didn’t work, you see, for some reason, it works absolutely beautifully on Studio, HOWEVER, when on the normal game client, the pathfinding decides that it does not want to work properly and starts walking into walls, going onto grass, and doesn’t work efficiently (as in the path is longer), I sent a bug report to roblox using support and it should hopefully be fixed, if it’s not then it will be time for me to learn how to make an A* pathfinding system and open source it so nobody else has to go through this, and if any Roblox admin is reading this, please, please, fix Pathfinding so that NPCs don’t just run into corners because that is the worst offender of Pathfinding.