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

Max physics dt slider should round to nearest 0.01 #213

Open
JonnyOThan opened this issue Mar 5, 2024 · 2 comments
Open

Max physics dt slider should round to nearest 0.01 #213

JonnyOThan opened this issue Mar 5, 2024 · 2 comments
Labels
kspUI User interface improvement

Comments

@JonnyOThan
Copy link
Contributor

I recently tried to set my max physics dt to 0.04, and I noticed that in the settings.cfg it was set like this:

PHYSICS_FRAME_DT_LIMIT = 0.03771428

This will result in a rather uneven framerate when the game is under load. We should probably round it to the nearest 0.01 so that you have precise control over the number of fixed updates per frame.

Perhaps this should be done when setting the unity field rather than only in the UI, but I'm not sure.

@JonnyOThan JonnyOThan added the bug Something isn't working label Mar 5, 2024
@gotmachine
Copy link
Contributor

Having the slider move in 0.1 increments in the settings UI would be more consistent with the displayed value, but I don't see underlying the technical need to have a rounded value, the fixed vs update loops call ratio is quite unpredictable in any case.
In any case, I wouldn't qualify this as a bug.

@gotmachine gotmachine added kspUI User interface improvement and removed bug Something isn't working labels Apr 5, 2024
@JonnyOThan
Copy link
Contributor Author

In the cases where the game is always hitting the dt limit, a value that doesn't factor nicely with 0.02 will result in periodic and regular spikes. With the max dt at 0.03 you will always get a 2-1-2-1 pattern which is at least consistent. With 0.037 you'd still get a repeating pattern but it won't feel very good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kspUI User interface improvement
Development

No branches or pull requests

2 participants