Author Topic: Multiplayer Issues  (Read 2671 times)

Offline Nalgas

  • Hero Member
  • *****
  • Posts: 680
Multiplayer Issues
« on: May 02, 2011, 02:30:23 pm »
I play AI War almost exclusively as a multiplayer game with a group of people that's been playing once a week for the past year, so it's kind of unfortunate that we've been having progressively more and more issues getting games to sync as time goes by.  I don't remember ever having any notable network problems in 3.x, and 4.x was usually pretty good, but if I'm remembering right, toward the end of that beta cycle and definitely ever since 5.0, we've been unable to complete a game.

Creating a new game always works fine, no matter what, for the entire length of that session.  If we actually make it in game when loading a save, it also works fine (with the exception of disabling/enabling a player slot while in-game, which more often than not breaks things horribly and requires us to all drop and reconnect).  The problem is that we only play a few hours at a time, so it takes several sessions to finish one campaign, and the more time has passed in the current campaign, the less likely we are to make it past the initial loading/syncing stage.

If we do somehow manage to make it into the game when loading a saved game, it will work with zero problems until we quit, but the odds of it loading again the next week keep getting progressively lower.  Eventually it gets to the point where we're nearing the end of the game and going to win after a few more hours, but it's so hard to coax it into loading the game for everyone that we just give up.

As far as we can tell, it doesn't matter which one of us hosts the game, and it doesn't matter which subset(s) of players join it or in what order.  Once it gets into that state, we haven't been able to figure out how to un-break it.  The only thing that seems to definitely prevent it is playing with only two players total, which none of us have ever had any problems with.  Three or more always seems to eventually gets borked, though.

We've tried with both 5.000 and 5.009 recently, and both have the same problem.  Everyone has the relevant port forwarding set up, a rather good Internet connection, and computers that way more than meet the requirements.  It happens with everyone using the Windows version or a mix of Windows/OS X clients.  No amount of fiddling with network settings seems to make much difference.  Our entire group is basically a bunch of IT people and programmers and whatnot, and we're completely at a loss and unable to find anything wrong outside of the game itself.

The odd thing is that it very rarely ever actually desyncs.  The problem only occurs when everyone is initially connecting to the host, and we all just end up sitting there on the map with the "Waiting for players..." message, while the host watches the numbers for each player slowly count down, then randomly jump back up again.  Occasionally it'll sort itself out and let us play the game, but usually it'll just repeat that cycle indefinitely, while half a dozen seconds of in-game time (according to the clock) will pass over the course of 20 minutes of real-world time.

Here's the most recent save we have.  No matter who tries to load and host it, the same thing happens.  I can get a couple dozen more, along with any other info that might be useful, if anyone has any ideas.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Multiplayer Issues
« Reply #1 on: May 02, 2011, 03:41:18 pm »
If you're unable to connect, especially if it's happening more and more as the game goes on, then I think there's a pretty clear indicator as to what the problem is: someone's network card or router is getting flooded and not sending data properly when too much data is dumped into its buffer at once.

The simplest way to fix that is usually for everyone who is playing to make sure that their network drivers and router firmware is up to date.  Generally it's a bug in one or the other, and just updating to the latest and greatest of both fixes it.  If that is infeasible or the latest versions are the one with the bug, then the game actually has a feature that lets you work around this: network sync size.

On the host, go into settings and it's right there on the main tab.  If N/1200 isn't doing it for you, then you probably want to try some other settings.  If it's just a marginal thing, like you mention, then N/1600 might be good enough.  Otherwise you could crank it all the way up to N/2400, even.  Or try some of the other options and see which ones help.

The network sync size divides your large messages into smaller parts, with a small sub-second delay after each one.  Because of the intentionally-added delays, it's notably slower on a LAN to split large messages into smaller parts.  Over the Internet, the slowest part is the Internet connection itself, so that's hardly going to slow it down at all, if at all.  But the benefit of that is that your network card, router, etc, only get a smaller bit of data at a go, and then have time to transmit it before getting the next bit of data, which basically bypasses the buffering issues that can crop up with bad drivers/firmware.

N/1200 is what we use for the default because it's the sweet spot for most people, but if you have a particularly flaky driver or your savegame gets above a certain size, then changing from that default can really help.  Another way to accomplish much the same thing is to only have one player connect at a time; when you have two players connecting at once, twice the data is being transmitted through your network, etc, at one time.  I've seen some wireless connections that literally just cut out and lose connection when you dump too much data into them at once, which is definitely not supposed to happen.  But even with wired connections, it can happen.

Anyway, my money would be on that as your problem.  Unless you're seeing actual error messages logged in the host or one of the client folders (under RuntimeData, it would be NetworkClientErrors.txt or NetworkServerErrors.txt), then it's got to be some sort of transport-level thing with the network card, routers, or similar.

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!

Offline Nalgas

  • Hero Member
  • *****
  • Posts: 680
Re: Multiplayer Issues
« Reply #2 on: May 11, 2011, 12:42:40 am »
Well, it works now, but we're not entirely sure why.  The most likely guess is that what was interfering was one guy's VOIP box, which has been moved from in front of the router to behind it.  Could've been other stuff that got updated, but that seems like the best candidate.

I'm still curious what AI War does that's either so sensitive to things like that or so rough on the network, because we've generally been able to run all sorts of other stuff without any problems, but we're all happy enough that it's back to working fine again.  We can even add and drop people in the middle of playing without restarting the game or having sync issues, which is actually better than it was before it started acting up, so that's good.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Multiplayer Issues
« Reply #3 on: May 11, 2011, 09:05:27 am »
Well, I'm glad to hear it's working now, at any rate.

AI War is particularly rough on the network because it transmits large amounts of data at uneven times.  When very little is going on, it's a low-moderate amount of traffic.  When there's a battle and the AI and the players are all sending lots of commands, then it's much heavier than an FPS game, and on the heavier side for an RTS, too.

That makes it sensitive to a variety of issues: QoS settings on networks that try to do "traffic smoothing" can actually be a huge cause of latency with it, too, though those are rare on home networks except when there's VOIP services built into the core router.

At any rate, glad that's working again!
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Nalgas

  • Hero Member
  • *****
  • Posts: 680
Re: Multiplayer Issues
« Reply #4 on: May 11, 2011, 01:27:24 pm »
AI War is particularly rough on the network because it transmits large amounts of data at uneven times.  When very little is going on, it's a low-moderate amount of traffic.  When there's a battle and the AI and the players are all sending lots of commands, then it's much heavier than an FPS game, and on the heavier side for an RTS, too.

I kind of figured as much, but at least on my end it doesn't look much worse than some of the other non-game stuff I've abused my network with.  I'm pretty much never the one hosting the game, though, because there's always someone with more bandwidth than I have (or more often everyone).  It also ended up not being my fault that it wasn't working, so maybe that's part of why I didn't notice anything wrong on my end.  Heh.

QoS settings on networks that try to do "traffic smoothing" can actually be a huge cause of latency with it, too

That's something that didn't occur to me, but it's apparently not an issue for me.  My network is completely unusable without QoS (which improves it to only "mostly unusable"), but it hasn't caused any problems with games or anything else.  Good thing, too, because the other option is to somehow convince everyone in the house to stop trying to watch six videos on YouTube simultaneously while also running torrents, and people are much less responsive/cooperative than my router...