Today I wanted to write a script for showing the speed values on screen. Have a screenshot:
Click
here to download. Edit: new version below.
It basically shows position and speed value for the current and last 20 frames. The lines scroll automatically each frame, from top to bottom. It automatically resets when you load a savestate.
The speed colors change in order to reflect the known target speed amounts. Red is for when standing still, white is average, green is good (maximum known speed), and blue is used if by any change you manage to break the known speed limit by whatever means.
Note that the speed value can randomly vary slightly due to a bug in the game engine, not because of this script.
For example, when you jump, the speed for the first frame is 1.8, then gets to 1.84, then 1.81, and then it finally starts lowering. This is why I don't trust speed values found in the game memory.
Edit: turns out it was actually my script's fault: the initial speed for jumping is 1.87. I've fixed the bug and you can download the v1.1 script
here.
Still, it's the game's fault if the horizontal speed does occasionally drop by 0.01 when walking from left to right. Don't trust speed values found in game memory.
And I've also created a script for calculating the average speed. You can download it
here. Edit 2: new version below.
Aesthetically speaking it's the same thing, even for the colors. The only difference is that the speed amounts are calculated as average amount of all the speeds from script launch onwards. If you want to start a new measurement, you must restart script execution. Starting the script execution in the right frame is vital in order to get the exact average. Also, in order to be able to do proper comparisons, make sure to keep track of the amount of frames; for this reason I added a frame counter that starts from script launch.
Edit 2: fixed in the average speed script a nasty bug caused due to bad handling of exponential notation. You can download v1.2
here.