Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Feature Request Customizable Ghosts Update Frequency

Discussion in 'NetCode for ECS' started by Opeth001, Aug 21, 2023.

  1. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,078
    Hello Unity Team,

    I've been working on a project involving multiplayer gameplay and have been working on a crucial aspect related to network optimization. Presently, when it comes to sending Ghost data to clients, the serialization frequency tends to be uniform for all Ghosts and Connections. However, I strongly believe that there could be substantial benefits in granting developers the ability to alter the serialization frequency of Ghosts based on custom factors, similar to the Relevancy feature.

    In situations where specific Ghosts (such as far away teammates or some marked enemies for display on the minimap) do not require high-frequency updates, the option to adjust their update rate for specific connections could help reducing network traffic and enhancing overall performance.

    I'm curious if Unity's Netcode team has any plans or considerations regarding the implementation of a feature that empowers developers to dynamically adjust the serialization frequency of ghosts based on custom factors. The inclusion of such a feature would enable game developers to meticulously fine-tune their network optimization strategies, ultimately leading to an elevated multiplayer experience.


    Thank you in Advance!
     
  2. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    806
    You can alter their update rate for ghosts by changing their priority. However, prioritisation is on a per chunk-basis using the GhostImportance and setting up the ScaleFunction.

    Although we already reckognised the importance of having this flexibility, fine tuning on a per-ghost basis is not currently achievable, because serialisation work an "per-chunk" basis.
    However, it is still possible to avoid serialising an entity by adding some little extra data on the already tracked per-ghost state on the server, allowing to avoid serialising ghosts based on some other factors (tuneable by users) in the same way we do for relevancy,
    This is actually pretty achievable by customising the package, but require indeed some changes.

    Indeed we want to provide better handling for this, importance and relevancy in general. So we hope to provide some improvement for that in the future.
     
    Opeth001 likes this.
  3. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,078
    Thank you for the detailed answer !