Since upgrading to Unity 2021, I’ve had a small set of my player bases having Unity hang (no error) after 5-15 minutes. The faster the framerate, the quicker it generally ends up in this non-responding state.
This does not happen on either of my computers, but I was able to get a file dump of the hung process from someone it was affecting. After digging into the file dump of a hung process, it appears the main thread has the following callstack:
GameAssembly!RVOSimulator.Update
GameAssembly!Simulator.Update
GameAssembly!Worker.Execute
→ runFlag.Set()
I’m on the most recent version (4.2.17). I don’t know if this is a new problem with Unity’s version of IL2CPP shipped with 2021, or a problem with A*PP that is now just more likely to happen.
Any thoughts on this issue? I’m next panning to try the beta version, but clearly I’m worried about shipping an update with a beta version if it does fix. I’ll report back if it fixes regardless.
It looks like there are no more crashes with the Beta version. Testing is ongoing, but looking very promising.
FYI - I do have someone at Unity investigating if they think it is related to their IL2CPP generated code or the underlying logic in place.
A few questions:
How “ready” is the beta version for production? I basically have the game completely stalled while this is being resolved, I would need to decide on falling back go 2020 and all the new functionality that was added from the 2021 patch, or moving forward with this beta version.
With the current way of getting the beta package, is there a way to edit the source code? I’ve had to make a few edits for my game. Simply coping the contents of “\Library\PackageCache\com.arongranberg.astar@4.3.48” directory to the “\Assets\AstarPathfindingProject” doesn’t seem to work, it’s like the project is not being included, my scripts can’t reference any of the classes. I’ve spent an hour trying to get it working.
As an FYI some of the edits I have are:
Upping the infinite loop limit in Path.cs
Adding a StartPathWithPartial() functions to AIBase.cs and Seeker.cs to allow a version of StartPath that sets the constructed path.pPathEnableTags = true, and passes in a custom set of enabledTags
Functions to AIPath to allow zeroing velocity2d & verticalVelocity (used by my emergency fix placment logic when an AI rarely falls off the map)
Very good point, I could do that but that does leave one thing I must have changed in my game. Long term: making that infinite loop check upper bounds a setting would be great. In my tower defence, mazes can get quite long.
I will give another attempt of setting up an “asset” version of the beta version. I’m not using an asmdef file.
Edit: My attempt worked this time, I made a temporary asmdef file to reference A*PP. Then after it downloaded the updated required dependicies, removed the reference. It’s compiling now, full speed ahead.
I’ll let you know if I hear anything from Unity reguading the base blocking problem.