Post Deserialization Performance Spike

Hello,

I am loading two big Recast graphs during the loading by this call:

AstarPath.active.data.DeserializeGraphs(bytes);

But few frames later, I am getting quite the huge performance spike (lag) in the game.
I would like to get rid of it, or at least somehow wait for it during the loading phase.

Could you please help me with this? Thanks

Hi

Looks like this is from the first time navmesh cutting happens. You can force this to happen immediately by having a navmesh cut in the scene when loading happens.

It looks like you have a lot of tiles. Is the graph really large, or do you use a very small tile size?

My graphs settings look like this:


Alright. I guess it’s just a pretty big graph.

Also I have only two NavmeshCuts for each graph. You still think it could be a problem? I am afraid I will not be able to have them ready during the loading phase. But the cuts are moving and during their udpates the issue is not longer present.

You can just include any dummy cut and even delete it afterward. The graphs skip doing a bunch of calculations if no navmesh cuts are present, but you force it to do those calculations if one is present. Once a navmesh cut has been used, it will continue calculating this extra info.

1 Like