Upvote Upvoted 30 Downvote Downvoted
Horizontal Velocity HUD Speedometer
posted in Customization
1
#1
0 Frags +

https://drive.google.com/file/d/15ZU9edavdIm2XVofU8XCxjc9IlvV6gDB

First time I've seen a horizontal velocity only speedometer so I'm uploading everywhere I'm told to

Main limitation is that the way I work out the horizontal velocity can have a little inaccuracy at times but I've managed to get the error <5%

Download instructions in readme

Demonstration here:
https://youtu.be/4EKwcbOttY8

https://drive.google.com/file/d/15ZU9edavdIm2XVofU8XCxjc9IlvV6gDB

First time I've seen a horizontal velocity only speedometer so I'm uploading everywhere I'm told to

Main limitation is that the way I work out the horizontal velocity can have a little inaccuracy at times but I've managed to get the error <5%

Download instructions in readme

Demonstration here:
https://youtu.be/4EKwcbOttY8
2
#2
12 Frags +

It's incredible you managed to implement this using VMT proxy math. I would not have been able to come up with a way to do this using the limited VMT math operations
A few suggestions and improvements I made over 3 days and a lot of head scratching.

  • Biggest improvement was in the Babylonian square-root method. instead of using 1 as an initial guess, using PlayerSpeed as an initial guess you can cut your iterations down from 11 iterations to just 2 with the same level of accuracy in most situations. This is because usually PlayerSpeed is pretty close to the square root we are interested in.
    There is the edge case that if you're going directly vertical (like jumping) then the game's reported speed and your horizontal speed can be different enough to require more iterations, I ended up getting around this by just overriding the initial guess to be 1 if my horizontal speed was less than 1 (stationary). You might be able to raise that initial guess override to account for way more extreme edge cases, but I haven't checked what the threshold for that is.
  • I also simplified the way that the final velocity is translated into the frames for the VTF. I'm not entirely certain what the original method used by you and Waldo was, but I just divide the final velocity by the digit place, then use the WrapMinMax proxy as a modulus 10 for the final frame count.
  • I stabilize the speedometer output by just adding 0.5 to the final velocity, which stops it from fluctuating down by 1 unit repeatedly by giving enough of a buffer to skip whatever calculation error causes that (happens in the game reported velocity too).

Here's a link to my implementation in a HUD: GitHub
Here's a link to just the speedometer download: Google Drive

One issue I've been working through but haven't found a solution to yet is the under reporting of speed when walking up or down a slope. From what I can tell, when you are contacting the ground the game ignores your Z velocity in its calculation for PlayerSpeed, which skews how we extract the frame time from that value.
I feel like there is probably a way to check if the Z position in our calculation is being excluded from the PlayerSpeed calculation, but I haven't had any luck.

It's incredible you managed to implement this using VMT proxy math. I would not have been able to come up with a way to do this using the limited VMT math operations
A few suggestions and improvements I made over 3 days and a lot of head scratching.
[list]
[*] Biggest improvement was in the Babylonian square-root method. instead of using 1 as an initial guess, using PlayerSpeed as an initial guess you can cut your iterations down from 11 iterations to just 2 with the same level of accuracy in [i]most[/i] situations. This is because usually PlayerSpeed is pretty close to the square root we are interested in.
There is the edge case that if you're going directly vertical (like jumping) then the game's reported speed and your horizontal speed can be different enough to require more iterations, I ended up getting around this by just overriding the initial guess to be 1 if my horizontal speed was less than 1 (stationary). You might be able to raise that initial guess override to account for way more extreme edge cases, but I haven't checked what the threshold for that is.
[*] I also simplified the way that the final velocity is translated into the frames for the VTF. I'm not entirely certain what the original method used by you and Waldo was, but I just divide the final velocity by the digit place, then use the WrapMinMax proxy as a modulus 10 for the final frame count.
[*] I stabilize the speedometer output by just adding 0.5 to the final velocity, which stops it from fluctuating down by 1 unit repeatedly by giving enough of a buffer to skip whatever calculation error causes that (happens in the game reported velocity too).
[/list]
Here's a link to my implementation in a HUD: [url=https://github.com/PapaPeach/xhud/tree/development/materials/vgui/replay/thumbnails/speedometer]GitHub[/url]
Here's a link to just the speedometer download: [url=https://drive.google.com/drive/folders/1XRK4T9CwCcXKF3Q5sphYH_P76pxDu_9I?usp=sharing]Google Drive[/url]

One issue I've been working through but haven't found a solution to yet is the under reporting of speed when walking up or down a slope. From what I can tell, when you are contacting the ground the game ignores your Z velocity in its calculation for PlayerSpeed, which skews how we extract the frame time from that value.
I feel like there is [i]probably[/i] a way to check if the Z position in our calculation is being excluded from the PlayerSpeed calculation, but I haven't had any luck.
3
#3
6 Frags +

this shit was posted 2 weeks ago and nobody noticed

appears to work pretty well, still playing around with it but i think its accurate enough

edit: seems to underestimate slightly, 1100 u/s should be rocket speed but its a bit slower with SgtPugs' speedo

this shit was posted 2 weeks ago and nobody noticed

appears to work pretty well, still playing around with it but i think its accurate enough

edit: seems to underestimate slightly, 1100 u/s should be rocket speed but its a bit slower with SgtPugs' speedo
4
#4
Spaceship Servers
10 Frags +

I've had my head buried in this engine for literal years of my life, and the shit hud people can do is still fuckin wizardry to me. Fucking phenomenal work

I've had my head buried in this engine for literal years of my life, and the shit hud people can do is still fuckin wizardry to me. Fucking phenomenal work
5
#5
2 Frags +

Is it at all possible to create a hud mod that only tracks vertical vel too? Phenomenal work!

Is it at all possible to create a hud mod that only tracks vertical vel too? Phenomenal work!
6
#6
-2 Frags +

:)

:)
Please sign in through STEAM to post a comment.