x


Multiplayer Physics Extrapolation

We're working on a smartfox multiplayer game with awkward latency (worst case ~200ms). On previous projects, we modified Box2D to extrapolate the position of a single body.

E.g. if I receive a position/momentum message which I know from its timestamp is 155ms old, then I can simulate that single body forward to "current time".

Is there a way to realize this with RigidBodies in Unity? Or will we have to script our own custom physics? I've experimented with an euler prediction step, e.g.

mBody.MovePosition(mBody.position + dt*mBody.velocity);
mBody.MoveRotation(Quaternion.Slerp(...));

However, the results have been less than acceptable (even if I take multiple smaller steps, the linear/angular velocity isn't integrated correctly).

more ▼

asked Apr 19 '10 at 03:25 PM

Max Kaufmann gravatar image

Max Kaufmann
573 10 12 21

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

what i ended ujp doing is have the movement of the player update quite often to keep the network better synced, and did all my physics calculations on the server and just updated the position on the client.

To smooth out the jump from between network updates to the movement I had the client actually effect its object in real time and interpolate between the received server movement and the current players movement actions

more ▼

answered Aug 28 '11 at 07:39 PM

Techsuport gravatar image

Techsuport
81 6 6 10

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1880
x1797
x711
x683

asked: Apr 19 '10 at 03:25 PM

Seen: 2438 times

Last Updated: Aug 28 '11 at 07:39 PM