docs.unity3d.com
    Show / Hide Table of Contents

    Struct ServerPopulatePrespawnedGhostsSystem

    Responsible for assigning a unique ghostId to each pre-spawned ghost, and and adding the ghosts to the spawned ghosts maps. Relies on the previous initializations step to determine the subscene subset to process.

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.NetCode
    Syntax
    [WorldSystemFilter(WorldSystemFilterFlags.ServerSimulation, WorldSystemFilterFlags.Default)]
    [UpdateInGroup(typeof(PrespawnGhostSystemGroup))]
    [UpdateAfter(typeof(PrespawnGhostInitializationSystem))]
    [BurstCompile]
    public struct ServerPopulatePrespawnedGhostsSystem : ISystem
    Remarks

    The server is authoritative and it is responsible for assigning unique id ranges to the each scene. For each section that present prespawn ghosts, the prespawn hash, id range and baseline hash are sent to client as part of the streaming protocol. Clients will use the received subscene hash and baseline hash for validation and the ghost range to assign the ghost id to the pre-spawned ghosts like the server. This remove any necessity for loading order determinism. Finally, clients will ack the server about the loaded scenes and the server, upon ack receipt, will start streaming the pre-spawned ghosts

    ### The Full Prespawn Subscene Sync Protocol

    The Server calculates the prespawn baselines. The Server assigns runtime ghost IDs to the prespawned ghosts. The Server stores the SubSceneHash, BaselineHash, AssignedFirstId, and PrespawnCount inside the the PrespawnHashElement collection. The Server creates a new ghost with a PrespawnSceneLoaded buffer that is serialized to the clients.

    ClientPopulatePrespawnedGhostsSystem

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023