Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Interpolation problem - how to debug?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 GuyWithBeard   Members   -  Reputation: 366

Like
0Likes
Like

Posted 23 October 2012 - 10:12 PM

Hi,

I have a problem with stuttering animations at frame rates lower than around 100 fps, and I am uncertain how to debug this.

In my engine the physics simulation is updated at 60Hz. Every time the physics is updated, my dynamic objects get a new position and orientation. This new transform data is added to an interpolator with a ring buffer, along with the current physics time which increases in steps of 1/60.

The renderer works at a variable frame rate but it can easily be capped at some frame rate. Every time a frame is rendered, the engine asks for the interpolated transform of the dynamic objects and renders those on the screen. The render time is updated every frame and increases with the dt of the last frame. I then apply a visual lag of 50 ms to the render time (ie. I just subtract 0.05 seconds from the time) to make sure I am interpolating and not extrapolating.

All of this works beautifully at high frame rates, but if I cap the frame rate at for example 70 fps, there is a very noticeable stuttering in the movements of all dynamic objects. This stuttering seems to come and go: It might be gone for 5 seconds and then stutter again for 5 seconds and so on.

Does this simply mean that the interpolator does not work as it should? I have checked and double checked the math inside it, and it seems correct. I have also checked that the data that goes into it has the correct transform and time. Everything seems to check out, at least on paper. I attached fraps to the application to see that the capped frame rate stays constant, and it seems to work fine.

What should I test for next?

Edited by GuyWithBeard, 23 October 2012 - 10:13 PM.


Sponsor:

#2 Álvaro   Members   -  Reputation: 5899

Like
0Likes
Like

Posted 24 October 2012 - 04:56 AM

I would try setting the simulation to update once per second or so, so you can observe the interpolation clearly. See if you notice something funny at that speed.

#3 Waterlimon   Members   -  Reputation: 1034

Like
0Likes
Like

Posted 24 October 2012 - 06:35 AM

Yeah, the cyclic nature of the stuttering might sugges something similiar to stuttering when the rendering fps (70) is synchronized in a certain way with that of the physics (60 fps)
The lack of awesome free resource gathering building sandbox games capable of running an user made 8 bit computer in the world disturbs me.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS