Path Update - Perfomance Improvement

Hello,

I save the scan data as a JSON file in the editor and load this data when the game starts.

However, in some parts of my game, I spawn obstacles, and because of this, I need to rescan my path data. But since my map is very large, the scanning process takes a long time, causing my game to freeze or significant fps drop.

What I want is for only the path around the object with the NavMeshCut to be updated. How can I solve this issue?

  • A* version: [5.2.4]
  • Unity version: [2022.3.35f]

Best

Hi

You can read more about partial graph updates here: Graph Updates during Runtime - A* Pathfinding Project

If you use the NavmeshCut component, you shouldn’t have to re-scan the graph data manually at all.

Hello Aron, thanks for the link but as I understand. I have to put the update in a queue and it will re-scan the whole map again right? I have a huge map and it takes long time. Is it possible to scan only specific area instead of whole map?

Since you’re using NavmeshCut, you won’t have to do any scanning on your end at all- no need to add the scan to a queue or anything of that sort. Add the NavmeshCut to your object and you’re good :+1:

Yes, by defining the bounds of where you want to scan-- but I do want to re-iterate that this is not required at all with NavmeshCut. Let us know if this isn’t working for you :smiley: