Skip to content

Wrong PredictedPing equation #17

@hexengraf

Description

@hexengraf

I was revising the ping code in my own fork and noticed your predicted ping equation is different from Deaod's repo. Yours is:

PredictedPing = (2.0*PredictedPing + (Level.TimeSeconds - PingSendTime))/PingTweenTime;

While the original was:

PredictedPing = (2.0*PredictedPing + (Level.TimeSeconds - PingSendTime))/3.0;

The 3.0 there was very intentional, it gives 1/3 of weight to the new ping and 2/3 of weight to the old ping, it is an exponential moving average.
PingTweenTime should not be used in this equation, imagine what will happen if someone changes it to 1 or values below 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions