docs.unity3d.com
    Show / Hide Table of Contents

    Struct NetworkStreamSnapshotTargetSize

    A per-connection component, which is used by the GhostSendSystem (on the server) to force a non-default packet size for snapshots. Must be added to the NetworkConnection entity for a connection, by your game logic.

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.NetCode
    Syntax
    public struct NetworkStreamSnapshotTargetSize : IComponentData, IQueryTypeParameter
    Remarks

    Helps enforce a specific KBPS target. For example: A value of 416 bytes * 60hz (via SimulationTickRate) = ~200kbit/s. Note, however, that this:

    • Does not include or affect RPCs, commands, control messages, or UDP header overhead.
    • Does include UTP packet header overhead.

    Fields

    Value

    The desired packet size to use for the snapshot. By default, the packet size is the MTU minus some headers. It is possible to specify a packet size larger than a single MTU, in which case the snapshot data is sent using a pipeline that support fragmentation (see unreliableFragmentedPipeline. The upper bound limit for this value is payload capacity of the fragmentation pipeline (see FragmentationUtility).

    Declaration
    public int Value
    Field Value
    Type Description
    Int32
    Remarks

    There is a minimum snapshot size, which ensures that some new and destroyed entities get replicated, and ensures that at least one ghost is replicated in every snapshot. See Unity.NetCode.GhostChunkSerializer for this behaviour.

    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