docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct GhostDeltaPredictor

    For internal use only. Used by the ghost component serializer to calculate (predict) the new value for a field, given the two previous baseline values.

    This value provides a good estimate for current value of a variable when changes are linear or otherwise predictable. I.e. Small deltas have good compression ratios.

    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 GhostDeltaPredictor

    Constructors

    GhostDeltaPredictor(NetworkTick, NetworkTick, NetworkTick, NetworkTick)

    Construct the predictor using the last three recent baselines ticks. The ticks are used to calculate the relative weight that is applied to the baseline values.

    Declaration
    public GhostDeltaPredictor(NetworkTick tick, NetworkTick baseline0_tick, NetworkTick baseline1_tick, NetworkTick baseline2_tick)
    Parameters
    Type Name Description
    NetworkTick tick

    the current server tick

    NetworkTick baseline0_tick

    Network tick baseline

    NetworkTick baseline1_tick

    Network tick baseline

    NetworkTick baseline2_tick

    Network tick baseline

    Methods

    PredictInt(int, int, int)

    Calculate the predicted value for the given integer, using the previous three baselines.

    Declaration
    public int PredictInt(int baseline0, int baseline1, int baseline2)
    Parameters
    Type Name Description
    int baseline0

    Tick baseline

    int baseline1

    Tick baseline

    int baseline2

    Tick baseline

    Returns
    Type Description
    int

    Predicted value for given integer

    PredictLong(long, long, long)

    Calculate the predicted value for the given long, using the previous three baselines.

    Declaration
    public long PredictLong(long baseline0, long baseline1, long baseline2)
    Parameters
    Type Name Description
    long baseline0

    Tick baseline

    long baseline1

    Tick baseline

    long baseline2

    Tick baseline

    Returns
    Type Description
    long

    Predicted value for given long

    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)