Hello there. I've been reading on this topic for some years now. Recently i started to program an action rpg game with online capabilities, but i always get lost when it comes to networking movement. Here are some of my doubts:
- First of all, many interpolation solutions takes for granted that packets will be received when a movement is produced. What if many move packets are collected and sent at the same time? This actually happens all the time. Client doesn't send player moves when buttons are pressed, they wait until packets are flushed.
- My entities have a speed property. I send this from server to client, but seems like client interpolation doesn't take them into account, which in my opinion makes my first question even more difficult to solve.
- How can i trust the player movement packet rate? The server will receive many of them at the same time, sometimes with different spikes of lag. I suppose that, in this regard, server cannot be too authoritative.
- How can i deal with different update rates between client and server? For example, if i want an entity to move 60 pixels per second, on client each update will move the entity less than in server. It seems to me that synchronizing both endpoints is like mission impossible.
-If possible i'd like to read some code examples. Souce multiplayer networking wiki has a lot of stuff but i cannot make mind.
Thanks, that's all for now. I have never seen the answer of some of these questions .