Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pause time calculation has (extremely minor) rounding errors #8

Open
Sophira opened this issue Aug 3, 2017 · 0 comments
Open

Pause time calculation has (extremely minor) rounding errors #8

Sophira opened this issue Aug 3, 2017 · 0 comments

Comments

@Sophira
Copy link
Owner

Sophira commented Aug 3, 2017

This is an extremely minor bug, but it's something that I want to fix at some point because I'm a bit of a perfectionist.

When calculating the amount of time to pause for, the component makes efforts to be as accurate as possible; it uses LiveSplit's timing mechanisms to pause the timer with accuracy down to the millisecond, and when the pause time expires, the component will adjust the Game Time to take into account the fact that LiveSplit's update refresh rate is not millisecond-accurate.

This allows us to pause accurately for times down to the millisecond. However, the component does not take into account rounding errors when calculating the number of milliseconds to pause for. This means that if the component needs to pause for, say, 500 frames at 60Hz (8.3333333... seconds), then it will only pause for 8333 milliseconds, discarding the remaining 0.00033333... seconds. In a run with 50 splits, and assuming that they all pause for this amount of time, the final recorded time will be out by exactly 1 frame (0.01666666... seconds).

This is obviously not something that most people will notice, and I don't plan on spending a large amount of time on this problem, but I do want to fix it at some point by allowing the component to remember how much time was discarded and, once the total 'discarded' time reaches a millisecond or more, adding that millisecond to the next pause time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant