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

Fixed time step config #19

Open
bentles opened this issue Jan 7, 2023 · 4 comments
Open

Fixed time step config #19

bentles opened this issue Jan 7, 2023 · 4 comments

Comments

@bentles
Copy link

bentles commented Jan 7, 2023

Is it possible to make the fixed timestep configurable? I can add it myself just not sure if xelmish relies on the timestep being fixed in some way

@ChrisPritchard
Copy link
Owner

No xelmish doesnt rely on it, and neither should you I would think? Almost always doing calculations with elapsed game time is more appropriate. Whatcha need to change it for?

@bentles
Copy link
Author

bentles commented Jan 8, 2023

I was thinking if you set the fixed timestep (and vsync I think) to false you can have the game draw as fast as possible and then implement a fixed timestep inside of that loop like this for the physics. I guess another option is to set the TargetElapsedTime to a smaller value (for a higher frame rate) and then skip calls to update the physics at a lower frame rate.

@ChrisPritchard
Copy link
Owner

Right. My understanding is that drawing faster might cause some stuttering due to garbage collection, but feel free to create a PR and I'll take a look. Or you can fork the project and have a go if you like?

@bentles
Copy link
Author

bentles commented Jan 11, 2023

Cool I'll give it a go after work today

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

No branches or pull requests

2 participants