Search Unity

Bug [1.0.8] Ghost CodeGenerator bug

Discussion in 'NetCode for ECS' started by hxhloveunity, Jun 5, 2023.

  1. hxhloveunity

    hxhloveunity

    Joined:
    May 27, 2022
    Posts:
    37
    Define a structure:

    Code (CSharp):
    1. public struct ActorAttributes : IComponentData {
    2.         [GhostField] public FixedBytes510 content;
    3. }
    Function SerializeSnapshot was wrong:

    Code (CSharp):
    1. uint num1 = GhostComponentSerializer.CopyFromChangeMask(changeMaskData, startOffset, 510);
    2. uint num2 = GhostComponentSerializer.CopyFromChangeMask(changeMaskData, startOffset + 32, 478);
    3. uint num3 = GhostComponentSerializer.CopyFromChangeMask(changeMaskData, startOffset + 32, 478);
    4. uint num4 = GhostComponentSerializer.CopyFromChangeMask(changeMaskData, startOffset + 32, 478);
    5. uint num5 = GhostComponentSerializer.CopyFromChangeMask(changeMaskData, startOffset + 32, 478);
    6. ....
    7. uint num16 = GhostComponentSerializer.CopyFromChangeMask(changeMaskData, startOffset + 32, 478);
    8.  
    and startOffset was not changed.
     
  2. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    900
    FixedBytes510 are only for internal use and debug purpose (see the class description), please use FixedList512 or similar instead.
    Thanks for reporting. Please open a case for it for proper tracking.
     
  3. hxhloveunity

    hxhloveunity

    Joined:
    May 27, 2022
    Posts:
    37
    The DefaultTypes supported by Ghost currently seem to only include the FixedString type, but what we need to synchronize is a custom data type that FixedString cannot meet.

    and how to open a case?