Jump to content
  • Advertisement
Sign in to follow this  
Jimage

Dealing with latency in a tile-based game

This topic is 3562 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

How might one go about optimising a multiplayer tile-based game for use over an Internet connection. So far I have managed to get some good, almost realtime performance over a LAN, but across an Internet connection latency starts becoming a problem. The method I'm using currently is an input stream, where the state of the arrow keys is sent as a sequence of four booleans every few game cycles (at 60Hz) in a guaranteed packet. This is where the problem comes in, I expect. An alternative that's been lurking at the back of my mind involves processing the input on the client machine and sending the actual moves to the server, which then makes sure the moves are valid and sends back any necessary corrections. An advanced version of this would use a timer to make sure the moves are synchronised, but the idea starts to get fuzzy when it comes to cheat-prevention by synchronising the client and server timers. Anyway, here are some links to what it looks like so far (For running the client, the port is 8899): Win32 binary: http://www.jimage.org/programs/experiments/zoidcom/jimage-zcblocks-00-win32.zip Linux binary: http://www.jimage.org/programs/experiments/zoidcom/jimage-zcblocks-00-linux.zip Source code: http://www.jimage.org/programs/experiments/zoidcom/jimage-zcblocks-00-src.zip

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!