Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question GhostComponent overhead?

Discussion in 'NetCode for ECS' started by optimise, Nov 28, 2023.

  1. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,108
    Is that zero overhead in terms of cpu performance and also network bandwidth if I just only use it to strip out component and make it only available at predicted client or all predicted using PrefabType = GhostPrefabType.PredictedClien or PrefabType = GhostPrefabType.AllPredicted attribute? There's no
    [GhostField] inside the component data field.
     
  2. NikiWalker

    NikiWalker

    Unity Technologies

    Joined:
    May 18, 2021
    Posts:
    286
    Hey optimise! Yes, correct. The presence of the GhostComponentAttribute does not incur bandwidth costs, nor should it increase CPU load of the GhostSend/Receive/UpdateSystem's, as we strip once, and don't iterate over those components during serialization (IIRC).
     
    Opeth001 and optimise like this.