Jump to content

Deterministic lockstep issue with high FPS


RetekEger
 Share

Recommended Posts

Hi,

I'm pretty new to Babylon.js, only started using it a few days ago, but really enjoy it, great work! :)

I encountered some odd behavior with using deterministic lockstep on my setup, when running the example from the Animation page (https://www.babylonjs-playground.com/index.html#DU4FPJ#3) on my laptop's display (120Hz) the animation is twice as fast as on my connected monitor (60Hz) - tried with both Latest and Stable version, with both Cannon and Oimo plugins. My first guess would be that the algorithm is only prepared to handle low FPS, and does not take into account possible higher values. Also tried to dig in to the project on GitHub, but since I'm not that familiar with the structure, sadly I did not find the sources responsible for the behavior. Could some expert please verify my finding?

Thank you, keep up the good work, cheers!

Link to comment
Share on other sites

Hi @RaananW,
Thanks for the fast answer! Actually in the before mentioned example, the timestep is explicitly set to 1/60, and for my scenario I find 120 FPS a bit of overkill for this edge case, although I'd need to be sure, that animation speed is independent of the user's FPS. Is there a best practice, to limit the physics engines' FPS to 60, even if running on a 120Hz monitor? I'd expect all animations to play the same speed if I use deterministicLockstep, regardless the environment (except for lockstepMaxSteps), but might be, that I'm misunderstanding the whole concept - that is why I asked for confirmation.

Thanks in advance!

Link to comment
Share on other sites

Yep, you are totally right - it should still run at 60FPS even on a 120FPS monitor.

Just for me to be sure - when you say animations, you mean the physical movement of objects, right? Babylon also have an animations API, both are implemented in the deterministic step.

 

maybe would be better to have a playground for this, I will try to emulate this on my poor 60fps screen :)

Link to comment
Share on other sites

I just went and confirmed, that the issue only exists with the physics engines' time-step, not with programmatic or loaded skeletal animations.

Playground tutorial where the issue can be seen, also can change to Oimo on line 11 with same output:
https://www.babylonjs-playground.com/#DU4FPJ#3

Confirmation control animation that I checked:
https://www.babylonjs-playground.com/#IQN716#9

If I can help with anything to move the solution further just ping me! :) Thx!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...