Issues with larger map sizes

Just purchased the Pro version from the Unity store and am having a problem with getting it running in larger maps. Our map is based on a 2km x 2km terrain with a lot of buildings to make up the city. When I try and run the C# recast navmesh generation it just bombs out with memory issues.

I’ve stripped back everything to just an empty terrain that’s 2000x2000 in size and I’m still getting issues. Any help would be appreciated. Thanks


There was an error generating the graphs:
System.ComponentModel.Win32Exception: ApplicationName=‘C:/Unity/AITEstTerrain/Assets/AstarPathfindingProject/recast’, CommandLine=‘C:\Users\Rollinsa\AppData\Local\Temp\recastMesh.obj
0.5
0.4
2
0.5
30
20
2
8
0.5’, CurrentDirectory=’’
at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in :0
at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in :0
at System.Diagnostics.Process.Start () [0x00000] in :0
at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start ()
at Pathfinding.RecastGraph.ScanCRecast () [0x002c1] in C:\Unity\AITEstTerrain\Assets\AstarPathfindingProject\Generators\RecastGenerator.cs:437
at Pathfinding.RecastGraph.Scan () [0x0000b] in C:\Unity\AITEstTerrain\Assets\AstarPathfindingProject\Generators\RecastGenerator.cs:274
at AstarPath+c__Iterator8.MoveNext () [0x00231] in C:\Unity\AITEstTerrain\Assets\AstarPathfindingProject\Core\AstarPath.cs:1554
at AstarPath.MenuScan () [0x000d7] in C:\Unity\AITEstTerrain\Assets\AstarPathfindingProject\Core\AstarPath.cs:1487

If you think this is a bug, please contact me on arongranberg.com (post a comment)

UnityEngine.Debug:LogError(Object)
AstarPath:MenuScan() (at Assets/AstarPathfindingProject/Core/AstarPath.cs:1491)
AstarPathEditor:OnInspectorGUI() (at Assets/AstarPathfindingProject/Editor/AstarPathEditor.cs:410)
UnityEditor.DockArea:OnGUI()

That’s not the C# version, that’s the C++ version. And that’s not a memory exception, that’s an exception telling you that it cannot start the program on windows, which is reasonable since it is only supported on unix. Try running the C# version and check the width/depth samples values in the Recast graph settings, they should be reasonable (2000 is around max I would say, then it starts to take a very long time to calculate). Also check the terrain sample size. You don’t need very low values for it if your terrain is relatively smooth.

Thanks for the quick reply. Sorry that’s my daft mistake that the log I posted wasn’t right, it resets back to the default C++ version after a crash. It was just saying out of Memory when I’d got the width/depth sample size up too high.

Thanks for the tips on the width/depth sample, I’ve adjusted that to keep it under 2000 which solves the crashes/out of memory erros but the mesh isn’t being connected in some doorways now.

Is there anyway to increase that maximum or is it possible to stitch two or more smaller navmeshes together so I can keep the cell size smaller?

You can stitch navmeshes together using links (see docs), but it is not always easy. What you can do is to export the mesh and manually edit it a bit, however I am not sure if the export to mesh feature is present in the latest version, perhaps it did not make it for the 3.1.4 release. Or you can try moving the colliders a bit if you can so that the doorways will be correctly calculated.