I’m new with this project and I must say it is awesome! I’ve been trying to use the penalty values to get my NPCs to get out of AoE spells in my game, and using Recast Graphs its working, but if I change to Grid Graph I get this warning once I add any penalty to the nodes based on the bounds of the collider.
Even if I dont add penalty at all, just calling AstarPath.active.UpdateGraphs(guo); causes this warning, showing extremely high values on the warning and stopping all paths.
All Im doing is activating an object with a box collider with the following lines:
I’m getting the same errors. I did check the penalties (0 or 1 on grid graph) and 1 per seeker via alternate path on approx. 100 seekers. after a while of clicking around to get the seekers moving, the errors start to pop up. These errors happen more quickly if i move the seekers to locations that have narrow corridors.
Question: Are those penalties somehow stored in the grid nodes and get bigger over time or something? If so, how can i reset the penalties?
The errors are: Very high penalty applied. Are you sure negative values haven't underflowed? Penalty values this high could with long paths cause overflows and in some cases infinity loops because of that. Penalty value applied: 4294966297
StackOverflowException: The requested operation caused a stack overflow. Pathfinding.GridNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/GridNode.cs:323)
Canceled path because a new one was requested. This happens when a new path is requested from the seeker when one was already being calculated. For example if a unit got a new order, you might request a new path directly instead of waiting for the now invalid path to be calculated. Which is probably what you want. If you are getting this a lot, you might want to consider how you are scheduling path requests.
Ok, did some digging. Those additional penalties are stored in the graph, but should get reset to the previous penalty on the next path request. Somehow, this reset isn’t done reliably if i set the thread count in the pathfinding settings to something other than one. If i set it to one, all the errors disappear and everything works fine.
Aron, if you’re interested direct message me your E-Mail address and i send you a project where this is reproducible.
I’m getting similar errors including StackOverflowException and “very high penalty applied” when using Alternative Path script updating the grid graph using a Graph Update Object. I’ve even reduced the Alternative Path penalty to 10 and I’m still getting the error. Is there something that I should be doing if I update the graph? Is there a way to reset penalties on the graph to zero?
Did you ever find the cause and solution to this?
I’m getting it as well, and i havent tampered with penality values at all, but just added the alternative path modifier to about 100 agents or so.