Crash when removing multiple rvo agents

Hi

Great product. Much better than Unity’s own pathfinding implementation.

However, I have discovered a problem when using rvo controllers.

It seems when I remove multiple rvo controllers (more than 5) I’ll get a crash on iOS. If I remove just one in one frame it works. If I have understood correctly, I should not need to remove agent from the simulator since ondisable will do it for me. It might be related to multithreading and neighbour checking failing when neighbour has just been removed on another thread. Dunno. Any ideas?

I need to dynamically add obstacles and also remove them after a time. I have used locked rvo controllers since adding rvo obstacle was terribly slow compared to adding a rvo controller. It would also be great if rvo obstacles could be set “disabled” state (without removing them) so I could create a couple of them onawake and then enable and move them when needed.

Kind regards,
Pauli Ojanen

Interesting… I thought I had all those cases covered.
Especially the RemoveAgent function, which looks like it is causing the crash has a line to block until rvo calculations are done (if multithreading and double buffering is used).

Do you think it would be possible to get some more debugging information from that crash. I think XCode can show you the log for that kind of stuff. A simple stacktrace would (hopefully) be enough to track down the bug.

Sure it does not happen on desktop and only on iOS?

Also, how exactly are you removing them?

RVOObstacles are harder to remove since each vertex is stored in a KDTree. Also having many disabled obstacles could affect performance since they would have to be skipped in the last step basically.

Sorry for the delay. Unfortunately I haven’t had time to study this further. I did not try see if the problem happens on desktop, probably yes. If I recall correctly I tried to remove it by first disabling the rvocontroller to trigger agent removal and directly after that called Destroy(gameObject) to remove the parent gameobject.