Here’s what I have used in the game, maybe someone else has experienced this before?
• I am using the new PathfindingModifier on some anchored parts in workspace.
• There are lots of dynamic moving and tweening anchored non-collide parts.
• PathAgent’s WaypointSpacing is mostly math.huge, so it uses inflection points.
• My world has ~11k parts, mostly anchored.
Any insight would be helpful, thanks in advance.
~Khronos
How often do you pathfind? How far are you pathfinding? About how many modifiers do your pathfinding operations include? These are all things to consider, and each of these would increase the load significantly. To combat this, I would maybe cut down on complexity or rate at which you pathfind.
Also, considering that there are lots of dynamic parts. This probably causes pathfinding service to be CONSTANTLY recalculating the path of your object. (I am assuming you recompute the path when you detect it is blocked). But this sounds like something to look into also.
Pathfinding is fairly expensive on its own so it would be helpful if you provided more details about how you’re incorporating pathfinding into your experience besides just using PathfindingModifiers. Pathfinding being expensive has been a common complaint amongst developers.
After a long debug and testing. I discover that the factors seems to be that when I used TweenService on a very large part (Anchored=true, Cancollide=false) to tween it’s CFrame and Size, it may have triggered the navmesh to update at the rate of TweenService.
I switched to a for loop with a step size of 0.1s and the memory usage was significantly reduced, but still at the 600MB range.
But I am uncertain because I think the navmesh would probably be optimized to not update every heartbeat so maybe they are just correlated.
If anyone has different findings please let me know.
Edit:
I’ve also tried having a PathModifier in the part with PassThrough=true and it didn’t make a difference.