Interpolation gives the appearance of collisions

Posted by Akroy on Game Development See other posts from Game Development or by Akroy
Published on 2012-06-09T21:29:20Z Indexed on 2012/06/09 22:48 UTC
Read the original article Hit count: 291

I'm implementing a simple 2D platformer with a constant speed update of the game logic, but with the rendering done as fast as the machine can handle. I interpolate positions between actual game updates by just using the position and velocity of objects at the last update. This makes things look really smooth in general, but when something hits a wall/floor, it appears to go through the wall for a moment before being positioned correctly. This is because the interpolator is not taking walls into account, so it guesses the position into walls until the actual game update fixes it. Are there any particularly elegant solutions for this?

Simply increasing the update rate seems like a band-aid solution, and I'm trying to avoid increasing the system reqs. I could also check for collisions in the actual interpolator, but that seems like heavy overhead, and then I'm no longer dividing the drawing and the game updating.

© Game Development or respective owner

Related posts about collision-detection

Related posts about interpolation