Overflowing graphs, penalty set too high, no new paths will be created

Hi,

I’ve been having some trouble trying to figure out what might be causing some errors I am getting during runtime.

I just upgraded A* to the most current version, and am seeing a few warnings and errors that I didn’t see prior to the upgrade.

1st… After a few minutes and 30 or so units are on the grid I see warnings telling me that there are high penalties set… As far as I can tell, there are no penalties set anywhere.

2nd… I receive a warning telling me that no new paths will be created, and things stop moving/freeze one at a time mid path.

Last… I receive an overflow message when errors and warnings seem to begin popping up.

If anyone has any ideas of what might be causing this please leave a comment.

Thanks
-Kory

Hi

What exact error messages are you seeing (including stack traces)?

Hi Aron…

Below are the error messages that I am receiving. I am probably in way over my head with this… Not much of a coder yet. I’m not sure if this is the info that you want/need.

Thanks for any help you can offer,
-Kory

No new paths are accepted
UnityEngine.Debug:LogWarning(Object)
Pathfinding.Path:LogError(String) (at Assets/AstarPathfindingProject/Core/Path.cs:339)
AstarPath:StartPath(Path, Boolean) (at Assets/AstarPathfindingProject/Core/AstarPath.cs:2277)
Seeker:StartPathInternal(Path, OnPathDelegate) (at Assets/AstarPathfindingProject/Core/AI/Seeker.cs:367)
Seeker:StartPath(Path, OnPathDelegate, Int32) (at Assets/AstarPathfindingProject/Core/AI/Seeker.cs:339)
Seeker:StartPath(Vector3, Vector3, OnPathDelegate, Int32) (at Assets/AstarPathfindingProject/Core/AI/Seeker.cs:321)
Seeker:StartPath(Vector3, Vector3) (at Assets/AstarPathfindingProject/Core/AI/Seeker.cs:296)
AIPath:SearchPath() (at Assets/AstarPathfindingProject/Core/AI/AIPath.cs:243)
AIPath:TrySearchPath() (at Assets/AstarPathfindingProject/Core/AI/AIPath.cs:219)
c__Iterator1:MoveNext() (at Assets/AstarPathfindingProject/Core/AI/AIPath.cs:206)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
AIPath:OnEnable() (at Assets/AstarPathfindingProject/Core/AI/AIPath.cs:185)
AIPath:Start() (at Assets/AstarPathfindingProject/Core/AI/AIPath.cs:167)
ObjNavigation:Start() (at Assets/Scripts/ObjNavigation.cs:13)

Penalty too high… I cannot find any penalties on any of my prefabs using A*

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: 4294967246
UnityEngine.Debug:LogWarning(Object)
Pathfinding.GraphNode:set_Penalty(UInt32) (at Assets/AstarPathfindingProject/Core/Nodes/GraphNode.cs:128)
Pathfinding.AlternativePath:InversePrevious() (at Assets/AstarPathfindingProject/Modifiers/AlternativePath.cs:103)
Pathfinding.AlternativePath:ClearOnDestroy(Path) (at Assets/AstarPathfindingProject/Modifiers/AlternativePath.cs:86)
c__Iterator7:MoveNext() (at Assets/AstarPathfindingProject/Core/AstarPath.cs:2612)
AstarPath:Update() (at Assets/AstarPathfindingProject/Core/AstarPath.cs:896)

Stack overflow error
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:378)
Pathfinding.GridNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/GridNode.cs:378)
Pathfinding.GridNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/GridNode.cs:378)
Pathfinding.GridNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/GridNode.cs:378)
Pathfinding.GridNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/GridNode.cs:378)
Pathfinding.GridNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/GridNode.cs:378)
Pathfinding.GridNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/GridNode.cs:378)
Pathfinding.GridNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/GridNode.cs:378)
Pathfinding.GridNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/GridNode.cs:378)
Pathfinding.GridNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/GridNode.cs:378)
Pathfinding.GridNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/GridNode.cs:378)
Pathfinding.GridNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/GridNode.cs:378)
Pathfinding.GridNode.UpdateRecursiveG (Pathfinding.Path path, Pathfinding.PathNode pathNode, Pathfinding.PathHandler handler) (at Assets/AstarPathfindingProject/Generators/NodeClasses/GridNode.cs:378)

Unhandled exception
Unhandled exception during pathfinding. Terminating.
UnityEngine.Debug:LogError(Object)
AstarPath:Update() (at Assets/AstarPathfindingProject/Core/AstarPath.cs:904)

Hi

I have sent you an update to the AlternativePath script via a PM that I think fixes this problem.