Libgdx: Large delta after pause/resume (iOS)

Created on 3 Jul 2020  路  3Comments  路  Source: libgdx/libgdx

Similar to #1196

Issue details

If a game is paused for a long time, after resuming, Gdx.graphics.getDeltaTime() will give the delta of the entire pause duration. This causes freeze/stutter on resume as the game tries to process possibly hours worth of delta. This was fixed for the android version but not for iOS which makes it inconsistent across backends.

Version of LibGDX and/or relevant dependencies

_Please provide the version(s) affected._
1.9.10

Please select the affected platforms

  • [ ] Android
  • [x] iOS (robovm)
  • [ ] iOS (MOE)
  • [ ] HTML/GWT
  • [ ] Windows
  • [ ] Linux
  • [ ] MacOS
bug good first issue ios

Most helpful comment

Yep, it looks like a similar fix to the Android one can be applied to iOS backend. In the meantime as a workaround you can clamp the delta (for instance to 1/30f) which in most games it's a good practice protect against lag spikes (Scene2D for instance has this behaviour by default).

All 3 comments

Yep, it looks like a similar fix to the Android one can be applied to iOS backend. In the meantime as a workaround you can clamp the delta (for instance to 1/30f) which in most games it's a good practice protect against lag spikes (Scene2D for instance has this behaviour by default).

Great, thank you.

good first issue! 馃憤

Was this page helpful?
0 / 5 - 0 ratings