Shortened PingWindowSize to get a faster more accurate result. (#3395)

* Shortened PingWindowSize to get a faster more accurate result.

Shortened PingWindowSize to get a faster more accurate result.
It taking too long to calculate the average may look bad to users

* Revert "Shortened PingWindowSize to get a faster more accurate result."

This reverts commit 0a5916b4dc.

* Revert "Shortened PingWindowSize to get a faster more accurate result."

This reverts commit 0a5916b4dc.

* Shortened PingWindowSize to get a faster more accurate result.

Shortened PingWindowSize to get a faster more accurate result.
It taking too long to calculate the average may look bad to users

* Shortened PingWindowSize to get a faster more accurate result.

Shortened PingWindowSize to get a faster more accurate result.
It taking too long to calculate the average may look bad to users, choosing 6 gives us an average of 3 results, where as the previous 10, would wait for 5, it should be a slight visual improvement.
This commit is contained in:
JesusLuvsYooh 2023-02-25 10:11:56 +00:00 committed by GitHub
parent 228a577683
commit 4603bb1a4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,7 @@ public static class NetworkTime
public static float PingFrequency = 2;
/// <summary>Average out the last few results from Ping</summary>
public static int PingWindowSize = 10;
public static int PingWindowSize = 6;
static double lastPingTime;
@ -74,7 +74,7 @@ public static double time
public static void ResetStatics()
{
PingFrequency = 2;
PingWindowSize = 10;
PingWindowSize = 6;
lastPingTime = 0;
_rtt = new ExponentialMovingAverage(PingWindowSize);
#if !UNITY_2020_3_OR_NEWER