A* Pathfinding Project

Exception while updating graphs: System.OverflowException


#1

Hi!

I upgraded to latest beta and when I try to use UpdateGraphs method I get this error every time:

Exception while updating graphs:
System.OverflowException
at (wrapper managed-to-native) System.Object.__icall_wrapper_ves_icall_array_new_specific(intptr,int)
at Pathfinding.RecastGraph.PutMeshesIntoTileBuckets (System.Collections.Generic.List`1[T] meshes, Pathfinding.IntRect tileBuckets) [0x00011] in E:_GamesConcepts\Archers\Assets\AstarPathfindingProject\Generators\RecastGenerator.cs:629
at Pathfinding.RecastGraph.Pathfinding.IUpdatableGraph.UpdateArea (Pathfinding.GraphUpdateObject guo) [0x000b5] in E:_GamesConcepts\Archers\Assets\AstarPathfindingProject\Generators\RecastGenerator.cs:517
at Pathfinding.GraphUpdateProcessor.ProcessGraphUpdatesAsync () [0x00096] in E:_GamesConcepts\Archers\Assets\AstarPathfindingProject\Core\Misc\GraphUpdateProcessor.cs:331
UnityEngine.Debug:LogError(Object)
Pathfinding.GraphUpdateProcessor:ProcessGraphUpdatesAsync() (at Assets/AstarPathfindingProject/Core/Misc/GraphUpdateProcessor.cs:337)
System.Threading.ThreadHelper:ThreadStart()

The code I use is this:

Bounds bounds = new Bounds(transform.position, m_meshRebuildSize);
GraphUpdateObject lastGuo = new GraphUpdateObject(bounds);
lastGuo.updatePhysics = true;
AstarPath.active.UpdateGraphs(lastGuo);

It upgrades graph but also spams this message


#2

Hi

I have studied the code but I cannot see how this could happen. Could you give me some details about your game world? Roughly how many meshes do you have in it? How many tiles does that bounding box cover (roughly)?


#3

Okay, so it occurs when GraphUpdateObject bounds is far away from a small graph. Immage attached. White quad on the right is GraphUpdateObject bounds and in the middle is graph.

I actualy does not need this kind of situation in my game. I have 4 recast graphs in my game and in current moment I made 2 of them very small so that unity will start game faster. And those 2 was spamming erros when I was using GraphUpdateObject. I guess this is not a problem as I will make those 2 bigger size eventualy but maybe this will cause some errors in library in some cases, I dont know.


#4

Hi

Thank you.
I have uploaded version 4.3.16 now which fixes this bug. See https://www.arongranberg.com/astar/download