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

Changing demos tickrate #321

Open
Kermalis opened this issue Apr 26, 2024 · 1 comment
Open

Changing demos tickrate #321

Kermalis opened this issue Apr 26, 2024 · 1 comment

Comments

@Kermalis
Copy link

Hello, I've been using bepu for a few years now. However I recently have had to diagnose an issue in my project, so I looked to reproduce it in the demos which I'm familiar with.
However, I had to change the rate from 1/60 to 1/120 to match my settings. This completely slows down the CarDemo for example. So I assume there are still some assumptions about being 60hz around the demos project, but I couldn't figure it out myself. I did see a hard-coded 60 for the framerate debugger as well, but that didn't solve the issue.

So I'm just making this issue to bring awareness that the demos can use more access to the actual tickrate somewhere, so it can be easily changed via the one constant

@RossNordby
Copy link
Member

The demos simply execute updates at the refresh rate of the monitor or as close to that as it can get. That does indeed mean that changing the timestep duration from 1/60 to 1/120 will make time progress half as fast, since by default, only one timestep is executed per graphical frame.

This was done for simplicity and for debugging; it's often helpful to have a visual representation of every single frame, and there's no hard requirement for consistency in the demos application.

That said, it was definitely less wonky back when most monitors were only 60hz. I was playing around with it on a 240hz laptop recently and... something does probably need to change :P

I might just add a simple flag for temporal accumulation based timestepping. There's already an example implementation commented out in the demo update showing how to do it.

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