How to perform game object smoothing in multiplayer games

Posted by spaceOwl on Game Development See other posts from Game Development or by spaceOwl
Published on 2013-10-19T17:38:44Z Indexed on 2013/10/19 22:17 UTC
Read the original article Hit count: 181

We're developing an infrastructure to support multiplayer games for our game engine.

In simple terms, each client (player) engine sends some pieces of data regarding the relevant game objects at a given time interval.

On the receiving end, we step the incoming data to current time (to compensate for latency), followed by a smoothing step (which is the subject of this question).

I was wondering how smoothing should be performed ?

Currently the algorithm is similar to this:

  • Receive incoming state for an object (position, velocity, acceleration, rotation, custom data like visual properties, etc).

  • Calculate a diff between local object position and the position we have after previous prediction steps.

  • If diff doesn't exceed some threshold value, start a smoothing step:

    1. Mark the object's CURRENT POSITION and the TARGET POSITION.
    2. Linear interpolate between these values for 0.3 seconds.

I wonder if this scheme is any good, or if there is any other common implementation or algorithm that should be used?

(For example - should i only smooth out the position? or other values, such as speed, etc)

any help will be appreciated.

© Game Development or respective owner

Related posts about programming

Related posts about networking