5.4.4 RVO unity crash

After updating the package version
The rvo causes Unity to crash when too many follower entities are instantiated.

If I disable the rvo, everything works correctly.

So after several tests The problem does not come from a version change. Here the issue arises from the change in graph; I switched from recastgraph to the grid graph. If I use a grid graph that is too large, for example, 1000x1000 at the moment my follower entities spawn. Unity crashes; if I use a grid graph of 500x500, everything works perfectly. If I use a grid graph of 1000x1000 and disable the RVO, there is no crash either.

What version of Unity is this happening in?

Update: If you’re using Unity 6.1, this was in the 5.3.7 update for the plugin:

Significantly improved performance when scanning grid graphs when using Unity 6000.1+. This optimization has been tried multiple times before, but due to Unity bugs it has had to be rolled back. I think Unity has fixed the final physx bug relating to this now, so this optimization is back. Please report in the forum if you notice any hard crashes of the unity editor, when scanning grid graphs, after this update.

Gonna tag Aron on this as it seems pretty dang related :+1:

I am currently using version 6000.1.4f.
I will try to switch to 6000.2 to see if the issue is still there.

I just tried to upgrade to version 6000.2, but the problem is still there.

Once again, the issue does not stem from the scan but from the spawning of follower entities on a 1000x1000 grid with RVO enabled.

The strangest thing is that I have no error messages, and there’s nothing in the editor log either.
Unity suddenly crashes when I spawn the follower entities, and I have no error information.

Hi

I’ve tried out a 1000x1000 grid in two different scenes, using local avoidance with the FollowerEntity. It works perfectly fine, without any crashes.

Not sure what’s happening on your end.

So I just ran a bunch of tests on an empty scene

I currently have version 6000.1.4f of Unity with version 5.4.4 of Astar.

The problem mostly occurs when the follower entities are spawned exactly in the same place and at the same time.

So here, in terms of setup, I have a cube with a follower entity on top.
An RVO simulator is active in the scene and a grid of 1000x1000.

I spawn 20 enemies exactly in the same spot at the same moment, and Unity crashes.

I should clarify that the issue does not occur when I spawn the follower entities with a random radius for each.

And to clarify, this only happens with a grid graph? Not when spawning 20 units at the same position using a recast graph?

I just tried it, and yes, indeed, it’s only with the grid graph.
Here the issue arises with 20 follower entities on the grid graph.

I just tried it with the recast graph to spawn 20 follower entities in the same spot, and there was no crash.

I just took an additional test.

1000 follower entities spawn within a radius of 30 meters on a grid of 1000x1000

At first, everything goes smoothly, but when all the follower entities converge at the destination point, Unity crashes.

I tried to spawn 500 agents in exactly the same position on a 1000x1000 grid. No crash.

Does anything change if you uncheck “Use Navmesh As Obstacle” in the rvo simulator settings? (or tweak some other settings there?)

The “Use Navmesh As Obstacle” was already unchecked, and I tried with several parameters; unfortunately, the issue persists.

With 10 follower entities, I don’t have the issue, but with 15, I do.

The trouble begins with 15 follower entities in the same place.
While 14 of them are functioning well

Feel free to send your project file to us and we can just test your exact setup. If you’re gonna upload it with Astar still in it (which may be better in this case), make sure you don’t upload it somewhere public and then send it to one/both us in a DM :slight_smile:

I just tried it with a brand new HDRP 6000.1.4F project; I only have hotreload and AstarPath activated in the project as packages.

With a grid of 1000x1000 and follower entities, I experienced a crash when 15 follower entities spawned simultaneously at the same location, so the issue does not stem from my current project, as I encountered the same problem with an entirely new project.

How can I send you a private message with the test project I just created?

I am currently trying with another computer to see if the issue comes from my PC.

UPDATE : Same issue on an another computer with AMD processor

UPDATE 2 :

I just sent an email to Aron with the download link for the test project I’m using.

I just tried it on three different PCs with the same test project, and all three crashed.

Unity 6000.1.4f HDRP DX12

computer 1: RTX 3080, AMD RYZEN 7 9800X3D

computer 2: RTX 5090, AMD RYZEN 9 9950X3D

computer 3: RTX 4080, Intel Core i9 13980HX

UPDATE 3:
I managed to find a more comprehensive editor log than the one on my main PC on one of the other test PCs. here it is.

(Filename: Assets/AstarPathfindingProject/Core/AstarPath.cs Line: 881)

Path Completed : Computation Time 0,00 ms Searched Nodes 95 Path Length 41 Path Cost: 40000
Unique Path ID: 15
UnityEngine.Debug:ExtractStackTraceNoAlloc (byte*,int,string)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object)
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:Log (object)
AstarPath:LogPathResults (System.Text.StringBuilder,Pathfinding.Path) (at Assets/AstarPathfindingProject/Core/AstarPath.cs:881)
AstarPath:<.ctor>b__87_3 (Pathfinding.PathHandler,Pathfinding.Path) (at Assets/AstarPathfindingProject/Core/AstarPath.cs:684)
Pathfinding.PathProcessor:CalculatePathsThreaded (Pathfinding.PathHandler,Pathfinding.Sync.BlockableChannel`1/Receiver<Pathfinding.Path>) (at Assets/AstarPathfindingProject/Core/Pathfinding/PathProcessor.cs:373)
Pathfinding.PathProcessor/<>c__DisplayClass27_0:b__0 () (at Assets/AstarPathfindingProject/Core/Pathfinding/PathProcessor.cs:122)
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart ()

(Filename: Assets/AstarPathfindingProject/Core/AstarPath.cs Line: 881)

Shut down.
Error reading command from socket

Hi

“Error reading command from socket” is not an error message I recognize. It doesn’t come from my package, at least.

Yes, I understand, but the problem arises in a blank project with follower entities spawning in the same place at the same time.

I only have a scene with the grid, the RVO, and the only thing I do is spawn follower entities, nothing else.

The written error isn’t really the source of the problem; it’s indicated after Unity’s shutdown.

Have you tried the project I sent you by email?