(IN-41882) [1.0.8] Enableable ghost component with specific attribute setup bug

Get 2 similar errors spamming when run the game at editor when setup enableable ghost component to be like this.

[GhostComponent(SendDataForChildEntity = true, SendTypeOptimization = GhostSendType.OnlyPredictedClients, OwnerSendType = SendToOwnerType.SendToOwner)]
[GhostEnabledBit]
public struct EnableableComponent : IComponentData, IEnableableComponent
{
    [GhostField]
    public bool value;
}

InvalidOperationException: Read only 0 enable bits but expected to read exacly 152 for this ghost type
Unity.NetCode.GhostUpdateSystem+UpdateJob.ValidateAllEnableBitsHasBeenRead (System.Int32 enableableMaskOffset, System.Int32 numEnableBits) (at ./Library/PackageCache/com.unity.netcode@1.0.8/Runtime/Snapshot/GhostUpdateSystem.cs:112)
Unity.NetCode.GhostUpdateSystem+UpdateJob.Execute (Unity.Entities.ArchetypeChunk& chunk, System.Int32 unfilteredChunkIndex, System.Boolean useEnabledMask, Unity.Burst.Intrinsics.v128& chunkEnabledMask) (at ./Library/PackageCache/com.unity.netcode@1.0.8/Runtime/Snapshot/GhostUpdateSystem.cs:656)
Unity.NetCode.GhostUpdateSystem+UpdateJob.Unity.Entities.IJobChunk.Execute (Unity.Entities.ArchetypeChunk& chunk, System.Int32 unfilteredChunkIndex, System.Boolean useEnabledMask, Unity.Burst.Intrinsics.v128& chunkEnabledMask) (at :0)
Unity.Entities.JobChunkExtensions+JobChunkProducer1[T].ExecuteInternal (Unity.Entities.JobChunkExtensions+JobChunkWrapper1[T]& jobWrapper, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at ./Library/PackageCache/com.unity.entities@1.0.8/Unity.Entities/IJobChunk.cs:409)
Unity.Entities.JobChunkExtensions+JobChunkProducer1[T].Execute (Unity.Entities.JobChunkExtensions+JobChunkWrapper1[T]& jobWrapper, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at ./Library/PackageCache/com.unity.entities@1.0.8/Unity.Entities/IJobChunk.cs:357)

InvalidOperationException: Read only 0 enable bits but expected to read exacly 148 for this ghost type
Unity.NetCode.GhostUpdateSystem+UpdateJob.ValidateAllEnableBitsHasBeenRead (System.Int32 enableableMaskOffset, System.Int32 numEnableBits) (at ./Library/PackageCache/com.unity.netcode@1.0.8/Runtime/Snapshot/GhostUpdateSystem.cs:112)
Unity.NetCode.GhostUpdateSystem+UpdateJob.Execute (Unity.Entities.ArchetypeChunk& chunk, System.Int32 unfilteredChunkIndex, System.Boolean useEnabledMask, Unity.Burst.Intrinsics.v128& chunkEnabledMask) (at ./Library/PackageCache/com.unity.netcode@1.0.8/Runtime/Snapshot/GhostUpdateSystem.cs:656)
Unity.NetCode.GhostUpdateSystem+UpdateJob.Unity.Entities.IJobChunk.Execute (Unity.Entities.ArchetypeChunk& chunk, System.Int32 unfilteredChunkIndex, System.Boolean useEnabledMask, Unity.Burst.Intrinsics.v128& chunkEnabledMask) (at :0)
Unity.Entities.JobChunkExtensions+JobChunkProducer1[T].ExecuteInternal (Unity.Entities.JobChunkExtensions+JobChunkWrapper1[T]& jobWrapper, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at ./Library/PackageCache/com.unity.entities@1.0.8/Unity.Entities/IJobChunk.cs:409)
Unity.Entities.JobChunkExtensions+JobChunkProducer1[T].Execute (Unity.Entities.JobChunkExtensions+JobChunkWrapper1[T]& jobWrapper, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at ./Library/PackageCache/com.unity.entities@1.0.8/Unity.Entities/IJobChunk.cs:357)

Thanks for the report optimise! Please file this as a Unity bug report, and link the IN-XXX report here.

Just to make sure I understand correctly:

  • Will the component replicate correctly if any of these GhostComponentAttribute values are different?
  • I.e. Is it a specific attribute value that causes this?
  • If so, presumably the workaround is to comment out some of these GhostComponentAttribute nuances for the time being? Does that unblock you?
  • Presumably this is 100% reproable immediately after entering playmode?

It looks like another missed test-case. We’ll get this patched. Thank you!

  1. Ya. The component seems replicate correctly at owner predicted ghost at client
    1. Ya, I change it back to [GhostComponent(SendDataForChildEntity = true)] then will fix the error spamming
  2. Yes. Basically it will spam errors when interpolated ghost inside ghost relevancy range and owner predicted ghost will start having difficulty to sync data like moving stuck there for sometime. And then when interpolated ghost out of range of ghost relevancy will stop error spamming and owner predicted ghost back to normal again.

IN-41882. Sorry for late bug report.

is there a hot fix for this?

No, it requires some replication fixes in the Netcode package. There is not an hot patch for it.

hwww, thank for the anws ,seem like have to pause project for a while.

is there a fix for this ?

we are fixing it, yes. We hope to release this soon

Note that you can work around this by simply commenting out these two arguments: **SendTypeOptimization = GhostSendType.OnlyPredictedClients, OwnerSendType = SendToOwnerType.SendToOwner**. When these fields use default values, this error does not occur. Commenting these out will slightly increase snapshot sizes, but my understanding is that it is not a blocking issue (especially during dev).

EDIT: The fix for this is non-trivial, but as Cristian said, is being worked on yes.

Hello.
is there a fix for this error ?