Jump to content

  • Log In with Google      Sign In   
  • Create Account


How to perform client side smoothing


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
3 replies to this topic

#1 Lysergide   Members   -  Reputation: 663

Like
0Likes
Like

Posted 19 October 2013 - 11:45 AM

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.


Lior Tal
Game Developer/Software Engineer

Sponsor:

#2 snacktime   Members   -  Reputation: 281

Like
0Likes
Like

Posted 19 October 2013 - 01:05 PM

I'm a bit confused, the client sends the server information information about game objects?  Or is this peer to peer?  Who is authoritative?

 

Chris



#3 Lysergide   Members   -  Reputation: 663

Like
0Likes
Like

Posted 19 October 2013 - 01:20 PM

There's no central server. Each player sends his own state to all other players.

 

Upon receiving state regarding another player, each local client updates his local approximation accordingly.


Edited by LiorTal, 19 October 2013 - 01:42 PM.

Lior Tal
Game Developer/Software Engineer

#4 hplus0603   Moderators   -  Reputation: 4984

Like
0Likes
Like

Posted 20 October 2013 - 09:08 PM

I'm assuming that you are aware of the cheating vulnearbilities in a P2P architecture, and you have made sure that your particular game design is not susceptible to catastrophic failure because of that?

 

Anyway, the EPIC interpolator does forward smoothing by calculating where the entity ought to be 100 milliseconds from now, and interpolates from the current position to that position over 100 milliseconds, but which time the next network packet has arrived. (The actual value of "100 milliseconds" varies depending on networking implementation.)

 

0.3 seconds sounds like a lot, although can be fine if your game is not twitch-based and doesn't rely on players knowing very accurately where other players are at all times. (So, no shooting or driving or fighting games)


enum Bool { True, False, FileNotFound };




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