"Very high penalty applied"


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:

    private void OnEnable()
	guo = new GraphUpdateObject(myBounds);
	guo.addPenalty = penalty; //penalty = 10

Any ideas of what I can be doing wrong? (again, this error do not occur with Recast Graphs)

Uh… Hm… That is really weird. Make sure you are not using negative penalties somewhere. And check the default penalty on the grid graph settings.

If nothing seems to be working, you could send me a small scene which shows the problem and I will have a look at it.

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.

No new paths are accepted UnityEngine.Debug:LogWarning(Object) Pathfinding.Path:LogError(String) (at Assets/AstarPathfindingProject/Core/Path.cs:357) AstarPath:StartPath(Path, Boolean) (at Assets/AstarPathfindingProject/Core/AstarPath.cs:2184) Seeker:StartPath(Path, OnPathDelegate, Int32) (at Assets/AstarPathfindingProject/Core/AI/Seeker.cs:480) Seeker:StartPath(Vector3, Vector3, OnPathDelegate, Int32) (at Assets/AstarPathfindingProject/Core/AI/Seeker.cs:420) Seeker:StartPath(Vector3, Vector3) (at Assets/AstarPathfindingProject/Core/AI/Seeker.cs:396) <StartSeeker>c__IteratorC:MoveNext() (at Assets/Scripts/UnitAI.cs:77)

Oh, and this one too:

Error : This part should never be reached.

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.


That would be interesting. My email is aron [dot] g [at@] me [dot] com.

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.