Currently, the only reason I am having to shy away from using PathfindingService for my NPCs is the buildup of Navigation memory over long periods of time. I’ve come to realize this is probably because the NavMeshes used for generating paths are never cleared from memory and always persist even after that path is gone and done with.
This behavior makes it pretty hard to justify using PathfindingService outside of super-specific scenarios, ones where that path is never anything other than preplanned and never changing for things like cutscenes, bots walking around on sidewalks or something, etc.
I’ve had to ditch PathfindingService in my game solely because of this memory buildup. Even after throttling my bots to only call upon :ComputeAsync() every minute the server would gain +500mb of Navigation memory over a period of about 6 hours, which caused enough delay to appear causing gameplay issues. This is after I had done tons of performance changes to try to negate this, as I had seen up to +1000mb of server memory in a shorter span.
My game is vast and uses parts to build its terrain. Even with this I had never noticed a downside to using PathfindingService with hundreds of NPCs besides this memory buildup. It was extremely cool to see my NPCs interact with players and each other intelligently through PathfindingService, scaling mountains and obstacles to complete unique behaviors I had made, but now I’ve had to render them dumb while looking for other alternatives in the name of performance.
This build up of memory almost does not sound intentional. If this is a bug or something it would really be appreciated if it could be looked into as from what I’ve seen this behavior has been happening for awhile. If not then the same goes for investing in getting this changed. I spent weeks trying to salvage what I had using this service but this behavior stopped me in my tracks.