Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

106 Neutral

About firmware_dude

  • Rank
  1. firmware_dude

    Physics interpolation gives me periodic bumps and jumps

      The minimum is applied to prevent a "spiral of death". On slow devices, if the FPS goes too low and low enough to require multiple physics world updates per frame, the multiple physics updates might make it even slower. To prevent this, the min is capping the number of physics updates.   delta is physicsDelta. physicsDelta which is returned by update() is passed to the render function.
  2. firmware_dude

    Physics interpolation gives me periodic bumps and jumps

      Thanks for the detailed explanation. I'll give it a shot.
  3. firmware_dude

    Physics interpolation gives me periodic bumps and jumps

    Thanks for you reply, but I'm afraid I couldn't understand quite a bit of it. :(   As for the renderer being called multiple times with the same physics state, this can happen when the renderer is much faster than the physics rate. But the point here is that the interpolation should take care of not "hang"ing. Say, the interpolation alpha is 0.1, 0.4, 0.7 for the same physics state across 3 successive frames, without any physics world updatess. Even then, the renderer is drawing different things. Each thing that the renderer draws is interpolated between the same two physics states, but at different alphas. I think this is very appropriate and the only way to go about it, since we have no other information between the two physics states.   In your explanantion, I don't understand what "simulation time" and "render time" are. As I understand, there is only one time. This is the render time. The physics world may be updated a little less in which we store that left over time in an accumulator.   Can you please explain?
  4. firmware_dude

    Physics interpolation gives me periodic bumps and jumps

      Yes all of this is in one thread.   Here is more code: http://pastebin.com/PSZrntZP   I've omitted the obvious stuff like constructors, etc.   (PS, GameWorld.timeDelta is 1/60.0f. Sorry I forgot to include that line.)   Please ask me if something is unclear or if you need to see more code.
  5. Hi,   I am trying to use interpolation in my physics game so that I can use a fixed timestep to update my Box2d physics world.   I have followed the same steps as in this article.   What I notice in my Android game is that my interpolation alpha (or fraction or accumulatorRatio) varies with this pattern as frames progress: 0.13 0.22 0.31 0.45 0.49 0.62 0.81 0.94 0.03 0.1   The above is an illustration but the point is that it goes from 0 to 1 and cycles back to 0 periodically. I believe this is due to the game frame rate being slight faster than the physics update interval. Every time the interpolation alpha cycles around, it gives me a jitter (or jump).   Here is a log file: http://pastebin.com/3Yb7nVxX The two columns are (i) interpolation alpha (ii) physics step count The "jumps" happen roughly in lines 262 to 266 in the log.   Here is the code: http://pastebin.com/vWC7yNGM What is causing these periodic "jumps"?   Thank you   (I have been stuck with this problem since such a long time. I would be happy to give a humble tip out of gratitude if this problem gets fixed :) )  
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!