0
\$\begingroup\$

I'm making a 2d multiplayer html5 game that needs client-side movement, collision etc.

Client sends active cursors to the server (w,a,s,d), server updates cursors on all clients and clients handles movement for each other. Every client sends server it's x,y every 100ms and server updates sender's x,y on all clients.

It works perfectly if player's latency is <1ms but even if player has 40ms latency everything seems like teleporting.

How can i make everything smooth without handling movement on the server? (like transformice.com do)

Sorry for my grammar.

\$\endgroup\$
1
  • \$\begingroup\$ You may want to start here: gafferongames.com and specifically at the networking sections. Even if you're doing a simple concept at least you'll know the networking territory that you're working in. \$\endgroup\$ May 26, 2017 at 16:18

1 Answer 1

0
\$\begingroup\$

The general answer is to do movement on the client but correct it when you get server updates. So like move the player to where the server says he is (probably interpolate rather than jump to that position.)

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .