Freezing by RVO deadlock!

Hello, I have problem with local avoidance system.
I used one RVOSimulator object, and several RVOContoller in scene.

when I create some object at sametime; like 5~20 gameobject contain RVOController,
sometimes freezes problem ouccured. Same problem ouccured in Unity editor and Android build.

It it very critical issue so I can’t release my game at this time.
This problem occured by RVOCoreSimulator code.

			public void Run () {
#if NET_4_6 || NET_STANDARD_2_0
				runFlag.Wait();
				runFlag.Reset();
#else
				runFlag.WaitOne();
#endif

				while (!terminate) {
					try {
						List<Agent> agents = simulator.GetAgents();
						if (task == 0) {
							for (int i = start; i < end; i++) {
								agents[i].CalculateNeighbours();
								agents[i].CalculateVelocity(context);
							}
						} else if (task == 1) {
							for (int i = start; i < end; i++) {
								agents[i].BufferSwitch();
							}
						} else if (task == 2) {
							simulator.BuildQuadtree();
						} else {
							Debug.LogError("Invalid Task Number: " + task);
							throw new System.Exception("Invalid Task Number: " + task);
						}
					} catch (System.Exception e) {
						Debug.LogError(e);
					}
					waitFlag.Set();
#if NET_4_6 || NET_STANDARD_2_0
					**runFlag.Wait();**
					runFlag.Reset();
#else
					runFlag.WaitOne();
#endif
				}
			}

image

RVOCoreSimulator.cs

runFlag.Wait() <- Wait here forever!

Hi

You could try using the beta version. It has a completely rewritten local avoidance system. Maybe it doesn’t have the same issue. See https://www.arongranberg.com/astar/download

Ok, I’ll try it in this weekend. Thanks for reply!

How to download the beta version?

I modified “manifest.json” following guide in download page.
But Unity Package Manager show always 4.2.15 version only.

p.s. I using Unity 2019.3.10f1

image

Oh, I found it in All packages list.

image

It’s my fault. I found the error. I tried create object infinitely!
Thx your support. I got 4.3 version and it so fast.

Only problem is, sometimes freezes by block.wait() 1~2 seconds…

2 Likes

Unfortunately, I can’t use the beta version since following error.
Everything just works in editor.

Hi

I cannot replicate that error in a standalone build.
Which version of Unity and the Burst package are you using? And what platform are you building for?
Do you think you could do a debug build so that it will print line numbers?