SerializeSnapshot & Deserialize increase the startOffset and decrease ChangeMaskBits by 32 only once as it calls GhostComponentSerializer.CopyFromChangeMask to get the correct changeMask resulting in badly serialized data. It should increase it after every call resulting in 32->64->96 offset. CalculateChangeMask seems to be doing this correctly.
IIRC correctly we recently fixed that issue, but I may have understood that incorrectly.
The generated code for the serialiser does not increment the startOffset itself, but introduce every 32 change mask bits something like:
GhostComponentSerializer.CopyFromChangeMask(
changeMaskData, startOffset + __GHOST_CHANGE_MASK_BITS__, ChangeMaskBits - __GHOST_CHANGE_MASK_BITS__)
The GHOST_CHANGE_MASK_BITS is actually the incrementing variable (32,64,96…)
Se a generated serialiser looks like:
var changeMask.= GhostComponentSerializer.CopyFromChangeMask(changeMaskData, startOffset, ChangeMaskBits)
if(xxx..)
dataStream.Write(..)
...
//after 32 change bits
changeMask = GhostComponentSerializer.CopyFromChangeMask(changeMaskData, startOffset + 32, ChangeMaskBits - 32);
Can you please copy here the code of one of these generated ghost serialiser that are incorrectly handling this? Even better if you can open a case for this.
Correct, in SerializeSnapshot and Deserialize the GHOST_CHANGE_MASK_BITS only does the first 32, and does not increment to 64,96 etc.
If you still need a case I’ll try make a small project and submit at end of day.
which version of Netcode for Entities are you using? (just to be sure) The latest one?
I’m on 1.0.15, I didn’t see the new version. Do you know if it would be fixed in that one? It did not specify in change log.
I confirm the bug still exist and will be fixed as soon as possible.
Got it reported as an issue ![]()
yeah! It has been already resolved.