Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved A ghost changed type

Discussion in 'NetCode for ECS' started by optimise, Oct 29, 2022.

  1. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,029
    When I test android build with editor as server then I get this error. Then the game starts to not working properly anymore. Seems like it's unstable. I found that u can easily reproduce it by tab editor server out and back again. You will get the following error when u do that.

    System.InvalidOperationException: A ghost changed type, ghost must keep the same serializer type throughout their lifetime
    This Exception was thrown from a job compiled with Burst, which has limited exception support.
    0x00007ff83c119825 (00d71a9bbe63e83b45cfe08dedb9a8f) [GhostChunkSerializer.cs:822] Unity.NetCode.GhostChunkSerializer::Unity.NetCode.GhostChunkSerializer.SerializeEntities
    0x00007ff83c10d95a (00d71a9bbe63e83b45cfe08dedb9a8f) [GhostChunkSerializer.cs:1555] Unity.NetCode.GhostChunkSerializer::Unity.NetCode.GhostChunkSerializer.SerializeChunk
    0x00007ff83c129bbe (00d71a9bbe63e83b45cfe08dedb9a8f) [GhostSendSystem.cs:993] Unity.NetCode.GhostSendSystem/SerializeJob::Unity.NetCode.GhostSendSystem.SerializeJob.sendEntities
    0x00007ff83c104205 (00d71a9bbe63e83b45cfe08dedb9a8f) [IJobParallelForDefer.cs:64] Unity.Jobs.IJobParallelForDeferExtensions.JobParallelForDeferProducer`1<Unity.NetCode.GhostSendSystem.SerializeJob>.Execute
    0x00007ff83c0ea211 (00d71a9bbe63e83b45cfe08dedb9a8f) af7dabd0549a381e501936043c336ba5
    0x00007ff704d98db0 (Unity) ExecuteJob
    0x00007ff704d99114 (Unity) ExecuteJobCopyData
    0x00007ff704d99f05 (Unity) ForwardJobForEachToManagedDefer
    0x00007ff704d9690a (Unity) ujob_execute_job
    0x00007ff704d96157 (Unity) lane_guts
    0x00007ff704d98004 (Unity) worker_thread_routine
    0x00007ff704fae9e7 (Unity) Thread::RunThreadWrapper
    0x00007ff8a80a7034 (KERNEL32) BaseThreadInitThunk
    0x00007ff8a93e26a1 (ntdll) RtlUserThreadStart


    System.InvalidOperationException: Failed to send a snapshot to a client
    This Exception was thrown from a job compiled with Burst, which has limited exception support.
    0x00007ff83c1046c7 (00d71a9bbe63e83b45cfe08dedb9a8f) [IJobParallelForDefer.cs:66] Unity.Jobs.IJobParallelForDeferExtensions.JobParallelForDeferProducer`1<Unity.NetCode.GhostSendSystem.SerializeJob>.Execute
    0x00007ff83c0ea211 (00d71a9bbe63e83b45cfe08dedb9a8f) af7dabd0549a381e501936043c336ba5
    0x00007ff704d98db0 (Unity) ExecuteJob
    0x00007ff704d99114 (Unity) ExecuteJobCopyData
    0x00007ff704d99f05 (Unity) ForwardJobForEachToManagedDefer
    0x00007ff704d9690a (Unity) ujob_execute_job
    0x00007ff704d96157 (Unity) lane_guts
    0x00007ff704d98004 (Unity) worker_thread_routine
    0x00007ff704fae9e7 (Unity) Thread::RunThreadWrapper
    0x00007ff8a80a7034 (KERNEL32) BaseThreadInitThunk
    0x00007ff8a93e26a1 (ntdll) RtlUserThreadStart
     
    Last edited: Oct 29, 2022
  2. jonathan-hertz

    jonathan-hertz

    Unity Technologies

    Joined:
    Jan 15, 2020
    Posts:
    11
    Hi, I tried reproducing the issue but was unable to do so. Are there any specific settings you have enabled, or maybe it's some code in your project that is causing it?
     
  3. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,029
    I believe I dun have any specific settings. I think it failed to work properly when editor as server didn't always focus and run in background when u have a client player runtime build connect to editor server to do something.
     
  4. jonathan-hertz

    jonathan-hertz

    Unity Technologies

    Joined:
    Jan 15, 2020
    Posts:
    11
    Hmm, I was only able to get packet queue full when run in background isn't enabled, no actual errors. Either way, the server should always be running in the background to avoid problems such as these.
     
  5. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    774
    mmm.. Are you changing archetype on the server ? adding/removing component or something like that? Are you using something like shared component or distance partitioning ? (So ghost are actually changing chunks time to time?)
     
  6. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,029
    Should be no since it's the same project I upgrade from 0.51 to this new 1.0. It looks like not really make sense since after upgrade it's not working anymore is caused by the issue u mention. Previously at 0.51 it works perfectly.