Bug With Recast Graph Export/Import

Hello, I would like to report what I believe to be a bug that affects exporting a recast graph into a navmesh graph on version 4.2.2 of the library.

Problem Description

Exporting a recast graph and then importing it as a navmesh without modifying it can result in cross-tile nodes failing to connect on the navmesh.

The recast graph:


The generated navmesh once imported:


How to Recreate

  1. Import version 4.2.2 of the A* Pathfinding Project.
  2. Open scene Assets/AstarPathfindingProject/ExampleScenes/Example3_Recast_Navmesh1/RecastExample
  3. Under the Astar Path component, change Tile Size to 50 and scan.
  4. Export the RecastGraph to Resources/navmesh.obj
  5. Under the Astar Path component, create a new Navmesh Graph and connect the generated navmesh.
  6. Disable or delete the original recast graph.
  7. Observe the missing connections around nodes near tile boundaries at obstacles.

Speculation

This seems to be due to using tiles in the recast graph when generating the navmesh. From viewing the mesh in Blender, it’s exported with each of its tiles having no shared vertices. It seems that normally this is resolved in the NavMeshGraph without problem by merging any shared vertices in the mesh. However, using RecastGraph it is possible to generate graphs where triangles on the border of tiles have adjacent edges without sharing two vertices.

I’ll attach an image below (if possible) to try to provide a visual aid to explain what I mean (new users are limited to 2 images per post).

Aforementioned visual aid:

I believe this is the cause of the problem but I could be mistaken.

Hi

Yeah, this is something that cannot be handled at the moment. An exported .obj file has no way of containing the metadata about which node is contained in what tile, or even what the tile size is. So it makes the round trip a lossy operation. It will work if you disable tiling on the recast graph however.

Thanks for the response. This problem isn’t relevant to anything I’m working on, I just wanted to bring attention to it since it seemed like it could potentially affect others.

1 Like