I'm working currently on 2d MMORPG in canvas. I introduced many features and finally test performance. I'm a little bit worried, because it doesn't look so good to be called mmo. It's tile based game with tile size 32x32. Actually server sending data over socket.io to players every 40ms. When player run to animate him server is modifying his coordinates by 2px in interval till the coordinates reach next tile coords. It's one of thing which has big performance impact. What's the other possibility to animate running player smoothly without interval?
I tried to only send information to client that his character is moving and calculate animation on client side, but it was even worse. I know about
window.requestAnimationFrame, but i don't know how to use it in this case. How to synchronize client and server?
I think the player animation should be separated from player coordinates and only after move by a tile coords should be compared between client and server.