News:

Herr Otto Partz says you're all nothing but pipsqueaks!

Main Menu

Time rounding

Started by HerrNove, September 24, 2025, 12:40:20 PM

Previous topic - Next topic

HerrNove

I think it could be useful to formalize how the time is rounded after applying the car bonus. Last night I submitted a 1:45.10 with the Lotus, which corresponds to 83.029 seconds after applying the 21% bonus. The submission page showed me a weighed time of 1:23.02, which would have been enough to beat Mortimer by 0.01 s. However, after uploading the replay, the ranking showed a time of 1:23.03, exactly equal to Mortimer's and therefore penalized in terms of PTB.

My situation was not so bad as I got immediate feedback from the leaderboard, but in cases where a quiet replay is posted, having a unverifiable 0.01 discrepancy could result in big disappointments.

Pinging @dreadnaut :)

dreadnaut

Internally, it's definitely 8303 hsec or 1:23.03, so I can confirm the number reproduced by the scoreboard is the correct one.

The problem seems to be the cast to integer I (hastily?) introduced last time when I fixed the replay preview. As a cast, it truncates, so it works as a floor instead of a round, and 8302.9 becomes 8302.0 hsec, or 12:23.02.

I'll double check during the day, but I think it's an easy fix. Thanks for bringing it up!

dreadnaut

Should be fixed now. I've removed all casts, and replaced them with the explicit conversion function in each occasion: floor, round, and intval.

HerrNove

Thanks for the quick fix!