Sometime ago I read some articles about smoothing dt to handle performance spikes.
I made this test with two jumping objects and discovered that the one using smooth dt had a much more precise jump height than the one using normal dt.
Here's the results:
Normal Scenario
Extreme Scenario
- The orange object uses normal dt and the blue smooth dt.
- The orange and blue lines at the top are the maximum height of the last jump.
- The semi-transparent boxes around the lines indicate how much the jump height has drifted in the last jumps.
Notice that the jump height of the object with smooth dt barely drift compared with the one using normal dt.
What happens is that it creates some micro slow-downs or speed-ups on the object the more dt oscillates, that results in a more constant position increment.
Maybe it can help solve your problem.
I used a pretty naive smoothing, but there's better methods that take more frames into consideration and may give better results. The way I implemented doesn't work with behaviors, but I think it's possible to set the global timescale to (smoothDt/dt) and it will work with everything. Maybe you should give it a try.
Here's the capx:
[attachment=0:ym3jqwvc][/attachment:ym3jqwvc]
*It uses the Canvas plugin.
**For some reason it's not rendering the dt graph correctly in Firefox, but it works in Chrome.