How to synchronise the acceleration, velocity and position of the monsters on the server with the players?

Posted by Nick on Game Development See other posts from Game Development or by Nick
Published on 2012-06-28T07:57:29Z Indexed on 2012/06/28 9:23 UTC
Read the original article Hit count: 209

Filed under:
|
|
|

I'm building an MMO using Node.js, and there are monsters roaming around. I can make them move around on the server using vector variables acceleration, velocity and position.

acceleration = steeringForce / mass;

velocity += acceleration * dTime;

position += velocity * dTime;

Right now I just send the positions over, and tell the players these are the "target positions" of the monsters, and let the monsters move towards the target positions on the client with a speed dependant on the distance of the target position. It works but looks rather strange.

How do I synchronise these properly with the players without looking funny to them, taking into account the server lag?

The problem is that I don't know how to make use of the correct acceleration/velocity values here; right now they just move directly in a straight line to the target position instead of accelerating/braking there properly. How can I implement such behaviour?

© Game Development or respective owner

Related posts about architecture

Related posts about physics