docs.unity3d.com
    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.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.NetCode
    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
    NetworkTick baseline1_tick
    NetworkTick baseline2_tick

    Methods

    PredictInt(Int32, Int32, Int32)

    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
    Int32 baseline0
    Int32 baseline1
    Int32 baseline2
    Returns
    Type Description
    Int32

    PredictLong(Int64, Int64, Int64)

    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
    Int64 baseline0
    Int64 baseline1
    Int64 baseline2
    Returns
    Type Description
    Int64
    In This Article
    • Constructors
      • GhostDeltaPredictor(NetworkTick, NetworkTick, NetworkTick, NetworkTick)
    • Methods
      • PredictInt(Int32, Int32, Int32)
      • PredictLong(Int64, Int64, Int64)
    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