Open pokeball99 opened 5 years ago
Pretty sure @leijurv already did something like this, although probably over a shorter period than 30s. Maybe this should be rephrased as allow configuring the average time period?
There is already a moving average with configurable duration. However I realized that it isn't exactly accurate due to lagbacks. What I mean is that if you take the average of your speed values over the last 5 seconds, that isn't how far you moved because of lagbacks having a speed but in the opposite direction. Instead of having a ring buffer of speeds, we need a ring buffer of positions and we need to calculate the actual distance you've traveled in that time.
If I may add, changing the client TIMER does not alter the recorded speed. Nor is vertical movement taken into account (I understand that isn't always useful, & maybe having a separate speedometer would be less useless?).
The awkward flickering is annoying with SPEED (Xhop) & antispeed on servers jittering the visuals.
lagbacks having a speed but in the opposite direction
That's velocity, speed it scalar while velocity is vector; crudely speed = |velocity|
. There is no such thing as negative speed.
That said, the lag back would still affect the average speed, probably by increasing it.
What is your suggestion?
Have the HUD Speedometer average the speed of the player using the speed from the last X seconds
Why is it useful?
various speed hacks cause the HUD Speedometer to flicker it's number, this would mostly solve that issue, as well as give a more useful reading