Hi,
I just upgraded from the free to the pro after running some tests.
One of my scenes , which worked fine on free version, is now failing with error below.
IndexOutOfRangeException: Array index is out of range.
Pathfinding.Node.GetNodeRun (Pathfinding.NodeRunData data) (at Assets/AstarPathfindingProject/Core/Node.cs:41)
Pathfinding.Path.Initialize () (at Assets/AstarPathfindingProject/Pathfinders/Path.cs:369)
AstarPath+c__IteratorC.MoveNext () (at Assets/AstarPathfindingProject/Core/AstarPath.cs:2231)
AstarPath+c__IteratorB.MoveNext () (at Assets/AstarPathfindingProject/Core/AstarPath.cs:2106)
Use case is generating a procedural maze, create a PointGraph with a set of position nodes, add some AI characters with AIPath, assign a mouse driven target. This worked in the free version, they all popped in and started chasing the mouse pointer driven target, but now it looks like they take 1 move forward then stop with above error.
Is there something between free and pro version that I missed that is causing the error.
ty!
I am wondering about the way you are creating those position nodes. Are you doing that via script? If you are, you will need a rescan or a call to DataUpdate to make sure the nodes are set up correctly.
The free version has a hard coded limit of the number of threads it can use to 1 separate thread, which disables some things. You can enable it in A* Inspector -> Optimizations -> ASTAR_SINGLE_THREAD_OPTIMIZE (or it might be named “Single_Core_Optimize” in your version) to get it running quickly if you want a quick fix.
Yes, there are generated in script with tags.
Awake()
pointGraph = new PointGraph();
pointGraph.searchTag = “pathnode”;
pointGraph.maxDistance =2.0f;
Start()
Create pathnodes
astarPath.astarData.AddGraph(pointGraph);
pointGraph.Scan();
It worked fine in free version, and is crashing on the pro version.
I’m already rescanning it.
Is there something else I can check?
Ok, it works now if I put in
astarPath.DataUpdate(); after the pointGraph .Scan() whenever I rebuild the nodes.
Why didn’t I have to do that in the free version?
ty!
You should actually not have to call DataUpdate after Scan. DataUpdate should be called in the Scan function, but in the current version it is left out. That is a bug.
In the pro version, graph connectivity data and temporary graph search data is separated. So the Node class does not contain all data required for searching it, or rather it requires that a few other classes are created to hold the temporary search data to be able to search it. The DataUpdate function makes sure that those extra classes are created. Since they are not needed in the free version, you could get away with not calling it.