Hardcrash in editor

Since I started creating a real map for my little game (with many enemies and objects), I’ve begun experiencing hard crashes in the editor. I’m using Unity 6.0.16 and A* 5.1.16 with Grid Graph and Follower Entity.

The log says:

========== OUTPUTTING STACK TRACE ==================

0x00007FFD7DAA226A (Unity) PopulateContacts
0x00007FFD7DA9F9F4 (Unity) PhysicsManager2D::ConvertCollision2DToScripting
0x00007FFD7D21DBF1 (Unity) SetupArgumentsForMessageInvocation
0x00007FFD7D217CBA (Unity) MonoBehaviour::HandleNotifications
0x00007FFD7CB01250 (Unity) GameObject::SendMessageAny
0x00007FFD7DAD6345 (Unity) PhysicsContacts2D::SendCallbackReports
0x00007FFD7DAD44DC (Unity) PhysicsContacts2D::ProcessContacts
0x00007FFD7DAA4153 (Unity) PhysicsManager2D::Simulate
0x00007FFD7DAA00D4 (Unity) PhysicsManager2D::FixedUpdate
0x00007FFD7DAA0320 (Unity) PhysicsManager2D::Initialize'::2’::FixedUpdatePhysics2DFixedUpdateRegistrator::Forward
0x00007FFD7CEA4657 (Unity) ExecutePlayerLoop
0x00007FFD7CEA47C7 (Unity) ExecutePlayerLoop
0x00007FFD7CEAA3EF (Unity) PlayerLoop
0x00007FFD7DF95D4A (Unity) EditorPlayerLoop::Execute
0x00007FFD7DFABB17 (Unity) PlayerLoopController::InternalUpdateScene
0x00007FFD7DFAD8BD (Unity) PlayerLoopController::UpdateSceneIfNeededFromMainLoop
0x00007FFD7DFA7731 (Unity) Application::TickTimer
0x00007FFD7E59C8BA (Unity) MainMessageLoop
0x00007FFD7E5A2592 (Unity) UnityMain
0x00007FF729842FBA (Unity) __scrt_common_main_seh
0x00007FFDF83F257D (KERNEL32) BaseThreadInitThunk
0x00007FFDF922AF28 (ntdll) RtlUserThreadStart

========== END OF STACKTRACE ===========

After several attempts, I isolated the issue, and it seems related to the NPCs. While they are wandering, if they move over colliders of other objects—perhaps pushed by other NPCs—the crash occurs. All my NPCs have colliders to push and be pushed with the player (not moved by A* but by a normal controller), and these colliders keep them separated. The problem occurs almost instantly if I have 100+ NPCs in a confined test area, and I start dragging an object with a collider that begins moving the NPCs in ways A* doesn’t anticipate. If i disable the npc collider, is all fine

I’m struggling to create a small example, but if needed, I can try. Is that log helpful, or should I try to create a sample? Or maybe it’s a Unity bug? I’m not sure where to turn. :frowning:

Hi there, sorry to hear about the crashing :frowning: We can try to see if Astar is having any effect on this, but from the stack trace it doesn’t seem likely. Regardless, let’s see what we can find out :smiley:

Would you possibly be able to make a simple movement script, maybe one that will just move your 100+ NPCs in in a random direction (where they are bound to collide) and see if it’s crashing then, taking Astar out of the equation entirely? If it’s still crashing it’s looking like a Unity bug. If it still happens, we can narrow it down some more with you.

From personal experience I can tell you that Unity has been mostly easy to work with when it comes to bugs and crashes. If it’s not on our end, you’ll want to bring it up with them. Here’s a link to their support documentation on how to report a bug. If we find it’s not coming from Astar, you should definitely contact them next :slight_smile:

Let me know what you find from taking Astar out of the movement code, and we can go from there!

Thanks for the replay.
I found out that it only happens if you set RigidBody2D.CollisionDetection to continuous, while with discrete it works without any issues. I reported the problem to Unity support with a 2GB example :slight_smile: I’ll keep you posted.

1 Like

Ah I see~ yes by all means keep us updated :slight_smile: Good luck with Unity support :saluting_face:

Oh…

10+ hours to debug and seems that there is already a fix in the next version :slight_smile:

1 Like

Haha how incredible- the most amazing part is how highly specific this is, too.

Also this is actually comedy gold:

Expected result: The Editor continues to run
Actual result: The Editor crashes

At any rate, I’m glad we could help point you in the right direction! :slight_smile: Let us know if you’re having more troubles.

1 Like