A* Pathfinder and hot reloading


#1

Hi !

I’m trying to enable hot reloading on a project that uses A* Pathfinding, but i have issues with AStarPath.

First, the graph data created via inspector in editor mode is not persisted.
To reproduce that :

  • create an empty GameObject,
  • add AStarPath component on it (Pathfinding => Pathfinder),
  • add a point graph,
  • launch play mode,
  • modify the code in VS and go back to Unity,
  • wait for hot reloading : the point graph data has disapeared.

Second, the AStarPath component itself seems to never be ready for a scan or a graph creation after the hot reload. For example, the “active” instance is not set again and I have to set it manually from elsewhere.

I suspect many other things need to be done after hot reloading, because all AStarPath init is done in Awake and that method is not executed again. But I prefer to ask here before digging into it: Does AStarPathfinding officialy support hot reloading? Does anyone have tried to use that feature?

Thanks in advance !

Ben


#2

Hi

Sorry. This is not supported at the moment. The main reason is that there is just way to much data for the Unity serializer to handle. If it tries to serialize all that data it just chokes and the unity editor starts to lag a lot. Then there is the additional complication of handling all cross references, which the Unity serializer cannot really handle.