Play mode breaks any time ghost prefabs are modified

I noticed that play mode breaks very often, especially after prefab/asset changes, but also at various random moments (presumably when an asset reimport is triggered by some script).

For a while I assumed this was a misconfiguration on my side, but it looks like this is a consequence of how Netcode for Entities works with entity subscenes. I checked the OnlineFPS sample, as well as the new Competitive Action Multiplayer template, and both of these break play mode very easily, e.g. by modifying any ghost prefab, but also often by touching/modifying/reimporting assets that are dependencies.

This obviously throws a wrench in the works when iterating.

Trying to despawn a ghost (Entity(998:3)) which is in the ghost map but does not have a ghost component. This can happen if you manually delete a ghost on the client.
0x000000047551523b (Mono JIT Code) Unity.NetCode.GhostReceiveSystem/ReadStreamJob:Execute () (at ./Library/PackageCache/com.unity.netcode/Runtime/Snapshot/GhostReceiveSystem.cs:498)
0x000000047551231b (Mono JIT Code) Unity.Jobs.IJobExtensions/JobStruct`1<Unity.NetCode.GhostReceiveSystem/ReadStreamJob>:Execute (Unity.NetCode.GhostReceiveSystem/ReadStreamJob&,intptr,intptr,Unity.Jobs.LowLevel.Unsafe.JobRanges&,int)
0x000000047551241a (Mono JIT Code) (wrapper delegate-invoke) Unity.Jobs.IJobExtensions/JobStruct`1/ExecuteJobFunction<Unity.NetCode.GhostReceiveSystem/ReadStreamJob>:invoke_void_T&_intptr_intptr_JobRanges&_int (Unity.NetCode.GhostReceiveSystem/ReadStreamJob&,intptr,intptr,Unity.Jobs.LowLevel.Unsafe.JobRanges&,int)

TBH Iā€™m about 90% sure this is a well-known issue and I somehow missed the discussion about this. Anyway, what are your ways of working around this problem? Is there a roadmap towards making this work better?

Could you help me by reporting this as a bug? That helps us track and resolve this issue.

You can post the issue number here I can help fast track it through our bug process.

Hi, I made a quick bug report. Issue IN-91985

2 Likes