ImpactDevelopment / ImpactIssues

Please use this repo to report bugs and request features
https://impactclient.net/
220 stars 36 forks source link

More Useful HUD Speed #1077

Open pokeball99 opened 5 years ago

pokeball99 commented 5 years ago

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

LeafHacker commented 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?

leijurv commented 5 years ago

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.

DeeFeeCee commented 5 years ago

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.

LeafHacker commented 5 years ago

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.