Quantcast
Channel: 2D Latest Topics
Viewing all articles
Browse latest Browse all 623

Multiplayer desync

$
0
0

What am I doing wrong here. Normal movement is fine, but when boost is applied, there is rubber banding at the end.

I'm using client/server model to implement movement.

 

pseudo code:

Client sends inputs to server

Client process inputs and displays locally

Server receives inputs and calculates where client should be

Server emit client coordinates

Client receives update and applies coordinates

Client reapply all inputs made after the last server update

 

Player class: https://github.com/GodsVictory/SuperOnRoad/blob/wip/public/js/player.js

Server code: https://github.com/GodsVictory/SuperOnRoad/blob/wip/server.js


Viewing all articles
Browse latest Browse all 623

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>