Recast vs Grid graph in my setup

I have a 2d topdown game that currently uses grid graph. I tried to set it to 512x512 and it started to crawl. I searched around on how to improve the performance and found that I can use recast graph but I’m not sure if it would work on my setup.

  1. Procedural infinite terrain generated
  2. NPC that uses the pathfinding (ProceduralGridMover will not work here right?)

I’m thinking about adding/removing grid graph on the fly while my game traverse the quadtree and just load the data from a file but I find recast autogeneration really interesting but without any free code in my hand, I just want to know if buying and using recast graph is the right path



For a procedural infinite world, a recast graph is very likely too slow. I would recommend either using the ProceduralGridMover (if you can define some kind of center for the world, usually a good performance optimization is to disable NPCs far away from the player anyway, or perhaps disable their pathfinding completely). Or you could do some other custom recalculation of the grid graphs that you control.

Make sure when you profile that you disable ‘Show Graphs’. Just rendering the graphs can be quite slow for large grid graphs.
The pro version could however help pathfinding performance as it allows you to use more pathfinding threads.