Author Topic: Multiplayer versus/co-op lag  (Read 2957 times)

Offline Johnnykey

  • Newbie
  • *
  • Posts: 1
Multiplayer versus/co-op lag
« on: July 09, 2011, 06:13:22 am »
Is it normal for the game to have a constant 3~4 seconds lag from 5 to 5 seconds (varying greatly)?

I don't really know which info should I post, whether it's me or my friend hosting, the lag is the same.

Please ask me any info that might help solve the problem or point me out something I might be doing wrong, thanks.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Multiplayer versus/co-op lag
« Reply #1 on: July 09, 2011, 09:38:52 am »
This is actually a really good question, and it's a bit tricky to answer briefly.  So please bear with me. :)

What's Actually Happening, If You're Curious
First, yes this is somewhat normal.  As in, the game is doing what it is supposed to do when there is a lot of network lag for whatever reason.  Given that this is an action puzzle game, if you have lag in your own board then that would be disastrous.  So what the game does is run each board local to the player playing in them.  And then it sends a recording, for lack of a better term, to the other player's computer so that they can see what is going on.

On a LAN, that would mean that there would always be maybe a 60ms to 200ms delay between the two computers: you'd see what is going on automatically, but very slightly behind what the other player is seeing on their own board.  And of course your local board runs at 0ms delay at all times, LAN or Internet, since that's so important.

I hope that made sense.  Now, on the Internet, round-trip times vary but tend to be a lot more than 200ms.  Under ideal circumstances you're probably looking at a 400ms delay, which is less than half a second and thus not too noticeable when you're talking about your opponent's board.  However, if there are a lot of dropped packets, or other causes of network lag, then that delay gets larger and larger.

When the delay reaches a threshold of about 5 seconds or so, then the game will literally pause the boards for a moment to let them both catch up, and then the delay goes back down to close to zero.  It does this to keep them from ever getting TOO divergent, and in cases of a brief temporary network lag this will actually cause the game to self-heal the delay so that you don't have to worry about it anymore.

What it sounds like is happening in your specific case is that your delay is growing and growing, and then you're hitting that 5 second point and it pauses to sync, and then it just starts growing and growing the delay once again after resuming.

What Causes The Above?
Okay, so given all of the above, basically the delay between the boards keeps spiraling out of control, and every 5 seconds the game pauses to let them catch up, but they never do.  There is only one direct cause of this behavior: the networks between your two computers are not transmitting data fast enough for the game.

Now, there can be several indirect causes of that:

1. Using dialup or similar, which literally doesn't have enough network throughput to run the game in any other fashion than what you describe.

2. Having one player on an unreliable wireless network connection, which could make even LAN play spotty if the signal is that weak.

3. Having a lot of dropped packets caused by a bad network driver, bad router firmware, or similar.

4. Having a lot of other congestion bogging down your network even if it is very fast and wired: Netflix streaming, VOIP services, background downloads, torrents, online radio streaming, and other similar things can really make for unreliable gameplay.  If someone else on either of your networks is doing these things in excess of what your network can handle while also playing online games, then that's a likely culprit.

5. Once again coming back to the router firmware, some of them -- specifically on VOIP-aware routers -- run something called QoS, or Quality of Service.  Sometimes this will throttle non-phone traffic to the point of strangulation, leading to behavior like this in games or similar.  Usually this is because of old firmware, and upgrading your router to the latest firmware (a free thing to do with most routers) usually fixes that, assuming that's what the problem actually is.  In other cases, simply having QoS services enabled on the router at all can make games laggy for a variety of reasons, and turning those off can breathe new life in to all your online multiplayer games.

So... What To Do?
Above are the most likely causes.  So, assuming you aren't on dialup, here are the things to try:

1. Make sure that nobody else on either of your networks is sucking away all your bandwidth for phones, TV, downloads, etc.  Similarly, if you're using Skype or whatever for voice chat, you might want to disable that temporarily and see if that helps.

2. Use a wired connection if either of you are using wireless, and see if that helps.

3. Make sure that the network drivers on both your machines are fully up to date (that can help if there's a lot of dropped packets).

4. Make sure that your firmware on your router is as up to date as possible (this often helps with dropped packets, QoS, and various other ailments).

5. Make sure that you're not running QoS on your network if all else fails and it's still slow.


Hope that helps!
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!