I need graph deserialization to perform better, this is the last hurdle between me and buttery smooth chunk loading.
I’ve found mentions of this topic several times in the past with some people saying they solved it back as far as 2016 and others being told it’s not supported 6 years later, is it being considered at all?
The graph scanning performs so quickly with some settings after all the attention on performance it’s had recently it seems to out perform just loading a saved graph - but I need the graph to be scanned separately so I can additively load terrain props at runtime (which need to exist before the graph scan can start) otherwise that will cause hitching.
The other questions in that last thread I haven’t found an answer for yet would resolve the same problem with a different solution, so if Aron has input on either I’d be happy.
Mkay I’ll go ahead and tag Aron on this one as well- when he gets the chance to check up on this I’ll cross post the answer/his findings to the other post
Optimizing graph deserialization is a bit tricky since it’s very serial at the moment (everything reads from a file), and a large part of it is just allocations that parallelize badly in any case. I have some optimizations that I’ll include in the next update, but it’s not much.
To save and load recast graph chunks, I could instead recommend the method recastGraph.ToTileMeshes and recastGraph.ReplaceTiles, which will be available in the next update. In my testing it’s about twice as fast.
Or you can use the NavmeshPrefab component, which is already available and uses the same internal apis. It should load faster, and you’ll be able to load chunks on a tile-by-tile basis, instead of the whole graph at once.
Didn’t actually know about this! Read up on it and sounds very powerful. And also looks like a good fit for this specific issue since ‘the size of a NavmeshPrefab must be a multiple of the graph’s tile size’. Which yours seem to be from the video you sent in the other thread.
I see the NavmeshPrefab component expects a text asset I’m guessing that’s not what I need since I’m just looking to pass objects around and serialize the data myself.
It sounds like ToTileMeshes and ReplaceTiles could be the solution I’m looking for, will the objects those methods take and return have public constructors or be extendable? Any information in advance would be much appreciated, but thanks for the response.