1

I am using socket.io and HTML 5 canvas to build a MMO game as a practice. I finished the client side first and currently I am working on server side. Apparently the position/physics update is on client side for now. But I am facing the decision of moving the position update logic and physics update to the server or leaving them on the client side. If I put the update on the server side I will pass the mousemove/keystrokes to the server. But if I update positions only on clients side I will pass the positinos/directions/speed to the server. Which approach is better in my case?

newguy
  • 255
  • 2
  • 11

1 Answers1

4

Unless you want players to be able to teleport through walls using their browsers build-in JavaScript debugger, you will have to implement any game mechanics worth manipulating on the server.

This will lead to more noticeable lag, so you might implement it both on the client and the server. That way the client can perform the action locally so the player gets an immediate response to their input, but revert that action when the server says it failed.

Philipp
  • 119,250
  • 27
  • 256
  • 336