Stunts Forum

ZakStunts - the Competition => Competition and Website => Topic started by: HerrNove on September 24, 2025, 12:40:20 PM

Title: Time rounding
Post by: HerrNove on September 24, 2025, 12:40:20 PM
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 :)
Title: Re: Time rounding
Post by: dreadnaut on September 24, 2025, 11:30:14 PM
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!
Title: Re: Time rounding
Post by: dreadnaut on September 25, 2025, 11:44:03 PM
Should be fixed now. I've removed all casts, and replaced them with the explicit conversion function in each occasion: floor, round, and intval.
Title: Re: Time rounding
Post by: HerrNove on September 25, 2025, 11:47:15 PM
Thanks for the quick fix!