docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct SnapshotPacketLossStatistics

    Stores packet loss causes and statistics for all received snapshots. Thus, client-only (with one exception). Access via NetworkSnapshotAck.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.NetCode
    Assembly: Unity.NetCode.dll
    Syntax
    public struct SnapshotPacketLossStatistics
    Remarks

    Very similar approach to Unity.Networking.Transport.UnreliableSequencedPipelineStage Statistics.

    Fields

    NumClientAckErrorsEncountered

    Denotes how many times the client has reported a snapshot ack error, leading to the ack history buffer to have to be reset.

    Declaration
    public ulong NumClientAckErrorsEncountered
    Field Value
    Type Description
    ulong

    NumPacketsAcked

    Server-only. Stores the number of snapshots the client has successfully replied that they have acked.

    Declaration
    public ulong NumPacketsAcked
    Field Value
    Type Description
    ulong

    NumPacketsCulledAsArrivedOnSameFrame

    The Netcode package can only process one snapshot per render frame. If 2 or more arrive on the same frame, we'll delete all but one, without processing them. Therefore, this form of packet loss is common when your connection jitter is higher than a NetworkTickRate interval. E.g. If your jitter is ±20ms, but your NetworkTickRate is 60Hz (16.67ms), you can expect a lot of packet clobbering.

    Declaration
    public ulong NumPacketsCulledAsArrivedOnSameFrame
    Field Value
    Type Description
    ulong
    Remarks

    This is also called a "Packet Burst".

    NumPacketsCulledOutOfOrder

    Counts the number of snapshot packets dropped (i.e. "culled") due to invalid SequenceId. I.e. Implies the packet arrived, but out of order.

    Declaration
    public ulong NumPacketsCulledOutOfOrder
    Field Value
    Type Description
    ulong

    NumPacketsDroppedNeverArrived

    Detects gaps in CurrentSnapshotSequenceId to determine real packet loss.

    Declaration
    public ulong NumPacketsDroppedNeverArrived
    Field Value
    Type Description
    ulong

    NumPacketsReceived

    On the client, it counts the number of snapshot packets received by said client from the server. On the server, it stores the number of snapshots sent.

    Declaration
    public ulong NumPacketsReceived
    Field Value
    Type Description
    ulong

    Properties

    AckPercent

    Server-only. Percentage of all snapshot packets sent that the client has acked.

    Declaration
    public double AckPercent { get; }
    Property Value
    Type Description
    double

    ArrivedOnTheSameFrameClobberedPacketLossPercent

    Percentage of all snapshot packets - that we assume must have been sent to us (based on SequenceId) - which are culled due to arriving on the same frame as another snapshot.

    Declaration
    public double ArrivedOnTheSameFrameClobberedPacketLossPercent { get; }
    Property Value
    Type Description
    double

    CombinedPacketLossCount

    Count of packets lost in some form.

    Declaration
    public ulong CombinedPacketLossCount { get; }
    Property Value
    Type Description
    ulong

    CombinedPacketLossPercent

    Percentage of all snapshot packets - that we assume must have been sent to us (based on SequenceId) - which are dropped (for any reason).

    Declaration
    public double CombinedPacketLossPercent { get; }
    Property Value
    Type Description
    double

    NetworkPacketLossPercent

    Percentage of all snapshot packets - that we assume must have been sent to us (based on SequenceId) - which are lost due to network-caused packet loss.

    Declaration
    public double NetworkPacketLossPercent { get; }
    Property Value
    Type Description
    double

    OutOfOrderPacketLossPercent

    Percentage of all snapshot packets - that we assume must have been sent to us (based on SequenceId) - which are lost due to arriving out of order (and thus being culled).

    Declaration
    public double OutOfOrderPacketLossPercent { get; }
    Property Value
    Type Description
    double

    Methods

    ToFixedString()

    Formatted dump of statistics for this world-type.

    Declaration
    public FixedString512Bytes ToFixedString()
    Returns
    Type Description
    FixedString512Bytes

    Formatted dump of statistics for this world-type.

    Operators

    operator +(SnapshotPacketLossStatistics, SnapshotPacketLossStatistics)

    Adds two SnapshotPacketLossStatistics

    Declaration
    public static SnapshotPacketLossStatistics operator +(SnapshotPacketLossStatistics a, SnapshotPacketLossStatistics b)
    Parameters
    Type Name Description
    SnapshotPacketLossStatistics a

    First SnapshotPacketLossStatistics

    SnapshotPacketLossStatistics b

    Second SnapshotPacketLossStatistics

    Returns
    Type Description
    SnapshotPacketLossStatistics

    The resulting sum of the two SnapshotPacketLossStatistics.

    operator -(SnapshotPacketLossStatistics, SnapshotPacketLossStatistics)

    Subtracts two SnapshotPacketLossStatistics

    Declaration
    public static SnapshotPacketLossStatistics operator -(SnapshotPacketLossStatistics a, SnapshotPacketLossStatistics b)
    Parameters
    Type Name Description
    SnapshotPacketLossStatistics a

    First SnapshotPacketLossStatistics

    SnapshotPacketLossStatistics b

    Second SnapshotPacketLossStatistics

    Returns
    Type Description
    SnapshotPacketLossStatistics

    The resulting difference of the two SnapshotPacketLossStatistics.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)