web-marbles
web-marbles copied to clipboard
Improved marble timing
Description
Currently, the final time of a marble is calculated by using Date.now() at the race start and at crossing the finish line. Lag(spikes) and/or small accumulated inaccuracies during the physics updates could affect the end result. It's definitely negligible for the vast majority of races, but for accuracy's sake and in case of lag spikes, using a frame counter would keep the timing consistent.
Minimum Acceptance Criteria
- Physics should use frame counting in combination with the tickrate to determine the finish time of marbles, where counting starts when the gates are opened.
- Physics'
onMarbleFinishedevent should return the finish time of the marble, using the same time format that's currently used.