Author Topic: Multiplayer specs  (Read 9685 times)

Offline quickstix

  • Sr. Member
  • ****
  • Posts: 297
  • Buy Now
Multiplayer specs
« on: February 10, 2010, 07:56:40 AM »
Just a quick question in regards to multiplayer games.

What kind of bandwidth does AI War soak up in multiplayer for hosting and being a client, and how much of an issue is latency? I've only got the most basic of broadband connections (256/56, which in real terms is 25kbs down/~5kps up) and get a ping about 200-250ms to the US and about 300ms to Europe from here in Australia. I play on maps of size 80 and under, but I'd most likely end up being a client with my connection and my laptop's 1.6ghz dual core, which is fine in single player, but I'm not sure about for multi.


Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,629
Re: Multiplayer specs
« Reply #1 on: February 10, 2010, 11:35:18 AM »
Bandwidth Requirements
It's really hard to quantify exactly what bandwidth AI War requires, because that depends on a ton of factors.  If there are more players, that greatly impacts the bandwidth requirements of the host, but to a far lesser extent each client.  There is only one thing that actually causes bandwidth to even be used in AI War: commands.  This is commands from the players clicking stuff to create ships or order them around, or commands from the AI (running on the host only) to order its ships around.  The AI commands use about the same bandwidth as one player under normal load.

With a slow or packet-lossy connection, large commands (ordering around thousands of ships with one click) will cause lag.  But, assuming that all players just sit there staring at the screen and not issuing any orders, it would just be the continual smaller amounts of AI orders, and the turn-synchronization orders themselves, which would mean any spikes would just be based on packet loss or routing problems based on latency.  In other words, the more players are clicking around, the more load it creates, but generally that load is low enough as to not cause anything noticeable on most connections.

I wish I could be more specific with this, but to some degree you just have to try it and see with your specific connection, since there are more factors than just the bandwidth itself: stuff like latency, current business of that ISP and the backbone, and of course all of the factors such as the size of the game and what all is going on in it.  Basic broadband will not work as well by any stretch, but I have played AI War with two players and no lag over a 3G phone being the modem for the client, with basically I think 1500 or 1600 Kbps down on the phone, and something like 150 Kbps up on the phone (I may be remembering wrong, but it was about that).  So the floor is somewhere below that, but I don't know precisely where it is.

Latency Notes
AI War runs with 200ms turns under the hood.  That is how long the game runs by default before it has to pause waiting for more input if more input has not yet arrived.  The networking for the next turn happens simultaneously with the simulation for the last turn, which means that you need around a 100ms roundtrip time in order for it to be lag free.  At anything higher, you'll see a corresponding percentage drop in game speed: at 300ms roundtrip time, that would lead to each 200ms turn having a 400ms pause at the end of it, which would be incredibly frustrating for players.

Network Skip
However, we do have a solution for this, as well as the general too-low-of-bandwidth problems. Basically, this is called Network Skip, and allows you to increase the length of game turns by 45ms per skip.  So, when you have a network skip of +1, the turns are 245ms instead of 200ms, which means that to have no latency you need a roundtrip time of 122.5ms.  If you use a network skip of +16, the turns are 920ms, meaning your roundtrip time has to be 460ms to have no lag.  You can set network skip to whatever value gives you the best game experience, simply by using Ctrl+plus/minus while playing the game; if performance is bad at the start, then later gets better as you play, you can adjust as you go.

However, there is a downside to having longer turns (higher network skip): and that is command latency.  The time it takes for a command to be issued from when you give it is 2x the time of the the turn length (since turns are scheduled, and since the network is run simultaneous, that is unavoidable).  So, basically, you will wind up with normally it taking 400ms for the game to issue a command you give.  At +16 network skip, it would take a whopping 1.8 seconds between your issuing an order and it happening.  That can be frustrating on its own, but it is playable and if you are not a fast-clicker it matters comparably little: at least your game simulation is running at full speed, and the clock is ticking at a regular interval, etc.  It's like playing with a radio delay to mars, rather than playing in slow-mo, basically.

Suggestions for playing on slower connections
So, the above gives you a lot of information on what is technically going on under the hood, and general thoughts about requirements and some solutions.  Here are some tips on generally using those above facts to maximize performance if you are having issues:

1. Use network skip until the host doesn't see "(WAIT)" popping up next to player names.  Clients do not see this.

2. If the game has been running fine for a while, the host may want to try reducing the network skip to see if a lower value is now acceptable.

3. Generally speaking, it is not a good idea for the host to also host voice chat, unless the host as a super good connection.

4. Generally speaking, players with very bad connections should not host voice chat, and they may want to consider not using voice chat at all, instead typing to players.  Voice chat alone can eat up 30% of the bandwidth of an average broadband connection, or more in some cases.

5. Generally smaller maps will not really perform better in terms of the network, because there is a cap on how many commands the AI can issue per game turn.  Granted, in smaller maps there are fewer ships for the AI to order around at any given point anyway, so you will see some benefit, but it's not going to make much difference between 60 and 120, for instance, because it will probably be at the cap either way, there.  Might be some difference between 10 and 60, though, but I doubt it would be substantial.  So play on the map sizes you want, in other words.

6. Playing with fewer players will lessen the load greatly on the host's network connection, and to a lesser degree for the clients.  As far as the clients go, the only added load from having more players is the extra commands that those other players are issuing.  Assuming that those players just sit there and issue no commands, the added network load on the clients is precisely zero.  Realistically, though, they will generally be causing more commands and thus causing more load simply because there are more people telling ships what to do.  It all depends on how click-happy the other players are, but if you're concerned about your network speed then keeping it to 2-3, maybe 4 players, is probably a good idea.  And then if that works well, you can scale up to larger games if you want to try it.

This is such a good question that I'm moving it to tech support and stickying it!
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 Dalden

  • Newbie
  • *
  • Posts: 9
Re: Multiplayer specs
« Reply #2 on: January 26, 2011, 02:25:07 PM »
Great post, x400.

I was wondering if you could also elaborate on what the Network Sync Performance Settings in the settings game tab do?

I looked in the game manual, and it has the following description:

These settings can affect the performance of the game when loading/syncing games across
the network. If you are having trouble in this area, refer to the in game help for more detailed

But I can't seem to find the game help it refers to.

There are two options:

- Network Sync Size, with options to choose a number of messages, some of them with N/number, but it does not describe what N represents or how this option affects gameplay
- Skip Batch Network Sending. Also, not sure what this option does.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,629
Re: Multiplayer specs
« Reply #3 on: January 27, 2011, 11:24:41 AM »
I think there are tooltips over those elements, or at least there used to be.  At any rate, from the loca files of the game, here's the explanation that should be in-game but might not be:

This section will help you improve the performance of loading/syncing games across the network, if you are having trouble.  Please note that this will have NO effect on in-game performance, just on game syncs.  The default is N/1200 Messages, with batch network sending not turned off, and this will work well for most people.

However, for those with very fast connections, the old default of 100 Messages, with batch network sending skipped, may provide better performance (these are the old defaults).  This will vary depending on your connection, though, and some people had extremely poor connection speeds even on very fast connections with the old defaults, which is why the new defaults were added.

********     OTHER OPTIONS     ********
- 1 Msg. should generally be avoided, but it might work on some connections.

- If 100 Msgs. gives you some slowdown, but not a lot, try 1000 Msgs.

- N/2400 and N/200 and N/1600 create fewer message than N/1200, and may provide better performance than N/1200 on fast-but-not-super connections.

- N/800 and N/400 are really only for very slow broadband connections or lower.

********     IN SUMMARY     ********
The short explanation is that if the new default gives you slowdown, then try the old default.  If that also gives you slowdown, then you can try the other entries here.

********     WHAT SORT OF CONNECTION TIMES TO EXPECT?     ********
Here are some common connection time estimates (which may naturally vary some, but you have problems if it takes more than twice as long as these stated estimates).  Bear in mind that these estimates are for a fullspeed transfer, which might not be achievable because of packet loss and other network conditions, or based on the Network Sync Size you choose.

Host 100kbps upload, 1 Client, 500KB savegame:  41s
Host 100kbps upload, 4 Clients, 500KB savegame:  2m, 44s

Host 100kbps upload, 1 Client, 1.5 MB savegame:  2m, 3s
Host 100kbps upload, 4 Clients, 1.5 MB savegame:  8m, 12s

Host 300kbps upload, 1 Client, 500KB savegame:  14s
Host 300kbps upload, 4 Clients, 500KB savegame:  54s

Host 300kbps upload, 1 Client, 1.5 MB savegame:  42s
Host 300kbps upload, 4 Clients, 1.5 MB savegame:  2m, 47s

To your specific questions:

1. Batch Network Sending breaks up giant messages (larger than a few hundred KB -- such as syncing a 1MB savegame) into smaller parts, and sends them in a staggered fashion that is less likely to overload certain bad network drivers, etc.

2. The Network Sync Size is how many chunks it breaks it up into.  100 is a flat 100 chunks.  N/2400 is the size of the savegame, in ascii characters, divided by 2400.  N is always the size of the savegame, in ascii characters.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!


SMF spam blocked by CleanTalk