Sign in to follow this  

Dealing with latency in a tile-based game

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: Linux binary: Source code:

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this