• Advertisement
Sign in to follow this  

Movement protocol for tile-map games.

This topic is 2773 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello there,

I am working on a tile-map based online game. What is bothering us for a long time now is the movement protocol. The protocols we used so far were either too slow or lost packets (making the player revert to a position before). We are looking for a protocol that has acceptable speed and which doesn't revert you when moving(and shows your correct position to other players)-
This is for a game with tiled maps.

Can anyone help me out?

Share this post


Link to post
Share on other sites
Advertisement
The basic trade-off is one between latency and correctness.

If you want players to be close to where they are "now" then you have to guess where they will be. Extrapolation code like the EPIC library helps you with this, but as you're extrapolating, you can never get it perfect.

You can also run exactly the same path as the player ran originally, but because data takes time to get to other machines, those machines will see the player behind in time.

If you use UDP, then some packets will be lost, and thus the movement of remote players will be a little jerky -- either extra delayed in time, or extra wrong in position, depending on which approach you take.

If you use TCP, then some packets will be delayed, and thus the movement of remote players will also be a little jerky, in similar ways. The main difference is that, with TCP, if any one packet is delayed, all packets are delayed, so everyone might jerk at the same time.

In the UDP case, you want to be continually sending updates of where you are and how fast you're moving, even when you're standing still, so that you compensate for the occasional dropped packet.

Share this post


Link to post
Share on other sites
player sends "path plan" to server? (5 last moves in each packet + extrapolation)
Server then can accept the "move plan" and player moves to position.
If some packets are mist, plan can still be valid.
(remember to check players real movement speed for hacks)

/Tyrian

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement