Search Unity

Feedback Ghost entity of same archetype split as 1 ghost per chunk

Discussion in 'NetCode for ECS' started by optimise, Oct 2, 2023.

  1. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,128
    There's bug at last year that will sync incorrect ghost entity data between server and client and cause the game not working properly. It has been hack fixed by splitting all ghosts into 1 ghost per chunk even it's same archetype at both client and server. Is that official schedules to merge all the ghosts with same archetype back into same chunk at 1.1 release soon or later to boost performance significantly?
     
  2. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    894
    We didn't force 1 ghost per chunk. We just forced the fact every ghost, even if they have the same archetype (in terms of components) lives in different chunks. But you can still have multiple ghost per chunks.

    In term of changing that, there is not plan for it yet.
    Considering ghost of different types (because of different prefabs) but with the same archetype in the same chunk requires some major rewrite of certain logic in the GhostUpdateSystem, GhostReceiveSystem, GhostHystorySystem and so on. We need to still process the ghost differently (because they have different prefabs).
     
    optimise likes this.
  3. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,128
    Ya. But when it's at the same chunk, I believe it can reduce the lookup cost for searching target chunk before getting the target ghost entity.
     
  4. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,128
    I see. So actually it's each new ghost prefab will store in new chunk. The same ghost entity instantiates from the same ghost prefab will still store into same chunk.
     
  5. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    894
    Of course, as It should be! :)